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

Resolves specification inconsistency where iframe documents with pending orientation lock promises were not having their promises rejected during document unloading.

The previous algorithm would abort cleanup steps for non-top-level documents before rejecting pending promises. This fix separates two concerns:
1. Promise rejection (happens for ALL documents including iframes)
2. Screen orientation unlocking (only happens for top-level documents)

This aligns the specification with the Web Platform Test expectations in active-lock.html which expects iframe lock promises to be rejected with AbortError when the iframe document is unloaded.

Closes #257 

The following tasks have been completed:

 * [ ] Modified Web platform tests (link to pull request)

Implementation commitment:

 * [ ] WebKit (https://bugs.webkit.org/enter_bug.cgi)
 * [ ] Chromium (https://bugs.chromium.org/p/chromium/issues/detail?id=)
 * [ ] Gecko (https://bugzilla.mozilla.org/show_bug.cgi?id=)


<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***
<a href="https://pr-preview.s3.amazonaws.com/w3c/screen-orientation/pull/268.html" title="Last updated on Oct 16, 2025, 4:57 PM UTC (c0d6693)">Preview</a> | <a href="https://pr-preview.s3.amazonaws.com/w3c/screen-orientation/268/245ed44...c0d6693.html" title="Last updated on Oct 16, 2025, 4:57 PM UTC (c0d6693)">Diff</a>
You can view, comment on, or merge this pull request online at:

  https://github.com/w3c/screen-orientation/pull/268

-- Commit Summary --

  * Fix iframe promise rejection in unloading document cleanup

-- File Changes --

    M index.html (4)

-- Patch Links --

https://github.com/w3c/screen-orientation/pull/268.patch
https://github.com/w3c/screen-orientation/pull/268.diff

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

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

Received on Thursday, 16 October 2025 16:57:22 UTC