Bug 206170

Summary: onwebkit{animation, transition}XX handlers missing from Document
Product: WebKit Reporter: Stephen McGruer <smcgruer>
Component: DOMAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, cmarcelo, dino, esprehn+autocc, ews-watchlist, graouts, graouts, jonlee, kangil.han, kondapallykalyan, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 13   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=206171
Attachments:
Description Flags
Reproduction of bug
none
Patch
none
Patch none

Description Stephen McGruer 2020-01-13 04:47:27 PST
Created attachment 387514 [details]
Reproduction of bug

The spec says[0] that the prefixed animation event handlers (listed below) are defined on 'elements, Document objects, and Window objects'. Firefox defines it on all three, Chrome currently defines them only on Window but this is being fixed in [1], and WebKit defines them on elements and Window objects but not HTMLElements.

The event handlers are:

  * onwebkitanimationend
  * onwebkitanimationiteration
  * onwebkitanimationstart
  * onwebkittransitionend

A reproduction is attached. There are wpt.fyi tests at wpt/html/dom/idlharness.https.html?include=HTML.*[2] and wpt/html/dom/idlharness.https.html?include=(Document|Window)[3], but it looks like Safari's webdriver implementation fails to handle URLs with '(' (or maybe '|') in them, so currently the tests are harness errors (will file a separate bug for that).

[0]: https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers-on-elements,-document-objects,-and-window-objects
[1]: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/4Fidt4JqkTk
[2]: https://wpt.fyi/results/html/dom/idlharness.https.html%3Finclude=HTML.*?label=experimental&label=master&aligned
[3]: https://wpt.fyi/results/html/dom/idlharness.https.html%3Finclude%3D(Document%7CWindow)?label=master&label=experimental&aligned
Comment 1 Radar WebKit Bug Importer 2020-01-14 22:55:05 PST
<rdar://problem/58596373>
Comment 2 Jon Lee 2020-03-16 12:31:49 PDT
Is this a regression at all? And does this affect only the prefixed handlers?
Comment 3 Antoine Quint 2020-03-19 03:31:30 PDT
Stephen, I expect you meant "WebKit defines them on elements and Window objects but not Document objects", correct?
Comment 4 Antoine Quint 2020-03-19 03:52:01 PDT
Created attachment 393961 [details]
Patch
Comment 5 Antoine Quint 2020-03-19 03:54:54 PDT
(In reply to Jon Lee from comment #2)
> Is this a regression at all? And does this affect only the prefixed handlers?

Not a regression and yes, it only applies to prefixed handlers as the standard, non-prefixed handlers are defined in GlobalEventHandlers.idl, which is implemented by Document, DOMWindow, HTMLElement and SVGElement.
Comment 6 Antoine Quint 2020-03-19 05:29:02 PDT
Created attachment 393968 [details]
Patch
Comment 7 Antoine Quint 2020-03-19 06:36:54 PDT
For reference, this is the WebDriver bug Stephen is talking about: https://bugs.webkit.org/show_bug.cgi?id=206171.
Comment 8 EWS 2020-03-19 07:11:39 PDT
Committed r258697: <https://trac.webkit.org/changeset/258697>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 393968 [details].