Package

com.raquo.dombuilder.generic

nodes

Permalink

package nodes

Visibility
  1. Public
  2. All

Type Members

  1. trait ChildNode[N, +Ref <: BaseRef, BaseRef] extends Node[N, Ref, BaseRef] with Modifier[N with ParentNode[N, BaseRef, BaseRef]]

    Permalink

    This trait represents a Node that can have a parent.

    This trait represents a Node that can have a parent. All nodes except Root extend this trait.

  2. trait Comment[N, CommentRef <: BaseRef, BaseRef] extends Node[N, CommentRef, BaseRef] with domtypes.generic.nodes.Comment

    Permalink
  3. trait Element[N, +Ref <: BaseRef, BaseRef] extends domtypes.generic.nodes.Element with Node[N, Ref, BaseRef]

    Permalink

    This trait represents a DOM Element (as opposed to a Comment node or a Text node)

  4. trait EventfulNode[N, +Ref <: BaseElementRef, BaseElementRef <: BaseRef, BaseRef, BaseEvent, Callback[-_]] extends Element[N, Ref, BaseRef]

    Permalink

    This trait represents a Node that fires events that you can listen for.

    This trait represents a Node that fires events that you can listen for.

    This is separate from Element partially because you might not be able to listen for any events in the JVM environment.

  5. trait Node[N, +Ref <: BaseRef, BaseRef] extends domtypes.generic.nodes.Node

    Permalink

    This is the base trait for Scala DOM Builder nodes, which are objects representing a tree of real JS DOM nodes.

    This is the base trait for Scala DOM Builder nodes, which are objects representing a tree of real JS DOM nodes.

    N

    if you're extending Scala DOM Builder (i.e. you're not using the com.raquo.dombuilder.jsdom.simple package, this type param can be the base trait of your nodes. This will ensure that your nodes are instantiated with the same shared logic that you define in N, and that your nodes can only interact with each other, not other Scala DOM Builder nodes that might not have that shared logic. WARNING: This is a new library. The N mechanism is not battle tested for either usefulness or reliability, so it might very well change. I implemented N primarily looking at the needs of my Laminar project.

  6. trait ParentNode[N, +Ref <: BaseRef, BaseRef] extends Node[N, Ref, BaseRef]

    Permalink

    This trait represents a Node that can be a parent to other nodes.

    This trait represents a Node that can be a parent to other nodes.

    For example, Comment and Text are leaf nodes and can not be parent nodes.

  7. trait Root[N, +ParentRef <: BaseRef, BaseRef] extends ParentNode[N, ParentRef, BaseRef]

    Permalink

    This trait represents the root of your Scala DOM Builder tree.

    This trait represents the root of your Scala DOM Builder tree. It represents the root of the DOM subtree that you manage with Scala DOM Builder, not the whole DOM Document.

    Scala DOM Builder assumes that you do not manipulate DOM nodes represented by this subtree outside of Scala DOM Builder (e.g. by using other libraries or calling native JS DOM functions directly) in ways that would have affected the state of your Scala DOM Builder tree if those changes were made using Scala DOM Builder.

    So for example, moving a real DOM node that is represented in your Scala DOM Builder to a different parent would cause the real DOM hierarchy to become inconsistent with the parent-children links that are recorded in your Scala DOM Builder tree. If you then do anything that relies on those links to be correct, your code would produce unexpected results.

    On the other hand, if you say update an attribute of some real DOM node without going through Scala DOM Builder, that is completely fine because Scala DOM Builder by itself does not keep track of the attributes that exist on DOM nodes. Your application code might, but after attr := value setter is executed, it is normally discarded.

    Note: Scala DOM Builder doesn't actively police its DOM tree for inconsistencies with the real DOM.

  8. trait Text[N, TextRef <: BaseRef, BaseRef] extends Node[N, TextRef, BaseRef] with domtypes.generic.nodes.Text

    Permalink

Value Members

  1. object ChildNode

    Permalink

Ungrouped