Bug 73412 - Please add a way to prevent page rotation due to orientation changes
Summary: Please add a way to prevent page rotation due to orientation changes
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-30 01:38 PST by Paul Bakaus
Modified: 2011-12-14 10:18 PST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Bakaus 2011-11-30 01:38:45 PST
Both Gyroscope and Accelerometer APIs are rendered useless in their current state because of web devs inability to stop the content from rotating when the device does. This is a must-fix. Please see https://bugzilla.mozilla.org/show_bug.cgi?id=673922 for the same ticket with more content on Firefox.
Comment 1 Dean Jackson 2011-11-30 16:43:26 PST
We're very concerned about the user experience here. We'd love to give the content the ability to lock or, more accurately, choose the orientation but:

- a nasty page might flip/flop endlessly
- the user might be confused as to why their browser can rotate sometimes, not rotate other times, or even rotate when they have manually locked the orientation. Swapping tabs might trigger a rotation, for example.

So, this is probably best suited to "web apps" rather than general pages in the browser.

Interested to hear any thoughts you (or anyone listening) may have.
Comment 2 Paul Bakaus 2011-12-01 00:53:51 PST
(In reply to comment #1)
> We're very concerned about the user experience here. We'd love to give the content the ability to lock or, more accurately, choose the orientation but:
> 
> - a nasty page might flip/flop endlessly

I understand this concern well. I think there's a viable middle ground though. It would be to not give the users an API to manually rotate the page, but at minimum, just allow "blocking" of orientationchange.

> - the user might be confused as to why their browser can rotate sometimes, not rotate other times, or even rotate when they have manually locked the orientation. Swapping tabs might trigger a rotation, for example.

This is still a problem, even with my toned down solution above. I really can only weight one thing against another. Is it worse to slightly confuse users or to very much block web apps from working the way they're supposed to? Detecting the rotation after layout is super super ugly.

I imagine we could do a notification/request, telling the user "This website can only be displayed in landscape mode. To you want to allow it to block rotation?" or something. That'd be fair enough.

> 
> So, this is probably best suited to "web apps" rather than general pages in the browser.
> 
> Interested to hear any thoughts you (or anyone listening) may have.

I started to completely ignore web apps on iOS. I just don't believe users get it - I want to see stats of click-through rates, pinning it to the home screen.

We *must* stop thinking of web apps as apps that are pinned as an app. Gmail running in Safari is a web app.
Comment 3 Dean Jackson 2011-12-01 15:57:04 PST
(In reply to comment #2)
> (In reply to comment #1)
> > We're very concerned about the user experience here. We'd love to give the content the ability to lock or, more accurately, choose the orientation but:
> > 
> > - a nasty page might flip/flop endlessly
> 
> I understand this concern well. I think there's a viable middle ground though. It would be to not give the users an API to manually rotate the page, but at minimum, just allow "blocking" of orientationchange.

I think you need to also be able to specify an orientation as the page loads.

We did consider allowing the developer to catch and cancel the orientationchange event but that has some performance issues: when the user rotates the device they expect it to happen right away. If we do processing before rotating (in an event listener, which might decide to trigger layout) then the rotation can stall.

So I think the best we can do is a simple list of supported orientations that is read once on page load.

> 
> > - the user might be confused as to why their browser can rotate sometimes, not rotate other times, or even rotate when they have manually locked the orientation. Swapping tabs might trigger a rotation, for example.
> 
> This is still a problem, even with my toned down solution above. I really can only weight one thing against another. Is it worse to slightly confuse users or to very much block web apps from working the way they're supposed to? Detecting the rotation after layout is super super ugly.
> 
> I imagine we could do a notification/request, telling the user "This website can only be displayed in landscape mode. To you want to allow it to block rotation?" or something. That'd be fair enough.

I don't think we'd ever want to annoy the user like that. 

> > So, this is probably best suited to "web apps" rather than general pages in the browser.
> > 
> > Interested to hear any thoughts you (or anyone listening) may have.
> 
> I started to completely ignore web apps on iOS. I just don't believe users get it - I want to see stats of click-through rates, pinning it to the home screen.
> 
> We *must* stop thinking of web apps as apps that are pinned as an app. Gmail running in Safari is a web app.

Valuable feedback, thanks.

Dean
Comment 4 Simon Fraser (smfr) 2011-12-01 17:49:25 PST
This isn't the place to request iOS features.
Comment 5 Paul Bakaus 2011-12-02 00:58:24 PST
(In reply to comment #4)
> This isn't the place to request iOS features.

This is not strictly an iOS feature. It's in part talking about extending orientationchange events, meta orientation and JS APIs. It's a feature applying to any device that supports rotation detection.

Closing this ticket without giving a good advice how to go forward is not constructive.
Comment 6 Alexey Proskuryakov 2011-12-14 10:18:10 PST
See also: bug 74487.