WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
281404
SVG Animation Event names might need to be special-cased
https://bugs.webkit.org/show_bug.cgi?id=281404
Summary
SVG Animation Event names might need to be special-cased
Ahmad Saleem
Reported
2024-10-13 17:38:01 PDT
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
Comment 1
2024-10-20 17:38:13 PDT
<
rdar://problem/138288795
>
Karl Dubost
Comment 2
2024-11-06 22:55:55 PST
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
Comment 3
2025-08-27 00:33:29 PDT
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
Comment 4
2025-08-27 00:35:41 PDT
(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.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug