Skip to content

CSS Transitions/Animations DOM events in Safari - #6151

Merged
sideshowbarker merged 3 commits into
masterfrom
sideshowbarker/ontransitionrun-start-cancel-and-onanimationcancel-in-Safari
May 22, 2020
Merged

sideshowbarker merged 3 commits into
masterfrom
sideshowbarker/ontransitionrun-start-cancel-and-onanimationcancel-in-Safari

Conversation

@sideshowbarker

Copy link
Copy Markdown
Member

https://trac.webkit.org/changeset/229818/webkit#file15 added support to WebKit for the animationcancel, transitioncancel, transitionrun, and transitionstart events, and the onanimationcancel, ontransitionrun, ontransitionstart, and ontransitioncancel event handlers.

https://trac.webkit.org/browser/webkit/tags/Safari-606.1.36/Source/WebCore/dom/GlobalEventHandlers.idl#L100 shows that change was included in the Safari 12 release tag.

@ghost ghost added the data:api Compatibility data for Web API features. https://developer.mozilla.org/docs/Web/API label May 14, 2020
https://trac.webkit.org/changeset/229818/webkit#file15 added
support to WebKit for the animationcancel, transitioncancel,
transitionrun, and transitionstart events, and the onanimationcancel,
ontransitionrun, ontransitionstart, and ontransitioncancel event
handlers.

https://trac.webkit.org/browser/webkit/tags/Safari-606.1.36/Source/WebCore/dom/GlobalEventHandlers.idl#L100
shows that change was included in the Safari 12 release tag.
@sideshowbarker
sideshowbarker force-pushed the sideshowbarker/ontransitionrun-start-cancel-and-onanimationcancel-in-Safari branch from 411224b to e6751b1 Compare May 14, 2020 23:47
@Elchi3

Elchi3 commented May 21, 2020

Copy link
Copy Markdown
Member

Looks good to me, but maybe our Animation API expert @lpd-au knows more :)

@lpd-au lpd-au left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be mistaken, but I believe this should be 12 supported behind the experimental feature "Web Animations" + "CSS Animations via Web Animations" (assuming the version you found is correct) and 13.1/13.4 generally supported. Sanity test I used: https://jsbin.com/canoget/edit?html,css,js,output

@sideshowbarker

Copy link
Copy Markdown
Member Author

I may be mistaken, but I believe this should be 12 supported behind the experimental feature "Web Animations" + "CSS Animations via Web Animations"

Is there information online somewhere about that experimental feature? (I mean information from the time when it was still experimental.) There was a flag for setting it?

Looking through the revision at https://trac.webkit.org/changeset/229818/, I can’t find any indications at all in the source that it was implemented behind a flag of any kind.

https://web-confluence.appspot.com/#!/catalog?releases=%5B%22Safari_11.1.1_OSX_10.13.5%22,%22Safari_12.0_OSX_10.13.6%22,%22Safari_13.0.2_OSX_10.15%22%5D&q=%22ontransitioncancel%22 also seems to indicate that the event handlers were exposed in Safari 12 as-shipped (without any flags needing to be set).

At https://bugs.webkit.org/show_bug.cgi?id=187037 I see also that the overall Web Animations feature got marked as “Supported in Preview” on 2018-06-26, which is prior to the 2018-09-24 release date of Safari 12.

@sideshowbarker

Copy link
Copy Markdown
Member Author

OK I managed to find https://bugs.webkit.org/show_bug.cgi?id=184569 (“Turn CSS Animations and CSS Transitions as Web Animations on by default”) and https://bugs.webkit.org/show_bug.cgi?id=204650 and https://trac.webkit.org/changeset/252945/webkit, which flipped on 2019-11-29 flipped the “CSS Transitions as Web Animations” flag to true by default. Which means that Safari 13.1 was the first release to ship with it on by default — which aligns with @lpd-au’s comment at #6151 (review)

So I’ll update the patch to indicate that.

@lpd-au

lpd-au commented May 22, 2020 •

Copy link
Copy Markdown
Contributor

https://web-confluence.appspot.com/#!/catalog?releases=%5B%22Safari_11.1.1_OSX_10.13.5%22,%22Safari_12.0_OSX_10.13.6%22,%22Safari_13.0.2_OSX_10.15%22%5D&q=%22ontransitioncancel%22 also seems to indicate that the event handlers were exposed in Safari 12 as-shipped (without any flags needing to be set).

Yes, you appear to be right about that, the global event handlers are null rather than undefined in the default configuration. However, as far as I can tell the event handlers will never be called unless both experimental features are enabled. For the avoidance of doubt, perhaps api.GlobalEventHandlers.* specifically should instead be marked as a partial implementation as per Non-functional defined names imply partial_implementation, and only the others supported behind a flag (until 13.1/13.4).

@sideshowbarker

Copy link
Copy Markdown
Member Author

However, as far as I can tell the event handlers will never be called unless both experimental features are enabled.

Right — so they were useless in Safari 12 out of the box without the expected behavior being flipped on

For the avoidance of doubt, perhaps api.GlobalEventHandlers.* specifically should instead be marked as a partial implementation as per Non-functional defined names imply partial_implementation, and only the others supported behind a flag (until 13.1/13.4).

OK, I’ll write up a change which does it that way

@sideshowbarker

sideshowbarker commented May 22, 2020 •

Copy link
Copy Markdown
Member Author

@lpd-au By the way, in the existing data for getAnimations, in the #6061 additions I notice this:

"safari": [
{
"version_added": "14"
},
{
"version_added": "13.1",
"partial_implementation": true,
"notes": "Implements an older version of the specification and not supported on <code>ShadowRoot</code>, see Webkit bugs <a href='https://webkit.org/b/179536'>179536</a> and <a href='https://webkit.org/b/202192'>202192</a>."
},
{
"version_added": true,
"partial_implementation": true,
"notes": "Implements an older version of the specification and not supported on <code>ShadowRoot</code>, see Webkit bugs <a href='https://webkit.org/b/179536'>179536</a> and <a href='https://webkit.org/b/202192'>202192</a>.",

So, a couple questions:

  1. In my change in this current PR, should I also mark the events and event handlers as only partially supported in 13.1/13.4, and fully supported in 14 — and copy that note over to the data for the events and event handlers? Or instead does that only apply to getAnimations?
  2. OK if I go ahead and also (in this current PR) change the Safari and iOS Safari "version_added": true parts of getAnimations to "version_added": "12"?

Incidentally, as of 2020-04-06, https://webkit.org/b/179536 and https://webkit.org/b/202192 were both moved to resolved=fixed, so I think getAnimations behavior in Safari 106 — or maybe even in Safari 105 — should be fully conforming to the current spec (modulo more-minor bugs, as you noted in #6061). If so, then it confirms that keeping it marked in BCD as supported in Safari 14 is accurate. But if not — if further testing indicates it’s still not working per spec — then I guess we’d need to further update the BCD data?

@lpd-au

lpd-au commented May 22, 2020 •

Copy link
Copy Markdown
Contributor
  • In my change in this current PR, should I also mark the events and event handlers as only partially supported in 13.1/13.4, and fully supported in 14 — and copy that note over to the data for the events and event handlers? Or instead does that only apply to getAnimations?

Afaik, the behaviour of these events isn't linked to Document.getAnimations() in any way, except that the events are only triggered in the "via Web Animations" implementation of CSS transitions and not the previous implementation turned off in 13.1/13.4.

  • OK if I go ahead and also (in this current PR) change the Safari and iOS Safari "version_added": true parts of getAnimations to "version_added": "12"?

I would say a separate PR would be better, addressing both DocumentOrShadowRoot.getAnimations() and Element.getAnimations(). This is what I found previously:

#5743 (see also #6052 because I made some errors I later corrected here)

  • Safari 9.1: Does not support experimental features at all afaik? (Or in some different way I do not know of.)
  • Safari 10-10.1: Function exists with no preferences but always returns an empty array.
  • Safari 11-11.1: Function exists behind "Web Animations" preference as an initial implementation.
  • Safari 12-12.1: Returns css animations behind the "CSS Animations via Web Animations" preference.
  • Safari 13: No change.
  • Safari TP: Release notes indicate that options.subtree will be supported.

#6061

Web platform test results:

  • v10-10.1: 1 pass, 10 fail
  • v11-11.1: 1 pass, 9 fail, 1 timeout
  • v12-12.1: 6 pass, 5 fail
  • v13: 6 pass, 5 fail
  • v13.1: 6 pass, 5 fail
  • TP105: 9 pass, 2 fail

Relevant bugs:

@sideshowbarker

Copy link
Copy Markdown
Member Author

Afaik, the behaviour of these events isn't linked to Document.getAnimations() in any way, except that the events are only triggered in the "via Web Animations" implementation of CSS transitions and not the previous implementation turned off in 13.1/13.4.

OK — understood

  • OK if I go ahead and also (in this current PR) change the Safari and iOS Safari "version_added": true parts of getAnimations to "version_added": "12"?

I would say a separate PR would be better, addressing both DocumentOrShadowRoot.getAnimations() and Element.getAnimations().

OK

@sideshowbarker

Copy link
Copy Markdown
Member Author

OK 02d03f5 update pushed to the branch. Ready for re-review

@lpd-au lpd-au left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me although you may want to add notes to the Safari 12 api.GlobalEventHandlers.* entries.

@sideshowbarker

Copy link
Copy Markdown
Member Author

Looks good to me although you may want to add notes to the Safari 12 api.GlobalEventHandlers.* entries.

Thanks, good point — so in 3434f9e I’ve added those notes. Please review the wording and suggest any changes/refinements needed.

@sideshowbarker

Copy link
Copy Markdown
Member Author

@lpd-au Thanks much

@sideshowbarker
sideshowbarker merged commit aba681f into master May 22, 2020
@sideshowbarker
sideshowbarker deleted the sideshowbarker/ontransitionrun-start-cancel-and-onanimationcancel-in-Safari branch May 22, 2020 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:api Compatibility data for Web API features. https://developer.mozilla.org/docs/Web/API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants