Packages

object DomApi

Low level DOM APIs used by Laminar.

End users: Do not call any mutator methods here on Laminar-managed elements, these methods do not make the necessary updates to Laminar internal state. Instead, use regular Laminar API, or, if you must, the methods from com.raquo.laminar.nodes.ParentNode

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DomApi
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addEventListener[Ev <: Event](element: Element, listener: EventListener[Ev, _]): Unit

    Events

  5. def appendChild(parent: Node, child: Node): Boolean
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def assertHtmlElement(node: Node, clue: String = "Error"): Element
  8. def assertSingleNode(nodes: Array[Node], clue: String): Node
  9. def assertSvgElement(node: Node, clue: String = "Error"): Element
  10. def assertTagMatches[Ref <: Element](tag: Tag[ReactiveElement[Ref]], node: Node, clue: String = "Error"): Ref
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  12. def createCommentNode(text: String): Comment

    Comment Nodes

  13. def createHtmlElement[Ref <: Element](tag: HtmlTag[Ref]): Ref

    HTML Elements

  14. def createSvgElement[Ref <: Element](tag: SvgTag[Ref]): Ref

    SVG Elements

  15. def createTextNode(text: String): Text

    Text Nodes

  16. def debugNodeDescription(node: Node): String

    returns

    e.g. a, div#mainSection, span.sideNote.sizeSmall

  17. def debugNodeInnerHtml(node: Node): String
  18. def debugNodeOuterHtml(node: Node): String
  19. def debugPath(element: Node, initial: List[String] = Nil): List[String]

    returns

    hierarchical path describing the position and identity of this node, starting with the root.

    Annotations
    @tailrec()
  20. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  22. def getAriaAttribute[V](element: Base, attr: AriaAttr[V]): UndefOr[V]

    Aria attributes

  23. def getAriaAttributeRaw(element: Base, attr: AriaAttr[_]): UndefOr[String]
  24. def getChecked(element: Element): UndefOr[Boolean]

    Input related stuff

  25. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  26. def getFiles(element: Element): UndefOr[List[File]]

    See also

    https://developer.mozilla.org/en-US/docs/Web/API/File_API/Using_files_from_web_applications

  27. def getHtmlAttribute[V](element: Base, attr: HtmlAttr[V]): UndefOr[V]

    HTML Attributes

  28. def getHtmlAttributeRaw(element: Base, attr: HtmlAttr[_]): UndefOr[String]
  29. def getHtmlProperty[V, DomV](element: Base, prop: HtmlProp[V, DomV]): UndefOr[V]

    Returns js.undefined when the property is missing on the element.

    Returns js.undefined when the property is missing on the element. If the element type supports this property, it should never be js.undefined.

  30. def getHtmlPropertyRaw[V, DomV](element: Base, prop: HtmlProp[V, DomV]): UndefOr[DomV]
  31. def getHtmlStyleRaw(element: Base, styleProp: StyleProp[_]): String

    Note: this only gets inline style values – those set via the style attribute, which includes all style props set by Laminar.

    Note: this only gets inline style values – those set via the style attribute, which includes all style props set by Laminar. It does not account for CSS declarations in <style> tags.

    Returns empty string if the given style property is not defined in this element's inline styles.

    See https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration/getPropertyValue Contrast with https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle

  32. def getSvgAttribute[V](element: Base, attr: SvgAttr[V]): UndefOr[V]

    SVG Attributes

  33. def getSvgAttributeRaw(element: Base, attr: SvgAttr[_]): UndefOr[String]
  34. def getValue(element: Element): UndefOr[String]
  35. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  36. def indexOfChild(parent: Node, child: Node): Int

    Tree query functions

  37. def insertAfter(parent: Node, newChild: Node, referenceChild: Node): Boolean
  38. def insertBefore(parent: Node, newChild: Node, referenceChild: Node): Boolean
  39. def isCustomElement(element: Element): Boolean

    Custom Elements

  40. final def isDescendantOf(node: Node, ancestor: Node): Boolean

    Note: This walks up the real DOM element tree, not the Laminar DOM tree.

    Note: This walks up the real DOM element tree, not the Laminar DOM tree. See ChildNode.isDescendantOf if you want to walk up Laminar's tree instead.

    Annotations
    @tailrec()
  41. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  42. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  43. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  44. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  45. def removeAriaAttribute(element: Base, attr: AriaAttr[_]): Unit
  46. def removeChild(parent: Node, child: Node): Boolean
  47. def removeEventListener[Ev <: Event](element: Element, listener: EventListener[Ev, _]): Unit
  48. def removeHtmlAttribute(element: Base, attr: HtmlAttr[_]): Unit
  49. def removeSvgAttribute(element: Base, attr: SvgAttr[_]): Unit
  50. def replaceChild(parent: Node, newChild: Node, oldChild: Node): Boolean
  51. def setAriaAttribute[V](element: Base, attr: AriaAttr[V], value: V): Unit
  52. def setChecked(element: Element, checked: Boolean): Boolean

    returns

    whether the operation succeeded

  53. def setCommentNodeText(node: CommentNode, text: String): Unit
  54. def setHtmlAnyStyle[V](element: Base, style: StyleProp[V], value: |[V, String]): Unit
  55. def setHtmlAttribute[V](element: Base, attr: HtmlAttr[V], value: V): Unit
  56. def setHtmlProperty[V, DomV](element: Base, prop: HtmlProp[V, DomV], value: V): Unit
  57. def setHtmlStringStyle(element: Base, styleProp: StyleProp[_], value: String): Unit
  58. def setHtmlStyle[V](element: Base, styleProp: StyleProp[V], value: V): Unit
  59. def setSvgAttribute[V](element: Base, attr: SvgAttr[V], value: V): Unit
  60. def setTextNodeText(node: TextNode, text: String): Unit
  61. def setValue(element: Element, value: String): Boolean

    returns

    whether the operation succeeded

  62. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  63. def toString(): String
    Definition Classes
    AnyRef → Any
  64. def unsafeParseHtmlString[Ref <: Element](tag: HtmlTag[Ref], dangerousHtmlString: String): Ref

    #WARNING: Only use on trusted HTML strings.

    #WARNING: Only use on trusted HTML strings. HTML strings can contain embedded Javascript code, which this function will execute blindly!

    Note: this expects the html string to contain one element matching the tag name, and will throw otherwise (e.g. if given a text node, an element with a different tag name, or multiple elements)

  65. def unsafeParseHtmlString(dangerousHtmlString: String): Element

    #WARNING: Only use on trusted HTML strings.

    #WARNING: Only use on trusted HTML strings. HTML strings can contain embedded Javascript code, which this function will execute blindly!

    Note: this expects the html string to contain one HTML element, and will throw otherwise (e.g. if given a text node, an SVG, or multiple elements)

  66. def unsafeParseHtmlStringIntoNodeArray(dangerousHtmlString: String): Array[Node]

    #WARNING: Only use on trusted HTML strings.

    #WARNING: Only use on trusted HTML strings. HTML strings can contain embedded Javascript code, which this function will execute blindly!

    Note: This method does not work in Internet Explorer. See https://stackoverflow.com/q/10585029 for the issues with various approaches. Use this if you need IE support: https://gist.github.com/Munawwar/6e6362dbdf77c7865a99

  67. def unsafeParseSvgString[Ref <: Element](tag: SvgTag[Ref], dangerousSvgString: String): Ref

    #WARNING: Only use on trusted SVG strings.

    #WARNING: Only use on trusted SVG strings. SVG strings can contain embedded Javascript code, which this function will execute blindly!

    Note: this expects the svg string to contain one element matching the tag name, and will throw otherwise (e.g. if given a text node, an element with a different tag name, or multiple elements)

  68. def unsafeParseSvgString(dangerousSvgString: String): Element

    #WARNING: Only use on trusted SVG strings.

    #WARNING: Only use on trusted SVG strings. SVG strings can contain embedded Javascript code, which this function will execute blindly!

    Note: this expects the svg string to contain one HTML element, and will throw otherwise (e.g. if given a text node, HTML, or multiple elements)

  69. def unsafeParseSvgStringIntoNodeArray(dangerousSvgString: String): Array[Node]

    #WARNING: Only use on trusted SVG strings.

    #WARNING: Only use on trusted SVG strings. SVG strings can contain embedded Javascript code, which this function will execute blindly!

  70. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  71. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  72. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped