Skip to content

Commit 8bc214a

Browse files
committed
Dev edition: hide implementer-facing text for custom elements
1 parent 9c0619a commit 8bc214a

File tree

1 file changed

+41
-16
lines changed

1 file changed

+41
-16
lines changed

source

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65996,8 +65996,8 @@ console.log(plasticButton.outerHTML); // will output '<button is="plastic-but
6599665996

6599765997
<p>After a <span>custom element</span> is <span data-x="create an element">created</span>,
6599865998
changing the value of the <code data-x="attr-is">is</code> attribute does not
65999-
change the element's behavior, as it is saved on the element as its <span
66000-
data-x="concept-element-is-value"><code data-x="">is</code> value</span>.</p>
65999+
change the element's behavior<span w-nodev>, as it is saved on the element as its <span
66000+
data-x="concept-element-is-value"><code data-x="">is</code> value</span></span>.</p>
6600166001

6600266002
<p><span data-x="autonomous custom element">Autonomous custom elements</span> have the following
6600366003
element definition:</p>
@@ -66107,6 +66107,8 @@ console.log(plasticButton.outerHTML); // will output '&lt;button is="plastic-but
6610766107
data-x="">&lt;emotion-😍></code>.</p>
6610866108
</div>
6610966109

66110+
<div w-nodev>
66111+
6611066112
<p>A <dfn>custom element definition</dfn> describes a <span>custom element</span> and consists
6611166113
of:</p>
6611266114

@@ -66172,9 +66174,11 @@ console.log(plasticButton.outerHTML); // will output '&lt;button is="plastic-but
6617266174
<li><p>Return null.</p></li>
6617366175
</ol>
6617466176

66177+
</div>
66178+
6617566179
<h4 id="custom-elements-api">The <code>CustomElementRegistry</code> interface</h4>
6617666180

66177-
<p>Each <code>Window</code> object is associated with a unique instance of a
66181+
<p w-nodev>Each <code>Window</code> object is associated with a unique instance of a
6617866182
<code>CustomElementRegistry</code> object, allocated when the <code>Window</code> object is
6617966183
created.</p>
6618066184

@@ -66183,9 +66187,11 @@ console.log(plasticButton.outerHTML); // will output '&lt;button is="plastic-but
6618366187
the <code>HTMLElement</code> interface, and there is exactly one <code>HTMLElement</code>
6618466188
interface per <code>Window</code> object.</p>
6618566189

66186-
<p>The <dfn><code data-x="dom-window-customElements">customElements</code></dfn> attribute of the
66187-
<code>Window</code> interface must return the <code>CustomElementRegistry</code> object for that
66188-
<code>Window</code> object.</p>
66190+
<div w-nodev>
66191+
66192+
<p>The <dfn><code data-x="dom-window-customElements">customElements</code></dfn> attribute
66193+
of the <code>Window</code> interface must return the <code>CustomElementRegistry</code> object for
66194+
that <code>Window</code> object.</p>
6618966195

6619066196
<pre class="idl">[Exposed=Window]
6619166197
interface <dfn>CustomElementRegistry</dfn> {
@@ -66215,6 +66221,8 @@ dictionary <dfn>ElementDefinitionOptions</dfn> {
6621566221
is used to implement the <code
6621666222
data-x="dom-CustomElementRegistry-whenDefined">whenDefined()</code> method.</p>
6621766223

66224+
</div>
66225+
6621866226
<dl class="domintro">
6621966227
<dt><var>window</var> . <code data-x="dom-window-customElements">customElements</code> . <code
6622066228
subdfn data-x="dom-CustomElementRegistry-define">define</code>(<var>name</var>,
@@ -66261,9 +66269,11 @@ dictionary <dfn>ElementDefinitionOptions</dfn> {
6626166269

6626266270
<p><dfn>Element definition</dfn> is a process of adding a <span>custom element definition</span>
6626366271
to the <code>CustomElementRegistry</code>. This is accomplished by the <code
66264-
data-x="dom-CustomElementRegistry-define">define()</code> method. When invoked, the <dfn><code
66265-
data-x="dom-CustomElementRegistry-define">define(<var>name</var>, <var>constructor</var>,
66266-
<var>options</var>)</code></dfn> method must run these steps:</p>
66272+
data-x="dom-CustomElementRegistry-define">define()</code> method. <span w-nodev>When invoked,
66273+
the <dfn><code data-x="dom-CustomElementRegistry-define">define(<var>name</var>,
66274+
<var>constructor</var>, <var>options</var>)</code></dfn> method must run these steps:</span></p>
66275+
66276+
<div w-nodev>
6626766277

6626866278
<ol>
6626966279
<li><p>If <span>IsConstructor</span>(<var>constructor</var>) is false, then throw a
@@ -66451,6 +66461,8 @@ dictionary <dfn>ElementDefinitionOptions</dfn> {
6645166461
<li><p>Return <var>promise</var>.</p></li>
6645266462
</ol>
6645366463

66464+
</div>
66465+
6645466466
<div class="example">
6645566467
<p>The <code data-x="dom-CustomElementRegistry-whenDefined">whenDefined()</code> method can be
6645666468
used to avoid performing an action until all appropriate <span data-x="custom element">custom
@@ -66476,6 +66488,8 @@ fetch(articleURL)
6647666488
});</pre>
6647766489
</div>
6647866490

66491+
<div w-nodev>
66492+
6647966493
<p>When invoked, the <dfn><code
6648066494
data-x="dom-CustomElementRegistry-upgrade">upgrade(<var>root</var>)</code></dfn> method must run
6648166495
these steps:</p>
@@ -66488,6 +66502,8 @@ fetch(articleURL)
6648866502
<span data-x="concept-try-upgrade">try to upgrade</span> <var>candidate</var>.</p></li>
6648966503
</ol>
6649066504

66505+
</div>
66506+
6649166507
<div class="example">
6649266508
<p>The <code data-x="dom-CustomElementRegistry-upgrade">upgrade()</code> method allows upgrading
6649366509
of elements at will. Normally elements are automatically upgraded when they become
@@ -66505,6 +66521,8 @@ customElements.upgrade(el);
6650566521
console.assert(el instanceof SpiderMan); // upgraded!</pre>
6650666522
</div>
6650766523

66524+
<div w-nodev>
66525+
6650866526
<h4><dfn data-x="custom-element-upgrades">Upgrades</dfn></h4>
6650966527

6651066528
<p>To <dfn data-x="concept-upgrade-an-element" data-export="">upgrade an element</dfn>, given as
@@ -66654,6 +66672,8 @@ customElements.define("x-foo", class extends HTMLElement {
6665466672
reaction</span> given <var>element</var> and <var>definition</var>.</p></li>
6665566673
</ol>
6665666674

66675+
</div>
66676+
6665766677
<h4 id="custom-element-reactions">Custom element reactions</h4>
6665866678

6665966679
<p>A <span>custom element</span> possesses the ability to respond to certain occurrences by
@@ -66694,13 +66714,16 @@ customElements.define("x-foo", class extends HTMLElement {
6669466714
data-x="concept-range">range</span> manipulation), they will instead be delayed until after all
6669566715
the relevant user agent processing steps have completed, and then run together as a batch.</p>
6669666716

66697-
<p>Additionally, the precise ordering of these reactions is managed via a somewhat-complicated
66698-
stack-of-queues system, described below. The intention behind this system is to guarantee that
66699-
<span data-x="concept-custom-element-reaction">custom element reactions</span> always are invoked
66700-
in the same order as their triggering actions, at least within the local context of a single
66701-
<span>custom element</span>. (Because <span data-x="concept-custom-element-reaction">custom
66702-
element reaction</span> code can perform its own mutations, it is not possible to give a global
66703-
ordering guarantee across multiple elements.)</p>
66717+
<p><span w-nodev>Additionally, the precise ordering of these reactions is managed via a
66718+
somewhat-complicated stack-of-queues system, described below. The intention behind this system is
66719+
to guarantee</span><span w-nohtml>It is guaranteed</span> that <span
66720+
data-x="concept-custom-element-reaction">custom element reactions</span> always are invoked in the
66721+
same order as their triggering actions, at least within the local context of a single <span>custom
66722+
element</span>. (Because <span data-x="concept-custom-element-reaction">custom element
66723+
reaction</span> code can perform its own mutations, it is not possible to give a global ordering
66724+
guarantee across multiple elements.)</p>
66725+
66726+
<div w-nodev>
6670466727

6670566728
<hr>
6670666729

@@ -66928,6 +66951,8 @@ customElements.define("x-foo", class extends HTMLElement {
6692866951
</ul>
6692966952
</div>
6693066953

66954+
</div>
66955+
6693166956

6693266957
<h3 split-filename="semantics-other" id="common-idioms">Common idioms without dedicated elements</h3>
6693366958

0 commit comments

Comments
 (0)