New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 765381 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

The 'orientationchange' event is not triggered when rotating device upside-down

Reported by cristian...@gmail.com, Sep 14 2017

Issue description

Steps to reproduce the problem:
Note: This works as expected on a Nexus 7 tablet running Android v6.0.1 and Chrome v60.0.3112.116.

However the problem can be reproduced when using a Pixel Phone running Android v8.0.0 and Chrome v60.0.3112.116 (same version as above.)

1. Add event listener for 'orientationchange'
2. Rotate device to 'portrait-secondary' orientation

See https://jsfiddle.net/n2g1btsq/ for an example, or use the following code:

<script>
  window.addEventListener('orientationchange', () => {
    document.getElementsByTagName('body')[0].innerText = screen.orientation.type;
  }, false);
</script>

What is the expected behavior?
When rotating the device into portrait-primary orientation, the event handler should be invoked (in the example above, "portrait-primary" should be rendered inside <body/>.)

What went wrong?
The registered event handler is not called. It is however called when rotating the device in all other orientations (portrait-primary, landscape-primary, landscape-secondary)

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 60.0.3112.116  Channel: stable
OS Version: 8.0.0
Flash Version:
 
test.html
169 bytes View Download
CORRECTION: Section "What is the expected behavior?" should read:

When rotating the device into 'portrait-secondary' (upside-down) orientation, the event handler should be invoked (in the example above, 'portrait-secondary' should be rendered inside <body/>.)
Labels: Needs-triage-Mobile Needs-Bisect
Cc: msrchandra@chromium.org nyerramilli@chromium.org ligim...@chromium.org sandeepkumars@chromium.org
Components: Blink>Sensor>DeviceOrientation Blink>Layout
Labels: -Needs-Bisect Triaged-Mobile
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue in Android and seems to be a Non-Regression issue as same behavior is seen since M58. Observed the event is not invoking to portrait-secondary on rotating the device upside down.

Steps Followed
1. Launched Browser
2. Navigated to https://jsfiddle.net/n2g1btsq/
3. Rotated the device in both landscape and portrait orientation. 
4. Observed event is not invoking to portrait-secondary on rotating the device upside down.

Chrome versions tested
60.0.3112.116

OS
Android 8.0.0

Android Devices
Pixel Build/OPR1 170623.027

Please find the logs & video below

go/chrome-androidlogs/765381

Thanks!!

Comment 4 by e...@chromium.org, Sep 15 2017

Components: -Blink>Layout
Labels: M-63

Comment 6 by juncai@chromium.org, Sep 19 2017

Cc: juncai@chromium.org
Components: -Blink>Sensor>DeviceOrientation Blink>ScreenOrientation
I think the "Components" of this bug should be labelled as "Blink>ScreenOrientation" instead of "Blink>Sensor>DeviceOrientation", since it is related to the screen orientation API.
Cc: mlamouri@chromium.org
Status: WontFix (was: Untriaged)
This isn't a bug: the screen orientation doesn't actually change as by default portrait-secondary can't be used. It should work if you lock the orientation to 'any' then reproduce the steps as above.

Sign in to add a comment