[Webkit-unassigned] [Bug 237968] New: SVG external sprite always re-downloaded over network when DOM reconstructed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 16 09:51:06 PDT 2022


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

            Bug ID: 237968
           Summary: SVG external sprite always re-downloaded over network
                    when DOM reconstructed
           Product: WebKit
           Version: Safari 14
          Hardware: Mac (Intel)
                OS: macOS 12
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Page Loading
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: james at jross.me
                CC: beidson at apple.com

Created attachment 454850

  --> https://bugs.webkit.org/attachment.cgi?id=454850&action=review

Zip of files in the referenced github repo

When manually constructing an SVG via JavaScript that uses an external stylesheet via `<use>`, no matter if the sprite is already rendered on the page, or if it's been downloaded before, it is always fetched over the network. This can lead to an excessive number of requests on pages that use JS to construct and deconstruct tooltips, menus, etc.

Replication:

- Clone https://github.com/Cherry/svg-external-sprite-redownloaded (also attached as zip to this ticket)
- Run any server to serve this directory (npx serve for example)
- Open resulting site, and watch network requests as both a PNG and SVG element are constructed and deconstructed every second

Expected Results: `sprite.svg` to be only downloaded once
Actual Results: `sprite.svg` is downloaded every second

The replication was done using Safari 15.4 (17613.1.17.1.6) on MacOS 12.3. I did not test with iOS, but it's possible that's also impacted. I'm not sure if this is expected behaviour, but I did find a previous bug reporting similar things in the past:

- https://www.smashingmagazine.com/2016/05/safari-svg-sprite-bug/
- https://bugs.webkit.org/show_bug.cgi?id=156368

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220316/7732af41/attachment.htm>


More information about the webkit-unassigned mailing list