Intent to Remove: document.createEvent('WebKitTransitionEvent')

33 views
Skip to first unread message

TAMURA, Kent

unread,
Apr 14, 2017, 3:57:26 AM4/14/17
to blink-dev
Primary eng (and PM) emails

Link to “Intent to Deprecate” thread
None. I think sudden removal is ok in this case.

Summary
document.createEvent() supports only limited set of events.[1]
However, we support non-standard document.createEvent('WebKitTransitionEvent'). We'd like to remove it, and createEvent('WebKitTransitoinEvent') will throw.


Motivation
Remove non-standard feature.

Interoperability and Compatibility Risk
Low. No other browsers ship this feature now.

Edge: Not supported.
Firefox: Not supported.
Safari: Not supported.

Alternative implementation suggestion for web developers
Unprefixed document.createEvent('TransitionEvent') works.  However, creating such event doesn't make sense in general.

Usage information from UseCounter
0.013 - 0.017%.

This is not so low. So I investigated 100 sites using createEvent('WebKitTransitionEvent') with HTTP archive. My conclusion is the removal is safe, and we should not have a deprecation period.

99 sites used Tipped [2] or LightView [3] JavaScript libraries. They were written by the same author, and use createEvent('WebKitTransitionEvent') to detect CSS animation feature like:

cssTransitions: function() {
  var b=!1;
  return a.each(["WebKitTransitionEvent","TransitionEvent","OTransitionEvent"],function(a,c){
    try{
      document.createEvent(c),b=!0
    } catch(d){}
  }),b
}

So throwing for WebKitTransitionEvent is safe, and createEvent('TransitionEvent') sets true to |b|.
Because of this code, showing a deprecation message for createEvent('WebKitTransitionEvent') is harmful. Web authors don't need to do anything for the deprecation.

The remaining 1 site uses neither Tipped nor LightView, but it had very similar usage pattern, and throwing for createEvent('WebKitTransitionEvent') is safe.


OWP launch tracking bug

Entry on the feature dashboard


--
TAMURA Kent
Software Engineer, Google


Philip Jägenstedt

unread,
Apr 14, 2017, 4:07:57 AM4/14/17
to TAMURA, Kent, blink-dev
LGTM1, I love it when httparchive research reveals something like that to be the common pattern. With no other engine supporting this, it would be quite surprising if there's any serious breakage.

Chris Harrelson

unread,
Apr 14, 2017, 11:22:23 AM4/14/17
to Philip Jägenstedt, TAMURA, Kent, blink-dev
LGTM2

--
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.

Dimitri Glazkov

unread,
Apr 14, 2017, 11:22:58 AM4/14/17
to Chris Harrelson, Philip Jägenstedt, TAMURA, Kent, blink-dev
LGTM3

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Reply all
Reply to author
Forward
0 new messages