Skip to content

Commit ec09747

Browse files
committed
Add pending fullscreen request flag and promise to document state
This commit adds exported definitions for both 'pending fullscreen request flag' and 'pending fullscreen request promise' to document state, enabling other specifications to use modern WebIDL patterns. Changes: - Add 'pending fullscreen request flag' to document state (exported) - Add 'pending fullscreen request promise' to document state (exported) - Set flag and store promise when requestFullscreen() starts processing - Clear flag and promise when request resolves (success) or rejects (error) - Use consistent naming conventions without interface binding The flag enables detecting pending fullscreen requests, while the promise enables other specifications to use WebIDL 'react' patterns to respond to fullscreen request rejections instead of relying on flag state changes. This enables other specifications (like Screen Orientation) to detect when a document has a pending fullscreen request and react to promise rejections, allowing modern promise-based integration for web compatibility. Related to w3c/screen-orientation#254 and w3c/screen-orientation#255
1 parent 75c0c1d commit ec09747

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

fullscreen.bs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ stated otherwise it is unset.
6767
<p>All <a for=/>documents</a> have an associated <dfn>list of pending fullscreen events</dfn>, which
6868
is an <a>ordered set</a> of (<a>string</a>, <a>element</a>) <a>tuples</a>. It is initially empty.
6969

70+
<p>All <a for=/>documents</a> have an associated <dfn export>pending fullscreen request flag</dfn>.
71+
Unless stated otherwise it is unset. When set, it indicates that the document has an outstanding
72+
fullscreen request that has not yet resolved or been rejected.
73+
74+
<p>All <a for=/>documents</a> have an associated <dfn export>pending fullscreen request promise</dfn>.
75+
Unless stated otherwise it is null. When not null, it is the promise representing the current pending
76+
fullscreen request.
77+
7078
<p>To <dfn>fullscreen an <var>element</var></dfn>:
7179

7280
<ol>
@@ -266,6 +274,8 @@ are:
266274

267275
<li><p>Let <var>promise</var> be a new promise.
268276

277+
<li><p>Set <var>pendingDoc</var>'s <a>pending fullscreen request promise</a> to <var>promise</var>.
278+
269279
<li><p>If <var>pendingDoc</var> is not <a>fully active</a>, then reject <var>promise</var> with a
270280
{{TypeError}} exception and return <var>promise</var>.
271281

@@ -294,6 +304,8 @@ are:
294304
<li><p>If <var>error</var> is false, then <a>consume user activation</a> given
295305
<var>pendingDoc</var>'s <a>relevant global object</a>.
296306

307+
<li><p>If <var>error</var> is false, set <var>pendingDoc</var>'s <a>pending fullscreen request</a> flag.
308+
297309
<li><p>Return <var>promise</var>, and run the remaining steps <a>in parallel</a>.
298310

299311
<li>
@@ -342,6 +354,10 @@ are:
342354
<p>If <var>error</var> is true:
343355

344356
<ol>
357+
<li><p>Unset <var>pendingDoc</var>'s <a>pending fullscreen request</a> flag.
358+
359+
<li><p>Set <var>pendingDoc</var>'s <a>pending fullscreen request promise</a> to null.
360+
345361
<li><p><a for=set>Append</a> ({{fullscreenerror}}, <a>this</a>) to
346362
<var>pendingDoc</var>'s <a>list of pending fullscreen events</a>.
347363

@@ -391,6 +407,10 @@ are:
391407
<p class=note>The order in which elements are <a lt="fullscreen an element">fullscreened</a>
392408
is not observable, because <a>run the fullscreen steps</a> is invoked in <a>tree order</a>.
393409

410+
<li><p>Unset <var>pendingDoc</var>'s <a>pending fullscreen request</a> flag.
411+
412+
<li><p>Set <var>pendingDoc</var>'s <a>pending fullscreen request promise</a> to null.
413+
394414
<li><p>Resolve <var>promise</var> with undefined.
395415
</ol>
396416

0 commit comments

Comments
 (0)