Skip to content

Commit

Permalink
Editorial: add sections on document and shadow trees
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Mar 18, 2016
1 parent c7ec95d commit 018440e
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 104 deletions.
51 changes: 30 additions & 21 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ or null, and an ordered list of zero or more
<a>parent</a> is object <var>B</var> is a
<a>child</a> of <var>B</var>.

The <dfn export for=tree id=concept-tree-root>root</dfn> of an object is itself, if its
<a>parent</a> is null, or else it is the
<a for=tree>root</a> of its
<a>parent</a>.
<p>The <dfn export for=tree id=concept-tree-root>root</dfn> of an object is itself, if its
<a>parent</a> is null, or else it is the <a for=tree>root</a> of its <a>parent</a>. The
<a for=tree>root</a> of a <a>tree</a> is any object <a for=tree>participating</a> in that
<a>tree</a> whose <a for=tree>parent</a> is null.

An object <var>A</var> is called a
<dfn export for=tree id=concept-tree-descendant>descendant</dfn> of an object
Expand Down Expand Up @@ -1430,6 +1430,27 @@ A <a>node</a> is considered
<a>length</a> is zero.


<h4 id=document-trees>Document tree</h4>

<p>A <dfn export id=concept-document-tree>document tree</dfn> is a <a>node tree</a> whose
<a>root</a> is a <a>document</a>.

<p>The <dfn export>document element</dfn> of a <a>document</a> is the <a for="/">element</a> whose
<a>parent</a> is that <a>document</a>, if it exists, and null otherwise.

<p class="note no-backref">Per the <a>node tree</a> constraints, there can be only one such
<a for="/">element</a>.

<p>An <a for=/>element</a> is <dfn export>in a document</dfn> if its <a>root</a> is a
<a>document</a>.


<h4 id=shadow-trees>Shadow tree</h4>

<p>A <dfn export id=concept-shadow-tree>shadow tree</dfn> is a <a>node tree</a> whose <a>root</a> is
a <a for=/>shadow root</a>.


<h4 id=mutation-algorithms>Mutation algorithms</h4>

To <dfn export for=Node id=concept-node-ensure-pre-insertion-validity>ensure pre-insertion validity</dfn>
Expand Down Expand Up @@ -4999,12 +5020,12 @@ interface ShadowRoot : DocumentFragment {
<hr>

<p>In <dfn export id=concept-shadow-including-tree-order>shadow-including tree order</dfn>, is
<a>shadow-including preorder, depth-first traversal</a> of a <a>tree</a>.
<dfn noexport>shadow-including preorder, depth-first traversal</dfn> of a <a>tree</a>
<a>shadow-including preorder, depth-first traversal</a> of a <a>node tree</a>.
<dfn noexport>shadow-including preorder, depth-first traversal</dfn> of a <a>node tree</a>
<var>tree</var> is preorder, depth-first traversal of <var>tree</var>, with for each
<a for=/>element</a> <var>element</var> encountered in <var>tree</var>, whose
<a for=Element>shadow root</a> is non-null, <a>shadow-including preorder, depth-first traversal</a>
of the <a for=/>element</a>'s <a for=Element>shadow root</a>'s <a>tree</a> just after it is
<a for=/>element</a> <var>element</var> encountered in <var>tree</var> with a non-null
<a for=Element>shadow root</a>, <a>shadow-including preorder, depth-first traversal</a> of that
<a for=/>element</a>'s <a for=Element>shadow root</a>'s <a>node tree</a> just after it is
encountered.

<p>An object <var>A</var> is a
Expand Down Expand Up @@ -5361,18 +5382,6 @@ A <a>node</a>'s
<a>parent</a> of a different type, its
<a>parent element</a> is null.

The <dfn export>document element</dfn> of a
<a>document</a> is the
<a for="/">element</a> whose
<a>parent</a> is that
<a>document</a>, if it exists, and null otherwise.

<p class="note no-backref">Per the <a>node tree</a> constraints, there can only be one
such <a for="/">element</a>.

<p>An <a for=/>element</a> is <dfn export>in a document</dfn> if its <a>root</a> is a
<a>document</a>.

<hr>

<dl class=domintro>
Expand Down
Loading

0 comments on commit 018440e

Please sign in to comment.