Bug 130127 - Nested use of same SVG resource fails
Summary: Nested use of same SVG resource fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-03-12 06:54 PDT by Dirk Schulze
Modified: 2023-06-15 15:56 PDT (History)
7 users (show)

See Also:


Attachments
Example - passes if you see a circle (343 bytes, image/svg+xml)
2014-03-12 06:54 PDT, Dirk Schulze
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Schulze 2014-03-12 06:54:13 PDT
Created attachment 226500 [details]
Example - passes if you see a circle

An element is filled with a pattern #p1. The element gets masked as well. If this mask makes use of #p1 as well, then it fails.

This is probably a problem with the cycle detection code for SVG resources. For some reason the code detects a cycle even though this is absolutely fine. Creating a second pattern with a different id makes the example work.

The example passes if you see a circle.
Comment 1 Ahmad Saleem 2023-01-07 15:31:35 PST
It is still happening with Safari 16.2 and Safari Technology Preview 160, it was fixed in Blink with following commit:

Commit - https://src.chromium.org/viewvc/blink?view=revision&revision=175129 & https://src.chromium.org/viewvc/blink?revision=174862&view=revision

WebKit Source (Example) - https://searchfox.org/wubkat/source/Source/WebCore/rendering/svg/SVGResourcesCycleSolver.cpp#53

Just wanted to share this. Might be bit out of my area of expertise to try to merge this and don't want to cause collision with on-going LBSE work as well (if it reaches in this realm). Just wanted to share. Thanks!
Comment 2 Tim Nguyen (:ntim) 2023-01-07 16:53:31 PST
> Might be bit out of my area of expertise to try to merge this and don't want to cause collision with on-going LBSE work as well (if it reaches in this realm).

I don't think there is any collision with LBSE in this case. LBSE does not affect resource resolution.
Comment 3 Ahmad Saleem 2023-05-14 03:51:43 PDT
(In reply to Ahmad Saleem from comment #1)
> It is still happening with Safari 16.2 and Safari Technology Preview 160, it
> was fixed in Blink with following commit:
> 
> Commit - https://src.chromium.org/viewvc/blink?view=revision&revision=175129
> & https://src.chromium.org/viewvc/blink?revision=174862&view=revision
> 
> WebKit Source (Example) -
> https://searchfox.org/wubkat/source/Source/WebCore/rendering/svg/
> SVGResourcesCycleSolver.cpp#53
> 
> Just wanted to share this. Might be bit out of my area of expertise to try
> to merge this and don't want to cause collision with on-going LBSE work as
> well (if it reaches in this realm). Just wanted to share. Thanks!

We only need to do: https://src.chromium.org/viewvc/blink?view=revision&revision=175129

^ I tried but I think our code has also evolved, so it is not 1-1, there are still some similarities but we have WeakHashSet intro in this code as well.

@Ryosuke did some WeakHashSet intro in various places of code. Might be something you can have a look?
Comment 4 Ryosuke Niwa 2023-05-25 02:15:43 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14338
Comment 5 EWS 2023-05-26 20:52:07 PDT
Committed 264618@main (99265dce4d2f): <https://commits.webkit.org/264618@main>

Reviewed commits have been landed. Closing PR #14338 and removing active labels.
Comment 6 Radar WebKit Bug Importer 2023-05-26 20:53:16 PDT
<rdar://problem/109917889>