Skip to content

Commit c1b9455

Browse files
committed
Refactor fullscreen rejection handling to use WebIDL react pattern
This commit modernizes how the Screen Orientation specification responds to fullscreen request rejections by using the WebIDL 'react' concept instead of the previous flag-based approach. Changes: - Replace flag-based 'pending fullscreen request flag unset due to rejection' pattern - Use WebIDL 'react' pattern with 'pending fullscreen request promise' - Update reference to use proper 'pending fullscreen request flag' terminology - Extract duplicated descendant document logic into helper algorithm 'reject descendant document orientation promises' - Remove redundant fullscreen exit handling (already handled by Fullscreen spec) - Add clarifying notes for algorithm logic and same-origin security restrictions - Maintain all existing algorithm behavior while modernizing the specification architecture This enables cleaner, more maintainable specification text that follows modern WebIDL patterns for promise-based APIs and eliminates code duplication. The change complements the fullscreen spec changes in whatwg/fullscreen that add both the exported flag and promise definitions needed for this integration. Fixes #254 Fixes #255
1 parent 0c1da23 commit c1b9455

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

index.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -926,19 +926,19 @@ <h2>
926926
requested fullscreen. This prevents cross-origin documents from
927927
detecting the fullscreen state of their embedding document.
928928
</p>
929+
<aside class="note" title="Fullscreen exit handling">
930+
<p>
931+
When a [=document=] exits fullscreen, the [[FULLSCREEN]]
932+
specification automatically calls the [=fully unlock the screen
933+
orientation steps=], which handles unlocking orientation and
934+
rejecting any pending orientation lock promises for both the document
935+
and its same-origin descendant documents.
936+
</p>
937+
</aside>
929938
<p>
930-
When a [=document=] |doc| exits fullscreen, the user agent MUST:
931-
</p>
932-
<ol class="algorithm">
933-
<li>Run the [=fully unlock the screen orientation steps=] with |doc|.
934-
</li>
935-
<li>[=Reject descendant document orientation promises=] for |doc|.
936-
</li>
937-
</ol>
938-
<p>
939-
[=React=] to a [=document=] |doc|'s [=pending fullscreen request
940-
promise=]. When the promise is [=reject|rejected=], run the following
941-
steps:
939+
[=promise/React=] to a [=document=] |doc|'s [=pending fullscreen
940+
request promise=]. When the promise is [=reject|rejected=], run the
941+
following steps:
942942
</p>
943943
<ol class="algorithm">
944944
<li>If |doc|'s {{Document/[[orientationPendingPromise]]}} is not

0 commit comments

Comments
 (0)