Skip to content

Commit

Permalink
Un-customify adopted elements
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic authored and annevk committed Jun 1, 2016
1 parent d077da1 commit e417f9f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
17 changes: 15 additions & 2 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5036,10 +5036,23 @@ a <var>document</var>, run these steps:

<ol>
<li><p>For each <var>inclusiveDescendant</var> in <var>node</var>'s
<a>shadow-including inclusive descendants</a>, in <a>shadow-including tree order</a>, set
<var>inclusiveDescendant</var>'s <a>node document</a> to <var>document</var>.
<a>shadow-including inclusive descendants</a>, set <var>inclusiveDescendant</var>'s
<a>node document</a> to <var>document</var>.
<!--AttrExodus as well as any associated {{Attr}} nodes-->

<li>
<p>For each <var>inclusiveDescendant</var> in <var>node</var>'s
<a>shadow-including inclusive descendants</a> that is an <a>element</a> with
<a>custom element state</a> of "<code>custom</code>", set <var>inclusiveDescendant</var>'s
<a>custom element state</a> to "<code>undefined</code>".</p>

<p class="note">
If this adoption is followed by an <a lt="insert" for="Node">insertion</a>, as most are, then
the insertion will <a lt="try to upgrade an element">try to upgrade</a>
<var>inclusiveDescendant</var>, potentially causing it to become <a>custom</a> again.
</p>
</li>

<li><p>For each <var>inclusiveDescendant</var> in <var>node</var>'s
<a>shadow-including inclusive descendants</a>, in <a>shadow-including tree order</a>, run the
<a>adopting steps</a> with <var>inclusiveDescendant</var> and <var>oldDocument</var>.
Expand Down
11 changes: 7 additions & 4 deletions dom.html
Original file line number Diff line number Diff line change
Expand Up @@ -2730,7 +2730,7 @@ <h3 class="heading settled" data-level="4.4" id="interface-node"><span class="se
</ol>
<p>When invoked with the same argument, and as long as <var>root</var>’s <a data-link-type="dfn" href="#concept-node-document">node document</a>’s <a data-link-type="dfn" href="#concept-document-type">type</a> has not changed, the same <code class="idl"><a data-link-type="idl" href="#htmlcollection">HTMLCollection</a></code> object may be returned as
returned by an earlier call. </p>
<p>The <dfn data-dfn-type="dfn" data-export="" id="concept-getelementsbytagnamens">list of elements with namespace <var>namespace</var> and local name <var>localName</var><a class="self-link" href="#concept-getelementsbytagnamens"></a></dfn> for a <a data-link-type="dfn" href="#concept-node">node</a> <var>root</var> is the <code class="idl"><a data-link-type="idl" href="#htmlcollection">HTMLCollection</a></code> returned by the following algorithm:</p>
<p>The <dfn data-dfn-type="dfn" data-export="" data-lt="list of elements with namespace namespace and local name localName" id="concept-getelementsbytagnamens">list of elements with namespace <var>namespace</var> and local name <var>localName</var><a class="self-link" href="#concept-getelementsbytagnamens"></a></dfn> for a <a data-link-type="dfn" href="#concept-node">node</a> <var>root</var> is the <code class="idl"><a data-link-type="idl" href="#htmlcollection">HTMLCollection</a></code> returned by the following algorithm:</p>
<ol>
<li>If <var>namespace</var> is the empty string, set it to null.
<li>If both <var>namespace</var> and <var>localName</var> are "<code>*</code>" (U+002A), return a <code class="idl"><a data-link-type="idl" href="#htmlcollection">HTMLCollection</a></code> rooted at <var>root</var>, whose filter matches <a data-link-type="dfn" href="#concept-tree-descendant">descendant</a> <a data-link-type="dfn" href="#concept-element">elements</a>.
Expand Down Expand Up @@ -3025,7 +3025,11 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class
<p>If <var>document</var> is not the same as <var>oldDocument</var>, run these substeps: </p>
<ol>
<li>
<p>For each <var>inclusiveDescendant</var> in <var>node</var>’s <a data-link-type="dfn" href="#concept-shadow-including-inclusive-descendant">shadow-including inclusive descendants</a>, in <a data-link-type="dfn" href="#concept-shadow-including-tree-order">shadow-including tree order</a>, set <var>inclusiveDescendant</var>’s <a data-link-type="dfn" href="#concept-node-document">node document</a> to <var>document</var>. </p>
<p>For each <var>inclusiveDescendant</var> in <var>node</var>’s <a data-link-type="dfn" href="#concept-shadow-including-inclusive-descendant">shadow-including inclusive descendants</a>, set <var>inclusiveDescendant</var>’s <a data-link-type="dfn" href="#concept-node-document">node document</a> to <var>document</var>. </p>
<li>
<p>For each <var>inclusiveDescendant</var> in <var>node</var>’s <a data-link-type="dfn" href="#concept-shadow-including-inclusive-descendant">shadow-including inclusive descendants</a> that is an <a data-link-type="dfn" href="#concept-element">element</a> with <a data-link-type="dfn" href="#concept-element-custom-element-state">custom element state</a> of "<code>custom</code>", set <var>inclusiveDescendant</var>’s <a data-link-type="dfn" href="#concept-element-custom-element-state">custom element state</a> to "<code>undefined</code>".</p>
<p class="note" role="note"> If this adoption is followed by an <a data-link-type="dfn" href="#concept-node-insert">insertion</a>, as most are, then
the insertion will <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#concept-try-upgrade">try to upgrade</a> <var>inclusiveDescendant</var>, potentially causing it to become <a data-link-type="dfn" href="#concept-element-custom">custom</a> again. </p>
<li>
<p>For each <var>inclusiveDescendant</var> in <var>node</var>’s <a data-link-type="dfn" href="#concept-shadow-including-inclusive-descendant">shadow-including inclusive descendants</a>, in <a data-link-type="dfn" href="#concept-shadow-including-tree-order">shadow-including tree order</a>, run the <a data-link-type="dfn" href="#concept-node-adopt-ext">adopting steps</a> with <var>inclusiveDescendant</var> and <var>oldDocument</var>. </p>
</ol>
Expand Down Expand Up @@ -5980,8 +5984,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c
<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
namespace and local name localName</a><span>, in §4.4</span>
<li><a href="#concept-getelementsbytagnamens">list of elements with namespace namespace and local name localName</a><span>, in §4.4</span>
<li><a href="#concept-getelementsbytagname">list of elements with qualified name qualifiedName</a><span>, in §4.4</span>
<li><a href="#concept-collection-live">live</a><span>, in §4.2.10</span>
<li><a href="#concept-collection-live">live collection</a><span>, in §4.2.10</span>
Expand Down

0 comments on commit e417f9f

Please sign in to comment.