feat: Add Screen Orientation API support to Page#24327
Open
Artur- wants to merge 3 commits into
Open
Conversation
Expose the browser Screen Orientation API through Page methods, providing a read-only signal for tracking orientation changes and methods to lock/unlock screen orientation for tablet and mobile apps.
Addresses three API gaps surfaced while building use cases against the screen orientation API: - Add ScreenOrientation.isLandscape() / isPortrait() so adaptive layouts do not have to spell out the two-value disjunction. - Add ScreenOrientation.UNSUPPORTED, distinct from UNKNOWN: the client now reports "unsupported" from the bootstrap when screen.orientation is absent, so callers can tell "no data yet" from "the platform will never produce data." - Replace lockOrientation's PendingJavaScriptResult return with the Geolocation.getPosition-style onSuccess/onError callbacks, plus a ScreenOrientationLockError record carrying the DOMException name and message. Rejected lock requests now surface reactively instead of vanishing unless the caller chained .then(...) themselves. A fire-and-forget single-arg overload logs failures at DEBUG.
…lback Adds ExtendedClientDetails#isScreenOrientationSupported() for a synchronous feature-detect (mirrors the Page screen-orientation signal) and a Page#unlockOrientation(SerializableRunnable) overload that fires once the unlock round-trip completes — symmetric with the lockOrientation callbacks.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Expose the browser Screen Orientation API through Page methods,
providing a read-only signal for tracking orientation changes and
methods to lock/unlock screen orientation for tablet and mobile apps.