@@ -3358,6 +3358,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
3358
3358
<li><dfn data-x-href="https://dom.spec.whatwg.org/#abortcontroller-signal-abort">signal abort</dfn></li>
3359
3359
<li><dfn data-x="AbortSignal-add" data-x-href="https://dom.spec.whatwg.org/#abortsignal-add">add</dfn></li>
3360
3360
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-element-attributes-get-by-name">get an attribute by name</dfn> algorithm</li>
3361
+ <li><dfn data-x-href="https://dom.spec.whatwg.org/#valid-element-local-name">valid element local name</dfn></li>
3361
3362
</ul>
3362
3363
3363
3364
<p>The following features are defined in <cite>UI Events</cite>: <ref>UIEVENTS</ref></p>
@@ -73369,43 +73370,52 @@ document.body.append(parent);
73369
73370
73370
73371
<hr>
73371
73372
73372
- <p>A < dfn export>valid custom element name</dfn> is a sequence of characters <var>name</var> that
73373
- meets all of the following requirements :</p>
73373
+ <p>A string <var>name</var> is a < dfn export>valid custom element name</dfn> if all of the
73374
+ following are true :</p>
73374
73375
73375
73376
<ul>
73376
73377
<li>
73377
- <p><var>name</var> must match the <code
73378
- data-x="prod-PotentialCustomElementName">PotentialCustomElementName</code> production:</p>
73378
+ <p><var>name</var> is a <span>valid element local name</span>;</p>
73379
73379
73380
- <dl>
73381
- <dt><code data-x=""><dfn
73382
- data-x="prod-PotentialCustomElementName">PotentialCustomElementName</dfn> ::=</code></dt>
73383
- <dd><code data-x="">[a-z] (<span data-x="prod-PCENChar">PCENChar</span>)* '-'
73384
- (<span data-x="prod-PCENChar">PCENChar</span>)*</code></dd>
73385
-
73386
- <dt><code data-x=""><dfn data-x="prod-PCENChar">PCENChar</dfn> ::=</code></dt>
73387
- <dd><code data-x="">"-" | "." | [0-9] | "_" | [a-z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] |
73388
- [#xF8-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] |
73389
- [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] |
73390
- [#x10000-#xEFFFF]</code></dd>
73391
- </dl>
73380
+ <p class="note">This ensures the custom element can be created with <code
73381
+ data-x="dom-Document-createElement">createElement()</code>.</p>
73382
+ </li>
73392
73383
73393
- <p>This uses the <a href="https://www.w3.org/TR/xml/#sec-notation">EBNF notation</a> from the
73394
- <cite>XML</cite> specification. <ref>XML</ref></p>
73384
+ <li>
73385
+ <p><var>name</var>'s 0th <span>code point</span> is an <span>ASCII lower alpha</span>;</p>
73386
+
73387
+ <p class="note">This ensures the HTML parser will treat the name as a tag name instead of as
73388
+ text.</p>
73395
73389
</li>
73396
73390
73397
73391
<li>
73398
- <p><var>name</var> must not be any of the following:</p>
73392
+ <p><var>name</var> does not contain any <span data-x="ASCII upper alpha">ASCII upper
73393
+ alphas</span>;</p>
73394
+
73395
+ <p class="note">This ensures the user agent can always treat HTML elements
73396
+ ASCII-case-insensitively.</p>
73397
+ </li>
73398
+
73399
+ <li>
73400
+ <p><var>name</var> contains a U+002D (-); and</p>
73401
+
73402
+ <p class="note">This is used for namespacing and to ensure forward compatibility (since no
73403
+ elements will be added to HTML, SVG, or MathML with hyphen-containing local names going
73404
+ forward).</p>
73405
+ </li>
73406
+
73407
+ <li>
73408
+ <p><var>name</var> is not one of the following:</p>
73399
73409
73400
73410
<ul class="brief">
73401
- <li><code data-x="">annotation-xml</code></li>
73402
- <li><code data-x="">color-profile</code></li>
73403
- <li><code data-x="">font-face</code></li>
73404
- <li><code data-x="">font-face-src</code></li>
73405
- <li><code data-x="">font-face-uri</code></li>
73406
- <li><code data-x="">font-face-format</code></li>
73407
- <li><code data-x="">font-face-name</code></li>
73408
- <li><code data-x="">missing-glyph</code></li>
73411
+ <li>" <code data-x="">annotation-xml</code>" </li>
73412
+ <li>" <code data-x="">color-profile</code>" </li>
73413
+ <li>" <code data-x="">font-face</code>" </li>
73414
+ <li>" <code data-x="">font-face-src</code>" </li>
73415
+ <li>" <code data-x="">font-face-uri</code>" </li>
73416
+ <li>" <code data-x="">font-face-format</code>" </li>
73417
+ <li>" <code data-x="">font-face-name</code>" </li>
73418
+ <li>" <code data-x="">missing-glyph</code>" </li>
73409
73419
</ul>
73410
73420
73411
73421
<p class="note">The list of names above is the summary of all hyphen-containing element names
@@ -73414,34 +73424,14 @@ document.body.append(parent);
73414
73424
</li>
73415
73425
</ul>
73416
73426
73417
- <div class="note">
73418
- <p>These requirements ensure a number of goals for <span data-x="valid custom element name">valid
73419
- custom element names</span>:</p>
73420
-
73421
- <ul>
73422
- <li><p>They start with an <span>ASCII lower alpha</span>, ensuring that the HTML parser will
73423
- treat them as tags instead of as text.</li>
73424
-
73425
- <li><p>They do not contain any <span data-x="ASCII upper alpha">ASCII upper alphas</span>,
73426
- ensuring that the user agent can always treat HTML elements ASCII-case-insensitively.</p></li>
73427
-
73428
- <li><p>They contain a hyphen, used for namespacing and to ensure forward compatibility (since no
73429
- elements will be added to HTML, SVG, or MathML with hyphen-containing local names in the
73430
- future).</p></li>
73431
-
73432
- <li><p>They can always be created with <code
73433
- data-x="dom-Document-createElement">createElement()</code> and <code
73434
- data-x="dom-Document-createElementNS">createElementNS()</code>, which have restrictions that go
73435
- beyond the parser's.</p></li>
73436
- </ul>
73437
-
73438
- <p>Apart from these restrictions, a large variety of names is allowed, to give maximum
73439
- flexibility for use cases like <code data-x=""><math-α></code> or <code
73440
- data-x=""><emotion-😍></code>.</p>
73441
- </div>
73427
+ <p>Apart from these restrictions, a large variety of names is allowed, to give maximum
73428
+ flexibility for use cases like <code data-x=""><math-α></code> or <code
73429
+ data-x=""><emotion-😍></code>.</p>
73442
73430
73443
73431
<div w-nodev>
73444
73432
73433
+ <hr>
73434
+
73445
73435
<p>A <dfn export>custom element definition</dfn> describes a <span>custom element</span> and
73446
73436
consists of:</p>
73447
73437
0 commit comments