<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>130127</bug_id>
          
          <creation_ts>2014-03-12 06:54:13 -0700</creation_ts>
          <short_desc>Nested use of same SVG resource fails</short_desc>
          <delta_ts>2023-06-15 15:56:00 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>SVG</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=258171</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dirk Schulze">krit</reporter>
          <assigned_to name="Ryosuke Niwa">rniwa</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>mihnea</cc>
    
    <cc>ntim</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>WebkitBugTracker</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>989606</commentid>
    <comment_count>0</comment_count>
      <attachid>226500</attachid>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2014-03-12 06:54:13 -0700</bug_when>
    <thetext>Created attachment 226500
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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1923858</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-01-07 15:31:35 -0800</bug_when>
    <thetext>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&amp;revision=175129 &amp; https://src.chromium.org/viewvc/blink?revision=174862&amp;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&apos;t want to cause collision with on-going LBSE work as well (if it reaches in this realm). Just wanted to share. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1923870</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2023-01-07 16:53:31 -0800</bug_when>
    <thetext>&gt; Might be bit out of my area of expertise to try to merge this and don&apos;t want to cause collision with on-going LBSE work as well (if it reaches in this realm).

I don&apos;t think there is any collision with LBSE in this case. LBSE does not affect resource resolution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1955295</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-05-14 03:51:43 -0700</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #1)
&gt; It is still happening with Safari 16.2 and Safari Technology Preview 160, it
&gt; was fixed in Blink with following commit:
&gt; 
&gt; Commit - https://src.chromium.org/viewvc/blink?view=revision&amp;revision=175129
&gt; &amp; https://src.chromium.org/viewvc/blink?revision=174862&amp;view=revision
&gt; 
&gt; WebKit Source (Example) -
&gt; https://searchfox.org/wubkat/source/Source/WebCore/rendering/svg/
&gt; SVGResourcesCycleSolver.cpp#53
&gt; 
&gt; Just wanted to share this. Might be bit out of my area of expertise to try
&gt; to merge this and don&apos;t want to cause collision with on-going LBSE work as
&gt; 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&amp;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1957850</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-05-25 02:15:43 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/14338</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1958353</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-05-26 20:52:07 -0700</bug_when>
    <thetext>Committed 264618@main (99265dce4d2f): &lt;https://commits.webkit.org/264618@main&gt;

Reviewed commits have been landed. Closing PR #14338 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1958354</commentid>
    <comment_count>6</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-05-26 20:53:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/109917889&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>226500</attachid>
            <date>2014-03-12 06:54:13 -0700</date>
            <delta_ts>2014-03-12 06:54:13 -0700</delta_ts>
            <desc>Example - passes if you see a circle</desc>
            <filename>cycle-detection-bug.svg</filename>
            <type>image/svg+xml</type>
            <size>343</size>
            <attacher name="Dirk Schulze">krit</attacher>
            
              <data encoding="base64">PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KPHBhdHRlcm4gd2lkdGg9
IjEwMCUiIGhlaWdodD0iMTAwJSIgaWQ9InBhdHRlcm4iIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4N
CiAgPHJlY3Qgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIGZpbGw9ImdyYXkiLz4NCjwvcGF0dGVy
bj4NCjxtYXNrIGlkPSJtYXNrIj4NCiAgPGNpcmNsZSBmaWxsPSJ1cmwoI3BhdHRlcm4pIiBjeD0i
MTAwIiBjeT0iMTAwIiByPSIxMDAiLz4NCjwvbWFzaz4NCjxyZWN0IHdpZHRoPSIyMDAiIGhlaWdo
dD0iMjAwIiBtYXNrPSJ1cmwoI21hc2spIiBmaWxsPSJ1cmwoI3BhdHRlcm4pIi8+DQo8L3N2Zz4N
Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>