Firefox incorrectly allows lower-case 'webkitanimationend' event listener
Categories
(Core :: DOM: Events, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: smcgruer, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
Steps to reproduce:
I have been working on testing the widely supported prefixed animation/transition event handlers and listeners[0]. For the listeners, the spec says[1] that the event names are: webkitAnimationEnd, webkitAnimationIteration, webkitAnimationStart, webkitTransitionEnd, and that comparison is done exactly[2], i.e. case-sensitively.
In my testing, I found that Firefox appears to accept a fully-lower cased version of the event listeners (though it does not support other casing, e.g. fully-upper case), i.e.
foo.addEventListener('webkitanimationstart', () => {
console.log('This should never fire!');
});
See the reproduction at https://output.jsbin.com/nokakel/quiet, or the test results for [0], https://wpt.fyi/results/compat?run_id=398290001&run_id=381650003&run_id=387230001
[0] https://github.com/web-platform-tests/wpt/pull/19099
[1] https://dom.spec.whatwg.org/#concept-event-listener-invoke, step 8.2
[2] https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke, step 2.1
Updated•5 years ago
|
![]() |
Assignee | |
Comment 1•5 years ago
|
||
Minimal testcase:
<script>
var el = document.createElement("div");
el.addEventListener("webkitAnimationEnd", () => console.log("cased"));
el.addEventListener("webkitanimationend", () => console.log("lowercase"));
el.dispatchEvent(new AnimationEvent("webkitAnimationEnd"));
</script>
The issue is that https://searchfox.org/mozilla-central/rev/ba4fab1cc2f1c9c4e07cdb71542b8d441707c577/dom/events/EventNameList.h#519-537 map two different names to the same event type, and the dispatch is done by event type.
Fix coming up.
![]() |
Assignee | |
Updated•5 years ago
|
![]() |
Assignee | |
Comment 3•5 years ago
|
||
Hmm. So removing the lowercase mappings there entirely causes problems because then we don't treat the "onwebkitanimationend" content attribute as an event listener attribute... Thinking about other options.
![]() |
Assignee | |
Comment 4•5 years ago
|
||
The WPTs were cherrypicked from https://github.com/web-platform-tests/wpt/pull/19099
The issue in dom/events/test/test_bug1332699.html was discussed in
https://bugzilla.mozilla.org/show_bug.cgi?id=1332699#c8 and
https://bugzilla.mozilla.org/show_bug.cgi?id=1332699#c10 but Xidorn never quite
made it clear enough what the issue was, so it ended up making it into the tree.
Comment 6•5 years ago
|
||
bugherder |
Description
•