Skip to content

Commit a83846a

Browse files
authored
Look up a custom element registry can be given a DocumentFragment
Slightly modernize "create an element for the token" while here (#1706 remains). Fixes #11227.
1 parent 813c924 commit a83846a

File tree

1 file changed

+31
-32
lines changed

1 file changed

+31
-32
lines changed

source

+31-32
Original file line numberDiff line numberDiff line change
@@ -73754,8 +73754,8 @@ dictionary <dfn dictionary>ElementDefinitionOptions</dfn> {
7375473754
element names</span> to promises. It is used to implement the <code
7375573755
data-x="dom-CustomElementRegistry-whenDefined">whenDefined()</code> method.</p>
7375673756

73757-
<p>To <dfn export>look up a custom element registry</dfn>, given an <code>Element</code> object,
73758-
<code>ShadowRoot</code> object, or <code>Document</code> object <var>node</var>:</p>
73757+
<p>To <dfn export>look up a custom element registry</dfn>, given a <code>Node</code> object
73758+
<var>node</var>:</p>
7375973759

7376073760
<ol>
7376173761
<li><p>If <var>node</var> is an <code>Element</code> object, then return <var>node</var>'s <span
@@ -73764,8 +73764,10 @@ dictionary <dfn dictionary>ElementDefinitionOptions</dfn> {
7376473764
<li><p>If <var>node</var> is a <code>ShadowRoot</code> object, then return <var>node</var>'s
7376573765
<span data-x="shadow-root-custom-element-registry">custom element registry</span>.</p></li>
7376673766

73767-
<li><p>Return <var>node</var>'s <span data-x="document-custom-element-registry">custom element
73768-
registry</span>.</p></li>
73767+
<li><p>If <var>node</var> is a <code>Document</code> object, then return <var>node</var>'s <span
73768+
data-x="document-custom-element-registry">custom element registry</span>.</p></li>
73769+
73770+
<li><p>Return null.</p></li>
7376973771
</ol>
7377073772

7377173773
</div>
@@ -130839,39 +130841,39 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {
130839130841

130840130842
<hr>
130841130843

130842-
<p>When the steps below require the UA to <dfn data-x="create an element for the token">create an
130843-
element for a token</dfn> in a particular <var>given namespace</var> and with a
130844-
particular <var>intended parent</var>, the UA must run the following steps:</p>
130844+
<p>To <dfn data-x="create an element for the token">create an element for a token</dfn>, given a
130845+
token <var>token</var>, a string <var>namespace</var> and a <code>Node</code> object
130846+
<var>intendedParent</var>:</p>
130845130847

130846130848
<ol>
130847130849
<li><p>If the <span>active speculative HTML parser</span> is not null, then return the result of
130848130850
<span data-x="create a speculative mock element">creating a speculative mock element</span>
130849-
given <var>given namespace</var>, the tag name of the given token, and the attributes of the
130850-
given token.</p></li>
130851+
given <var>namespace</var>, <var>token</var>'s tag name, and <var>token</var>'s
130852+
attributes.</p></li>
130851130853

130852130854
<li>
130853-
<p>Otherwise, optionally <span>create a speculative mock element</span> given <var>given
130854-
namespace</var>, the tag name of the given token, and the attributes of the given token.</p>
130855+
<p>Otherwise, optionally <span>create a speculative mock element</span> given
130856+
<var>namespace</var>, <var>token</var>'s tag name, and <var>token</var>'s attributes.</p>
130855130857

130856130858
<p class="note">The result is not used. This step allows for a <span>speculative fetch</span> to
130857130859
be initiated from non-speculative parsing. The fetch is still speculative at this point,
130858130860
because, for example, by the time the element is inserted, <var>intended parent</var> might
130859130861
have been removed from the document.</p>
130860130862
</li>
130861130863

130862-
<li><p>Let <var>document</var> be <var>intended parent</var>'s <span>node document</span>.</li>
130864+
<li><p>Let <var>document</var> be <var>intendedParent</var>'s <span>node document</span>.</li>
130863130865

130864-
<li><p>Let <var>local name</var> be the tag name of the token.</p></li>
130866+
<li><p>Let <var>localName</var> be <var>token</var>'s tag name.</p></li>
130865130867

130866-
<li><p>Let <var>is</var> be the value of the "<code data-x="attr-is">is</code>" attribute in the
130867-
given token, if such an attribute exists, or null otherwise.</p></li>
130868+
<li><p>Let <var>is</var> be the value of the "<code data-x="attr-is">is</code>" attribute in
130869+
<var>token</var>, if such an attribute exists; otherwise null.</p></li>
130868130870

130869130871
<li><p>Let <var>registry</var> be the result of <span data-x="look up a custom element
130870-
registry">looking up a custom element registry</span> given <var>intended parent</var>.</p></li>
130872+
registry">looking up a custom element registry</span> given <var>intendedParent</var>.</p></li>
130871130873

130872130874
<li><p>Let <var>definition</var> be the result of <span data-x="look up a custom element
130873-
definition">looking up a custom element definition</span> given <var>registry</var>, <var>given
130874-
namespace</var>, <var>local name</var>, and <var>is</var>.</p></li>
130875+
definition">looking up a custom element definition</span> given <var>registry</var>,
130876+
<var>namespace</var>, <var>localName</var>, and <var>is</var>.</p></li>
130875130877

130876130878
<li><p>Let <var>willExecuteScript</var> be true if <var>definition</var> is non-null and the
130877130879
parser was not created as part of the <span>HTML fragment parsing algorithm</span>; otherwise
@@ -130894,8 +130896,8 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {
130894130896

130895130897
<li>
130896130898
<p>Let <var>element</var> be the result of <span data-x="create an element">creating an
130897-
element</span> given <var>document</var>, <var>localName</var>, <var>given namespace</var>,
130898-
null, <var>is</var>, <var>willExecuteScript</var>, and <var>registry</var>.</p>
130899+
element</span> given <var>document</var>, <var>localName</var>, <var>namespace</var>, null,
130900+
<var>is</var>, <var>willExecuteScript</var>, and <var>registry</var>.</p>
130899130901

130900130902
<p class="note">This will cause <span data-x="custom element constructor">custom element
130901130903
constructors</span> to run, if <var>willExecuteScript</var> is true. However, since we
@@ -130950,7 +130952,7 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {
130950130952
<span><code data-x="">form</code> element pointer</span> is not null, there is no
130951130953
<code>template</code> element on the <span>stack of open elements</span>, <var>element</var> is
130952130954
either not <span data-x="category-listed">listed</span> or doesn't have a <code
130953-
data-x="attr-fae-form">form</code> attribute, and the <var>intended parent</var> is in the same
130955+
data-x="attr-fae-form">form</code> attribute, and the <var>intendedParent</var> is in the same
130954130956
<span>tree</span> as the element pointed to by the <span><code data-x="">form</code> element
130955130957
pointer</span>, then <span data-x="concept-form-association">associate</span> <var>element</var>
130956130958
with the <code>form</code> element pointed to by the <span><code data-x="">form</code> element
@@ -130991,20 +130993,18 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {
130991130993
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18367
130992130994
Not sure what we could call them instead, though... -->
130993130995

130994-
<p>When the steps below require the user agent to <dfn>insert a foreign element</dfn> for a token
130995-
in a given namespace and with a boolean <var>onlyAddToElementStack</var>, the user agent must run
130996-
these steps:</p>
130996+
<p>To <dfn>insert a foreign element</dfn>, given a token <var>token</var>, a string
130997+
<var>namespace</var>, and a boolean <var>onlyAddToElementStack</var>:</p>
130997130998

130998130999
<ol>
130999-
<li><p>Let the <var>adjusted insertion location</var> be the <span>appropriate place for
131000-
inserting a node</span>.</p></li>
131000+
<li><p>Let the <var>adjustedInsertionLocation</var> be the <span>appropriate place for inserting
131001+
a node</span>.</p></li>
131001131002

131002131003
<!-- this insertion stuff should be cleaned up: https://github.com/whatwg/html/issues/1706 -->
131003131004

131004131005
<li><p>Let <var>element</var> be the result of <span data-x="create an element for the
131005-
token">creating an element for the token</span> in the given namespace, with the intended
131006-
parent being the element in which the <var>adjusted insertion location</var> finds
131007-
itself.</p></li>
131006+
token">creating an element for the token</span> given <var>token</var>, <var>namespace</var>,
131007+
and the element in which the <var>adjustedInsertionLocation</var> finds itself.</p></li>
131008131008

131009131009
<li><p>If <var>onlyAddToElementStack</var> is false, then run <span>insert an element at the
131010131010
adjusted insertion location</span> with <var>element</var>.</p></li>
@@ -131015,9 +131015,8 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {
131015131015
<li><p>Return <var>element</var>.</p></li>
131016131016
</ol>
131017131017

131018-
<p>When the steps below require the user agent to <dfn>insert an HTML element</dfn> for a token,
131019-
the user agent must <span>insert a foreign element</span> for the token, with the <span>HTML
131020-
namespace</span> and false.</p>
131018+
<p>To <dfn>insert an HTML element</dfn> given a token <var>token</var>: <span>insert a foreign
131019+
element</span> given <var>token</var>, the <span>HTML namespace</span>, and false.</p>
131021131020

131022131021
<hr>
131023131022

0 commit comments

Comments
 (0)