Skip to content

Commit 06c6e07

Browse files
dtapuskafoolip
authored andcommitted
Remove from top layer synchronously for not connected elements (#128)
If the fullscreen element is not connected anymore dispatch event and unfullscreen the element right away. When an node is being remove synchronously remove it from the top layer.
1 parent 05c072b commit 06c6e07

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

fullscreen.bs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ its <a>node document</a>'s <a>top layer</a>.
9292
these steps:
9393

9494
<ol>
95+
<li><p>Let <var>document</var> be <var>removedNode</var>'s <a>node document</a>.
96+
9597
<li><p>Let <var>nodes</var> be <var>removedNode</var>'s
9698
<a>shadow-including inclusive descendants</a> that have their <a>fullscreen flag</a> set, in
9799
<a>shadow-including tree order</a>.
@@ -100,11 +102,18 @@ these steps:
100102
<p><a>For each</a> <var>node</var> in <var>nodes</var>:
101103

102104
<ol>
103-
<li><p>If <var>node</var> is its <a>node document</a>'s <a>fullscreen element</a>,
104-
<a>exit fullscreen</a> that <a for=/>document</a>.
105+
<li><p>If <var>node</var> is <var>document</var>'s <a>fullscreen element</a>,
106+
<a>exit fullscreen</a> <var>document</var>.
107+
108+
<li><p>Otherwise, <a lt="unfullscreen an element">unfullscreen <var>node</var></a>.
109+
110+
<li>
111+
<p>If <var>document</var>'s <a>top layer</a> <a for=set>contains</a> <var>node</var>,
112+
<a for=set>remove</a> <var>node</var> from <var>document</var>'s <var>top layer</var>.
105113

106-
<li><p>Otherwise, <a lt="unfullscreen an element">unfullscreen <var>node</var></a> within its
107-
<a>node document</a>.
114+
<p class=note>Other specifications can add and remove elements from <a>top layer</a>, so
115+
<var>node</var> might not be <var>document</var>'s <a>fullscreen element</a>. For example,
116+
<var>node</var> could be an open <{dialog}> element.
108117
</ol>
109118
</ol>
110119

@@ -398,6 +407,13 @@ could be an open <{dialog}> element.
398407
<a>simple fullscreen document</a>, then set <var>doc</var> to <var>topLevelDoc</var> and
399408
<var>resize</var> to true.
400409

410+
<li><p>If <var>doc</var>'s <a>fullscreen element</a> is not <a>connected</a>:
411+
<ol>
412+
<li><p><a for=set>Append</a> (<code>fullscreenchange</code>, <var>doc</var>'s
413+
<a>fullscreen element</a>) to <var>doc</var>'s
414+
<a>list of pending fullscreen events</a>.
415+
</ol>
416+
401417
<li><p>Return <var>promise</var>, and run the remaining steps <a>in parallel</a>.
402418

403419
<li><p>If <var>resize</var> is true, resize <var>doc</var>'s viewport to its "normal" dimensions.
@@ -676,6 +692,7 @@ delivered with the <a>document</a> through which it is nested.
676692
Andy Earnshaw,
677693
Chris Pearce,
678694
Darin Fisher,
695+
Dave Tapuska,
679696
<i>fantasai</i>,
680697
Giuseppe Pascale,
681698
Glenn Maynard,

0 commit comments

Comments
 (0)