Bug 212820 - SVG fragment reference fails in shadow tree under some circumstances
Summary: SVG fragment reference fails in shadow tree under some circumstances
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: Safari 13
Hardware: All Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks: 148695
  Show dependency treegraph
 
Reported: 2020-06-05 06:17 PDT by ian
Modified: 2023-06-27 15:03 PDT (History)
28 users (show)

See Also:


Attachments
Repro (2.86 KB, text/html)
2020-06-05 06:17 PDT, ian
no flags Details
Expected example behavior (Chrome) (210.79 KB, video/mp4)
2020-06-05 06:18 PDT, ian
no flags Details
Actual behavior (Safari) (189.08 KB, video/mp4)
2020-06-05 06:18 PDT, ian
no flags Details
Expected and unexpected behavior in a project (426.84 KB, video/mp4)
2020-06-05 06:22 PDT, ian
no flags Details
reduced test case (1.18 KB, text/html)
2020-06-08 12:25 PDT, Said Abou-Hallawa
no flags Details
WIP (48.05 KB, patch)
2023-06-25 03:04 PDT, Ryosuke Niwa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP2 (57.22 KB, patch)
2023-06-26 00:03 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ian 2020-06-05 06:17:27 PDT
Created attachment 401145 [details]
Repro

filter:url(#myFilter), fill:url(#myPattern), etc. can fail in some circumstances when the SVG is in a shadowTree and there are multiple shadowTrees with that SVG in it. The result is no fill, no filter or the element disappearing. 

The attached example reproduces in Safari 13.1, STP 107, and iPadOS 13.5. 
It does not reproduce in Chrome 83 or FF 77.
Comment 1 ian 2020-06-05 06:18:24 PDT
Created attachment 401147 [details]
Expected example behavior (Chrome)
Comment 2 ian 2020-06-05 06:18:55 PDT
Created attachment 401148 [details]
Actual behavior (Safari)
Comment 3 ian 2020-06-05 06:22:37 PDT
Created attachment 401150 [details]
Expected and unexpected behavior in a project

It seems the issue manifests when there's only one instance of a shadowTree displayer with the offending SVG, except sometimes when the shadowTree is not the first child in the document that contains the offending SVG...
Comment 4 Radar WebKit Bug Importer 2020-06-07 13:46:20 PDT
<rdar://problem/64094920>
Comment 5 Said Abou-Hallawa 2020-06-08 12:25:57 PDT
Created attachment 401356 [details]
reduced test case

A reduced test case is attached.
Comment 6 Ahmad Saleem 2023-05-27 12:19:48 PDT
I am able to reproduce this bug in WebKit ToT / Safari 16.5.1 as well. Chrome Canary 116 and Firefox Nightly 115 works fine.
Comment 7 Ryosuke Niwa 2023-06-25 03:04:24 PDT
Created attachment 466820 [details]
WIP
Comment 8 Ryosuke Niwa 2023-06-26 00:03:50 PDT
Created attachment 466823 [details]
WIP2
Comment 9 Ryosuke Niwa 2023-06-26 15:58:06 PDT
Pull request: https://github.com/WebKit/WebKit/pull/15308
Comment 10 EWS 2023-06-27 15:03:25 PDT
Committed 265565@main (9057e67f7402): <https://commits.webkit.org/265565@main>

Reviewed commits have been landed. Closing PR #15308 and removing active labels.