[Webkit-unassigned] [Bug 81792] Triggering an animation in cloned (uses) object causes all other cloned objects to animate

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 23 05:54:23 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=81792





--- Comment #7 from David White <david at netriver.co.uk>  2012-03-23 05:54:23 PST ---
Thank you for getting back to me, Nikolas,

Unfortunately Webkit and FF are doing this different, which is a big concern. You said:

"You have to attach this animateTransform to the individual <use> elements, either as child of the <use> element or targeting the use element via xlink:href. Otherwise you'll always end up animating all instances of your path.

Imagine you're changing the "d" attribute of the path from JavaScript. What do you expect? All instances immediately reflect the change -- the same is true for SMIL animations here."

The spec states that:
"The effect of a ‘use’ element is as if the contents of the referenced element were deeply cloned into a separate non-exposed DOM tree which had the ‘use’ element as its parent and all of the ‘use’ element's ancestors as its higher-level ancestors"

My point is that because <use> does a "deep clone" of the referenced element, that means that the animateTransform is also copied and since the begin and end attributes of those copies do not reference an ID explicitly, those copied animateTransforms animate each cloned non-exposed DOM tree separately.

So, mouseover on the cloned element causes an event which bubbles up through the cloned tree and on through the parents. Since a referenced element cannot have a clone of itself as a child element, the event doesn't go anywhere near the referenced element. The only animateTransform that can pick up the event is the one in the non-exposed DOM tree - i.e. the cloned animateTransform. This means that the cloned path should animate and nothing else.

mouseover happens to the cloned elements - like you say it is analogous to setting a property. Using your analogy, it's like setting the fill colour on a <use> element as per my SVG example - you wouldn't expect everything including the referenced object to change colour. Yet that is what is happening with animation.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list