Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Intent to implement and ship: window.orientation and orientationchange event

60 views
Skip to first unread message

William Chen

unread,
Oct 19, 2015, 11:30:00 PM10/19/15
to dev-pl...@lists.mozilla.org
*Summary*: window.orientation returns a value corresponding to the screen
orientation. The orientationchange event is fired when the orientation of
the viewport is changed. These features are non-standard but have been
implemented by other browser vendors on mobile platforms leading to
widespread usage on major websites. In order to improve web compatibility,
these features are also going to be implemented by Gecko on mobile
platforms and we are also working on standardizing the feature. Web authors
should avoid these features because the values returned by
window.orientation are unreliable as it means different things across
different platforms. Instead, authors should use the ScreenOrientation API
which offers the more functionality and better specified behavior.

*Bug*: https://bugzilla.mozilla.org/show_bug.cgi?id=920734

*Link to standard*: https://compat.spec.whatwg.org/#dom-window-orientation

*Platform coverage*: Firefox for Android and Firefox OS.

*Estimated or target release*: Firefox 44

These features are currently implemented by the stock Android browser,
Safari on iOS, Chrome for Android and Internet Explorer on Windows Phone.

Jonas Sicking

unread,
Oct 19, 2015, 11:56:59 PM10/19/15
to William Chen, dev-platform
As someone pushing for the ScreenOrientation API, I agree with this
intent nonetheless.

It *might* be worth warning about this property being inconsistent,
and that it's better for users to use the ScreenOrientation API. But I
think it's really only worth doing if this is something that other
browsers agree to do as well.

/ Jonas
> _______________________________________________
> dev-platform mailing list
> dev-pl...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform

Mounir Lamouri

unread,
Oct 20, 2015, 5:49:59 AM10/20/15
to Jonas Sicking, William Chen, dev-platform
FWIW, this is the usage of window.orientation in the wild recorded by
Chrome:
https://www.chromestatus.com/metrics/feature/timeline/popularity/285

However, Google's internal tools allow me to see the repartition between
platforms and this seen a lot by Chrome Android users.

Should we add this to the Screen Orientation specification?

-- Mounir

Jonas Sicking

unread,
Oct 20, 2015, 7:13:01 AM10/20/15
to Mounir Lamouri, dev-platform, William Chen
On Tue, Oct 20, 2015 at 2:49 AM, Mounir Lamouri <mou...@lamouri.fr> wrote:
> Should we add this to the Screen Orientation specification?

I think so yes.

/ Jonas

Mike Taylor

unread,
Oct 20, 2015, 10:34:27 AM10/20/15
to Jonas Sicking, Mounir Lamouri, dev-platform, William Chen
I also think so. In my mind the Compat Standard should be transitional
in nature, rather than something we maintain forever.

Ideally the "standard" equivalents (or logical parent specs or whatever)
will take in what's specced there as historical APIs or aliases needed
for compatibility with the de-facto web.

--
Mike Taylor
Web Compat, Mozilla
0 new messages