Skip to content

api.Element.animationcancel_event - chromium supports onanimationcancel property #29376

Open

Description

@xBZZZZ

What type of issue is this?

Incorrect support data (example: BrowserX says "86" but support was added in "40")

What information was incorrect, unhelpful, or incomplete?

newest google chrome supports onanimationcancel property but mdn says
The onanimationcancel event handler property is not supported. To listen to this event, use element.addEventListener('animationcancel', function() {});. See bug 41404325.

What browsers does this problem apply to, if applicable?

Chromium (Chrome, Edge 79+, Opera, Samsung Internet)

What did you expect to see?

 🯧𜷖𜵛
 𜴘𜶷𜶷
 ▝𜶷𜵁
 ▝𜴧𜴒
 𜵺𜶻▂
 𜴘𜵁𜴆
𜵇🮂🮂𜶒
𜴝▂▂𜴒
𜷋▆𜵭𜶀
𜶢𜷐𜶊𜵰
𜴧𜴨𜴪𜴧
𜶀𜺠𜴐𜺨
 𜺨
145
𜺠𜺠𜺠

Did you test this? If so, how?

assuming ungoogled chromium version matches chrome version

tested these ungoogled chromium versions:

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

https://developer.mozilla.org/en-US/docs/Web/API/Element/animationcancel_event#browser_compatibility

Do you have anything more you want to share?

no

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Element/animationcancel_event

MDN metadata

MDN page report details
  • Query: api.Element.animationcancel_event
  • Report started: 2026-03-31T12:39:29.740Z

Activity

  1. caugner commented on Apr 1, 2026

    @caugner
    Contributor

    Thanks for reporting. Are you able to share your test case?

  2. xBZZZZ commented on Apr 1, 2026

    @xBZZZZ
    Author

    Thanks for reporting. Are you able to share your test case?

    <!doctype html>
    <style>
    @keyframes k{
    from{background-color:blue}
    to{background-color:red}
    }
    #q{animation:1s k;width:100px;height:100px}
    </style>
    <div id="q"></div>
    <script>
    q.onanimationcancel=function(){alert("cancel!")}
    setTimeout(function(){q.remove()},500)
    </script>
  3. caugner commented on Apr 1, 2026

    @caugner
    Contributor

    We have a collector test for this feature (https://collector.openwebdocs.org/tests/api/Element/animationcancel_event), but it's failing for me in Chrome Android 146.

    Does the test pass for you?

  4. added
    data:apiCompatibility data for Web API features. https://developer.mozilla.org/docs/Web/API
    p3Medium priority. Community pull requests are encouraged.
    and removed
    needs triageIssue that has not yet been reviewed.
    on Apr 1, 2026
  5. xBZZZZ commented on Apr 1, 2026

    @xBZZZZ
    Author

    We have a collector test for this feature (https://collector.openwebdocs.org/tests/api/Element/animationcancel_event), but it's failing for me in Chrome Android 146.

    (function () {
      var instance;
      try {
        instance = document.createElementNS("", "el");
      } catch (e) {
        instance = document.createElement("b");
      }
      return !!instance && "onanimationcancel" in instance;
    })();

    returns false both in firefox and chromium

    xml namespace (document.createElementNS argument 1) matters!

    //run in newest firefox or chromium
    "onanimationcancel" in document.createElementNS("http://www.w3.org/1999/xhtml","whatever")//true
    "onanimationcancel" in document.createElementNS("http://www.w3.org/2000/svg","whatever")//true
    "onanimationcancel" in document.createElementNS("http://www.w3.org/1998/Math/MathML","whatever")//true
    "onanimationcancel" in document.createElementNS("http://ifconfig.me/","whatever")//false
  6. caugner commented on Apr 1, 2026

    @caugner
    Contributor

    Good catch, the animationcancel event is not actually supported on Element itself.

    Both https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers-on-elements,-document-objects,-and-window-objects and https://drafts.csswg.org/css-animations-1/#event-handlers-on-elements-document-objects-and-window-objects state:

    The following are the event handlers (and their corresponding event handler event types) that must be supported by all HTML elements, as both event handler content attributes and event handler IDL attributes; and that must be supported by all Document and Window objects, as event handler IDL attributes:

    The onanimation* event handlers are added to GlobalEventHandlers via https://drafts.csswg.org/css-animations-1/#interface-globaleventhandlers-idl, and GlobalEventHandlers is only included by the following interfaces (see this list):

    Given that this affects the four animation* events, and possibly others, we should probably correct this in the BCD collector first.

  7. added
    p2High priority. Community pull requests are strongly encouraged.
    blockedIssue or pull request that cannot proceed until a blocker is resolved.
    and removed
    p3Medium priority. Community pull requests are encouraged.
    on Apr 1, 2026
  8. added
    browser:chromeIssue about Chrome support, including Chrome for Android and equivalent Edge support.
    on Jul 7, 2026
  9. BHUVANSH855 commented on Aug 11, 2026

    @BHUVANSH855
    Contributor

    I've opened a PR in the BCD collector to address the underlying GlobalEventHandlers handling:

    openwebdocs/mdn-bcd-collector#3324

    The PR updates the IDL flattening logic so GlobalEventHandlers members are mapped to their implementing interfaces while avoiding duplicate definitions. It also removes the now-unnecessary Element.onanimationcancel custom IDL entry and its Chrome/Edge overrides.

    This should address the collector-side issue identified in this report. Thanks for the investigation and test case!

  10. connorshea commented on Sep 11, 2026

    @connorshea
    Contributor

    Just ran into this and was about to open a ticket about it. Right now onAnimationCancel is missing in React as well 😅 It'd be good to get this fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedIssue or pull request that cannot proceed until a blocker is resolved.browser:chromeIssue about Chrome support, including Chrome for Android and equivalent Edge support.data:apiCompatibility data for Web API features. https://developer.mozilla.org/docs/Web/APIneeds collector updateIssue requires a BCD Collector updatep2High priority. Community pull requests are strongly encouraged.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions