Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3438,6 +3438,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x-href="https://dom.spec.whatwg.org/#valid-attribute-local-name">valid attribute local name</dfn></li>
<li><dfn data-x-href="https://dom.spec.whatwg.org/#valid-element-local-name">valid element local name</dfn></li>
<li><dfn data-x-href="https://dom.spec.whatwg.org/#is-a-global-custom-element-registry">is a global custom element registry</dfn></li>
<li><dfn data-x-href="https://dom.spec.whatwg.org/#concept-element-keep-custom-element-registry-null">keep element custom element registry null</dfn></li>
<li><dfn data-x-href="https://dom.spec.whatwg.org/#dom-processinginstruction-target" data-x="dom-ProcessingInstruction-target">processing instruction target</dfn></li>
</ul>

Expand Down Expand Up @@ -13028,6 +13029,7 @@ interface <dfn interface>HTMLElement</dfn> : <span>Element</span> {
[<span>CEReactions</span>, <span data-x="xattr-ReflectSetter">ReflectSetter</span>] attribute DOMString <span data-x="dom-writingSuggestions">writingSuggestions</span>;
[<span>CEReactions</span>, <span data-x="xattr-ReflectSetter">ReflectSetter</span>] attribute DOMString <span data-x="dom-autocapitalize">autocapitalize</span>;
[<span>CEReactions</span>] attribute boolean <span data-x="dom-autocorrect">autocorrect</span>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute boolean <dfn attribute for="HTMLElement" data-x="dom-element-customElementRegistry">customElementRegistry</dfn>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we did not spot this before, but this clashes directly with https://dom.spec.whatwg.org/#dom-element-customelementregistry

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the attribute should be called something like initialcustomelementregistry, this would also make it clearer that setting the attribute has no effect on the actual customElementRegistry.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The attribute hasn't been out for too long so it's probably still not too late to change it. Perhaps mirroring what we have for shadowrootcustomelementregistry, we can make this attribute elementcustomelementregistry. @annevk @Jamesernator thoughts?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer initialcustomelementregistry to elementcustomelementregistry. I kind of wonder if we could get away without the IDL reflection, though? It would be quite strange for the content attribute to not reflect, but maybe that's okay?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we've gone out of our way to reflect even the attributes on the template element that would be very weird and I don't think we should do that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discussed this with colleagues and we're not sure about either initial or default as the registry in principle doesn't change. How about scopedcustomelementregistry with scopedCustomElementRegistry as the IDL member?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have mixed feelings about scopedcustomelementregistry because having this attribute does not mean the user cannot assign a global registry to it later on, but perhaps that's not really a concern. I'm okay with this option, though I'm still more favoring elementcustomelementregistry because it has almost identical capabilities as shadowrootcustomelementregistry but on elements, so the naming mirroring can also make sense.


[<span>CEReactions</span>] attribute [<span>LegacyNullToEmptyString</span>] DOMString <span data-x="dom-innerText">innerText</span>;
[<span>CEReactions</span>] attribute [<span>LegacyNullToEmptyString</span>] DOMString <span data-x="dom-outerText">outerText</span>;
Expand Down Expand Up @@ -14375,6 +14377,7 @@ https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%
<li><code data-x="attr-autocorrect">autocorrect</code></li>
<li><code data-x="attr-fe-autofocus">autofocus</code></li>
<li><code data-x="attr-contenteditable">contenteditable</code></li>
<li><code data-x="attr-customelementregistry">customelementregistry</code></li>
<li><code data-x="attr-dir">dir</code></li>
<li><code data-x="attr-draggable">draggable</code></li>
<li><code data-x="attr-enterkeyhint">enterkeyhint</code></li>
Expand Down Expand Up @@ -78747,6 +78750,14 @@ console.assert(el instanceof SpiderMan); // upgraded!</code></pre>
<code>CustomElementRegistry</code> object, it intentionally cannot be changed any further. This
simplifies reasoning about code and allows implementations to optimize.</p>

<h4>The <code data-x="attr-customelementregistry">customelementregistry</code> attribute</h4>

<p> The
<dfn element-attr for="html-global"><code data-x="attr-customelementregistry">customelementregistry</code></dfn>
attribute is used to specify whether the parser should be
<span data-x="look up a custom element registry">looking up a custom element registry</span>
when the parser runs <span>Create an element for the token</span>. The value is boolean.</p>


<h4><dfn data-x="custom-element-upgrades">Upgrades</dfn></h4>

Expand Down Expand Up @@ -144196,8 +144207,15 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {
<li><p>Let <var>is</var> be the value of the "<code data-x="attr-is">is</code>" attribute in
<var>token</var>, if such an attribute exists; otherwise null.</p></li>

<li><p>Let <var>registry</var> be the result of <span data-x="look up a custom element
registry">looking up a custom element registry</span> given <var>intendedParent</var>.</p></li>
<li><p>Let <var>registry</var> be null if
<code data-x="attr-customelementregistry">customelementregistry</code> attribute exists;
otherwise let <var>registry</var> be the result of
<span data-x="look up a custom element registry">looking up a custom element registry</span>
given <var>intendedParent</var>.</p></li>
Comment thread
ja-y-son marked this conversation as resolved.

<li><p>Let <var>keepRegistryNull</var> be true if
<code data-x="attr-customelementregistry">customelementregistry</code> attribute exists;
otherwise false.

<li><p>Let <var>definition</var> be the result of <span data-x="look up a custom element
definition">looking up a custom element definition</span> given <var>registry</var>,
Expand Down Expand Up @@ -144286,6 +144304,10 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {
with the <code>form</code> element pointed to by the <span><code data-x="">form</code> element
pointer</span> and set <var>element</var>'s <span>parser inserted flag</span>.</p></li>

<li><p>If <var>keepRegistryNull</var> is true, set <var>element</var>'s
<span>keep element custom element registry null</span>
to true.

<li><p>Return <var>element</var>.</p></li>
</ol>
</div>
Expand Down Expand Up @@ -149032,6 +149054,15 @@ document.body.appendChild(text);
data-x="escaping a string">escaped as described below</span> in <i>attribute mode</i>,
followed by a U+0022 QUOTATION MARK character (&quot;).</p>

<p>If the element does not have a
<code data-x="attr-customelementregistry">customelementregistry</code> attribute in its
attribute list, and <var>current node</var>'s
<span data-x="element-custom-element-registry">custom element registry</span> is not the
same as the result of
<span data-x="look up a custom element registry">looking up a custom element
registry</span> given <var>current node</var>'s parent element, then append
"<code data-x=""> customelementregistry=&quot;&quot;</code>".</p>

<p>For each attribute that the element has, append a U+0020 SPACE character, the <span
data-x="attribute's serialized name">attribute's serialized name as described below</span>, a
U+003D EQUALS SIGN character (=), a U+0022 QUOTATION MARK character (&quot;), the
Expand Down Expand Up @@ -157786,6 +157817,11 @@ interface <dfn interface>External</dfn> {
<td> "<code data-x="attr-crossorigin-anonymous-keyword">anonymous</code>";
"<code data-x="attr-crossorigin-use-credentials-keyword">use-credentials</code>";
the empty string
<tr>
<th> <code data-x="">customelementregistry</code>
<td> <span data-x="attr-class">HTML elements</span>
<td> Whether the element should use scoped custom element registry
<td> <span>Boolean attribute</span>
<tr>
<th> <code data-x="">data</code>
<td> <code data-x="attr-object-data">object</code>
Expand Down
Loading