Skip to content

Commit

Permalink
Add the inert attribute and tweak definition of inert subtrees
Browse files Browse the repository at this point in the history
  • Loading branch information
nt1m committed Sep 30, 2021
1 parent bc7d13e commit de0330a
Showing 1 changed file with 37 additions and 16 deletions.
53 changes: 37 additions & 16 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -74071,25 +74071,25 @@ END:VCARD</pre>

<h3>Inert subtrees</h3>

<p class="note">This section <strong>does not</strong> define or create any content attribute
named "inert". This section merely defines an abstract <em>concept</em> of
<span data-x="inert">inertness</span>.</p>
<p class="note">See also <code data-x="attr-inert">inert</code> for an explanation of
the attribute of the same name.</p>

<p>A node (in particular elements and text nodes) can be marked as <dfn>inert</dfn>. When a node
is <span>inert</span>, then the user agent must act as if the node was absent for the purposes of
targeting user interaction events, may ignore the node for the purposes of
<span>find-in-page</span>, and may prevent the user from selecting text in that node. User agents
should allow the user to override the restrictions on search and text selection, however.</p>

<p class="example">For example, consider a page that consists of just a single <span>inert</span>
paragraph positioned in the middle of a <code>body</code>. If a user moves their pointing device
from the <code>body</code> over to the <span>inert</span> paragraph and clicks on the paragraph,
no <code data-x="event-mouseover">mouseover</code> event would be fired, and the <code
data-x="event-mousemove">mousemove</code> and <code data-x="event-click">click</code> events would
be fired on the <code>body</code> element rather than the paragraph.</p>

<p class="note">When a node is inert, it generally cannot be focused. Inert nodes that are <span
is <span>inert</span>:</p>

<ul>
<li><p>It behaves as if the pointer-events CSS property were set to the value none.</p></li>
<li><p>It generally cannot be focused. Inert nodes that are <span
data-x="concept-command">commands</span> will also get disabled.</p>
<li><p>Selecting text in that node may be prevented by the user agent.</p></li>
<li><p>The user agent may ignore the node for the purposes of text search user interfaces
(commonly known as "find in page").</p></li>
</ul>

<p>User agents may allow the user to override the restrictions on search, text selection,
however.</p>

<p>By default, an element is not <span>inert</span>.</p>

<p>While a <span>browsing context container</span> is marked as <span>inert</span>, its
<span>nested browsing context</span>'s <span>active document</span>, and all nodes in that
Expand All @@ -74113,7 +74113,27 @@ END:VCARD</pre>
data-x="top-layer-add">adding</span> the <code>dialog</code> element to its <span>node
document</span>'s <span>top layer</span>.</p>

<h4>The <dfn data-x="attr-inert"><code>inert</code></dfn> attribute</h4>

<p>The <code data-x="attr-inert">inert</code> attribute is a <span>boolean attribute</span> that
indicates, by its presence, that the element and all its shadow-including descendants is to be
made <span>inert</span>.</p>

<p w-nodev>While an element has an <code data-x="attr-inert">inert</code> attribute, the user
agent must mark that element and all its <span>flat tree</span> descendants as
<span>inert</span>. The topmost <code>dialog</code> </p>

<p class="note">By default, there is no persistent visual indication of a subtree being inert.
Authors are encouraged to clearly mark what parts of their document are active and which are
inert, to avoid user confusion. In particular, it is worth remembering that not all users can see
all parts of a page at once; for example, users of screen readers, users on small devices or with
magnifiers, and even users just using particularly small windows might not be able to see the
active part of a page and might get frustrated if inert sections are not obviously inert. For
individual controls, the <code data-x="attr-fe-disabled">disabled</code> attribute is probably
more appropriate.</p>

<p>The <dfn data-x="dom-inert"><code>inert</code></dfn> IDL attribute must <span>reflect</span>
the content attribute of the same name.</p>

<h3>Tracking user activation</h3>

Expand Down Expand Up @@ -127248,6 +127268,7 @@ INSERT INTERFACES HERE
Tim Altman,
Tim Dresser,
Tim Johansson,
Tim Nguyen, <!-- nt1m on Github -->
Tim Perry,
Tim van der Lippe,
TJ VanToll,
Expand Down

0 comments on commit de0330a

Please sign in to comment.