Fragment

io.eezo.core.html.Html.Fragment
final case class Fragment(children: Vector[Html])

Several nodes with no element of their own.

A Fragment renders its children and nothing of its own, so one tree child can become several DOM nodes, and every index after it would run ahead of the tree if the fragment were left in place. For example, div(span("a"), text("x") ++ text("y"), span("z")) renders `

axyz, which a browser parses as three DOM children; left unspliced, the two text nodes would sit behind one tree child. [[Tag.apply]] is the guard: it splices aFragmentchild into its parent's children, then merges adjacentTextchildren and drops empty ones, because the parser knows no boundary betweenxandyeither, so anElementbuilt through a tag holds exactly three children here and tree child index equals DOM child index. That guard isTag.apply's alone; building anElementby hand with aFragmentamong its children, or nesting oneFragment` inside another before it reaches a tag, sits outside it. The case survives as a root level value, where there is no parent to index into.

Attributes

Source
Html.scala

Members list

Value members

Inherited methods

def ++(that: Html): Html

Concatenation, flattening adjacent fragments rather than nesting them.

Concatenation, flattening adjacent fragments rather than nesting them.

Attributes

Inherited from:
Html
Source
Html.scala
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala
def render: String

The rendered markup, as a String. The HTTP boundary encodes it as UTF-8.

The rendered markup, as a String. The HTTP boundary encodes it as UTF-8.

Attributes

Inherited from:
Html
Source
Html.scala