New issue
Advanced search Search tips

Issue 904659 link

Starred by 1 user

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 does not reset to default orientation after unlock()

Reported by xiuqix.j...@intel.com, Nov 13

Issue description

Steps to reproduce the problem:
Steps to reproduce the problem:
1. put device at rest on a leveled surface
2. set device orientation lock to off
3. enter the test page, record its initial orientation type with screen orientation API(`screen.orientation.type`)
4. rotate to orientation type (`screen.orientation.lock("...")`)
5. unlock the screen orientation (`screen.orientation.unlock()`)

code snippet:
let initial_type = screen.orientation.type; // e.g. portrait-primary
screen.orientation.lock("landscape-primary");
screen.orientation.unlock();
let current_type = screen.orientation.type; //landscape-primary
assert_equals(initial_type, current_type); //false

What is the expected behavior?
current screen orientation type is equals to the initial one

What went wrong?
they are different

Did this work before? N/A 

Does this work in other browsers? N/A

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

Spec link: https://w3c.github.io/screen-orientation/

spec says:

When the unlock() method is invoked, the user agent MUST run the steps to lock the orientation of theresponsible document to the responsible document's default orientation.

A document's default orientation is the set of orientations to which the screen orientation is locked when it is not explicitly locked by this API or any other means.

For the perspective of a document, locking to the default orientation is equivalent to unlocking because it means that it no longer has a lock applied. However, it does not mean that the default orientation has to be any.
 
Demo link: https://intel.github.io/generic-sensor-demos/sensor-tester/build/bundled/accelerometer-screen
Demo code snippet: https://github.com/intel/generic-sensor-demos/blob/master/sensor-tester/src/orientation-changer.js
Demo test steps:
1. Click "Accelerometer screen coordinates".
2. Click "270°" radio button.
3. Click "RESET" button.
The expected result is "0° " screen orientation.
The actual result is "270° " screen orientation.

@chelamcherla@chromium.org, sorry for the delay reply, I maybe miss the comments, this new issue is related to https://bugs.chromium.org/p/chromium/issues/detail?id=888944. 
Components: Blink>ScreenOrientation
Labels: Needs-triage-Mobile
Cc: chelamcherla@chromium.org
Labels: Triaged-Mobile Needs-Feedback
@xiuqix.jiang: On navigating to above demo link in comment#1, it is showing File not found error. Could you please provide alternate URL or codepen to test this further.

Thanks!
Sorry, the entry should be https://intel.github.io/generic-sensor-demos/sensor-tester/build/bundled/, then you can navigate to accelerometer-screen test by clicking the "Accelerometer screen coordinates" button on the left panel
Project Member

Comment 6 by sheriffbot@chromium.org, Nov 15

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
Labels: Needs-Feedback
Tested the issue on android and seeing both 0 and 270 radio buttons selected

Steps to reproduce:
--------------------------
1. Launched chrome and navigated to  https://intel.github.io/generic-sensor-demos/sensor-tester/build/bundled/
2. Placed on leveled surface, selected 270 , clicked on reset
3. Observed selection of both 0 and 270. Attaching screencast for reference.

Chrome version:
70.0.3538.80, 72.0.3608.5 [latest dev] , 72.0.3610.0 [latest canary]

OS:
Android 9.0 

Android device:
Pixel 2  XL

@xiuqix.jiang: Please check the above steps and let us know if we miss anything. On which device is this issue seen? Any information on reproducing the issue would help in better triaging.

Thanks!
20181115_123418.mp4
6.5 MB View Download
Yeah, I cannot reproduce this issue on Android 9.0(the same result as you shared), but I can reproduce it on Android 7.1.1
Project Member

Comment 10 by sheriffbot@chromium.org, Nov 15

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
Labels: Needs-Feedback
@xiuqix.jiang: Tested this issue on Samsung Galaxy J7 with Android 7, and same behavior is seen. i.e; both 0 and 270 are being selected after clicking on reset button.

On which device this issue is seen? Could you please provide screencast of the issue.

Thanks!
I can only reproduce the issue on Nexus 9 with Android 7.1.1. In the screencast, you can see:
1. Initially, it is a vertical screen.
2. Click "270°", the page becomes a horizontal screen.
3. Click "RESET" button, the page is still a horizontal screen.
Project Member

Comment 13 by sheriffbot@chromium.org, Nov 16

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
1116_1.mov
3.1 MB View Download

Sign in to add a comment