From b9b3fb26c8f1009d3bab8dbe4555a27c5605a15e Mon Sep 17 00:00:00 2001 From: Alice Boxhall Date: Fri, 22 Mar 2019 15:13:47 +1100 Subject: [PATCH] Clarify event retargeting, and mention inertness in the definition of . --- source | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/source b/source index 7dc57aa437e..a68577e0583 100644 --- a/source +++ b/source @@ -3298,6 +3298,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • compositionstart event
  • compositionupdate event
  • compositionend event
  • + +
  • The event target concept
  • +
  • The topmost event target concept
  • The following features are defined in the Touch Events specification:

    @@ -54946,8 +54949,9 @@ MIT Room 32-G524
    -

    Changes the selection to cover the given substring in the given direction. If the direction - is omitted, it will be reset to be the platform default (none or forward).

    +

    If element is not inert, changes the selection to cover the given + substring in the given direction. If the direction is omitted, it will be reset to be the + platform default (none or forward).

    @@ -72482,9 +72486,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 @@ -72523,20 +72525,35 @@ 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 the inert element is the topmost event + target for one of the above events, which would be fired as a result of user input, 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

  • -
  • 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,