Re: [w3c/screen-orientation] Refactor fullscreen rejection handling to use WebIDL react pattern (PR #269)

@Copilot commented on this pull request.

## Pull Request Overview

This PR refactors the Screen Orientation specification to use the modern WebIDL 'react' pattern for handling fullscreen request rejections, replacing the previous flag-based approach. The change enables cleaner specification text while maintaining all existing algorithm behavior and better alignment with modern WebIDL patterns.

**Key Changes:**
- Replaces implicit flag-based fullscreen rejection handling with explicit WebIDL 'react' pattern
- Expands the fullscreen pre-lock condition definition from a simple reference to a detailed algorithmic specification
- Adds explicit handling for rejecting orientation lock promises when fullscreen requests are rejected or when documents exit fullscreen





---

<sub>**Tip:** Customize your code reviews with copilot-instructions.md. <a href="/w3c/screen-orientation/new/gh-pages/.github?filename=copilot-instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Create the file</a> or <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">learn how to get started</a>.</sub>

> +            <li>Let |descendantDocs| be an [=ordered set=] consisting of
+            |doc|'s [=Document/descendant navigables=]'s [=navigable/active
+            documents=], if any, in tree order.

This logic for collecting descendant documents is duplicated in both the exit fullscreen algorithm (lines 902-904) and the react pattern algorithm (lines 934-936). Consider extracting this into a helper algorithm to avoid duplication.

> +                <li>If |descendantDoc| is not [=same origin=] with |doc|,
+                continue.
+                </li>
+                <li>If |descendantDoc|'s
+                {{Document/[[orientationPendingPromise]]}} is not `null`,
+                [=reject and nullify the current lock promise=] of
+                |descendantDoc| with an {{"AbortError"}}.
+                </li>

The logic for iterating descendant documents and rejecting their orientation promises is duplicated in both algorithms (lines 908-915 and lines 940-947). This duplicated logic should be extracted into a shared helper algorithm.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/screen-orientation/pull/269#pullrequestreview-3348340035
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/screen-orientation/pull/269/review/3348340035@github.com>

Received on Friday, 17 October 2025 05:19:56 UTC