Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shadow host consideration for :focus selector #4731

Merged
merged 10 commits into from
Sep 24, 2019
27 changes: 21 additions & 6 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3160,7 +3160,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-DocumentFragment-host" data-x-href="https://dom.spec.whatwg.org/#concept-documentfragment-host">host</dfn> concept</li>
<li><dfn data-x-href="https://dom.spec.whatwg.org/#concept-shadow-root">shadow root</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><dfn data-x-href="https://dom.spec.whatwg.org/#interface-htmlcollection"><code>HTMLCollection</code></dfn> interface</li>
<li><dfn data-x="dom-HTMLCollection-length" data-x-href="https://dom.spec.whatwg.org/#dom-htmlcollection-length"><code>HTMLCollection.length</code></dfn> attribute</li>
Expand Down Expand Up @@ -3189,6 +3189,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-tree-child" data-x="concept-tree-child">child</dfn> concept</li>
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-tree-root">root</dfn> and <dfn data-x-href="https://dom.spec.whatwg.org/#concept-shadow-including-root">shadow-including root</dfn> concepts</li>
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor">inclusive ancestor</dfn>,
<dfn data-x-href="https://dom.spec.whatwg.org/#concept-shadow-including-ancestor">shadow-including ancestor</dfn>,
<dfn data-x-href="https://dom.spec.whatwg.org/#concept-shadow-including-descendant">shadow-including descendant</dfn>, and
<dfn data-x-href="https://dom.spec.whatwg.org/#concept-shadow-including-inclusive-descendant">shadow-including inclusive descendant</dfn> concepts</li>
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-tree-first-child">first child</dfn> and <dfn data-x-href="https://dom.spec.whatwg.org/#concept-tree-next-sibling">next sibling</dfn> concepts</li>
Expand Down Expand Up @@ -68942,11 +68943,24 @@ Demos:
<dt><dfn data-noexport=""><code data-x="selector-focus">:focus</code></dfn></dt>
<dd>
<p>For the purposes of the CSS <code data-x="selector-focus">:focus</code>
<span>pseudo-class</span>, an <dfn>element has the focus</dfn> when its <span>top-level browsing
context</span> has the system focus, it is not itself a <span>browsing context container</span>,
and it is one of the elements listed in the <span>focus chain</span> of the <span
data-x="currently focused area of a top-level browsing context">currently focused area of the
top-level browsing context</span>.</p>
<span>pseudo-class</span>, an <dfn>element has the focus</dfn> when:</p>

<ul>
<li><p>its <span>top-level browsing context</span> has the system focus;</p></li>
domenic marked this conversation as resolved.
Show resolved Hide resolved
<li><p>it is not itself a <span>browsing context container</span>; and</p></li>
rakina marked this conversation as resolved.
Show resolved Hide resolved
domenic marked this conversation as resolved.
Show resolved Hide resolved
<li>
domenic marked this conversation as resolved.
Show resolved Hide resolved
<p>at least one of the following is true:</p>
domenic marked this conversation as resolved.
Show resolved Hide resolved
<ul>
<li><p>it is one of the elements listed in the <span>focus chain</span> of the <span
data-x="currently focused area of a top-level browsing context">currently focused area of
the top-level browsing context</span>, or</p></li>
<li><p>its <span>shadow root</span> <var>shadowRoot</var> is not null,
domenic marked this conversation as resolved.
Show resolved Hide resolved
<var>shadowRoot</var>'s <span>delegates focus</span> is true, and <var>shadowRoot</var> is
the <span>root</span> of at least one element that <span data-x="element has the focus">has
the focus</span>.</p></li>
</ul>
domenic marked this conversation as resolved.
Show resolved Hide resolved
</li>
</ul>
</dd>

domenic marked this conversation as resolved.
Show resolved Hide resolved
<dt><dfn data-noexport=""><code data-x="selector-target">:target</code></dfn></dt>
Expand Down Expand Up @@ -124223,6 +124237,7 @@ INSERT INTERFACES HERE
Rahul Purohit,
Raj Doshi,
Rajas Moonka,
Rakina Zata Amni,
Ralf Stoltze,
Ralph Giles,
Raphael Champeimont,
Expand Down