Re: [whatwg] Forcing orientation in content
On Tue, Sep 10, 2013 at 4:22 PM, Ian Hickson wrote: > > In practice, game developers are rarely willing to spend the time to > > make their games work well in both portrait and landscape. > > That's certainly true, but the reality is that on the Web a web browser > window might be any number of dimensions, so that's a problem you have to > deal with regardless. > (I'm a little confused by this, since my next sentence was explaining how games can deal with this even if they don't spend the time to make it work well.) > > > In Firefox we have implemented the screen orientation spec > > https://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html > > That is unfortuate. I don't think that API puts the user first. > This is window.resizeTo all over again, and pages would use it for the same reason: "our page looks best in 640x480" becomes "our page looks best in portrait". The results will be far worse: the user's device will be flipping back and forth between orientations as he browses from page to page. Even if the user is simply tapping browser back a few times, the button will move around between each press as each page in history picks its preferred orientation. Unless implementations deal with these issues somehow, this API looks catastrophically broken. It seems like somebody just took a native mobile orientation API and translated it to JavaScript, without thinking about the differences between task switching on mobile and navigating between web pages. -- Glenn Maynard
Re: [whatwg] Forcing orientation in content
On Tuesday, September 10, 2013 at 11:22 PM, Ian Hickson wrote: > On Sat, 13 Jul 2013, Tobie Langel wrote: > > It is not uncommon for mobile experiences to rely on the accelerometer > > as an input mechanism, for example to control page scrolling (e.g. > > Instapaper) or for gameplay. > > > > In such cases, auto-rotation of the viewport is completely disruptive to > > the user's experience and needs to be inhibited. > > Sure, but that's an OS-level feature. Arguably. Signaling auto-rotation inhibited requirements isn't, though. That's application-level. Auto-rotation inhibition needs to be automatic and scoped to the document. > > So this isn't so much about forcing orientation as it is about > > inhibiting auto-rotation. > > This would only work if the page was already in the orientation the user > wants, but how can we ensure that? The UA is free to provide whatever UI it wants to allow the user to enable/disable auto-rotation inhibition and/or pick a preferred orientation. From the use cases can be derived requirements for the content author to be able to signal to the UA the preference to inhibit auto-roation. Whether the UA decides to comply to this stated pref, allow its user to override it, etc. should be implementation-specific. > > Your desktop comparison is inadequate, as there aren't comparable > > auto-rotation mechanisms there. > > It would be equivalent to forcing a particular window size. No. A better analogy is the autoplay feature of video elements. Merely a hint that can be overridden by the user/UA. And frankly even that comparison is dodgy: playing a video doesn't have close to the discoverability and usability issues inhibiting auto-rotation at the OS level has. > On Mon, 15 Jul 2013, Kornel Lesiński wrote: > > Since specific, locked screen orientation is mostly needed in games, and > > forced rotation is disruptive to other things on the screen (e.g. moving > > buttons/addressbar to other physical edge of the screen), maybe it > > should be tied to the Fullscreen API? > > > > element.requestFullscreen({orientation:'landscape', autorotation:false}) > That makes sense to me. Anne? Agreed these requirements are generally tied to fullscreen/absence of browser-chrome context. Unfortunately, this is achieved using a variety of AP across implementations (e.g. iOS/Android?). So this proposition would only cater to those situation where the fullscreen API was used. --tobie
Re: [whatwg] Forcing orientation in content
On Tue, Sep 10, 2013 at 10:22 PM, Ian Hickson wrote: > On Mon, 15 Jul 2013, Kornel Lesiński wrote: >> Since specific, locked screen orientation is mostly needed in games, and >> forced rotation is disruptive to other things on the screen (e.g. moving >> buttons/addressbar to other physical edge of the screen), maybe it >> should be tied to the Fullscreen API? >> >>element.requestFullscreen({orientation:'landscape', autorotation:false}) > > That makes sense to me. Anne? Almost missed this! Filed: https://www.w3.org/Bugs/Public/show_bug.cgi?id=23204 Implementer feedback welcome. -- http://annevankesteren.nl/
Re: [whatwg] Forcing orientation in content
On Fri, 12 Jul 2013, Glenn Maynard wrote: > On Fri, Jul 12, 2013 at 2:45 PM, Ian Hickson wrote: > > > > Why? As a user on desktop, I can resize my window however I want, to > > be landscape or portrait. Why wouldn't I be allowed to do the same on > > any other device? > > In mobile accelerometer/gyro-based games, you don't want the user's > shifting the device around to cause the screen to change orientation > while they're playing. This means locking the current orientation, > though, rather than a specific orientation (for example, you'd probably > want to unlock it when the user is in a menu and not actually playing > the game). I could see locking the orientation in full-screen mode, sure (as Kornel suggested in a later e-mail, see below). > On Fri, Jul 12, 2013 at 7:07 PM, Ian Hickson wrote: > > > > Sure, some orientations might be better -- just like the HTML spec is > > more readable on a taller large screen than on a landscape phone > > screen -- but if the user wants to play the other way, it seems wrong > > to be able to prevent it. > > In practice, game developers are rarely willing to spend the time to > make their games work well in both portrait and landscape. That's certainly true, but the reality is that on the Web a web browser window might be any number of dimensions, so that's a problem you have to deal with regardless. > The Web solution is probably not to lock the display, though, but to > letterbox the display if the window's aspect ratio is too far off, as > with videos. Well, not so much letterbox as just fit in the given width, leaving a lot of space at the bottom (or centering vertically), sure. On Fri, 12 Jul 2013, Jonas Sicking wrote: > On Fri, Jul 12, 2013 at 12:45 PM, Ian Hickson wrote: > > On Thu, 18 Apr 2013, David Bruant wrote: > >> > >> Currently working on a web project where tablet support (iPad > >> especially) is important, I'm facing a need which apparently the > >> platform doesn't support. I would need to lock the screen in > >> landscape mode. > > > > Why? As a user on desktop, I can resize my window however I want, to > > be landscape or portrait. Why wouldn't I be allowed to do the same on > > any other device? > > If the content is sized better for portrait or landscape, then it's > generally good for the user if the mode is forced by the application. I disagree. The author doens't know better than I do what I want. > Otherwise the user will have to scroll, or will see content that is > smaller than it otherwise would be. Or rotate the device, which the user will have to do regardless if the application forces it. > Users can't always rotate the screen themselves to control this since > many times users disable screen rotation controlled by gravity. If the user disables it, the user can just as easily re-enable it... Also, if the user disabled it, I think it's even more of a reason not to rotate the display for the user. > Common cases when this is done is if they find that the screen too often > erratically rotates due to the user moving around the device. Another > scenario is if laying down with the device in bed in which case rotating > according to gravity will result in a screen that is off by 90 degrees > from the users orientation. Indeed. > The reason we don't do this on desktop systems is that desktop platforms > generally don't let the user adjust to an application rendering itself > sideways to fit in the current window size. On tablets and mobile > platforms, there is an established UI paradigm of simply rotating the > device when content renders itself sideways. A quite annoying UI paradigm... > If we don't provide webplatform support for setting orientation, content > will simply use things like CSS transformation to render itself > sideways. This results in a much poorer experience for the user since it > interacts poorly with for example gravitational orientation. I.e. the > user might see the content sideways, then rotate the device in order to > see the content correctly, resulting in the device then changing > rendering orientation. The page will then detect this and undo the > transformation. The result is a lot of back and forth which is > disruptive to the user. Any automatic rotation not under the control of the user, or locking of rotation not under the control of the user, is disruptive to the user. > Another problem that is likely to occur is authors accidentally applying > CSS transformation in on devices where the user can't reorient the > device. > > Not to mention that using CSS transformation will likely result in > content that has to use more javascript driven layout with all the > downsides that come with that. I'm certainly not advocating for authors manually rotating the content to be at 90 degrees to the device's native orientation. > By supporting pages setting the orientation we can put the user more in > charge by ignoring that ori
Re: [whatwg] Forcing orientation in content
On Sat, 13 Jul 2013 08:13:03 +0100, Tobie Langel wrote: It is not uncommon for mobile experiences to rely on the accelerometer as an input mechanism, for example to control page scrolling (e.g. Instapaper) or for gameplay. In such cases, auto-rotation of the viewport is completely disruptive to the user's experience and needs to be inhibited. Indeed, this ruins accelerometer-based games. It's also slightly problematic in applications using compass (augumented reality or navigation apps pointing user towards a direction) - auto-rotation misfires when person rotates themselves while holding phone in front of them. Inhibiting auto-rotation may be sufficient, and shouldn't be too annoying. Browsers might even have option to unlock rotation (e.g. Instapaper shows rotation lock switch when you shake the device). I suspect that games designed for being locked in a particular screen orientation will be forcing users to rotate device to desired orientation first (e.g. I can imagine racing games to refuse to start the race until user rotates device to landscape) — but maybe that's a good thing? Since specific, locked screen orientation is mostly needed in games, and forced rotation is disruptive to other things on the screen (e.g. moving buttons/addressbar to other physical edge of the screen), maybe it should be tied to the Fullscreen API? element.requestFullscreen({orientation:'landscape', autorotation:false}) -- regards, Kornel
Re: [whatwg] Forcing orientation in content
On 2013-07-13 06:17, Glenn Maynard wrote: Changing orientation is disruptive. I can hardly imagine how obnoxious Web browsing would be on a mobile device, if every second page I navigated to decided to flip my device to a different orientation. This feels like the same sort of misfeature as allowing pages to resize the browser window: "best viewed in 800x600" (so we'll force it), "best viewed in portrait" (so we'll force it). I have a tablet here that does that with a few apps. And one of them actually does it within itself during certain parts of the program. And I can testify it's annoying as hell. For those curious it was a banking app. And the main menu is forced/locked. But the rest like account activity etc. is not. And you can imagine how stupid it is when you have to rotate the tablet each time you go back to the main menu. I find responsive and scalable design (so it looks good) on multiple aspects ratios and multiple PPIs is a must for modern coding. Please note I have not said orientation at all above, instead I said aspect ratio as that is the key here. Any device (unless it's square) has only two aspects. There really is no up or down. Again this is from experience with my tablet. It is rectangular and when I pick it up i pick it up. And which ever edge faces me becomes "down". And I prefer a wide aspect ratio normally, but for parts with listings I prefer a narrow aspectratio. My suggestion is that a webpage or web app signal to the browser what it's preferred aspect ratio (and resolution) is by using existing CSS viewport features. But the browser is under no obligation to enforce anything. If a rotation lock is really that desired, then the browser MUST provide a user toggle-able option that is off by default and is named something along the lines of: Allow Pages/Apps to disable rotation. But. At the same time a similar option would also be needed called: Always lock Pages/Apps to "Horizontal" (or Vertical) orientation. Now I have not looked at many tablets and phones, and certainly not their option screens, so I have no idea if some or several of them already have one of these options. My advise is that if a page or app is aspect limited to simply keep it aspect limited (use the current CSS stuff to help inform the browser about that). Let the user rotate the screen to whatever works best for them. For all one might know their device might be huge and have a very high PPI, you can never know. There are people who prefer to have a monitor rotated 90 degrees, or put two browser windows side by side. And as has been said, certain devices may have orientation detection turned off, or the device may not even have that feature at all. Myself I think ideally that page rotation locking should be a user choice and put in the browser context menu so the user can just click and select if they wish to "lock" the rotation (for that page). Also if a page really looks better rotated 90 degrees then the user will quickly figure that out anyway, by *gasp* rotating their display. And by not allowing web pages/apps to force the orientation we also encourage better design. HTML5 + CSS + Javascript is all about being fluid and dynamic and adaptable and being scalable and fail/fallback gracefully. It would be silly to take a step backwards from that. -- Roger "Rescator" Hågensen. Freelancer - http://www.EmSai.net/
Re: [whatwg] Forcing orientation in content
On Friday, July 12, 2013 at 9:45 PM, Ian Hickson wrote: > On Thu, 18 Apr 2013, David Bruant wrote: > > Currently working on a web project where tablet support (iPad > > especially) is important, I'm facing a need which apparently the > > platform doesn't support. I would need to lock the screen in landscape > > mode. > > Why? As a user on desktop, I can resize my window however I want, to be > landscape or portrait. Why wouldn't I be allowed to do the same on any > other device? It is not uncommon for mobile experiences to rely on the accelerometer as an input mechanism, for example to control page scrolling (e.g. Instapaper) or for gameplay. In such cases, auto-rotation of the viewport is completely disruptive to the user's experience and needs to be inhibited. So this isn't so much about forcing orientation as it is about inhibiting auto-rotation. Your desktop comparison is inadequate, as there aren't comparable auto-rotation mechanisms there. --tobie
Re: [whatwg] Forcing orientation in content
On Fri, Jul 12, 2013 at 10:25 PM, Jonas Sicking wrote: > If the content is sized better for portrait or landscape, then it's > generally good for the user if the mode is forced by the application. > Otherwise the user will have to scroll, or will see content that is > smaller than it otherwise would be. > I disagree completely. Even for landscape videos, I'd strongly prefer that a video not force my phone to portrait. Leave my orientation alone, and vertically letterbox the content, despite that giving a small viewing area. That lets me rotate the device at my convenience, rather than rotating the device on its own, so browser controls don't suddenly jump to a different place (eg. if I decide to back out instead of viewing), and not forcing me to rotate the device if I don't feel the need (eg. if it's a short clip and the small viewing area is sufficient). Changing orientation is disruptive. I can hardly imagine how obnoxious Web browsing would be on a mobile device, if every second page I navigated to decided to flip my device to a different orientation. This feels like the same sort of misfeature as allowing pages to resize the browser window: "best viewed in 800x600" (so we'll force it), "best viewed in portrait" (so we'll force it). -- Glenn Maynard
Re: [whatwg] Forcing orientation in content
On Fri, Jul 12, 2013 at 12:45 PM, Ian Hickson wrote: > On Thu, 18 Apr 2013, David Bruant wrote: >> >> Currently working on a web project where tablet support (iPad >> especially) is important, I'm facing a need which apparently the >> platform doesn't support. I would need to lock the screen in landscape >> mode. > > Why? As a user on desktop, I can resize my window however I want, to be > landscape or portrait. Why wouldn't I be allowed to do the same on any > other device? If the content is sized better for portrait or landscape, then it's generally good for the user if the mode is forced by the application. Otherwise the user will have to scroll, or will see content that is smaller than it otherwise would be. Users can't always rotate the screen themselves to control this since many times users disable screen rotation controlled by gravity. Common cases when this is done is if they find that the screen too often erratically rotates due to the user moving around the device. Another scenario is if laying down with the device in bed in which case rotating according to gravity will result in a screen that is off by 90 degrees from the users orientation. The reason we don't do this on desktop systems is that desktop platforms generally don't let the user adjust to an application rendering itself sideways to fit in the current window size. On tablets and mobile platforms, there is an established UI paradigm of simply rotating the device when content renders itself sideways. If we don't provide webplatform support for setting orientation, content will simply use things like CSS transformation to render itself sideways. This results in a much poorer experience for the user since it interacts poorly with for example gravitational orientation. I.e. the user might see the content sideways, then rotate the device in order to see the content correctly, resulting in the device then changing rendering orientation. The page will then detect this and undo the transformation. The result is a lot of back and forth which is disruptive to the user. Another problem that is likely to occur is authors accidentally applying CSS transformation in on devices where the user can't reorient the device. Not to mention that using CSS transformation will likely result in content that has to use more javascript driven layout with all the downsides that come with that. By supporting pages setting the orientation we can put the user more in charge by ignoring that orientation when appropriate. Such as on devices where changing the orientation is bad, or when the user has explicitly requested the orientation not to change. In Firefox we have implemented the screen orientation spec https://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html However I personally would like to see declarative support in addition to the script API. / Jonas
Re: [whatwg] Forcing orientation in content
On Fri, Jul 12, 2013 at 2:45 PM, Ian Hickson wrote: > Why? As a user on desktop, I can resize my window however I want, to be > landscape or portrait. Why wouldn't I be allowed to do the same on any > other device? > In mobile accelerometer/gyro-based games, you don't want the user's shifting the device around to cause the screen to change orientation while they're playing. This means locking the current orientation, though, rather than a specific orientation (for example, you'd probably want to unlock it when the user is in a menu and not actually playing the game). On Fri, Jul 12, 2013 at 7:07 PM, Ian Hickson wrote: > Sure, some orientations might be better -- just like the HTML spec is more > readable on a taller large screen than on a landscape phone screen -- but > if the user wants to play the other way, it seems wrong to be able to > prevent it. > In practice, game developers are rarely willing to spend the time to make their games work well in both portrait and landscape. The Web solution is probably not to lock the display, though, but to letterbox the display if the window's aspect ratio is too far off, as with videos. -- Glenn Maynard
Re: [whatwg] Forcing orientation in content
On Fri, 12 Jul 2013, Peter Occil wrote: > > One use case I can think of is games. For instance, there are several > games for Android that run the game in a particular orientation, such as > Jewels Deluxe, Shoot the Apple, and similar puzzle and casual games. > > I can't speak for why that's the case exactly, but I believe it's for at > least one of the following: > > - Some puzzle games have a non-square gameboard, such as many jewel/gem > matching games. Using two different orientations might force the gameboard to > look smaller in one orientation than the other. > - In some games, resizing the viewport to either orientation causes two > issues: The game might look squashed in one orientation but not the other, or > the game will be letterboxed in one orientation if aspect ratio is preserved. > - It might be more costly to create game assets and user experience for both > orientations. Sure, some orientations might be better -- just like the HTML spec is more readable on a taller large screen than on a landscape phone screen -- but if the user wants to play the other way, it seems wrong to be able to prevent it. -- Ian Hickson U+1047E)\._.,--,'``.fL http://ln.hixie.ch/ U+263A/, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
Re: [whatwg] Forcing orientation in content
One use case I can think of is games. For instance, there are several games for Android that run the game in a particular orientation, such as Jewels Deluxe, Shoot the Apple, and similar puzzle and casual games. I can't speak for why that's the case exactly, but I believe it's for at least one of the following: - Some puzzle games have a non-square gameboard, such as many jewel/gem matching games. Using two different orientations might force the gameboard to look smaller in one orientation than the other. - In some games, resizing the viewport to either orientation causes two issues: The game might look squashed in one orientation but not the other, or the game will be letterboxed in one orientation if aspect ratio is preserved. - It might be more costly to create game assets and user experience for both orientations. I agree that for Web sites in general, other than games, these points are not important. (The use case of games is hinted at by David Bruant's opening message.) These points also wouldn't matter much if the game can listen for orientation changes (such as the "onorientationchange" event) and redraw the game rotated as needed to give the illusion that the game is "locked" at a particular orientation, but I don't know how easy that would be compared to the alternative of forcing a particular orientation. -Original Message- From: Ian Hickson Sent: Friday, July 12, 2013 3:45 PM To: David Bruant Cc: whatwg Subject: Re: [whatwg] Forcing orientation in content On Thu, 18 Apr 2013, David Bruant wrote: Currently working on a web project where tablet support (iPad especially) is important, I'm facing a need which apparently the platform doesn't support. I would need to lock the screen in landscape mode. Why? As a user on desktop, I can resize my window however I want, to be landscape or portrait. Why wouldn't I be allowed to do the same on any other device? -- Ian Hickson U+1047E)\._.,--,'``.fL http://ln.hixie.ch/ U+263A/, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
Re: [whatwg] Forcing orientation in content
On Thu, 18 Apr 2013, David Bruant wrote: > > Currently working on a web project where tablet support (iPad > especially) is important, I'm facing a need which apparently the > platform doesn't support. I would need to lock the screen in landscape > mode. Why? As a user on desktop, I can resize my window however I want, to be landscape or portrait. Why wouldn't I be allowed to do the same on any other device? -- Ian Hickson U+1047E)\._.,--,'``.fL http://ln.hixie.ch/ U+263A/, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
Re: [whatwg] Forcing orientation in content
On 2013-05-03 08:29, Gray Zhang wrote: >> Not sure if WHATWG is doing anything, but in the W3C there ishttps://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html in the Web Apps group > ... > > How would it behave if my web app requests orientation locking but is placed in an `` element and the parent browsing context is locked in another orientation? The logical behavior would be that the parent element takes precedence, and the child (the iframe in this case) retains it's aspect ratio if possible. R. -- Roger "Rescator" Hågensen. Freelancer - http://www.EmSai.net/
Re: [whatwg] Forcing orientation in content
> Not sure if WHATWG is doing anything, but in the W3C there > ishttps://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html in the > Web Apps group Actually I personally have a little more concerns on this API. First of all, some of current mobile browsers provide `orientation` as a number, whose value is among 0, 90 and -90, how would the current API conform to the new one? Secondly, I'd love to see a `orientationLocked` property to check if the orientation of page is locked, this is for several reasons: - It is better to keep unified with the fullscreen API which gives a `fullscreenEnabled` property - I'm a developer on 3rd-party script (e.g. ads), we investigated a bunch of users before and found out that once if a device locks its orientation, they have very little chance to unlock it, so we can provide more accurate and suitable content to a locked screen resolution, it would be much help if detection for whether the orientation is locked is possible. Last, How would it behave if my web app requests orientation locking but is placed in an `` element and the parent browsing context is locked in another orientation? thanks 在 2013-4-18,上午7:03,Charles McCathie Nevile 写道: > Not sure if WHATWG is doing anything, but in the W3C there > ishttps://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html in the > Web Apps group (by Mounir, who works on Firefox OS as a day job) > > I expect to know a bit more about the implementation status of this in about > a week, when the group has a face to face meeting.
Re: [whatwg] Forcing orientation in content
On Thursday, April 18, 2013 at 10:08 AM, David Bruant wrote: > Le 18/04/2013 01:03, Charles McCathie Nevile a écrit : > > Hi, > > > > On Thu, 18 Apr 2013 01:52:47 +0300, David Bruant > (mailto:bruan...@gmail.com)> > > wrote: > > > > > Hi, > > > > > > Currently working on a web project where tablet support (iPad > > > especially) is important, I'm facing a need which apparently the > > > platform doesn't support. > > > I would need to lock the screen in landscape mode. > > > > > > > > Not sure if WHATWG is doing anything, but in the W3C there is > > https://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html > > in the Web Apps group (by Mounir, who works on Firefox OS as a day job) > > > Thanks for the pointer! But as said very explicitly in the screen > orientation draft: > " This specification doesn't intend to specify a declarative orientation > locking. However, other specifications specify ways to do that. > > The Web Application Manifest Format and Management APIs > [WEBAPPS-MANIFEST-API] specifies a way to declare a default orientation > for a web application inside the manifest file." > > And I really wished it was a declarative thing. > > I understand the value of locking dynamically in some cases, but both in > my use case and the Romanian guy use case, we want to lock the screen > once and for all at the beginning. The web browser shouldn't have to > wait for JS execution to know how to render things. I'm afraid it will > result in a graphic glitch at application startup if a first frame is > rendered *before* the JS saying "lockOrientation" is executed. > If the locking is expressed declaratively in the , no such glitch > is possible, resulting in a better user experience. > > I feel an inline
Re: [whatwg] Forcing orientation in content
Le 18/04/2013 01:03, Charles McCathie Nevile a écrit : Hi, On Thu, 18 Apr 2013 01:52:47 +0300, David Bruant wrote: Hi, Currently working on a web project where tablet support (iPad especially) is important, I'm facing a need which apparently the platform doesn't support. I would need to lock the screen in landscape mode. Not sure if WHATWG is doing anything, but in the W3C there is https://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html in the Web Apps group (by Mounir, who works on Firefox OS as a day job) Thanks for the pointer! But as said very explicitly in the screen orientation draft: " This specification doesn't intend to specify a declarative orientation locking. However, other specifications specify ways to do that. The Web Application Manifest Format and Management APIs [WEBAPPS-MANIFEST-API] specifies a way to declare a default orientation for a web application inside the manifest file." And I really wished it was a declarative thing. I understand the value of locking dynamically in some cases, but both in my use case and the Romanian guy use case, we want to lock the screen once and for all at the beginning. The web browser shouldn't have to wait for JS execution to know how to render things. I'm afraid it will result in a graphic glitch at application startup if a first frame is rendered *before* the JS saying "lockOrientation" is executed. If the locking is expressed declaratively in the , no such glitch is possible, resulting in a better user experience. I feel an inline
Re: [whatwg] Forcing orientation in content
Hi, On Thu, 18 Apr 2013 01:52:47 +0300, David Bruant wrote: Hi, Currently working on a web project where tablet support (iPad especially) is important, I'm facing a need which apparently the platform doesn't support. I would need to lock the screen in landscape mode. Not sure if WHATWG is doing anything, but in the W3C there is https://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html in the Web Apps group (by Mounir, who works on Firefox OS as a day job) I expect to know a bit more about the implementation status of this in about a week, when the group has a face to face meeting. cheers Chaals I've been searching and StackOverflow suggested this is not possible [1][2][3][4]. The best solution that I have read online was to listen to orientation changes, update an "orient" attribute (on or ) and change the CSS based on that. Or Media Queries. But I don't really want to play with either JavaScript or CSS, I don't really know why I should. Especially given that in some comments [1], it is suggested that it is possible to lock the orientation in native apps. Beyond my current project, I have participated to a "FirefoxOS app days" in Bucharest (helped people developing their apps mostly answering their questions). A participant wanted to port his website (games for ~5yo kids) as an FirefoxOS app and told me clearly that if he had no way to lock the screen in landscape, he wouldn't be interested in FirefoxOS (pretty sharp opinion, but that's what he said). Fortunately, that's possible, but one has to use metadata to do so [5]. So I feel the need is there. I was wondering if it would be possible to add a (or whatever else is felt more relevant) to lock the orientation declaratively. It sounds like an information that belongs to the . I feel the FirefoxOS experience [5] sets a good example. Thanks, David [1] http://stackoverflow.com/questions/2772691/is-it-possible-to-prevent-iphone-ipad-orientation-changing-in-the-browser/2772748#2772748 [2] http://stackoverflow.com/questions/8738072/forcing-web-site-to-show-in-landscape-mode-only [3] http://stackoverflow.com/questions/3217805/force-orientation-on-ipad-javascript [4] http://stackoverflow.com/questions/1207008/how-do-i-lock-the-orientation-to-portrait-mode-in-a-iphone-web-application [5] https://developer.mozilla.org/en-US/docs/Apps/Manifest#orientation -- Charles McCathie Nevile - Consultant (web standards) CTO Office, Yandex cha...@yandex-team.ru Find more at http://yandex.com
[whatwg] Forcing orientation in content
Hi, Currently working on a web project where tablet support (iPad especially) is important, I'm facing a need which apparently the platform doesn't support. I would need to lock the screen in landscape mode. I've been searching and StackOverflow suggested this is not possible [1][2][3][4]. The best solution that I have read online was to listen to orientation changes, update an "orient" attribute (on or ) and change the CSS based on that. Or Media Queries. But I don't really want to play with either JavaScript or CSS, I don't really know why I should. Especially given that in some comments [1], it is suggested that it is possible to lock the orientation in native apps. Beyond my current project, I have participated to a "FirefoxOS app days" in Bucharest (helped people developing their apps mostly answering their questions). A participant wanted to port his website (games for ~5yo kids) as an FirefoxOS app and told me clearly that if he had no way to lock the screen in landscape, he wouldn't be interested in FirefoxOS (pretty sharp opinion, but that's what he said). Fortunately, that's possible, but one has to use metadata to do so [5]. So I feel the need is there. I was wondering if it would be possible to add a (or whatever else is felt more relevant) to lock the orientation declaratively. It sounds like an information that belongs to the . I feel the FirefoxOS experience [5] sets a good example. Thanks, David [1] http://stackoverflow.com/questions/2772691/is-it-possible-to-prevent-iphone-ipad-orientation-changing-in-the-browser/2772748#2772748 [2] http://stackoverflow.com/questions/8738072/forcing-web-site-to-show-in-landscape-mode-only [3] http://stackoverflow.com/questions/3217805/force-orientation-on-ipad-javascript [4] http://stackoverflow.com/questions/1207008/how-do-i-lock-the-orientation-to-portrait-mode-in-a-iphone-web-application [5] https://developer.mozilla.org/en-US/docs/Apps/Manifest#orientation