From c0d6693135e2f3873fe50e9a69b06f7b8b620e3d Mon Sep 17 00:00:00 2001
From: Marcos Caceres
Date: Fri, 17 Oct 2025 00:55:37 +0800
Subject: [PATCH] Fix iframe promise rejection in unloading document cleanup
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.
---
index.html | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/index.html b/index.html
index 5b5f19c..c7c5d86 100644
--- a/index.html
+++ b/index.html
@@ -834,6 +834,10 @@
|document|, the user agent MUST run the following steps:
+ - If |document|'s {{Document/[[orientationPendingPromise]]}} is not
+ `null`, [=reject and nullify the current lock promise=] of |document|
+ with an {{"AbortError"}}.
+
- If |document| is not a [=top-level browsing context=]'s
[=navigable/active document=], abort these steps.