Skip to content

Conversation

marcoscaceres
Copy link
Member

@marcoscaceres marcoscaceres commented Oct 16, 2025

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:


Preview | Diff

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.
@marcoscaceres marcoscaceres requested a review from Copilot October 16, 2025 16:57
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +837 to +840
<li>If |document|'s {{Document/[[orientationPendingPromise]]}} is not
`null`, [=reject and nullify the current lock promise=] of |document|
with an {{"AbortError"}}.
</li>
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should pending promise be abort if document isn't top-level?

1 participant