New issue
Advanced search Search tips

Issue 888929 link

Starred by 3 users

Issue metadata

Status: Unconfirmed
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Screen Orientation: screen.orientation.lock("portrait-secondary") unable to rotate screen when the device orientation lock is on

Reported by xiuqix.j...@intel.com, Sep 25

Issue description

Steps to reproduce the problem:
1.Set device orientation lock is on.
2.Visit https://intel.github.io/generic-sensor-demos/sensor-tester/build/bundled/.
3.Click "Accelerometer screen coordinates" in the left.
4.Click "0˚" radio in the right.
5.Click "180˚" radio in the right.

What is the expected behavior?
The screen rotate to 180˚ when Click "180˚" radio.

What went wrong?
The screen didn't rotate.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 71.0.3557.2  Channel: canary
OS Version: 7.1.1
Flash Version: 

Spec link: https://w3c.github.io/screen-orientation/ 
References relevant code snippet: https://github.com/intel/generic-sensor-demos/blob/master/sensor-tester/src/orientation-changer.js

BTW, when the device orientation lock is on, only "portrait-secondary" does not work, when the device orientation lock is off, "portrait-secondary" works well.
 
Adding a bit more info from our own app issue list:

Surely looks like a Chrome bug, given that lockOrientation('portrait-secondary') succeeds but doesn't rotate and therefore doesn't send 'change' event.

Different variations with 180 (portrait-secondary) fails, eg.

270 - 180 - 90 fail
90 - 180 - 270 fail
180 - 90 fail
90 - 180 - 0 fail

It fails with AbortError. As 180 (portrait-secondary) completes with success without changing orientation, it makes sense if you read the spec text:

https://w3c.github.io/screen-orientation/#dfn-apply-an-orientation-lock

If one of the browsing contexts's document's pending promise is not null:
Let doc be the document which has a not null pending promise.
Reject doc's pending promise with DOMException whose name is AbortError.
Set doc's pending promise to null .
There is probably a pending promise that was never dealt with as it just "completed"
Cc: mlamouri@chromium.org
Components: Blink>Sensor>DeviceOrientation Blink>ScreenOrientation
I don't think it's a Chrome bug and most likely Android does not do the change. Maybe we could handle this somehow but no one is really working on this feature anymore.
Labels: Needs-triage-Mobile
Components: -Blink>Sensor>DeviceOrientation
This looks like definitively a screen orientation issue unrelated to the device orientation sensor.
Cc: chelamcherla@chromium.org
Labels: Triaged-Mobile Needs-Feedback
Tested this issue on Pixel 2 using 71.0.3563.0 and below are the observations

When auto-rotate is off:
=======================
1. Navigated to above html file and selected "Accelerometer screen coordinates""
2. Selected 180˚ and no screen rotation is seen.

When auto-rotate is on:
=======================
1. Navigated to above html file and selected "Accelerometer screen coordinates""
2. Selected 180˚ and screen rotation of 180˚ is seen.

Attaching screencast for reference.

@xiuqix.jiang: Please check the screencast and let us know if this is the behavior you are telling.

Thanks!
888929.mp4
9.7 MB View Download
Yeah, you did reproduce the issue.
Project Member

Comment 8 by sheriffbot@chromium.org, Sep 29

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment