Set doc's [[orientationPendingPromise]] to a newly-created promise.
Then in 7.2.4.2:
Let browsing contexts be the list of the descendant browsing contexts of the top-level browsing context's document.
Since doc's browsing context is a descendant of the top-level browsing context's document, doc's browsing context will itself be in browsing contexts.
Then in 7.2.4.2:
If one of the browsing contexts's document's [[orientationPendingPromise]] is not null
which will be true, since it was set in 7.2.3, so we have to do 7.2.4.2.2:
Reject doc's [[orientationPendingPromise]] with "AbortError" DOMException.
Since this is done in parallel with the 7.2.4.5 "Lock the orientation of the document to orientations." if it completes first we will reject the new promise that was just created.
It seems to me that 7.2.4.2 needs to somehow exclude the promise created in 7.2.3
In
7.2.3
:Then in
7.2.4.2
:Since doc's browsing context is a descendant of the top-level browsing context's document, doc's browsing context will itself be in browsing contexts.
Then in
7.2.4.2
:which will be
true
, since it was set in7.2.3
, so we have to do7.2.4.2.2
:Since this is done in parallel with the
7.2.4.5
"Lock the orientation of the document to orientations." if it completes first we will reject the new promise that was just created.It seems to me that
7.2.4.2
needs to somehow exclude the promise created in7.2.3