From a13a3c7fc14732691b50c51316b16de0915a61f2 Mon Sep 17 00:00:00 2001
From: Rick Byers Let capture and passive be false.
+ Let capture be false.
If options is a boolean, set capture to options.
If options is a dictionary and If options is a dictionary and Return capture and passive.
+ Return capture.
To flatten more options, run these
steps:
Let capture and passive be the result of flattening
- options.
+ Let capture be the result of flattening options.
- Let once be false.
+ Let once and passive be false.
+
+ If options is a dictionary and If options is a dictionary and 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 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 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 @@ event . preventDefault()
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])
-
{{EventListenerOptions/capture}}
is
present in options with value true, then set capture to true.
- {{EventListenerOptions/passive}}
is
- present in options with value true, then set passive to true.
-
-
-
{{AddEventListenerOptions/passive}}
+ is present in options with value true, then set passive to true.
{{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:
TypeError
. [[!SERVICE-WORKERS]]
- 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.
dispatched, can be canceled by invoking the
preventDefault()
method.
event . preventDefault()
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
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])
target . dispatchEvent(event)
@@ -754,25 +754,24 @@ Let capture and passive be false.
+Let capture be false.
If options is a boolean, set capture to options.
If options is a dictionary and
is
present in options with value true, then set capture to true. capture
If options is a dictionary and
is
- present in options with value true, then set passive to true. passive
Return capture and passive.
+Return capture.
To flatten more options, run these steps:
Let capture and passive be the result of flattening options.
+Let capture be the result of flattening options.
+Let once and passive be false.
Let once be false.
+If options is a dictionary and
is present in options with value true, then set passive to true. passive
If options is a dictionary and
is
present in options with value true, then set once to true. once
Let capture, passive, and once be the result of flattening more options.
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
ServiceWorkerGlobalScope
object and
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.
+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:
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).
To dispatch an event to a target, with an optional target override, run these steps:
@@ -5904,7 +5904,7 @@