Skip to content

Commit

Permalink
Add shadowRoot to ElementInternals
Browse files Browse the repository at this point in the history
  • Loading branch information
mfreed7 authored Oct 5, 2020
1 parent a72c7b3 commit 564dfd5
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion source
Original file line number Diff line number Diff line change
Expand Up @@ -2917,7 +2917,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x-href="https://dom.spec.whatwg.org/#concept-node-document">node document</dfn> concept</li>
<li><dfn data-x="concept-document-type" data-x-href="https://dom.spec.whatwg.org/#concept-document-type">document type</dfn> concept</li>
<li><dfn data-x="concept-DocumentFragment-host" data-x-href="https://dom.spec.whatwg.org/#concept-documentfragment-host">host</dfn> concept</li>
<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>
<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>
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#element-shadow-host">shadow host</dfn> concept</li>
<li><dfn data-x-href="https://dom.spec.whatwg.org/#interface-htmlcollection"><code>HTMLCollection</code></dfn> interface, its
<dfn data-x="dom-HTMLCollection-length" data-x-href="https://dom.spec.whatwg.org/#dom-htmlcollection-length"><code>length</code></dfn> attribute, and its
Expand Down Expand Up @@ -67310,6 +67310,8 @@ interface <dfn>ElementInternals</dfn> {
boolean <span data-x="dom-ElementInternals-reportValidity">reportValidity</span>();

readonly attribute <span>NodeList</span> <span data-x="dom-ElementInternals-labels">labels</span>;

readonly attribute <code>ShadowRoot</code>? <span data-x="dom-ElementInternals-shadowRoot">shadowRoot</span>;
};

ElementInternals includes <span>ARIAMixin</span>;
Expand Down Expand Up @@ -67409,6 +67411,12 @@ dictionary <dfn>ValidityStateFlags</dfn> {
<var>internals</var>'s <span data-x="internals-target">target element</span>, which will be used
unless the page author overrides them using the <code data-x="attr-aria-*">aria-*</code>
attributes.</p></dd>

<dt><var>internals</var> . <code data-x="dom-ElementInternals-shadowRoot">shadowRoot</code></dt>
<dd><p>Returns the <code>ShadowRoot</code> for <var>internals</var>'s
<span data-x="internals-target">target element</span>, if the
<span data-x="internals-target">target element</span> is a <span>shadow host</span>, or null
otherwise.</p></dd>
</dl>

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

<p>The <dfn><code data-x="dom-ElementInternals-shadowRoot">shadowRoot</code></dfn> getter steps are:

<ol>
<li><p>Let <var>target</var> be <code>ElementInternals</code>'s <span
data-x="internals-target">target element</span>.</p></li>

<li><p>If <var>target</var> is not a <span>shadow host</span>, then return null.</p></li>

<li><p>Let <var>shadow</var> be <var>target</var>'s
<span data-x="concept-element-shadow-root">shadow root</span>.</p></li>

<li><p>If <var>shadow</var>'s <span>available to element internals</span> is false, then return
null.</p></li>

<li><p>Return <var>shadow</var>.</p></li>
</ol>

<hr>

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

0 comments on commit 564dfd5

Please sign in to comment.