Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

PSA: Restrict orientation lock behavior to android phones

23 views
Skip to first unread message

Frank Liberato

unread,
Feb 28, 2025, 12:31:13 PMFeb 28
to blink-dev

Contact Email

libe...@google.com

twell...@google.com


Specification

ScreenOrientation::lock()


Chrome Status Entry

https://chromestatus.com/feature/5144443101118464


Summary

Android tablets can and sometimes do lie about handling an application’s request to lock orientation.  For example, in response to an application request to lock the orientation to landscape while in portrait mode, the tablet might report success after (a) doing nothing, (b) letterboxing while remaining in portrait, or (c) correctly rotating the display.  This makes the behavior of the ScreenOrientation::lock() API on tablets hard for sites to rely on; a successfully resolved Promise doesn’t always mean what the spec says it means.


Further, these behaviors are becoming more common among tablets.  We expect this trend to continue.


To address this, we plan to make ScreenOrientation::lock() for all non-phone form-factors reject the resulting Promise with a `NotSupportedError` without attempting to lock orientation.


Foldables will behave according to Chrome’s belief about the current device shape, though Chrome’s detection of this continues to be somewhat flaky.  Other form-factors, e.g. “automotive”, don’t really make sense with this API anyway.


Blink Components

Blink>ScreenOrientation


Tracking Bug

https://launch.corp.google.com/launch/4383592

https://b.corp.google.com/issues/384736274


Estimated Milestone
M136

Mike Taylor

unread,
Feb 28, 2025, 12:34:23 PMFeb 28
to Frank Liberato, blink-dev

On 2/28/25 12:31 PM, 'Frank Liberato' via blink-dev wrote:

Contact Email

libe...@google.com

twell...@google.com


Specification

ScreenOrientation::lock()


Chrome Status Entry

https://chromestatus.com/feature/5144443101118464


Summary

Android tablets can and sometimes do lie about handling an application’s request to lock orientation.  For example, in response to an application request to lock the orientation to landscape while in portrait mode, the tablet might report success after (a) doing nothing, (b) letterboxing while remaining in portrait, or (c) correctly rotating the display.  This makes the behavior of the ScreenOrientation::lock() API on tablets hard for sites to rely on; a successfully resolved Promise doesn’t always mean what the spec says it means.


Further, these behaviors are becoming more common among tablets.  We expect this trend to continue.


To address this, we plan to make ScreenOrientation::lock() for all non-phone form-factors reject the resulting Promise with a `NotSupportedError` without attempting to lock orientation.

What are the spec implementations of this change? Have you brought this up to other implementers that also ship on Tablets?

Foldables will behave according to Chrome’s belief about the current device shape, though Chrome’s detection of this continues to be somewhat flaky.  Other form-factors, e.g. “automotive”, don’t really make sense with this API anyway.


Blink Components

Blink>ScreenOrientation


Tracking Bug

https://launch.corp.google.com/launch/4383592

https://b.corp.google.com/issues/384736274


Estimated Milestone M136 --
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/87a37476-72e4-4aad-824d-ce3e00616a01n%40chromium.org.

Frank Liberato

unread,
Feb 28, 2025, 12:47:45 PMFeb 28
to Mike Taylor, blink-dev
> What are the spec implementations of this change?

I don't believe that the spec requires a change; it has broad language that says only "If the user agent does not support locking the screen orientation to orientation" without specifying anything about when or if a UA must support it.  The PSA is just about making the currently fragmented and unreliable behavior on tablets uniformly not supported.

> Have you brought this up to other implementers that also ship on Tablets?

I haven't, but good point; I will do so.

thanks
-fl
--
I sometimes work nonstandard hours.  Please don't feel any urgency to respond outside of your working hours.
Reply all
Reply to author
Forward
0 new messages