Re: [w3c/screen-orientation] Fix iframe promise rejection in unloading document cleanup (PR #268)

@Copilot commented on this pull request.

## Pull Request Overview

Fixes unloading behavior so that iframe documents with pending orientation lock promises have those promises rejected, aligning spec text with WPT expectations.
- Reject and nullify the current lock promise for all documents (including iframes) before aborting steps for non-top-level documents.
- Leave screen orientation unlocking only for top-level documents.





---

<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>If |document|'s {{Document/[[orientationPendingPromise]]}} is not
+        `null`, [=reject and nullify the current lock promise=] of |document|
+        with an {{"AbortError"}}.
+        </li>

Spec markup issues: (1) {{Document/[[orientationPendingPromise]]}} is not a valid Bikeshed/IDL reference for an internal slot; link the internal slot relative to the algorithm variable using [= |document| / [[orientationPendingPromise]] =]. (2) {{"AbortError"}} is not a valid IDL link; use 'AbortError' DOMException per standard phrasing. Suggested rewrite: If [= |document| / [[orientationPendingPromise]] =] is not `null`, [=reject and nullify the current lock promise=] of |document| with an 'AbortError' DOMException.

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

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

Received on Thursday, 16 October 2025 16:58:47 UTC