<?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>182172</bug_id>
          
          <creation_ts>2018-01-26 09:41:51 -0800</creation_ts>
          <short_desc>SVG2: WebKit incorrectly disregards &quot;width&quot; and &quot;height&quot; attributes on SVG &lt;symbol&gt; element</short_desc>
          <delta_ts>2023-05-10 14:42:04 -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 11</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>200445</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, FromImplementor, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>191292</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Holbert">dholbert</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>jespertheend</cc>
    
    <cc>me</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1393543</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2018-01-26 09:41:51 -0800</bug_when>
    <thetext>What steps will reproduce the problem?
(1) Visit https://jsfiddle.net/mca17zyk/

What is the expected result?
 Small purple rectangle and square. (Each 20px tall.)

What happens instead?
 The square is huge.

Please use labels and text to provide additional information.
Per SVG2, the square (really, the &lt;use&gt;-generated &lt;svg&gt; element that gets filled with a 100%-sized purple rect) should take its width/height attributes from the &lt;symbol&gt; element that it cloned.  That &lt;symbol&gt; element has width=20 height=20, so its &lt;svg&gt; clone should as well.

The rectangle (the first purple thing in the testcase) works correctly because it explicitly overrides the width and height by setting those attributes on the use element itself. But if they&apos;re unset on &lt;use&gt;, then we should use the ones from the &lt;symbol&gt;.

WebKit&apos;s behavior here would be correct per SVG 1.1:
https://www.w3.org/TR/SVG11/struct.html#SymbolElement

...but it&apos;s incorrect per SVG 2:
https://svgwg.org/svg2-draft/struct.html#SymbolElement

The specific commit in the SVG 2 spec repo is here:
https://github.com/w3c/svgwg/commit/ca0f76bf83825505e17d8b69ead26b01d3bc75dc#diff-6e6915b15fe92e713aecbcc7786991f6R449
That commit added x,y,width,height to &lt;symbol&gt;, and added prose saying they should have the same effect on clones-of-&lt;symbol&gt; as they have on an &lt;svg&gt; element.


Firefox gives &quot;Expected Results&quot; here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1393548</commentid>
    <comment_count>1</comment_count>
      <attachid>332378</attachid>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2018-01-26 09:50:57 -0800</bug_when>
    <thetext>Created attachment 332378
testcase 1 (same as jsfiddle)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1393549</commentid>
    <comment_count>2</comment_count>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2018-01-26 09:51:29 -0800</bug_when>
    <thetext>I filed Chrome/Edge bugs as well, for the record:
 https://bugs.chromium.org/p/chromium/issues/detail?id=806289
 https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/15641029/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1587138</commentid>
    <comment_count>3</comment_count>
    <who name="Michal Vašíček">me</who>
    <bug_when>2019-11-04 13:53:28 -0800</bug_when>
    <thetext>This was already fixed in Chrome in March 2019, any updates on this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1587181</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-11-04 15:14:15 -0800</bug_when>
    <thetext>&lt;rdar://problem/56882593&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1587414</commentid>
    <comment_count>5</comment_count>
      <attachid>382828</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2019-11-05 09:04:51 -0800</bug_when>
    <thetext>Created attachment 382828
reduced test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1954261</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-05-10 00:28:39 -0700</bug_when>
    <thetext>This seems to be similar to bug 200445?

Can we mark this as duplicate of 200445, since I have already done PR for that?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1954315</commentid>
    <comment_count>7</comment_count>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2023-05-10 07:09:33 -0700</bug_when>
    <thetext>Sure, that&apos;s fine with me!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1954517</commentid>
    <comment_count>8</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-05-10 14:42:04 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 200445 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>332378</attachid>
            <date>2018-01-26 09:50:57 -0800</date>
            <delta_ts>2018-01-26 09:50:57 -0800</delta_ts>
            <desc>testcase 1 (same as jsfiddle)</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>880</size>
            <attacher name="Daniel Holbert">dholbert</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+Cjxib2R5PgpZb3Ugc2hvdW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2lkdGg9IjEwMCUiIGZpbGw9InB1cnBsZSIgc3Ryb2tlPSJibGFjayI+CiAgICA8L3JlY3Q+CiAg
PC9zeW1ib2w+Cjwvc3ZnPgo8L2JvZHk+Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>382828</attachid>
            <date>2019-11-05 09:04:51 -0800</date>
            <delta_ts>2019-11-05 09:04:51 -0800</delta_ts>
            <desc>reduced test case</desc>
            <filename>test296.svg</filename>
            <type>image/svg+xml</type>
            <size>202</size>
            <attacher name="Said Abou-Hallawa">sabouhallawa</attacher>
            
              <data encoding="base64">PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxzeW1ib2wgd2lkdGg9
IjIwIiBoZWlnaHQ9IjIwIiBpZD0iZ3JlZW4tcmVjdCI+CiAgICA8cmVjdCBoZWlnaHQ9IjEwMCUi
IHdpZHRoPSIxMDAlIiBmaWxsPSJncmVlbiIvPgogIDwvc3ltYm9sPgogIDx1c2Ugd2lkdGg9IjEw
MCIgaHJlZj0iI2dyZWVuLXJlY3QiLz4KPC9zdmc+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>