Bug 281404
| Summary: | SVG Animation Event names might need to be special-cased | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | karlcow, rniwa, webkit-bug-importer |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ahmad Saleem
Hi Team,
While looking into why we don't have following EventHandlers in the `SVGAnimationElement.idl`:
attribute EventHandler onbegin;
attribute EventHandler onend;
attribute EventHandler onrepeat;
Web Specification: https://svgwg.org/specs/animations/#InterfaceSVGAnimationElement
__
When we have to add them in bug 275669 (PR - https://github.com/WebKit/WebKit/pull/29984), it is something where we need to add.
`begin` in (EventNames), where this can be linked with `onbegin` instead of `EventNames` automatically linking with `beginEvent` (which we already have).
Without adding `begin`, we fail `idlharness.html` tests in `svg` directory.
___
We have following already.
`beginEvent`
`endEvent`
in EventNames.json but if I add just `idl` bits, it does not compile and give error (at least for begin) but if I add `begin` then it compiles.
Although, it leads to another WPT test failures.
____
So now why we need special case:
1) We already have `end` and `endEvent` in `EventNames.json`
2) Now if I add `attribute EventHandler.json
3) It compiles and progress one test in WPT but at the same time leads to this failure.
FAILURE: https://wpt.fyi/results/svg/animations/custom-events.html?label=experimental&label=master&aligned
___
Now look into failure:
First test -> custom events with the name 'end' should only call the event listener for the event 'end' and no attribute handlers or IDL listeners
Second -> custom events with the name 'endEvent' should call 'onend' attribute handlers and IDL property listeners, and 'endEvent' listeners
By adding `IDL`, we start failing first one.
___
We need to make sure, `endEvent` map to `onend` and similarly for other `beginEvent` map to `onbegin` etc.
____
This was done via something like this in blink:
+ DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(begin, beginEvent);
+ DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(end, endEvent);
+ DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(repeat, repeatEvent);
Commit - https://codereview.chromium.org/201673003
___
We have removed `DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER` macro as well.
____
If we add `begin` in EventNames.json, it leads to following `Safe C++` [Smart Pointer] violation: https://ews-build.webkit.org/#/builders/120/builds/1177
'Found 1 new failure in JSSVGAnimationElement.cpp'
=> UncountedCallArgsChecker
JSSVGAnimationElement.cpp
___
Just raising so we can fix it.
Thanks!
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/138288795>
Karl Dubost
https://searchfox.org/wubkat/rev/d45649fa32a499702c30474e94bd6843c4c67849/Source/WebCore/svg/SVGAnimationElement.idl
SMIL has attributes.
https://searchfox.org/wubkat/rev/d45649fa32a499702c30474e94bd6843c4c67849/Source/WebCore/svg/animation/SVGSMILElement.cpp#513-518
Ahmad Saleem
To fix:
1) Go to `EventNames.json`, keep only `beginEvent`, `endEvent` and `repeatEvent`.
2) In IDL file - add all `onbegin`, `onend`, `onrepeat`.
3) Now go to `dom/make-event-names.py` and make special case above so we link `onbegin = beginEvent`, `onend = endEvent` and `onrepeat = repeatEvent`.
Ahmad Saleem
(In reply to Ahmad Saleem from comment #3)
> To fix:
>
> 1) Go to `EventNames.json`, keep only `beginEvent`, `endEvent` and
> `repeatEvent`.
> 2) In IDL file - add all `onbegin`, `onend`, `onrepeat`.
> 3) Now go to `dom/make-event-names.py` and make special case above so we
> link `onbegin = beginEvent`, `onend = endEvent` and `onrepeat = repeatEvent`.
4) Remove `begin`, `end` and `repeat` from EventNames.json file.
5) Might need to fix SVGSMILElement.cpp file where we have currently `beginEventEvent` calls and other bits.