@@ -951,7 +951,7 @@ dictionary EventListenerOptions {
951
951
};
952
952
953
953
dictionary AddEventListenerOptions : EventListenerOptions {
954
- boolean passive = false ;
954
+ boolean passive;
955
955
boolean once = false;
956
956
AbortSignal signal;
957
957
};
@@ -971,7 +971,7 @@ when something has occurred.
971
971
<li> <dfn for="event listener">type</dfn> (a string)
972
972
<li> <dfn for="event listener">callback</dfn> (null or an {{EventListener}} object)
973
973
<li> <dfn for="event listener">capture</dfn> (a boolean, initially false)
974
- <li> <dfn for="event listener">passive</dfn> (a boolean, initially false )
974
+ <li> <dfn for="event listener">passive</dfn> (null or a boolean, initially null )
975
975
<li> <dfn for="event listener">once</dfn> (a boolean, initially false)
976
976
<li> <dfn for="event listener">signal</dfn> (null or an {{AbortSignal}} object)
977
977
<li> <dfn for="event listener">removed</dfn> (a boolean for bookkeeping purposes, initially false)
@@ -1069,16 +1069,18 @@ steps:
1069
1069
<ol>
1070
1070
<li><p> Let <var> capture</var> be the result of <a>flattening</a> <var> options</var> .
1071
1071
1072
- <li><p> Let <var> once</var> and <var> passive </var> be false.
1072
+ <li><p> Let <var> once</var> be false.
1073
1073
1074
- <li><p> Let |signal| be null.
1074
+ <li><p> Let |passive| and | signal| be null.
1075
1075
1076
1076
<li>
1077
1077
<p> If |options| is a <a for=/>dictionary</a> , then:
1078
1078
1079
1079
<ol>
1080
- <li><p> Set |passive| to |options|["{{AddEventListenerOptions/passive}}"] and |once| to
1081
- |options|["{{AddEventListenerOptions/once}}"] .
1080
+ <li><p> Set |once| to |options|["{{AddEventListenerOptions/once}}"] .
1081
+
1082
+ <li><p> If |options|["{{AddEventListenerOptions/passive}}"] [=map/exists=] , then set |passive| to
1083
+ |options|["{{AddEventListenerOptions/passive}}"] .
1082
1084
1083
1085
<li><p> If |options|["{{AddEventListenerOptions/signal}}"] [=map/exists=] , then set |signal| to
1084
1086
|options|["{{AddEventListenerOptions/signal}}"] .
@@ -1098,6 +1100,26 @@ constructor steps are to do nothing.
1098
1100
if this would be useful for your programs. For now, all author-created {{EventTarget}} s do not
1099
1101
participate in a tree structure.</p>
1100
1102
1103
+ <p> The <dfn>default passive value</dfn> , given an event type |type| and an {{EventTarget}}
1104
+ |eventTarget|, is determined as follows:
1105
+
1106
+ <ol>
1107
+ <li>
1108
+ <p> Return true if all of the following are true:
1109
+
1110
+ <ul>
1111
+ <li><p> |type| is one of "<code> touchstart</code> ", "<code> touchmove</code> ",
1112
+ "<code> wheel</code> ", or "<code> mousewheel</code> ". [[TOUCH-EVENTS]] [[UIEVENTS]]
1113
+
1114
+ <li><p> |eventTarget| is a {{Window}} object, or is a <a for=/>node</a> whose <a>node document</a>
1115
+ is |eventTarget|, or is a <a for=/>node</a> whose <a>node document</a> 's <a>document element</a>
1116
+ is |eventTarget|, or is a <a for=/>node</a> whose <a>node document</a> 's
1117
+ <a lt="the body element">body element</a> is |eventTarget|. [[!HTML]]
1118
+ </ul>
1119
+
1120
+ <li><p> Return false.
1121
+ </ol>
1122
+
1101
1123
<p> To <dfn export>add an event listener</dfn> , given an {{EventTarget}} object
1102
1124
<var> eventTarget</var> and an <a>event listener</a> <var> listener</var> , run these steps:
1103
1125
@@ -1115,6 +1137,9 @@ participate in a tree structure.</p>
1115
1137
1116
1138
<li><p> If <var> listener</var> 's <a for="event listener">callback</a> is null, then return.
1117
1139
1140
+ <li><p> If <var> listener</var> 's <a for="event listener">passive</a> is null, then set it to the
1141
+ <a>default passive value</a> given |type| and |eventTarget|.
1142
+
1118
1143
<li><p> If <var> eventTarget</var> 's <a>event listener list</a> does not <a for=list>contain</a> an
1119
1144
<a>event listener</a> whose <a for="event listener">type</a> is <var> listener</var> 's
1120
1145
<a for="event listener">type</a> , <a for="event listener">callback</a> is <var> listener</var> 's
0 commit comments