Created attachment 239075 [details]
Artifacting experienced when hovering over an SVG sprite
SVG fragment identifiers added in Safari 7.1 for Mavericks (and also in iOS 8) render incorrectly when multiple remote images are referenced using the same URL path.
Sometimes the wrong image is displayed, other times no image at all. When using hover effects images can be rendered with inline artefacts (see attached image).
Created attachment 240358 [details]
Additional test file (svg sprite sheet)
This also causes issues when customizing the viewBox or specifying a view id. When two with the same viewBox are rendered next to each other, the latter will render correctly, but the first will not.
Created attachment 240359 [details]
Test File (html)
Additional test case html file.
Created attachment 240569 [details]
Test case showing issue with no interaction at all.
With this test case, SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription) is called constantly and results in a wrong rendering showing cogs / car / flag instead of car / flag / cogs.
It appears that each time we draw an SVG image, we draw whatever the last draw state was for the actual SVG image, so we're seeing the wrong content.
It's as if when we set the :target, it only gets picked up on the next draw of the image, which is for the next element, so we're always off by one.
All the <img> element share a single SVGImage, which gets redrawn each time with a new fragment identifier. I wonder if we should have different SVGImage instances for each fragment identifier. It's also unclear why we constantly redraw.
Created attachment 253720 [details]
Comment on attachment 253720 [details]
Clearing flags on attachment: 253720
Committed r184874: <http://trac.webkit.org/changeset/184874>
All reviewed patches have been landed. Closing bug.