w3c / screen-orientation

The screen orientation lock specification
https://w3c.github.io/screen-orientation/
Other
27 stars 29 forks source link

Apply an orientation lock rejects its own newly created promise #198

Closed smacleod closed 2 years ago

smacleod commented 4 years ago

In 7.2.3:

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