Skip to content

Commit 564dfd5

Browse files
authored
Add shadowRoot to ElementInternals
Closes WICG/webcomponents#871.
1 parent a72c7b3 commit 564dfd5

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

source

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2917,7 +2917,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
29172917
<li><dfn data-x-href="https://dom.spec.whatwg.org/#concept-node-document">node document</dfn> concept</li>
29182918
<li><dfn data-x="concept-document-type" data-x-href="https://dom.spec.whatwg.org/#concept-document-type">document type</dfn> concept</li>
29192919
<li><dfn data-x="concept-DocumentFragment-host" data-x-href="https://dom.spec.whatwg.org/#concept-documentfragment-host">host</dfn> concept</li>
2920-
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-shadow-root">shadow root</dfn> concept, and its <dfn data-x-href="https://dom.spec.whatwg.org/#shadowroot-delegates-focus">delegates focus</dfn></li>
2920+
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-shadow-root">shadow root</dfn> concept, and its <dfn data-x-href="https://dom.spec.whatwg.org/#shadowroot-delegates-focus">delegates focus</dfn> and <dfn data-x-href="https://dom.spec.whatwg.org/#shadowroot-available-to-element-internals">available to element internals</dfn>.</li>
29212921
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#element-shadow-host">shadow host</dfn> concept</li>
29222922
<li><dfn data-x-href="https://dom.spec.whatwg.org/#interface-htmlcollection"><code>HTMLCollection</code></dfn> interface, its
29232923
<dfn data-x="dom-HTMLCollection-length" data-x-href="https://dom.spec.whatwg.org/#dom-htmlcollection-length"><code>length</code></dfn> attribute, and its
@@ -67310,6 +67310,8 @@ interface <dfn>ElementInternals</dfn> {
6731067310
boolean <span data-x="dom-ElementInternals-reportValidity">reportValidity</span>();
6731167311

6731267312
readonly attribute <span>NodeList</span> <span data-x="dom-ElementInternals-labels">labels</span>;
67313+
67314+
readonly attribute <code>ShadowRoot</code>? <span data-x="dom-ElementInternals-shadowRoot">shadowRoot</span>;
6731367315
};
6731467316

6731567317
ElementInternals includes <span>ARIAMixin</span>;
@@ -67409,6 +67411,12 @@ dictionary <dfn>ValidityStateFlags</dfn> {
6740967411
<var>internals</var>'s <span data-x="internals-target">target element</span>, which will be used
6741067412
unless the page author overrides them using the <code data-x="attr-aria-*">aria-*</code>
6741167413
attributes.</p></dd>
67414+
67415+
<dt><var>internals</var> . <code data-x="dom-ElementInternals-shadowRoot">shadowRoot</code></dt>
67416+
<dd><p>Returns the <code>ShadowRoot</code> for <var>internals</var>'s
67417+
<span data-x="internals-target">target element</span>, if the
67418+
<span data-x="internals-target">target element</span> is a <span>shadow host</span>, or null
67419+
otherwise.</p></dd>
6741267420
</dl>
6741367421

6741467422
<p>Each <code>ElementInternals</code> has a <dfn data-x="internals-target">target element</dfn>,
@@ -67453,6 +67461,23 @@ dictionary <dfn>ValidityStateFlags</dfn> {
6745367461
<span data-x="internals-target">targeting</span> <var>element</var>, and return it.</p></li>
6745467462
</ol>
6745567463

67464+
<p>The <dfn><code data-x="dom-ElementInternals-shadowRoot">shadowRoot</code></dfn> getter steps are:
67465+
67466+
<ol>
67467+
<li><p>Let <var>target</var> be <code>ElementInternals</code>'s <span
67468+
data-x="internals-target">target element</span>.</p></li>
67469+
67470+
<li><p>If <var>target</var> is not a <span>shadow host</span>, then return null.</p></li>
67471+
67472+
<li><p>Let <var>shadow</var> be <var>target</var>'s
67473+
<span data-x="concept-element-shadow-root">shadow root</span>.</p></li>
67474+
67475+
<li><p>If <var>shadow</var>'s <span>available to element internals</span> is false, then return
67476+
null.</p></li>
67477+
67478+
<li><p>Return <var>shadow</var>.</p></li>
67479+
</ol>
67480+
6745667481
<hr>
6745767482

6745867483
<p>Each <span>form-associated custom element</span> has <dfn

0 commit comments

Comments
 (0)