Intent to Deprecate and Remove: Non-standard DeviceOrientation Event initialization functions

109 views
Skip to first unread message

Reilly Grant

unread,
Mar 1, 2017, 4:32:49 PM3/1/17
to blink-dev

Primary eng (and PM) emails

rei...@chromium.org


Summary

Remove the DeviceOrientationEvent.initDeviceOrientationEvent and DeviceMotionEvent.initDeviceMotionEvent functions.


Motivation

These methods are not defined in the DeviceOrientation Event specification. Measurements indicate that they have no usage and they can be entirely replaced by the DeviceOrientationEvent and DeviceMotionEvent constructors that are being shipped in parallel to this intent.


Compatibility And Interoperability Risk

Chrome has supported Device Orientation since M-7. These unspecified functions were shipped on all WebKit platforms at the time (Chrome and Mobile Safari). UseCounters indicate that these functions have zero usage.


Edge: Deprecated ("As of Microsoft Edge, the createEvent()/initEvent() constructor pattern for synthetic events is deprecated.")

Firefox: Shipped

Safari: Shipped

Web developers: No signals


Alternative implementation suggestion for web developers

Sites which wish to generate synthetic DeviceOrientationEvents and DeviceMotionEvents may use the constructors which are shipping in parallel to this removal.


Usage information from UseCounter

No usage. DeviceOrientationEvent.initDeviceOrientationEvent metrics. DeviceMotionEvent.initDeviceMotionEvent metrics.


OWP launch tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=697598


Entry on the feature dashboard

https://www.chromestatus.com/feature/5650190849540096

Philip Jägenstedt

unread,
Mar 3, 2017, 11:23:36 AM3/3/17
to Reilly Grant, blink-dev
This is a tricky one.

Usage is also incredibly low, and init*Event() methods are strange things. Also, these init*Event() methods stand in the way of removing support for document.createEvent("DeviceOrientationEvent") and document.createEvent("DeviceMotionEvent"), which I'd quite like to do in general.

But, these are implemented in all engines, and we do not want to remove these only to learn that some other engine isn't at all interesting in taking such risks. To mitigate that, could you start a discussion in the relevant place and loop in the relevant people from each engine? If they all say "we'll remove this if you succeed" then that would be enough I think.

Also, I think this should block on shipping the constructors, and the deprecation messages we use here should recommend their usage.

Reilly Grant

unread,
Mar 6, 2017, 6:02:36 PM3/6/17
to Philip Jägenstedt, blink-dev
I've filed an issue on the DeviceOrientation spec to try to document the consensus on this. Both MDN and MSDN list the init*Event() pattern as deprecated. Only MSDN actually documents the initDevice(Motion|Orientation)Event() methods.

I updated the OWP launch tracking bug to indicate it is blocked on shipping the constructors, which will happen in M-59 as I already have LGTMs on that Intent to Ship.

If you would like we can downgrade this to an "Intent to Deprecate" and I can add deprecation warnings for M-59 and remove in M-60.

Philip Jägenstedt

unread,
Mar 8, 2017, 6:34:46 AM3/8/17
to Reilly Grant, blink-dev
Thanks for filing that issue, Reilly! You may eventually have do some poking to get a satisfactory answer from all engines.

Until we have a better sense of where that's going, I think we shouldn't bother web developers with deprecation messages. Especially if the message said that removal is planned for M60, that'd put is in an odd situation if some engine is very strongly opposed to attempting removal and we backpedal.

(Deprecation is probably used in the original sense on MDN/MSDN, to recommend against the feature without implying a coming removal.)

Reilly Grant

unread,
Mar 8, 2017, 11:26:38 AM3/8/17
to Philip Jägenstedt, blink-dev
Given the extremely low usage of these functions I disagree. Very few web developers will see these messages and they could act as a deterrent to that number increasing.

Reilly Grant

unread,
Mar 14, 2017, 9:31:46 PM3/14/17
to Philip Jägenstedt, blink-dev
Based on discussion on the W3C Device Orientation spec GitHub Issue Tracker I have updated the feature dashboard with the support and skepticism from other vendors:

Edge: Public support
Firefox: Public support
Safari: Public skepticism

Chris Harrelson

unread,
Mar 16, 2017, 1:35:37 PM3/16/17
to Reilly Grant, Philip Jägenstedt, blink-dev
LGTM1

On Tue, Mar 14, 2017 at 6:31 PM, Reilly Grant <rei...@chromium.org> wrote:
Based on discussion on the W3C Device Orientation spec GitHub Issue Tracker I have updated the feature dashboard with the support and skepticism from other vendors:

Edge: Public support
Firefox: Public support

I hope this means they will remove the feature also soon?
 
Safari: Public skepticism
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Jochen Eisinger

unread,
Mar 16, 2017, 1:37:00 PM3/16/17
to Chris Harrelson, Reilly Grant, Philip Jägenstedt, blink-dev
lgtm2

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

Dimitri Glazkov

unread,
Mar 17, 2017, 10:32:37 AM3/17/17
to Jochen Eisinger, Chris Harrelson, Reilly Grant, Philip Jägenstedt, blink-dev
LGTM3

Philip Jägenstedt

unread,
Mar 21, 2017, 4:51:26 AM3/21/17
to Dimitri Glazkov, Jochen Eisinger, Chris Harrelson, Reilly Grant, blink-dev
Looping back on this way after it's too late, what ended up happening is direct removal in https://codereview.chromium.org/2728963004 which avoided speculative deprecation messages, so LGTM4 to that.
Reply all
Reply to author
Forward
0 new messages