Skip to content

Commit 858fa1e

Browse files
committed
Editorial: make adopt traverse the tree less
1 parent 31ff09c commit 858fa1e

1 file changed

Lines changed: 34 additions & 41 deletions

File tree

dom.bs

Lines changed: 34 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6026,57 +6026,50 @@ algorithm is passed <var ignore>node</var> and <var ignore>oldDocument</var>, as
60266026
<var>node</var>.
60276027

60286028
<li>
6029-
<p>If <var>document</var> is not <var>oldDocument</var>:
6029+
<p>If <var>document</var> is not <var>oldDocument</var>, then for each
6030+
<var>inclusiveDescendant</var> of <var>node</var>'s <a>shadow-including inclusive descendants</a>,
6031+
in <a>shadow-including tree order</a>:
60306032

60316033
<ol>
6032-
<li>
6033-
<p>For each <var>inclusiveDescendant</var> of <var>node</var>'s
6034-
<a>shadow-including inclusive descendants</a>, in <a>shadow-including tree order</a>:
6035-
6036-
<ol>
6037-
<li><p>Set <var>inclusiveDescendant</var>'s <a for=Node>node document</a> to <var>document</var>.
6034+
<li><p>Set <var>inclusiveDescendant</var>'s <a for=Node>node document</a> to <var>document</var>.
60386035

6039-
<li>
6040-
<p>If <var>inclusiveDescendant</var> is a <a for=/>shadow root</a> and if any of the following
6041-
are true:
6036+
<li>
6037+
<p>If <var>inclusiveDescendant</var> is a <a for=/>shadow root</a> and if any of the following
6038+
are true:
60426039

6043-
<ul>
6044-
<li><p><var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a> is null
6045-
and <var>inclusiveDescendant</var>'s <a for=ShadowRoot>keep custom element registry null</a>
6046-
is false; or
6040+
<ul>
6041+
<li><p><var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a> is null
6042+
and <var>inclusiveDescendant</var>'s <a for=ShadowRoot>keep custom element registry null</a> is
6043+
false; or
60476044

6048-
<li><p><var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a>
6049-
<a>is a global custom element registry</a>,
6050-
</ul>
6045+
<li><p><var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a>
6046+
<a>is a global custom element registry</a>,
6047+
</ul>
60516048

6052-
<p>then set <var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a> to
6053-
<var>document</var>'s <a>effective global custom element registry</a>.
6049+
<p>then set <var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a> to
6050+
<var>document</var>'s <a>effective global custom element registry</a>.
60546051

6055-
<li>
6056-
<p>Otherwise, if <var>inclusiveDescendant</var> is an <a for=/>element</a>:
6052+
<li>
6053+
<p>Otherwise, if <var>inclusiveDescendant</var> is an <a for=/>element</a>:
60576054

6058-
<ol>
6059-
<li><p>Set the <a for=Node>node document</a> of each <a>attribute</a> in
6060-
<var>inclusiveDescendant</var>'s <a for=Element>attribute list</a> to <var>document</var>.
6061-
6062-
<li><p>If <var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a> is null
6063-
or <var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a>'s
6064-
<a for=CustomElementRegistry>is scoped</a> is false, then set
6065-
<var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a> to
6066-
<var>document</var>'s <a>effective global custom element registry</a>.
6067-
</ol>
6055+
<ol>
6056+
<li><p>Set the <a for=Node>node document</a> of each <a>attribute</a> in
6057+
<var>inclusiveDescendant</var>'s <a for=Element>attribute list</a> to <var>document</var>.
6058+
6059+
<li><p>If <var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a> is null
6060+
or <var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a>'s
6061+
<a for=CustomElementRegistry>is scoped</a> is false, then set
6062+
<var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a> to
6063+
<var>document</var>'s <a>effective global custom element registry</a>.
6064+
6065+
<li><p>If <var>inclusiveDescendant</var> is <a for=Element>custom</a>, then
6066+
<a>enqueue a custom element callback reaction</a> with <var>inclusiveDescendant</var>, callback
6067+
name "<code>adoptedCallback</code>", and « <var>oldDocument</var>, <var>document</var> ».
6068+
<!-- attributeChangedCallback is also old, then new -->
60686069
</ol>
60696070

6070-
<li><p>For each <var>inclusiveDescendant</var> of <var>node</var>'s
6071-
<a>shadow-including inclusive descendants</a> that is <a for=Element>custom</a>, in
6072-
<a>shadow-including tree order</a>: <a>enqueue a custom element callback reaction</a> with
6073-
<var>inclusiveDescendant</var>, callback name "<code>adoptedCallback</code>", and
6074-
« <var>oldDocument</var>, <var>document</var> ».
6075-
<!-- attributeChangedCallback is also old, then new -->
6076-
6077-
<li><p>For each <var>inclusiveDescendant</var> of <var>node</var>'s
6078-
<a>shadow-including inclusive descendants</a>, in <a>shadow-including tree order</a>: run the
6079-
<a>adopting steps</a> with <var>inclusiveDescendant</var> and <var>oldDocument</var>.
6071+
<li><p>Run the <a>adopting steps</a> with <var>inclusiveDescendant</var> and
6072+
<var>oldDocument</var>.
60806073
</ol>
60816074
</ol>
60826075
</div>

0 commit comments

Comments
 (0)