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.
Created attachment 401147 [details] Expected example behavior (Chrome)
Created attachment 401148 [details] Actual behavior (Safari)
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...
<rdar://problem/64094920>
Created attachment 401356 [details] reduced test case A reduced test case is attached.
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.
Created attachment 466820 [details] WIP
Created attachment 466823 [details] WIP2
Pull request: https://github.com/WebKit/WebKit/pull/15308
Committed 265565@main (9057e67f7402): <https://commits.webkit.org/265565@main> Reviewed commits have been landed. Closing PR #15308 and removing active labels.