Bug 137328 - SVG fragment identifier rendering issue
Summary: SVG fragment identifier rendering issue
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.9
: P2 Normal
Assignee: Said Abou-Hallawa
URL: https://gist.github.com/sidepodcast/b...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-10-01 18:38 PDT by me
Modified: 2015-05-26 14:24 PDT (History)
10 users (show)

See Also:


Attachments
Artifacting experienced when hovering over an SVG sprite (25.96 KB, image/jpeg)
2014-10-01 18:38 PDT, me
no flags Details
Additional test file (svg sprite sheet) (548 bytes, image/svg+xml)
2014-10-23 11:55 PDT, Bear Travis
no flags Details
Test File (html) (611 bytes, text/html)
2014-10-23 11:57 PDT, Bear Travis
no flags Details
Test case showing issue with no interaction at all. (484 bytes, text/html)
2014-10-28 13:30 PDT, Antoine Quint
no flags Details
Patch (3.93 KB, patch)
2015-05-26 12:55 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description me 2014-10-01 18:38:59 PDT
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).
Comment 1 Bear Travis 2014-10-23 11:55:21 PDT
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.
Comment 2 Bear Travis 2014-10-23 11:57:39 PDT
Created attachment 240359 [details]
Test File (html)

Additional test case html file.
Comment 3 Antoine Quint 2014-10-28 13:30:19 PDT
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.
Comment 4 Antoine Quint 2014-10-28 13:53:07 PDT
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.
Comment 5 Antoine Quint 2014-10-28 14:18:17 PDT
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.
Comment 6 Antoine Quint 2014-10-28 14:22:56 PDT
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.
Comment 7 Radar WebKit Bug Importer 2015-04-20 14:27:24 PDT
<rdar://problem/20623034>
Comment 8 Said Abou-Hallawa 2015-05-26 12:55:28 PDT
Created attachment 253720 [details]
Patch
Comment 9 WebKit Commit Bot 2015-05-26 14:24:21 PDT
Comment on attachment 253720 [details]
Patch

Clearing flags on attachment: 253720

Committed r184874: <http://trac.webkit.org/changeset/184874>
Comment 10 WebKit Commit Bot 2015-05-26 14:24:25 PDT
All reviewed patches have been landed.  Closing bug.