Intent to Ship: Screen Orientation API

150 views
Skip to first unread message

Mounir Lamouri

unread,
Jul 30, 2014, 4:32:28 PM7/30/14
to blin...@chromium.org
Contact email: mlam...@chromium.org

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

Summary:
The Screen Orientation API provides the ability to read the screen
orientation type and angle, to be informed when the screen orientation
state changes, and be able to lock the screen orientation to a specific
state.

Intent to Implement:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/lgUq8K9IGlU/PTPKKkKHOeUJ

Is this feature supported on all five Blink platforms (Windows, Mac,
Linux, Chrome OS and Android)?
There are two parts for this feature:
* Reading the screen orientation and getting an event what it changes:
Yes in all platforms with a possible No for Android API Level before 17
(depends on API OWNERS decision). Also, Win8 Metro has a bug being
worked on (ash fully ignores the native screen for the moment).
* Locking the screen orientation: Yes. However, the specification allows
us to reject the request which is what we do in all platforms but
Android (in which you need to be fullscreen unless you have been added
to homescreen). Windows 8 support _might_ happen before shipping. Chrome
OS support will happen later.

Demo link:
http://oldworld.fr/google/screenorientation.html (very basic, meant for
testing/debugging)

Debuggability:
There isn't much need for debuggability tools but we could include
easily something in the Emulator part of the DevTools to help developers
change their device orientation angle.

Compatibility Risk:
I have been working closely with Mozilla on the specification. They are
happy with the current document (and are now co-editing it). Microsoft
expressed positive feedback during the lastest WebApps F2F. Both Mozilla
and Microsoft are shipping a prefixed API that is matching an older
version of the specification. There have been a few changes in the API
since the "Intent to Implement" to match a lot of feedback we got. I am
fairly confident there should not be major changes coming now as far as
compatibility is concerned.

OWP launch tracking bug: http://crbug.com/162827

Link to entry on the feature dashboard:
http://www.chromestatus.com/features/6191285283061760

Cheers,
-- Mounir

Kenneth Rohde Christiansen

unread,
Jul 31, 2014, 4:01:12 AM7/31/14
to Mounir Lamouri, blink-dev
I would be very happy to see this shipping - and it is one of those missing features on mobile that developers complain about in comparison with native apps.

Cheers,
Kenneth


To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.



--
Kenneth Rohde Christiansen
Web Platform Architect, Intel Corporation.
Phone  +45 4294 9458 ﹆﹆﹆

PhistucK

unread,
Aug 1, 2014, 4:07:18 AM8/1/14
to Mounir Lamouri, blink-dev
This is great! I am glad this it so close to being shipped.

However - why do you require going full screen for locking to be allowed?
I know web applications that simply do not support landscape because it makes the site unusable (there is no room for the content they display). Going full screen is a pretty big hammer and may disrupt the user (if I remember correctly, some system user interface elements are gone, like the top status bar, for example and maybe also the bottom bar?).


PhistucK


Kenneth Rohde Christiansen

unread,
Aug 1, 2014, 5:11:49 AM8/1/14
to PhistucK, Mounir Lamouri, blink-dev
It would break page navigation if not. It is pretty weird to go back and suddenly the screen changes orientation. Also users would assume that their browser can change orientation and it will be difficult to understand that an individual page is blocking it for doing so. We already has such issues with the viewport meta tag and the ability to turn of pinch-zoom - it is just bad UX.

Limiting it to fullscreen and apps bookmarked to the home screen, solves all those cases.

Kenneth

PhistucK

unread,
Aug 1, 2014, 5:28:11 AM8/1/14
to Kenneth Rohde Christiansen, Mounir Lamouri, blink-dev
But native applications can do that, right?
You start an application, it locks the orientation, you tap back (or switch to another application using a long tap home or something), is the orientation still locked? Is it unlocked and the orientation is changed? This should work similarly.

Unless native applications work differently, as confusing as it may be, I do not see it as such a bad user experience. On the contrary - taking control of your entire screen, removing useful information, just to lock the orientation seems like a bad user experience to me.
If the web application simply does not fit into the landscape mode, it makes sense to me to let it be portrait only without going full screen.


PhistucK

Torne (Richard Coles)

unread,
Aug 1, 2014, 5:32:41 AM8/1/14
to PhistucK, blink-dev, Kenneth Rohde Christiansen, Mounir Lamouri

Native apps generally can only lock orientation when in full screen as well.

Mounir Lamouri

unread,
Aug 1, 2014, 5:37:01 AM8/1/14
to PhistucK, Kenneth Rohde Christiansen, blink-dev
On Fri, 1 Aug 2014, at 19:27, PhistucK wrote:
> But native applications can do that, right?
> You start an application, it locks the orientation, you tap back (or
> switch
> to another application using a long tap home or something), is the
> orientation still locked? Is it unlocked and the orientation is changed?
> This should work similarly.

True. That's why if a web page is added to homescreen and is run without
a chrome UI, it is not required to go fullscreen.

> Unless native applications work differently, as confusing as it may be, I
> do not see it as such a bad user experience. On the contrary - taking
> control of your entire screen, removing useful information, just to lock
> the orientation seems like a bad user experience to me.
> If the web application simply does not fit into the landscape mode, it
> makes sense to me to let it be portrait only without going full screen.

I understand your concern and I agree that your opinion might be valid.
Note that the fullscreen limitation is something implemented in Chromium
and is up to the embedder to toggle. A browser like Opera Mobile could
definitely not require that. This is a detail that is left out of Blink.

-- Mounir

Mounir Lamouri

unread,
Aug 1, 2014, 5:38:01 AM8/1/14
to Torne, PhistucK, blink-dev, Kenneth Rohde Christiansen
On Fri, 1 Aug 2014, at 19:32, 'Torne (Richard Coles)' via blink-dev
wrote:
> Native apps generally can only lock orientation when in full screen as
> well.

It's not really the same fullscreen. On Android, apps are run in a
"maximized" mode. Going fullscreen removes the Android chrome like the
notification bar.

-- Mounir

PhistucK

unread,
Aug 1, 2014, 5:42:07 AM8/1/14
to Mounir Lamouri, Torne, blink-dev, Kenneth Rohde Christiansen
What is this "maximized" mode?
Is the status bar shown?
Is the bottom bar shown (in devices that show it in the first place, of course)?

If so, this seems like a "normal" application mode and not full screen.
So it is basically the same as when you scroll down a bit in Chrome and the location bar goes away, right? This is the "maximized" mode of Chrome (for web pages), for that matter?


PhistucK

PhistucK

unread,
Aug 1, 2014, 5:49:53 AM8/1/14
to Mounir Lamouri, Kenneth Rohde Christiansen, blink-dev
I created a Chrome feature request.

I am not sure regarding the appropriate labels for this and you mentioned the embedder, so I put it under Cr-Blink-API since it says "embedding API"... probably wrong. Can you, please, help here?


PhistucK

Mounir Lamouri

unread,
Aug 1, 2014, 5:52:54 AM8/1/14
to PhistucK, Kenneth Rohde Christiansen, blink-dev
On Fri, 1 Aug 2014, at 19:49, PhistucK wrote:
> I created a Chrome feature request.
> https://code.google.com/p/chromium/issues/detail?id=39956

It seems to be the wrong bug.

-- Mounir

PhistucK

unread,
Aug 1, 2014, 5:54:58 AM8/1/14
to Mounir Lamouri, Kenneth Rohde Christiansen, blink-dev
Oops. I omitted the last digit. Sorry!


PhistucK

Adam Barth

unread,
Aug 5, 2014, 1:33:48 PM8/5/14
to PhistucK, Mounir Lamouri, Kenneth Rohde Christiansen, blink-dev
The API OWNERS meet with Mounir and Miguel to discuss this feature.  Mounir's recent CLs to unify screen orientation with several other device-related features addresses my concern about the implementation.  The API OWNERS approved this feature for shipping.

Adam
Reply all
Reply to author
Forward
0 new messages