DescriptionDo not call an event listener on a cloned node in svg <use>'s UA shadow tree
SVG <use> element tries to clone a user-provided subtree into its UA shadow tree.
This approach allows a user to access a cloned node in UA's shadow tree if a node
has an event listener.
e.g.
<svg>
<g id="a">
<image href="" onerror="window.nodes.push(event.target);">
</g>
<use href="#a">
</svg>
As a result, we will leak a node in <use>'s UA shadow tree.
Given the current implementation of <use>, we have to shrink an event path so
it does not include a node in <use>'s UA shadow tree.
A <use> element itself still receives an event if an event is a composed event.
This CL also reverts the most parts of https://codereview.chromium.org/312423002
because it is no longer valid in the latest SVG spec, and stop copying event
listeners from a referenced node into a cloned node because it is no longer
necessary.
BUG=630870
Committed: https://crrev.com/c4f2b0897923d1fa54fd2b644f6771290e812f4b
Cr-Commit-Position: refs/heads/master@{#409455}
Patch Set 1 #Patch Set 2 : Rewrite #
Total comments: 9
Patch Set 3 : addressed #Patch Set 4 : skip timeout test #Dependent Patchsets: Messages
Total messages: 60 (30 generated)
|