Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clarify mouse pointer and event behaviour
Browse files Browse the repository at this point in the history
Alice Boxhall committed Jan 13, 2019
1 parent 0e1f7de commit be0a03d
Showing 1 changed file with 31 additions and 25 deletions.
56 changes: 31 additions & 25 deletions source
Original file line number Diff line number Diff line change
@@ -3199,6 +3199,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li>The <dfn data-x="concept-event-fire" data-x-href="https://dom.spec.whatwg.org/#concept-event-fire">fire an event</dfn> algorithm</li>
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#canceled-flag">canceled flag</dfn></li>
<li>The <dfn data-x="concept-event-dispatch" data-x-href="https://dom.spec.whatwg.org/#concept-event-dispatch">dispatch</dfn> algorithm</li>
<li>The concept of <dfn data-x="concept-event-listener-invoke" data-x-href="https://dom.spec.whatwg.org/#concept-event-listener-invoke">invoking</dfn> an event listener</li>
<li><dfn data-x-href="https://dom.spec.whatwg.org/#dictdef-eventinit"><code>EventInit</code></dfn> dictionary type</li>
<li><dfn data-x="dom-Event-type" data-x-href="https://dom.spec.whatwg.org/#dom-event-type"><code>type</code></dfn> attribute</li>
<li><dfn data-x="dom-Event-target" data-x-href="https://dom.spec.whatwg.org/#dom-event-target"><code>target</code></dfn> attribute</li>
@@ -3209,6 +3210,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x="dom-Event-isTrusted" data-x-href="https://dom.spec.whatwg.org/#dom-event-istrusted"><code>isTrusted</code></dfn> attribute</li>
<li><dfn data-x="dom-Event-initEvent" data-x-href="https://dom.spec.whatwg.org/#dom-event-initevent"><code>initEvent()</code></dfn> method</li>
<li><dfn data-x-href="https://dom.spec.whatwg.org/#add-an-event-listener">add an event listener</dfn></li>
<li><dfn data-x-href="https://dom.spec.whatwg.org/#eventtarget-event-listener-list">event listener list</dfn></li>
<li><dfn data-x="dom-EventTarget-addEventListener" data-x-href="https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener"><code>addEventListener()</code></dfn> method</li>
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#remove-an-event-listener">remove an event listener</dfn> and
<dfn data-x-href="https://dom.spec.whatwg.org/#remove-all-event-listeners">remove all event listeners</dfn> algorithms</li>
@@ -72272,26 +72274,36 @@ 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>
named "inert". This section merely defines an abstract <em>concept</em> of <span
data-x="inert">inertness</span>. See <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 text search user
interfaces (commonly known as "find in page"), 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>
is <span>inert</span>, then:</p>

<ul>
<li><p>the user agent must act as if the node's <span>event listener list</span> is empty for the
purposes of <span data-x="concept-event-listener-invoke">event invocation</span>,</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"), and</p></li>
<li><p>the user agent may prevent the user from selecting text in that node.</p></li>
</ul>

<p>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>
<code>button</code> positioned in the middle of a <code>body</code>. If a user clicks on the
button, the <code data-x="event-click">click</code> event would cause no event listeners on
<code>button</code> to be run, and the event would bubble up to the <code>body</code> element
regardless of any event listeners on the <code>button</code>.</p>

<p class="note">When a node is inert, it generally cannot be focused. Inert nodes that are <span
data-x="concept-command">commands</span> will also get disabled.</p>

<p>User agents should show the default cursor when a user indicates an element in an inert subtree
using a pointing device.</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
<code>Document</code>, must be marked as <span>inert</span>.</p>
@@ -72324,19 +72336,13 @@ END:VCARD</pre>
must mark that element and all its descendants as <span>inert</span>.</p>

<p class="note">By default, there is no persistent visual indication of a subtree being inert.
Since inert subtrees may not be the target of user interaction events,
including text selection,
user agents should show the default cursor when an the user indicates an element in an inert subtree
using a pointing device.
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 may 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>
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>

0 comments on commit be0a03d

Please sign in to comment.