Skip to content

Commit

Permalink
Editorial: be clearer on host, define light tree
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Mar 18, 2016
1 parent 018440e commit ce7df0b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
16 changes: 13 additions & 3 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,11 @@ A <a>node</a> is considered
<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>.

<p>A <a for=/>shadow root</a> is always connected to another <a>node tree</a> through its
<a for=DocumentFragment>host</a>. A <a>shadow tree</a> is therefore never alone. The
<a>node tree</a> of a <a for=/>shadow root</a>'s <a for=DocumentFragment>host</a> is sometimes
referred to as the <dfn export id=concept-light-tree>light tree</dfn>.</p>


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

Expand Down Expand Up @@ -4975,13 +4980,14 @@ interface DocumentFragment : Node {
};
</pre>

<p>A {{DocumentFragment}} <a>node</a> can have an associated <a for="/">element</a> named
<dfn export id=concept-documentfragment-host for=DocumentFragment>host</dfn>.
<p>A {{DocumentFragment}} <a>node</a> has an associated
<dfn export id=concept-documentfragment-host for=DocumentFragment>host</dfn> (null or an
<a for="/">element</a> in a different <a>node tree</a>). It is null unless otherwise stated.

<p>An object <var>A</var> is a
<dfn export id=concept-tree-host-including-inclusive-ancestor>host-including inclusive ancestor</dfn>
of an object <var>B</var>, if either <var>A</var> is an <a>inclusive ancestor</a> of <var>B</var>,
or if <var>B</var>'s <a for=tree>root</a> has an associated <a for=DocumentFragment>host</a> and
or if <var>B</var>'s <a for=tree>root</a> has a non-null <a for=DocumentFragment>host</a> and
<var>A</var> is a <a>host-including inclusive ancestor</a> of <var>B</var>'s <a for=tree>root</a>'s
<a for=DocumentFragment>host</a>.

Expand Down Expand Up @@ -5014,6 +5020,10 @@ interface ShadowRoot : DocumentFragment {
<p><a for=/>Shadow roots</a> have an associated <dfn for=ShadowRoot>encapsulation mode</dfn>
("<code>open</code>" or "<code>closed</code>").</p>

<p><a for=/>Shadow roots</a>'s associated <a for=DocumentFragment>host</a> is never null.</p>
<!-- If we ever change this, e.g., add a ShadowRoot object constructor, that would have serious
consequences for innerHTML. -->

<p>The <dfn attribute for=ShadowRoot><code>host</code></dfn> attribute's getter must return the
<a>context object</a>'s <a for=DocumentFragment>host</a>.

Expand Down
8 changes: 6 additions & 2 deletions dom.html
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,8 @@ <h4 class="heading settled" data-level="4.2.1" id="document-trees"><span class="
<h4 class="heading settled" data-level="4.2.2" id="shadow-trees"><span class="secno">4.2.2. </span><span class="content">Shadow tree</span><a class="self-link" href="#shadow-trees"></a></h4>
<p>A <dfn data-dfn-type="dfn" data-export="" id="concept-shadow-tree">shadow tree<a class="self-link" href="#concept-shadow-tree"></a></dfn> is a <a data-link-type="dfn" href="#concept-node-tree">node tree</a> whose <a data-link-type="dfn" href="#concept-tree-root">root</a> is
a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>. </p>
<p>A <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a> is always connected to another <a data-link-type="dfn" href="#concept-node-tree">node tree</a> through its <a data-link-type="dfn" href="#concept-documentfragment-host">host</a>. A <a data-link-type="dfn" href="#concept-shadow-tree">shadow tree</a> is therefore never alone. The <a data-link-type="dfn" href="#concept-node-tree">node tree</a> of a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>’s <a data-link-type="dfn" href="#concept-documentfragment-host">host</a> is sometimes
referred to as the <dfn data-dfn-type="dfn" data-export="" id="concept-light-tree">light tree<a class="self-link" href="#concept-light-tree"></a></dfn>.</p>
<h4 class="heading settled" data-level="4.2.3" id="mutation-algorithms"><span class="secno">4.2.3. </span><span class="content">Mutation algorithms</span><a class="self-link" href="#mutation-algorithms"></a></h4>
<p>To <dfn data-dfn-for="Node" data-dfn-type="dfn" data-export="" id="concept-node-ensure-pre-insertion-validity">ensure pre-insertion validity<a class="self-link" href="#concept-node-ensure-pre-insertion-validity"></a></dfn> of a <var>node</var> into a <var>parent</var> before a <var>child</var>, run these steps:</p>
<ol>
Expand Down Expand Up @@ -2768,9 +2770,9 @@ <h3 class="heading settled" data-level="4.7" id="interface-documentfragment"><sp
interface <dfn class="idl-code" data-dfn-type="interface" data-export="" id="documentfragment">DocumentFragment<a class="self-link" href="#documentfragment"></a></dfn> : <a data-link-type="idl-name" href="#node">Node</a> {
};
</pre>
<p>A <code class="idl"><a data-link-type="idl" href="#documentfragment">DocumentFragment</a></code> <a data-link-type="dfn" href="#concept-node">node</a> can have an associated <a data-link-type="dfn" href="#concept-element">element</a> named <dfn data-dfn-for="DocumentFragment" data-dfn-type="dfn" data-export="" id="concept-documentfragment-host">host<a class="self-link" href="#concept-documentfragment-host"></a></dfn>. </p>
<p>A <code class="idl"><a data-link-type="idl" href="#documentfragment">DocumentFragment</a></code> <a data-link-type="dfn" href="#concept-node">node</a> has an associated <dfn data-dfn-for="DocumentFragment" data-dfn-type="dfn" data-export="" id="concept-documentfragment-host">host<a class="self-link" href="#concept-documentfragment-host"></a></dfn> (null or an <a data-link-type="dfn" href="#concept-element">element</a> in a different <a data-link-type="dfn" href="#concept-node-tree">node tree</a>). It is null unless otherwise stated. </p>
<p>An object <var>A</var> is a <dfn data-dfn-type="dfn" data-export="" id="concept-tree-host-including-inclusive-ancestor">host-including inclusive ancestor<a class="self-link" href="#concept-tree-host-including-inclusive-ancestor"></a></dfn> of an object <var>B</var>, if either <var>A</var> is an <a data-link-type="dfn" href="#concept-tree-inclusive-ancestor">inclusive ancestor</a> of <var>B</var>,
or if <var>B</var>’s <a data-link-type="dfn" href="#concept-tree-root">root</a> has an associated <a data-link-type="dfn" href="#concept-documentfragment-host">host</a> and <var>A</var> is a <a data-link-type="dfn" href="#concept-tree-host-including-inclusive-ancestor">host-including inclusive ancestor</a> of <var>B</var>’s <a data-link-type="dfn" href="#concept-tree-root">root</a>’s <a data-link-type="dfn" href="#concept-documentfragment-host">host</a>. </p>
or if <var>B</var>’s <a data-link-type="dfn" href="#concept-tree-root">root</a> has a non-null <a data-link-type="dfn" href="#concept-documentfragment-host">host</a> and <var>A</var> is a <a data-link-type="dfn" href="#concept-tree-host-including-inclusive-ancestor">host-including inclusive ancestor</a> of <var>B</var>’s <a data-link-type="dfn" href="#concept-tree-root">root</a>’s <a data-link-type="dfn" href="#concept-documentfragment-host">host</a>. </p>
<p class="note no-backref" role="note">The <code class="idl"><a data-link-type="idl" href="#documentfragment">DocumentFragment</a></code> <a data-link-type="dfn" href="#concept-node">node</a>’s <a data-link-type="dfn" href="#concept-documentfragment-host">host</a> concept is useful for HTML’s <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/scripting.html#the-template-element">template</a></code> element and for <a data-link-type="dfn" href="#concept-shadow-root">shadow roots</a>, and impacts the <a data-link-type="dfn" href="#concept-node-pre-insert">pre-insert</a> and <a data-link-type="dfn" href="#concept-node-replace">replace</a> algorithms. </p>
<dl class="domintro">
<dt><code><var>tree</var> = new <code class="idl"><a data-link-type="idl" href="#dom-documentfragment-documentfragment">DocumentFragment()</a></code></code>
Expand All @@ -2787,6 +2789,7 @@ <h3 class="heading settled" data-level="4.8" id="interface-shadowroot"><span cla
</pre>
<p><code class="idl"><a data-link-type="idl" href="#shadowroot">ShadowRoot</a></code> <a data-link-type="dfn" href="#concept-node">nodes</a> are simply known as <dfn data-dfn-type="dfn" data-export="" data-lt="shadow root" id="concept-shadow-root">shadow roots<a class="self-link" href="#concept-shadow-root"></a></dfn>. </p>
<p><a data-link-type="dfn" href="#concept-shadow-root">Shadow roots</a> have an associated <dfn data-dfn-for="ShadowRoot" data-dfn-type="dfn" data-noexport="" id="shadowroot-encapsulation-mode">encapsulation mode<a class="self-link" href="#shadowroot-encapsulation-mode"></a></dfn> ("<code>open</code>" or "<code>closed</code>").</p>
<p><a data-link-type="dfn" href="#concept-shadow-root">Shadow roots</a>’s associated <a data-link-type="dfn" href="#concept-documentfragment-host">host</a> is never null.</p>
<p>The <dfn class="idl-code" data-dfn-for="ShadowRoot" data-dfn-type="attribute" data-export="" id="dom-shadowroot-host"><code>host</code><a class="self-link" href="#dom-shadowroot-host"></a></dfn> attribute’s getter must return the <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-documentfragment-host">host</a>. </p>
<hr>
<p>In <dfn data-dfn-type="dfn" data-export="" id="concept-shadow-including-tree-order">shadow-including tree order<a class="self-link" href="#concept-shadow-including-tree-order"></a></dfn>, is <a data-link-type="dfn" href="#shadow-including-preorder-depth-first-traversal">shadow-including preorder, depth-first traversal</a> of a <a data-link-type="dfn" href="#concept-node-tree">node tree</a>. <dfn data-dfn-type="dfn" data-noexport="" id="shadow-including-preorder-depth-first-traversal">shadow-including preorder, depth-first traversal<a class="self-link" href="#shadow-including-preorder-depth-first-traversal"></a></dfn> of a <a data-link-type="dfn" href="#concept-node-tree">node tree</a> <var>tree</var> is preorder, depth-first traversal of <var>tree</var>, with for each <a data-link-type="dfn" href="#concept-element">element</a> <var>element</var> encountered in <var>tree</var> with a non-null <a data-link-type="dfn" href="#concept-element-shadow-root">shadow root</a>, <a data-link-type="dfn" href="#shadow-including-preorder-depth-first-traversal">shadow-including preorder, depth-first traversal</a> of that <a data-link-type="dfn" href="#concept-element">element</a>’s <a data-link-type="dfn" href="#concept-element-shadow-root">shadow root</a>’s <a data-link-type="dfn" href="#concept-node-tree">node tree</a> just after it is
Expand Down Expand Up @@ -5193,6 +5196,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c
<li><a href="#dom-characterdata-length">attribute for CharacterData</a><span>, in §4.10</span>
<li><a href="#dom-domtokenlist-length">attribute for DOMTokenList</a><span>, in §7.1</span>
</ul>
<li><a href="#concept-light-tree">light tree</a><span>, in §4.2.2</span>
<li><a href="#concept-document-limited-quirks">limited-quirks mode</a><span>, in §4.5</span>
<li><a href="#concept-getelementsbyclassname">list of elements with class names classNames</a><span>, in §4.4</span>
<li><a href="#concept-getelementsbytagnamens">list of elements with namespace
Expand Down

0 comments on commit ce7df0b

Please sign in to comment.