New issue
Advanced search Search tips

Issue 877900 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 27
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

SVG: Support attaching event listeners to animation events

Reported by paul.leb...@gmail.com, Aug 27

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

Steps to reproduce the problem:
See the following fiddle: https://jsfiddle.net/s1qa6v98/7/

Attaching event handlers to SVG animation events ("start", "repeat", "end") does not work in Chrome.  Chrome requires that you use the "onX" properties.
However other events, like "click", can be attached that way.

Firefox is the opposite.  It doesn't support the "onX" properties, and instead requires that you use `addEventListener".

if ("onrepeat" in anim) {

  // Required for Chrome
  anim.onrepeat = function(evt) {
    console.log("onrepeat");
  };

} else {

  // Required for Firefox
  anim.addEventListener("repeat", function(evt) {
    console.log("repeat");
  });

}

What is the expected behavior?
That addEventListener("start"/"repeat"/"end", fn) works.

What went wrong?
addEventListener("start"/"repeat"/"end", fn) doesn't work.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 68.0.3440.106  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 
The event names are beginEvent/endEvent/repeatEvent [1], and plugging that into addEventListener ought to work in Blink.

If you think that's silly (I kinda do - this confused me too at times), the WG would be the right place to bring that up...

[1] https://svgwg.org/svg2-draft/interact.html#BeginEvent
Hmm, I actually see now that that table has "none" where I would expect it to say "(same)", which make the situation even more interesting...
Labels: Needs-Feedback
NextAction: 2018-09-10
fs@, so what is the status of the bug? WontFix, or something to do?
My bad.  I just assumed it was "begin"/"end/"repeat" because it worked in FF, and I didn't double check the names in the spec.

I just checked that the correct names work in both Chrome and FF.

You can close this, with my apologies.
Project Member

Comment 5 by sheriffbot@chromium.org, Aug 27

Cc: schenney@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-Triage-M68
Status: WontFix (was: Unconfirmed)
Thanks. No need to apologize. We appreciate everyone who tries to correct our system.
The NextAction date has arrived: 2018-09-10
NextAction: ----

Sign in to add a comment