Skip to content

Commit c7baccf

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 c7baccf

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

index.html

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -926,19 +926,18 @@ <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]] specification automatically calls
932+
the [=fully unlock the screen orientation steps=], which handles unlocking orientation
933+
and rejecting any pending orientation lock promises for both the document and its
934+
same-origin descendant documents.
935+
</p>
936+
</aside>
929937
<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:
938+
[=promise/React=] to a [=document=] |doc|'s [=pending fullscreen
939+
request promise=]. When the promise is [=reject|rejected=], run the
940+
following steps:
942941
</p>
943942
<ol class="algorithm">
944943
<li>If |doc|'s {{Document/[[orientationPendingPromise]]}} is not

0 commit comments

Comments
 (0)