diff --git a/dom.bs b/dom.bs index 088ffa633..cbbf377d1 100644 --- a/dom.bs +++ b/dom.bs @@ -694,7 +694,7 @@ inherits from the {{Event}} interface.
event . preventDefault()
If invoked when the {{Event/cancelable}} attribute value is true, and while executing a - listener for the event with {{EventListenerOptions/passive}} set to false, signals to + listener for the event with {{AddEventListenerOptions/passive}} set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
event . {{Event/defaultPrevented}} @@ -949,10 +949,10 @@ callback interface EventListener { dictionary EventListenerOptions { boolean capture; - boolean passive; }; dictionary AddEventListenerOptions : EventListenerOptions { + boolean passive; boolean once; }; @@ -1012,8 +1012,8 @@ specified otherwise it returns null. will only be invoked once after which the event listener will be removed. The event listener is appended to target's list of event listeners and is - not appended if it is a duplicate, i.e., having the same type, callback, - capture and passive values. + not appended if it is a duplicate, i.e., having the same type, callback, and + capture values.
target . removeEventListener(type, callback [, options])
Remove the event listener @@ -1032,27 +1032,26 @@ specified otherwise it returns null. steps:
    -
  1. Let capture and passive be false. +

  2. Let capture be false.

  3. If options is a boolean, set capture to options.

  4. If options is a dictionary and {{EventListenerOptions/capture}} is present in options with value true, then set capture to true. -

  5. If options is a dictionary and {{EventListenerOptions/passive}} is - present in options with value true, then set passive to true. - -

  6. Return capture and passive. +

  7. Return capture.

To flatten more options, run these steps:

    -
  1. Let capture and passive be the result of flattening - options. +

  2. Let capture be the result of flattening options. -

  3. Let once be false. +

  4. Let once and passive be false. + +

  5. If options is a dictionary and {{AddEventListenerOptions/passive}} + is present in options with value true, then set passive to true.

  6. If options is a dictionary and {{AddEventListenerOptions/once}} is present in options with value true, then set once to true. @@ -1081,10 +1080,9 @@ method, when invoked, must run these steps:

  7. If context object's associated list of event listener does not contain an event listener whose type is type, callback is callback, - capture is capture, and passive is passive, then append a new - event listener to it, whose type is type, callback is - callback, capture is capture, passive is passive, - and once is once. + and capture is capture, then append a new event listener to it, whose + type is type, callback is callback, capture is + capture, passive is passive, and once is once.

The @@ -1096,13 +1094,12 @@ method, when invoked, must, run these steps its associated service worker's script resource's has ever been evaluated flag is set, throw a TypeError. [[!SERVICE-WORKERS]] -

  • Let capture and passive be the result of flattening - options. +

  • Let capture be the result of flattening options.

  • If there is an event listener in the associated list of event listeners whose - type is type, callback is callback, capture is - capture, and passive is passive then set that event listener's - removed to true and remove it from the associated list of event listeners. + type is type, callback is callback, and capture is + capture, then set that event listener's removed to true and remove it from + the associated list of event listeners.

    The dispatchEvent(event) method, when @@ -1129,12 +1126,12 @@ requires observing event listeners. This can make the presence of listene that even empty listeners can have a dramatic performance impact on the behavior of the application. For example, touch and wheel events which can be used to block asynchronous scrolling. In some cases this problem can be mitigated by specifying the event to be {{Event/cancelable}} only when there is -at least one non-{{EventListenerOptions/passive}} listener. For example, -non-{{EventListenerOptions/passive}} {{TouchEvent}} listeners must block scrolling, but if all -listeners are {{EventListenerOptions/passive}} then scrolling can be allowed to start +at least one non-{{AddEventListenerOptions/passive}} listener. For example, +non-{{AddEventListenerOptions/passive}} {{TouchEvent}} listeners must block scrolling, but if all +listeners are {{AddEventListenerOptions/passive}} then scrolling can be allowed to start in parallel by making the {{TouchEvent}} uncancelable (so that calls to {{Event/preventDefault()}} are ignored). So code dispatching an event is able to observe the absence -of non-{{EventListenerOptions/passive}} listeners, and use that to clear the {{Event/cancelable}} +of non-{{AddEventListenerOptions/passive}} listeners, and use that to clear the {{Event/cancelable}} property of the event being dispatched.

    Ideally, any new event APIs are defined such that they do not need this property (use diff --git a/dom.html b/dom.html index 8fb9bfee2..9a2614025 100644 --- a/dom.html +++ b/dom.html @@ -550,7 +550,7 @@

    dispatched, can be canceled by invoking the preventDefault() method.
    event . preventDefault()
    If invoked when the cancelable attribute value is true, and while executing a - listener for the event with passive set to false, signals to + listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
    event . defaultPrevented
    Returns true if preventDefault() was invoked successfully to indicate cancellation, @@ -704,10 +704,10 @@

    EventListenerOptions { boolean capture; - boolean passive; }; dictionary AddEventListenerOptions : EventListenerOptions { + boolean passive; boolean once; }; @@ -743,7 +743,7 @@

    §3.7 Observing event listeners.

    When set to true, options’s once member indicates that the callback will only be invoked once after which the event listener will be removed.

    The event listener is appended to target’s list of event listeners and is - not appended if it is a duplicate, i.e., having the same type, callback, capture and passive values.

    + not appended if it is a duplicate, i.e., having the same type, callback, and capture values.

    target . removeEventListener(type, callback [, options])
    Remove the event listener in target’s list of event listeners with the same type, callback, and options.
    target . dispatchEvent(event) @@ -754,25 +754,24 @@

    1. -

      Let capture and passive be false.

      +

      Let capture be false.

    2. If options is a boolean, set capture to options.

    3. If options is a dictionary and capture is present in options with value true, then set capture to true.

    4. -

      If options is a dictionary and passive is - present in options with value true, then set passive to true.

      -
    5. -

      Return capture and passive.

      +

      Return capture.

    To flatten more options, run these steps:

    1. -

      Let capture and passive be the result of flattening options.

      +

      Let capture be the result of flattening options.

      +
    2. +

      Let once and passive be false.

    3. -

      Let once be false.

      +

      If options is a dictionary and passive is present in options with value true, then set passive to true.

    4. If options is a dictionary and once is present in options with value true, then set once to true.

      @@ -793,8 +792,8 @@

      Let capture, passive, and once be the result of flattening more options.

    5. -

      If context object’s associated list of event listener does not contain an event listener whose type is type, callback is callback, capture is capture, and passive is passive, then append a new event listener to it, whose type is type, callback is callback, capture is capture, passive is passive, - and once is once.

      +

      If context object’s associated list of event listener does not contain an event listener whose type is type, callback is callback, + and capture is capture, then append a new event listener to it, whose type is type, callback is callback, capture is capture, passive is passive, and once is once.

    The removeEventListener(type, callback, options) method, when invoked, must, run these steps

      @@ -802,9 +801,10 @@

      If the context object’s global object is a ServiceWorkerGlobalScope object and its associated service worker’s script resource’s has ever been evaluated flag is set, throw a TypeError. [SERVICE-WORKERS]

    1. -

      Let capture and passive be the result of flattening options.

      +

      Let capture be the result of flattening options.

    2. -

      If there is an event listener in the associated list of event listeners whose type is type, callback is callback, capture is capture, and passive is passive then set that event listener’s removed to true and remove it from the associated list of event listeners.

      +

      If there is an event listener in the associated list of event listeners whose type is type, callback is callback, and capture is capture, then set that event listener’s removed to true and remove it from + the associated list of event listeners.

    The dispatchEvent(event) method, when invoked, must run these steps:

    @@ -826,10 +826,10 @@

    cancelable only when there is -at least one non-passive listener. For example, -non-passive TouchEvent listeners must block scrolling, but if all -listeners are passive then scrolling can be allowed to start in parallel by making the TouchEvent uncancelable (so that calls to preventDefault() are ignored). So code dispatching an event is able to observe the absence -of non-passive listeners, and use that to clear the cancelable property of the event being dispatched.

    +at least one non-passive listener. For example, +non-passive TouchEvent listeners must block scrolling, but if all +listeners are passive then scrolling can be allowed to start in parallel by making the TouchEvent uncancelable (so that calls to preventDefault() are ignored). So code dispatching an event is able to observe the absence +of non-passive listeners, and use that to clear the cancelable property of the event being dispatched.

    Ideally, any new event APIs are defined such that they do not need this property (use public-scrip-coord@w3.org for discussion).

    3.8. Dispatching events

    To dispatch an event to a target, with an optional target override, run these steps:

    @@ -5904,7 +5904,7 @@

    participate, in §2.1
  • participate in a tree, in §2.1
  • participates in a tree, in §2.1 -
  • passive, in §3.6 +
  • passive, in §3.6
  • pointerBeforeReferenceNode, in §6.1
  • position, in §5.2
  • preceding, in §2.1 @@ -6403,10 +6403,10 @@

    I dictionary EventListenerOptions { boolean capture; - boolean passive; }; dictionary AddEventListenerOptions : EventListenerOptions { + boolean passive; boolean once; };