mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 14:30:43 +00:00

Both the deprecated `Screen.lockOrientation` and replacement `ScreenOrientation.lock` APIs have been updated to make use of a new `OrientationLock` field on the `BrowsingContext`. This replaces the storage and use of APIs for this on the root docshell. In the non fission case things should behave the same, as pending promises for previous calls to `Screen.lockOrientation` will still be cancelled in process. If there are `BrowsingContext`s in other processes though, IPC will be sent to the parent, and then each other child to cancel them. This should be spec compliant as the spec is already racy with regards to multiple `lockOrientation` calls. This new implementation has a little extra IPC than the optimal implementation would since the root `BrowsingContext`s `OrientationLock` is set using the normal `SyncedContext` machinery, rather than combining the `AbortOtherOrientationPendingPromises` message for a single message. This commit fixes both Bug 1597413 and Bug 1597443. Differential Revision: https://phabricator.services.mozilla.com/D70416