@@ -694,7 +694,7 @@ inherits from the {{Event}} interface.
694
694
695
695
<dt><code><var> event</var> . <a method for=Event lt="preventDefault()">preventDefault</a> ()</code>
696
696
<dd> If invoked when the {{Event/cancelable}} attribute value is true, and while executing a
697
- listener for the <var> event</var> with {{EventListenerOptions /passive}} set to false, signals to
697
+ listener for the <var> event</var> with {{AddEventListenerOptions /passive}} set to false, signals to
698
698
the operation that caused <var> event</var> to be <a>dispatched</a> that it needs to be canceled.
699
699
700
700
<dt><code><var> event</var> . {{Event/defaultPrevented}} </code>
@@ -949,10 +949,10 @@ callback interface EventListener {
949
949
950
950
dictionary EventListenerOptions {
951
951
boolean capture;
952
- boolean passive;
953
952
};
954
953
955
954
dictionary AddEventListenerOptions : EventListenerOptions {
955
+ boolean passive;
956
956
boolean once;
957
957
};
958
958
</pre>
@@ -1012,8 +1012,8 @@ specified otherwise it returns null.
1012
1012
will only be invoked once after which the event listener will be removed.
1013
1013
1014
1014
The <a>event listener</a> is appended to <var> target</var> 's list of <a>event listeners</a> and is
1015
- not appended if it is a duplicate, i.e., having the same <b> type</b> , <b> callback</b> ,
1016
- <b> capture</b> and <b> passive </b> values.
1015
+ not appended if it is a duplicate, i.e., having the same <b> type</b> , <b> callback</b> , and
1016
+ <b> capture</b> values.
1017
1017
1018
1018
<dt><code><var> target</var> . <a method lt="removeEventListener()">removeEventListener</a> (<var> type</var> , <var> callback</var> [, <var>options</var>] )</code>
1019
1019
<dd> Remove the <a>event listener</a>
@@ -1032,27 +1032,26 @@ specified otherwise it returns null.
1032
1032
steps:
1033
1033
1034
1034
<ol>
1035
- <li><p> Let <var> capture</var> and <var> passive </var> be false.
1035
+ <li><p> Let <var> capture</var> be false.
1036
1036
1037
1037
<li><p> If <var> options</var> is a boolean, set <var> capture</var> to <var> options</var> .
1038
1038
1039
1039
<li><p> If <var> options</var> is a dictionary and <code> {{EventListenerOptions/capture}} </code> is
1040
1040
present in <var> options</var> with value true, then set <var> capture</var> to true.
1041
1041
1042
- <li><p> If <var> options</var> is a dictionary and <code> {{EventListenerOptions/passive}} </code> is
1043
- present in <var> options</var> with value true, then set <var> passive</var> to true.
1044
-
1045
- <li><p> Return <var> capture</var> and <var> passive</var> .
1042
+ <li><p> Return <var> capture</var> .
1046
1043
</ol>
1047
1044
1048
1045
<p> To <dfn export for=Event>flatten more</dfn> <!-- sorry --> <var> options</var> , run these
1049
1046
steps:
1050
1047
1051
1048
<ol>
1052
- <li><p> Let <var> capture</var> and <var> passive</var> be the result of <a>flattening</a>
1053
- <var> options</var> .
1049
+ <li><p> Let <var> capture</var> be the result of <a>flattening</a> <var> options</var> .
1054
1050
1055
- <li><p> Let <var> once</var> be false.
1051
+ <li><p> Let <var> once</var> and <var> passive</var> be false.
1052
+
1053
+ <li><p> If <var> options</var> is a dictionary and <code> {{AddEventListenerOptions/passive}} </code>
1054
+ is present in <var> options</var> with value true, then set <var> passive</var> to true.
1056
1055
1057
1056
<li><p> If <var> options</var> is a dictionary and <code> {{AddEventListenerOptions/once}} </code> is
1058
1057
present in <var> options</var> with value true, then set <var> once</var> to true.
@@ -1081,10 +1080,9 @@ method, when invoked, must run these steps:
1081
1080
1082
1081
<li><p> If <a>context object</a> 's associated list of <a>event listener</a> does not contain an
1083
1082
<a>event listener</a> whose <b> type</b> is <var> type</var> , <b> callback</b> is <var> callback</var> ,
1084
- <b> capture</b> is <var> capture</var> , and <b> passive</b> is <var> passive</var> , then append a new
1085
- <a>event listener</a> to it, whose <b> type</b> is <var> type</var> , <b> callback</b> is
1086
- <var> callback</var> , <b> capture</b> is <var> capture</var> , <b> passive</b> is <var> passive</var> ,
1087
- and <b> once</b> is <var> once</var> .
1083
+ and <b> capture</b> is <var> capture</var> , then append a new <a>event listener</a> to it, whose
1084
+ <b> type</b> is <var> type</var> , <b> callback</b> is <var> callback</var> , <b> capture</b> is
1085
+ <var> capture</var> , <b> passive</b> is <var> passive</var> , and <b> once</b> is <var> once</var> .
1088
1086
</ol>
1089
1087
1090
1088
<p> The
@@ -1096,13 +1094,12 @@ method, when invoked, must, run these steps
1096
1094
its associated <a>service worker</a> 's <a>script resource</a>' s <a>has ever been evaluated flag</a>
1097
1095
is set, <a>throw</a> a <code> TypeError</code> . [[!SERVICE-WORKERS]]
1098
1096
1099
- <li><p> Let <var> capture</var> and <var> passive</var> be the result of <a>flattening</a>
1100
- <var> options</var> .
1097
+ <li><p> Let <var> capture</var> be the result of <a>flattening</a> <var> options</var> .
1101
1098
1102
1099
<li><p> If there is an <a>event listener</a> in the associated list of <a>event listeners</a> whose
1103
- <b> type</b> is <var> type</var> , <b> callback</b> is <var> callback</var> , <b> capture</b> is
1104
- <var> capture</var> , and <b> passive </b> is <var> passive </var> then set that <a>event listener</a> 's
1105
- <b> removed </b> to true and remove it from the associated list of <a>event listeners</a> .
1100
+ <b> type</b> is <var> type</var> , <b> callback</b> is <var> callback</var> , and <b> capture</b> is
1101
+ <var> capture</var> , then set that <a>event listener</a> 's <b> removed </b> to true and remove it from
1102
+ the associated list of <a>event listeners</a> .
1106
1103
</ol>
1107
1104
1108
1105
<p> The <dfn method for=EventTarget><code>dispatchEvent(<var>event</var>)</code></dfn> method, when
@@ -1129,12 +1126,12 @@ requires observing <a>event listeners</a>. This can make the presence of listene
1129
1126
that even empty listeners can have a dramatic performance impact on the behavior of the application.
1130
1127
For example, touch and wheel events which can be used to block asynchronous scrolling. In some cases
1131
1128
this problem can be mitigated by specifying the event to be {{Event/cancelable}} only when there is
1132
- at least one non-{{EventListenerOptions /passive}} listener. For example,
1133
- non-{{EventListenerOptions /passive}} {{TouchEvent}} listeners must block scrolling, but if all
1134
- listeners are {{EventListenerOptions /passive}} then scrolling can be allowed to start
1129
+ at least one non-{{AddEventListenerOptions /passive}} listener. For example,
1130
+ non-{{AddEventListenerOptions /passive}} {{TouchEvent}} listeners must block scrolling, but if all
1131
+ listeners are {{AddEventListenerOptions /passive}} then scrolling can be allowed to start
1135
1132
<a>in parallel</a> by making the {{TouchEvent}} uncancelable (so that calls to
1136
1133
{{Event/preventDefault()}} are ignored). So code dispatching an event is able to observe the absence
1137
- of non-{{EventListenerOptions /passive}} listeners, and use that to clear the {{Event/cancelable}}
1134
+ of non-{{AddEventListenerOptions /passive}} listeners, and use that to clear the {{Event/cancelable}}
1138
1135
property of the event being dispatched.
1139
1136
1140
1137
<p> Ideally, any new event APIs are defined such that they do not need this property (use
0 commit comments