From 617566c1c6b544101e18529df0e146b6748339f7 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Wed, 29 Jun 2016 18:25:00 -0400 Subject: [PATCH 01/11] Re-add the inert="" attribute This reverts the edits made in https://github.com/whatwg/html/commit/5ddfc78b1f82e86cc202d72ccc752a0e15f1e4ad (and https://github.com/whatwg/html/commit/b0ec7168f44ac6281e7867dc2367ffb2b66131d9) which removed the inert attribute. The inert attribute was originally added in https://github.com/whatwg/html/commit/2fb24fcf3f916236e8767e2cb72b23e5c75b77e9 as part of the feature. It is currently being re-considered as part of the https://github.com/WICG/inert proposal. --- source | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source b/source index c127ef318d6..7053a4f81d8 100644 --- a/source +++ b/source @@ -72548,7 +72548,25 @@ END:VCARD data-x="top-layer-add">adding the dialog element to its node document's top layer.

+

The inert attribute

+

The inert attribute is a boolean attribute that + indicates, by its presence, that the element and all its descendants is to be made + inert.

+ +

When an element has an inert attribute, the user agent + must mark that element and all its descendants as inert.

+ +

By default, there is no 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 may get frustrated if inert sections are not obviously inert. For individual controls, + the disabled attribute is probably more appropriate.

+ +

The inert IDL attribute must reflect + the content attribute of the same name.

Tracking user activation

From fea0edb8d968ba50b7ae9db957b722ebaec1f4e9 Mon Sep 17 00:00:00 2001 From: Alice Boxhall Date: Wed, 8 Aug 2018 15:44:27 +1000 Subject: [PATCH 02/11] Add advice to use default cursor --- source | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/source b/source index 7053a4f81d8..5d05dad0946 100644 --- a/source +++ b/source @@ -72557,13 +72557,20 @@ END:VCARD

When an element has an inert attribute, the user agent must mark that element and all its descendants as inert.

-

By default, there is no 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 may get frustrated if inert sections are not obviously inert. For individual controls, - the disabled attribute is probably more appropriate.

+

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 disabled attribute + is probably more appropriate.

The inert IDL attribute must reflect the content attribute of the same name.

From 4faaca339a1b708fa63eb07f6eac62a55a9631ca Mon Sep 17 00:00:00 2001 From: Alice Boxhall Date: Tue, 8 Jan 2019 11:21:26 +1100 Subject: [PATCH 03/11] Clarify mouse pointer and event behaviour --- source | 54 +++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/source b/source index 5d05dad0946..04778ca3d40 100644 --- a/source +++ b/source @@ -72507,25 +72507,35 @@ END:VCARD

Inert subtrees

This section does not define or create any content attribute - named "inert". This section merely defines an abstract concept of - inertness.

+ named "inert". This section merely defines an abstract concept of inertness. See inert for an explanation of + the attribute of the same name.

A node (in particular elements and text nodes) can be marked as inert. When a node - is inert, 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 - 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.

+ is inert, then:

+ +
    +
  • the user agent must act as if the node's event listener list is empty for the + purposes of event invocation,

  • +
  • the user agent may ignore the node for the purposes of find-in-page, and

  • +
  • the user agent 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.

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

+ button positioned in the middle of a body. If a user clicks on the + button, the click event would cause no event listeners on + button to be run, and the event would bubble up to the body element + regardless of any event listeners on the button.

When a node is inert, it generally cannot be focused. Inert nodes that are commands will also get disabled.

+

User agents should show the default cursor when a user indicates an element in an inert subtree + using a pointing device.

+

While a browsing context container is marked as inert, its nested browsing context's active document, and all nodes in that Document, must be marked as inert.

@@ -72548,7 +72558,7 @@ END:VCARD data-x="top-layer-add">adding the dialog element to its node document's top layer.

-

The inert attribute

+

The inert attribute

The inert attribute is a boolean attribute that indicates, by its presence, that the element and all its descendants is to be made @@ -72558,19 +72568,13 @@ END:VCARD must mark that element and all its descendants as inert.

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 disabled attribute - is probably more appropriate.

+ 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 disabled attribute is probably + more appropriate.

The inert IDL attribute must reflect the content attribute of the same name.

From 0819a4b0155c961d039a4b03ad5cf6f7ae49bd8b Mon Sep 17 00:00:00 2001 From: Alice Boxhall Date: Tue, 19 Mar 2019 15:23:19 +1100 Subject: [PATCH 04/11] Add touch events and comments on hit testing --- source | 55 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 7 deletions(-) diff --git a/source b/source index 04778ca3d40..68dd89f59f2 100644 --- a/source +++ b/source @@ -72514,11 +72514,53 @@ END:VCARD

A node (in particular elements and text nodes) can be marked as inert. When a node is inert, then:

-
    -
  • the user agent must act as if the node's event listener list is empty for the - purposes of event invocation,

  • -
  • the user agent may ignore the node for the purposes of find-in-page, and

  • -
  • the user agent may prevent the user from selecting text in that node.

  • +
      +
    • +

      the user agent must not fire any of the following events on the node:

      +
        +
      • blur

      • +
      • focus

      • +
      • focusin

      • +
      • focusout

      • +
      • auxclick

      • +
      • click

      • +
      • dblclick

      • +
      • mousedown

      • +
      • mouseenter

      • +
      • mouseleave

      • +
      • mousemove

      • +
      • mouseout

      • +
      • mouseover

      • +
      • mouseup

      • +
      • touchstart

      • +
      • touchend

      • +
      • touchmove

      • +
      • touchcancel

      • +
      • wheel

      • +
      • beforeinput

      • +
      • input

      • +
      • keydown

      • +
      • keyup

      • +
      • compositionstart

      • +
      • compositionupdate

      • +
      • compositionend

      • +
      +
    • + +
    • if one of the above events would otherwise be fired on the element + as a result of a user interaction, where the process for determining the + event target entails "hit testing", the event must instead be targeted at + the non-inert ancestor of the element which would be the topmost "hit + testing" result for the point at which the interaction occurred, if the inert + element, its inert ancestors, and any unrelated elements were not + present;

    • + +
    • the user agent may ignore the node for the purposes of text search user interfaces + (commonly known as "find in page"); and

    • + +
    • the user agent may prevent the user from selecting text in that node, and may prevent + code calling setSelectionRange() + on the node.

    User agents should allow the user to override the restrictions on search and text selection, @@ -72527,8 +72569,7 @@ END:VCARD

    For example, consider a page that consists of just a single inert button positioned in the middle of a body. If a user clicks on the button, the click event would cause no event listeners on - button to be run, and the event would bubble up to the body element - regardless of any event listeners on the button.

    + button to be run, and the event would instead be targeted at the body element.

    When a node is inert, it generally cannot be focused. Inert nodes that are commands will also get disabled.

    From c173dae2267dda1a7dd7d7f8fae8f56115386510 Mon Sep 17 00:00:00 2001 From: Alice Boxhall Date: Fri, 22 Mar 2019 15:13:47 +1100 Subject: [PATCH 05/11] Clarify event retargeting, and mention inertness in the definition of . --- source | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source b/source index 68dd89f59f2..77380469d51 100644 --- a/source +++ b/source @@ -3053,7 +3053,19 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • keydown event
  • keypress event
  • keyup event
  • -
+ +
  • focusin event
  • +
  • focusout event
  • + +
  • beforeinput event
  • + +
  • compositionstart event
  • +
  • compositionupdate event
  • +
  • compositionend event
  • + +
  • The event target concept
  • +
  • The topmost event target concept
  • +

    The following features are defined in Touch Events:

    From 5da910e9c8e12244787832be45ada76e809fbad3 Mon Sep 17 00:00:00 2001 From: Alice Boxhall Date: Fri, 22 Mar 2019 17:01:36 +1100 Subject: [PATCH 06/11] Rephrase and capitalise --- source | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/source b/source index 77380469d51..734d4318f03 100644 --- a/source +++ b/source @@ -72518,9 +72518,7 @@ END:VCARD

    Inert subtrees

    -

    This section does not define or create any content attribute - named "inert". This section merely defines an abstract concept of inertness. See inert for an explanation of +

    See also inert for an explanation of the attribute of the same name.

    A node (in particular elements and text nodes) can be marked as inert. When a node @@ -72559,13 +72557,31 @@ END:VCARD -

  • if one of the above events would otherwise be fired on the element - as a result of a user interaction, where the process for determining the - event target entails "hit testing", the event must instead be targeted at - the non-inert ancestor of the element which would be the topmost "hit - testing" result for the point at which the interaction occurred, if the inert - element, its inert ancestors, and any unrelated elements were not - present;

  • +
  • +

    If one of the following events would be fired as a result of user input, such that the + inert element would be the topmost event + target, an alternative event target must be found as + follows:

    +
      +
    1. Let originalElement be the topmost event + target for the event.

    2. +
    3. Let candidate be the same element.

    4. +
    5. Let ineligible be an empty list.

    6. +
    7. +

      While candidate is inert, or candidate is not an an + ancestor of originalElement:

      +
        +
      1. Add candidate to ineligible.

      2. +
      3. Let candidate be the element which would be the topmost event target if all the elements in + ineligible were excluded from consideration.

      4. +
      +
    8. +
    9. If candidate is not null, let candidate be the new event target.

    10. +
    11. Otherwise, do not fire the event.

    12. +
    +
  • the user agent may ignore the node for the purposes of text search user interfaces (commonly known as "find in page"); and

  • From 2f1b841ea66566fa431a5937698ef540f9a3c41f Mon Sep 17 00:00:00 2001 From: Alice Boxhall Date: Fri, 12 Apr 2019 14:35:36 +1000 Subject: [PATCH 07/11] Remove list of forbidden events, and clarify behaviour for shadow trees and iframes --- source | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/source b/source index 734d4318f03..676a4d500f3 100644 --- a/source +++ b/source @@ -72526,39 +72526,7 @@ END:VCARD
    • -

      the user agent must not fire any of the following events on the node:

      -
        -
      • blur

      • -
      • focus

      • -
      • focusin

      • -
      • focusout

      • -
      • auxclick

      • -
      • click

      • -
      • dblclick

      • -
      • mousedown

      • -
      • mouseenter

      • -
      • mouseleave

      • -
      • mousemove

      • -
      • mouseout

      • -
      • mouseover

      • -
      • mouseup

      • -
      • touchstart

      • -
      • touchend

      • -
      • touchmove

      • -
      • touchcancel

      • -
      • wheel

      • -
      • beforeinput

      • -
      • input

      • -
      • keydown

      • -
      • keyup

      • -
      • compositionstart

      • -
      • compositionupdate

      • -
      • compositionend

      • -
      -
    • - -
    • -

      If one of the following events would be fired as a result of user input, such that the +

      If an event would be fired as a result of user input, such that the inert element would be the topmost event target, an alternative event target must be found as follows:

      @@ -72583,12 +72551,10 @@ END:VCARD
    • -
    • the user agent may ignore the node for the purposes of text search user interfaces +

    • The user agent may ignore the node for the purposes of text search user interfaces (commonly known as "find in page"); and

    • -
    • the user agent may prevent the user from selecting text in that node, and may prevent - code calling setSelectionRange() - on the node.

    • +
    • The user agent 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, From a69465a6ef877ada931dc9788fd718a8df897adb Mon Sep 17 00:00:00 2001 From: Alice Boxhall Date: Fri, 3 May 2019 09:47:28 +1000 Subject: [PATCH 08/11] Address Anne's comments --- source | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/source b/source index 676a4d500f3..007277f1290 100644 --- a/source +++ b/source @@ -3054,15 +3054,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • keypress event
  • keyup event
  • -
  • focusin event
  • -
  • focusout event
  • - -
  • beforeinput event
  • - -
  • compositionstart event
  • -
  • compositionupdate event
  • -
  • compositionend event
  • -
  • The event target concept
  • The topmost event target concept
  • @@ -55137,6 +55128,8 @@ MIT Room 32-G524 apply">does not apply to this element, throw an "InvalidStateError" DOMException.

    +
  • If this element is inert, return.

  • +
  • Set the selection range with start, end, and direction.

  • @@ -72540,9 +72533,10 @@ END:VCARD ancestor of originalElement:

    1. Add candidate to ineligible.

    2. -
    3. Let candidate be the element which would be the

      Set candidate to the element which would be the topmost event target if all the elements in - ineligible were excluded from consideration.

    4. + ineligible were excluded from consideration, or null if no such element + exists.

  • If candidate is not null, let candidate be the new

  • The user agent 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, +

    User agents may allow the user to override the restrictions on search and text selection, however.

    -

    For example, consider a page that consists of just a single inert +

    Consider a page that consists of just a single inert button positioned in the middle of a body. If a user clicks on the button, the click event would cause no event listeners on - button to be run, and the event would instead be targeted at the body element.

    + button to be run, and the event would instead be targeted at the body + element.

    When a node is inert, it generally cannot be focused. Inert nodes that are commands will also get disabled.

    @@ -72571,6 +72566,8 @@ END:VCARD

    User agents should show the default cursor when a user indicates an element in an inert subtree using a pointing device.

    +

    By default, an element is not inert.

    +

    While a browsing context container is marked as inert, its nested browsing context's active document, and all nodes in that Document, must be marked as inert.

    From 24ae880b31ed1bc9445717f697927cdc64611896 Mon Sep 17 00:00:00 2001 From: Alice Boxhall Date: Wed, 12 Jun 2019 14:13:50 +1000 Subject: [PATCH 09/11] s/when/while/ --- source | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source b/source index 007277f1290..59afe7ee451 100644 --- a/source +++ b/source @@ -1,4 +1,4 @@ -