Open Bug 619509 Opened 11 years ago Updated 3 years ago
animate-interact-events-01-t.svg fails because we clone the <use> target, so all the instances don't animate when animation of the <use> target starts.
This testcase illustrates a bit about what's going on here. When we have <rect id="foo"...> <set ... begin="mouseover"> </rect> <use xlink:href="#foo" .../> <use xlink:href="#foo" .../> then that 'set' should be triggered simultaneously for the original and for *all* of its clones, whenever *any* of them is hovered. (because events are supposed to be propagated to all of them) This doesn't work currently. What *does* work, however, is: <rect id="foo"...> <set ... begin="somethingELSE.mouseover"> </rect> <use xlink:href="#foo" ...> <use xlink:href="#foo" ...> <circle id="somethingELSE" .../> There, when you hover over the circle, it correctly triggers animations on the rect and all of its clones. (Though that's not particularly surprising -- just including it as a slightly different case that does work.) The attached testcase demonstrates both of these use-cases.
I don't think description of what does happen is quite correct. It's worth working this out so that all browsers work to spec. When mouseover happens for rect it should animate all, as described.This is currently broken. To quote http://www.w3.org/TR/SVG/struct.html#UseElement Animations on a referenced element will cause the instances to also be animated. However, it doesn't work the other way around. when mouseover happens for <use> it should only animate the single <use> the mouse is over. This is different to the current bug description but is *not* a bug in Firefox, it does it correctly. This is because for events in <use>, the event target is the cloned element tree. There is no propagation of events to the referenced element. To quote http://www.w3.org/TR/SVG/struct.html#UseElement "The event handling for the non-exposed tree works as if the referenced element had been textually included as a deeply cloned child of the ‘use’ element, except that events are dispatched to the SVGElementInstance objects ..." The SVGElementInstance objects are the cloned elements created by the <use>, not the referenced elementt. They are what makes the non-exposed DOM tree that <use> creates. There is no mechanism to get the event to the referenced element (rect).
You need to log in before you can comment on or make changes to this bug.