~/bend-docscommunity

dom.bend checks

raw source on the hub · import element-html@0.1.0.0/dom.bend as Dom

1 import
import Base

Types

type Attr source · line 5 · raw

Data

type Node source · line 8 · raw

Data

Definitions

def tag_of source · line 14 · raw

@n:Node -> String

def attrs_of source · line 21 · raw

@n:Node -> List<&2, Attr>

def children_of source · line 28 · raw

@n:Node -> List<&2, Node>

def comment_tag source · line 38 · raw

String

A comment is kept as an element with this tag, its text in a "data" attribute; it is not an element to anything that asks for elements, its text is not text content, and nothing renders it.

def is_comment source · line 41 · raw

@+tag:String -> Bool

def only_elements source · line 44 · raw

@xs:List<&2, Node> -> List<&2, Node>

def element_children source · line 56 · raw

@n:Node -> List<&2, Node>

def attr_go source · line 59 · raw

@xs:List<&2, Attr> -> @+name:String -> @acc:String -> String

def attr source · line 69 · raw

@n:Node -> @+name:String -> String

The value of attribute name (the first one wins in HTML), or "".

def is_shadow source · line 78 · raw

@+tag:String -> Bool

A shadow root is kept as a child of its host with this tag; the host's textContent, serialization and queries do not see into it.

def is_content source · line 86 · raw

@+tag:String -> Bool

A <template>'s content (HTML 4.12.3: a DocumentFragment, not its children) is kept as one child of the template with this tag: the template's childNodes, textContent and queries do not see into it, no script in it runs and no style in it applies; serializing the template writes it (its innerHTML is its content's).

def is_root_child source · line 91 · raw

@+tag:String -> Bool

A child that is a fragment of its own (a shadow root or a template's content): not in the parent's child list, a root for what is under it.

def text_list source · line 95 · raw

@xs:List<&2, Node> -> String

All text under a node, in document order.

def text_of source · line 108 · raw

@n:Node -> String

The text of a node's subtree (a shadow tree under it is not its text; a shadow root's own text is).

def first_of source · line 115 · raw

@a:Maybe<&2, Node> -> @b:Maybe<&2, Node> -> @c:Maybe<&2, Node> -> Maybe<&2, Node>

def find_go source · line 127 · raw

@xs:List<&2, Node> -> @+name:String -> Maybe<&2, Node>

First element with this tag, depth-first (document order).

def find source · line 141 · raw

@n:Node -> @+name:String -> Maybe<&2, Node>

def has_content source · line 148 · raw

@xs:List<&2, Node> -> Bool

Every <template>'s children moved into its content (a "#content" child), as the HTML parser does (13.2.6.4.4: a template's contents go to its template contents). A template whose only child is its content already is left as it is.

def contents source · line 159 · raw

@xs:List<&2, Node> -> List<&2, Node>

def no_contents source · line 173 · raw

@xs:List<&2, Node> -> List<&2, Node>

The nodes without template contents (what loads, runs and styles).