Closed Bug 1608498 Opened 4 years ago Closed 4 years ago

Weird behavior of webkit-prefixed transition/animation events wrt case

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1607918

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Consider this 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>

In Firefox, that logs both "cased" and "lowercase" to the console. In Chrome and Safari it just logs "cased". The same happens for webkitAnimationIteration, webkitAnimationStart, webkitTransitionEnd.

I expect that's because 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.

What I am not quite sure about is why we need these all-lowercase bits guarded on MESSAGE_TO_EVENT at all. Can't we just define the properly-cased versions and use [BinaryName] to map the all-lowercase IDL bits to the correct-cased getters/setters?

Assignee: nobody → bzbarsky

Hey Boris; thanks for filing this, but I think it is a dupe of https://bugzilla.mozilla.org/show_bug.cgi?id=1607918 :)

Indeed. Hadn't done the search and didn't know a bug was already filed. ;)

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.