@@ -133,13 +133,30 @@ security risk, or platform limitation.
133
133
</ul>
134
134
<!-- cross-process -->
135
135
136
+ <hr>
137
+
138
+ <p> To <dfn>fire a fullscreen event</dfn> named <var> e</var> for an (<var> element</var> ,
139
+ <var> document</var> ) <a>pair</a> , run these steps:
140
+
141
+ <ol>
142
+ <li><p> Let <var> target</var> be <var> element</var> if <var> element</var> is <a>connected</a>
143
+ and its <a>node document</a> is <var> document</var> , and otherwise let <var> target</var> be
144
+ <var> document</var> .
145
+
146
+ <li><p> <a>Fire an event</a> named <var> e</var> , with its {{Event/bubbles}} and {{Event/composed}}
147
+ attributes set to true, at <var> target</var> .
148
+ </ol>
149
+
136
150
137
151
138
152
<h2 id=api>API</h2>
139
153
140
154
<pre class=idl>
141
155
partial interface Element {
142
156
Promise<void> requestFullscreen();
157
+
158
+ attribute EventHandler onfullscreenchange;
159
+ attribute EventHandler onfullscreenerror;
143
160
};
144
161
145
162
partial interface Document {
@@ -156,6 +173,8 @@ partial interface DocumentOrShadowRoot {
156
173
[LenientSetter] readonly attribute Element? fullscreenElement;
157
174
};
158
175
</pre>
176
+ <!-- The event handler attributes are intentially not in a partial DocumentAndElementEventHandlers
177
+ interface, which is implemented by Document and HTMLElement, not Element. -->
159
178
160
179
<dl class=domintro>
161
180
<dt><code><var> promise</var> = <var> element</var> . {{Element/requestFullscreen()}} </code>
@@ -241,9 +260,9 @@ these steps:
241
260
<!-- cross-process; check is only needed on pending as it is recursive already -->
242
261
</ul>
243
262
244
- <li><p> If <var> error</var> is true, <a>fire an event</a> named <code> fullscreenerror </code> on
245
- <var> pendingDoc </var> , reject <var> promise </var> with a <code> TypeError </code> exception, and
246
- terminate these steps.
263
+ <li><p> If <var> error</var> is true, <a>fire a fullscreen event</a> named
264
+ <code> fullscreenerror </code> for ( <var> pending </var> , <var> pendingDoc </var> ), reject
265
+ <var> promise </var> with a <code> TypeError </code> exception, and terminate these steps.
247
266
248
267
<li><p> Let <var> fullscreenElements</var> be an <a>ordered set</a> initially consisting of
249
268
<var> pending</var> .
@@ -253,7 +272,7 @@ these steps:
253
272
<var> fullscreenElements</var> .
254
273
<!-- cross-process -->
255
274
256
- <li><p> Let <var> eventDocs </var> be a new <a>ordered set</a> .
275
+ <li><p> Let <var> eventPairs </var> be a new <a>ordered set</a> .
257
276
258
277
<li>
259
278
<p> <a>For each</a> <var> element</var> in <var> fullscreenElements</var> :
@@ -266,16 +285,19 @@ these steps:
266
285
267
286
<p class=note> No need to notify observers when nothing has changed.
268
287
269
- <li><p> Otherwise, <a for=set>append</a> <var> doc</var> to <var> eventDocs</var> .
288
+ <li><p> Otherwise, <a for=set>append</a> (<var> element</var> , <var> doc</var> ) to
289
+ <var> eventPairs</var> .
270
290
271
291
<li><p> If <var> element</var> is <var> pending</var> and <var> pending</var> is an <{iframe}>
272
292
<a>element</a> , then set <var> element</var> 's <a>iframe fullscreen flag</a> .
273
293
274
294
<li><p> <a lt="fullscreen an element">Fullscreen <var>element</var></a> within <var> doc</var> .
275
295
</ol>
276
296
277
- <li><p> <a>For each</a> <var> doc</var> in <var> eventDocs</var> , <a>fire an event</a>
278
- named <code> fullscreenchange</code> on <var> doc</var> .
297
+ <li><p> <a>For each</a> (<var> element</var> , <var> document</var> ) in <var> eventPairs</var> :
298
+ <a>fire a fullscreen event</a> named <code> fullscreenchange</code> for (<var> element</var> ,
299
+ <var> document</var> ).
300
+ </ol>
279
301
280
302
<li><p> Resolve <var> promise</var> with undefined.
281
303
</ol>
@@ -397,25 +419,36 @@ could be an open <{dialog}> element.
397
419
<code> TypeError</code> exception, and terminate these steps.
398
420
<!-- cross-process -->
399
421
422
+ <li><p> Let <var> eventPairs</var> be a new <a>ordered set</a> .
423
+
400
424
<li><p> Let <var> descendantDocs</var> be an <a>ordered set</a> consisting of <var> doc</var> 's
401
425
<a>descendant browsing contexts</a> ' <a>active documents</a> whose <a>fullscreen element</a> is
402
426
non-null, if any, in <em> reverse</em> <a>tree order</a> .
403
427
<!-- cross-process -->
404
428
405
- <li><p> <a>For each</a> <var> descendantDoc</var> in <var> descendantDocs</var> ,
406
- <a lt="unfullscreen a document">unfullscreen <var>descendantDoc</var></a> .
407
- <!-- cross-process -->
429
+ <li>
430
+ <p> <a>For each</a> <var> descendantDoc</var> in <var> descendantDocs</var> :
408
431
409
- <li><p> <a>For each</a> <var> exitDoc</var> in <var> exitDocs</var> ,
410
- <a lt="unfullscreen an element">unfullscreen</a> <var> exitDoc</var> 's <a>fullscreen element</a> .
432
+ <ol>
433
+ <li><p> <a for=set>Append</a> (<var> descendantDoc</var> 's <a>fullscreen element</a> ,
434
+ <var> descendantDoc</var> ) to <var> eventPairs</var> .
411
435
412
- <li><p> <a>For each</a> <var> descendantDoc</var> in <var> descendantDocs</var> ,
413
- <a>fire an event</a> named <code> fullscreenchange</code> on <var> descendantDoc</var> .
414
- <!-- cross-process -->
436
+ <li><p> <a lt="unfullscreen a document">Unfullscreen <var>descendantDoc</var></a> .
437
+ </ol>
415
438
416
- <li><p> <a>For each</a> <var> exitDoc</var> in <var> exitDocs</var> , <a>fire an event</a> named
417
- <code> fullscreenchange</code> on <var> exitDoc</var> .
418
- <!-- cross-process -->
439
+ <li>
440
+ <p> <a>For each</a> <var> exitDoc</var> in <var> exitDocs</var> :
441
+
442
+ <ol>
443
+ <li><p> <a for=set>Append</a> (<var> exitDoc</var> 's <a>fullscreen element</a> ,
444
+ <var> exitDoc</var> ) to <var> eventPairs</var> .
445
+
446
+ <li><p> <a lt="unfullscreen an element">Unfullscreen</a> <var> exitDoc</var> 's <a>fullscreen element</a> .
447
+ </ol>
448
+
449
+ <li><p> <a>For each</a> (<var> element</var> , <var> document</var> ) in <var> eventPairs</var> :
450
+ <a>fire a fullscreen event</a> named <code> fullscreenchange</code> for (<var> element</var> ,
451
+ <var> document</var> ).
419
452
420
453
<li><p> Resolve <var> promise</var> with undefined.
421
454
</ol>
@@ -429,7 +462,8 @@ return the result of running <a>exit fullscreen</a> on the <a>context object</a>
429
462
<hr>
430
463
431
464
<p> The following are the <a>event handlers</a> (and their corresponding
432
- <a>event handler event types</a> ) that must be supported on <a for=/>documents</a> as attributes:
465
+ <a>event handler event types</a> ) that must be supported by {{Element}} and {{Document}} objects as
466
+ <a>event handler IDL attributes</a> :
433
467
434
468
<table>
435
469
<thead>
@@ -445,6 +479,9 @@ return the result of running <a>exit fullscreen</a> on the <a>context object</a>
445
479
<td><code> fullscreenerror</code>
446
480
</table>
447
481
482
+ <p class=note> These are not supported by {{ShadowRoot}} or {{Window}} objects, and there are no
483
+ corresponding <a>event handler content attributes</a> for {{Element}} objects in any namespace.
484
+
448
485
449
486
450
487
<h2 id=ui>UI</h2>
0 commit comments