<?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>243661</bug_id>
          
          <creation_ts>2022-08-08 02:50:18 -0700</creation_ts>
          <short_desc>Min-width does not respect implicit width on SVG</short_desc>
          <delta_ts>2023-07-26 09:34:59 -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>Layout and Rendering</component>
          <version>Safari 15</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 12</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>257614</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=257614</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>murrayadcock+webkit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1889633</commentid>
    <comment_count>0</comment_count>
    <who name="">murrayadcock+webkit</who>
    <bug_when>2022-08-08 02:50:18 -0700</bug_when>
    <thetext>If an SVG element has an implicit width set (e.g. &lt;svg width=&quot;45px&quot;&gt;...&lt;/svg&gt;) then this should be considered the minimum width of the element.

Currently, setting max-width: min-content works as expected (the SVG element will be 45px wide).

But setting min-width: min-content makes the SVG a seemingly arbitrary width (302px in the test case). (this is the same for max-content and fit-content, neither of which appear to respect intrinsic sizing either)

No combination of other width settings seems to be able to override this. For example, setting a max-width or width value of 45px still results in a 302px element.

Changing the implicit width on the element doesn&apos;t seem to have any effect either (it sticks to 302px wide).

See this reproduction of the issue, which has optional code for testing in a Grid format (grid columns also ignore the actual minimum width and default to 302px wide) and which shows that min-w-idth: auto works as expected:

https://codepen.io/theadhocracy/pen/OJvEmPv

[FYI this has also been tested on iCab to rule out Safari-specific bugs and can be reproduced there, as well as on WebKit browsers on iOS devices]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891305</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-08-15 02:51:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/98661480&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1968154</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-07-25 16:56:34 -0700</bug_when>
    <thetext>It get fixed by: https://github.com/WebKit/WebKit/pull/16084

I have above patches in local WebKit ToT and it seems to fix this test case and make us match Chrome Canary 117.

I removed above patches and then compiled local and we fail this test case.

Just wanted to add this information, if above PR stick, I will mark this as &apos;RESOLVED CONFIGURATION CHANGED&apos; else it would be helpful for someone else in future while trying to fix this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1968244</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-07-26 09:34:59 -0700</bug_when>
    <thetext>Fixed now.

*** This bug has been marked as a duplicate of bug 257614 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>