<?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>228537</bug_id>
          
          <creation_ts>2021-07-27 23:35:06 -0700</creation_ts>
          <short_desc>SVG image with radius causes page to freeze/hang</short_desc>
          <delta_ts>2021-07-28 07:28:07 -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>Safari Technology Preview</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <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="Peter Breuls">breuls</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>gsnedders</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1779963</commentid>
    <comment_count>0</comment_count>
      <attachid>434404</attachid>
    <who name="Peter Breuls">breuls</who>
    <bug_when>2021-07-27 23:35:06 -0700</bug_when>
    <thetext>Created attachment 434404
HTML page with problematic SVG image

Safari loads a page very slowly when a certain SVG image is used on that page. On Mac, the page load may take almost 2 minutes. On iOS, Safari eventually crashes.

This problem was initially reported by a customer as &quot;the page does not load on iPhone&quot;. After investigation, using Safari&apos;s timeline recording tools, it showed a slow loading SVG image and a slow loading JPG image, plus a long time for a Paint event (30+ before the event starts and almost a minute before it completes). This paint event corresponds to the SVG and the JPG; the SVG is used as an overlay to the JPG.

Replacing the SVG image with something else fixes the problem: no slow loading experience, no hangs. So I&apos;ve looked at the SVG image specifically: it&apos;s a small XML file with nothing more complex than a radius. I have included an HTML page with that SVG as an attachment. Opening it in Safari shows that it loads slowly, albeit somewhat faster than on the customer&apos;s website. (This test page currently takes around 25 seconds to load on my machine.)

I tested the page in Safari 14.1.1 (both the current macOS release and the current recent WebKit build (280374)), and in Safari Technology Preview 128 (15.0). Behavior is the same for all versions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1780052</commentid>
    <comment_count>1</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-07-28 07:27:56 -0700</bug_when>
    <thetext>738  WebCore::RenderSVGRoot::layout() + 1996 (WebCore + 1190124) [0x1566678ec]
   738  WebCore::SVGRenderSupport::layoutChildren(WebCore::RenderElement&amp;, bool) + 818 (WebCore + 33435298) [0x158527ea2]
     738  WebCore::RenderSVGShape::layout() + 299 (WebCore + 1193819) [0x15666875b]
       738  WebCore::RenderSVGRect::updateShapeFromElement() + 1759 (WebCore + 2066111) [0x15673d6bf]
         738  WebCore::RenderSVGShape::updateShapeFromElement() + 282 (WebCore + 1195146) [0x156668c8a]
           738  WebCore::RenderSVGShape::calculateStrokeBoundingBox() const + 147 (WebCore + 1196323) [0x156669123]
             738  WebCore::Path::strokeBoundingRect(WTF::Function&lt;void (WebCore::GraphicsContext&amp;)&gt; const&amp;) const + 186 (WebCore + 30048538) [0x1581ed11a]
               738  CGContextReplacePathWithStrokedPath + 63 (CoreGraphics + 1066835) [0x7ff819470753]

...and then into CoreGraphics. Will post a full spindump on Radar.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1780053</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-07-28 07:28:07 -0700</bug_when>
    <thetext>&lt;rdar://problem/81215623&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>434404</attachid>
            <date>2021-07-27 23:35:06 -0700</date>
            <delta_ts>2021-07-27 23:35:06 -0700</delta_ts>
            <desc>HTML page with problematic SVG image</desc>
            <filename>svg-test.html</filename>
            <type>text/html</type>
            <size>495</size>
            <attacher name="Peter Breuls">breuls</attacher>
            
              <data encoding="base64">PGh0bWw+PGhlYWQ+Cjx0aXRsZT5TVkcgdGVzdDwvdGl0bGU+CjwvaGVhZD4KPGJvZHk+Cgo8c3Zn
IHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjIxODAiIGhlaWdodD0i
NjA1IiB2aWV3Qm94PSIwIDAgMjE4MCA2MDUiPgogIDxkZWZzPgogICAgPHN0eWxlPgogICAgICAu
Y2xzLTEgewogICAgICAgIGZpbGw6ICMwMDlkZDE7CiAgICAgICAgc3Ryb2tlOiAjMDAwOwogICAg
ICAgIHN0cm9rZS13aWR0aDogMDsKICAgICAgICBzdHJva2UtZGFzaGFycmF5OiAwLjAwMSAwIDAg
MDsKICAgICAgfQogICAgPC9zdHlsZT4KICA8L2RlZnM+CiAgPHJlY3QgaWQ9IkFmZ2Vyb25kZV9y
ZWNodGhvZWtfMSIgZGF0YS1uYW1lPSJBZmdlcm9uZGUgcmVjaHRob2VrIDEiIGNsYXNzPSJjbHMt
MSIgeD0iLTk1NSIgeT0iLTE0NjEiIHdpZHRoPSIyMTIyIiBoZWlnaHQ9IjIwODAiIHJ4PSI0Nzku
NSIgcnk9IjQ3OS41Ii8+Cjwvc3ZnPgoKCjwvYm9keT48L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>