Suppose you have several SVG tags, in each of which you define a different click path with the same identifier.
<svg id="svg1" width="200" height="200"> <defs> <clipPath id="nodeclipper"> <rect width="100" height="100" x="0" y="0" /> </clipPath> </defs> </svg> <svg id="svg2" width="200" height="200"> <defs> <clipPath id="nodeclipper"> <circle cx="20" cy="0" r="40" /> </clipPath> </defs> </svg>
I also made JSFiddle . What is the expected behavior? I thought that an element can only refer to definitions inside its own SVG tag, but that doesn't seem to be the case:
- Chrome 26: Uses the
circle clip path two times. - Firefox 17: Uses the
rect path of the clip twice. - Safari 6: Displays one
rect and one circle clip path, as expected.
It is strange when to hide one of the SVG tags , because Chrome and Safari then completely reject clip-path .
I know this works when clipPath have different identifiers, but should it be like that? As far as I understand, spec does not contain information about the problem.
source share