DomApi

object DomApi
class Object
trait Matchable
class Any

Value members

Concrete methods

def addEventListener[Ev <: Event](element: Base, listener: EventListener[Ev, _]): Unit

Events

Events

def appendChild(parent: Base, child: Base): Boolean

Tree functions

Tree functions

def createCommentNode(text: String): Comment

Comment Nodes

Comment Nodes

def createHtmlElement[Ref <: Element](element: ReactiveHtmlElement[Ref]): Ref

HTML Elements

HTML Elements

def createSvgElement[Ref <: Element](element: ReactiveSvgElement[Ref]): Ref
def createTextNode(text: String): Text

Text Nodes

Text Nodes

def debugNodeDescription(node: Node): String
Returns

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

@tailrec
def debugPath(element: Node, initial: List[String]): List[String]
Returns

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

def getChecked(element: Element): UndefOr[Boolean]

Input related stuff

Input related stuff

def getHtmlAttribute[V, DomV](element: Base, attr: HtmlAttr[V]): Option[V]
def getHtmlProperty[V, DomV](element: Base, prop: Prop[V, DomV]): V

#Note not sure if this is completely safe. Could this return null?

#Note not sure if this is completely safe. Could this return null?

def getSvgAttribute[V](element: Base, attr: SvgAttr[V]): Option[V]
def getValue(element: Element): UndefOr[String]
def insertBefore(parent: Base, newChild: Base, referenceChild: Base): Boolean
def isCustomElement(element: Element): Boolean

Custom Elements

Custom Elements

def removeChild(parent: Base, child: Base): Boolean
def removeEventListener[Ev <: Event](element: Base, listener: EventListener[Ev, _]): Unit
def removeHtmlAttribute(element: Base, attr: HtmlAttr[_]): Unit
def removeSvgAttribute(element: Base, attr: SvgAttr[_]): Unit
def replaceChild(parent: Base, newChild: Base, oldChild: Base): Boolean
def setChecked(element: Element, checked: Boolean): Boolean
Returns

whether the operation succeeded

def setCommentNodeText(node: CommentNode, text: String): Unit
def setHtmlAnyStyle[V](element: Base, style: Style[V], value: V | String): Unit
def setHtmlAttribute[V](element: Base, attr: HtmlAttr[V], value: V): Unit
def setHtmlProperty[V, DomV](element: Base, prop: Prop[V, DomV], value: V): Unit
def setHtmlStringStyle(element: Base, style: Style[_], value: String): Unit
def setHtmlStyle[V](element: Base, style: Style[V], value: V): Unit
def setSvgAttribute[V](element: Base, attr: SvgAttr[V], value: V): Unit
def setTextNodeText(node: TextNode, text: String): Unit
def setValue(element: Element, value: String): Boolean
Returns

whether the operation succeeded