<?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>106603</bug_id>
          
          <creation_ts>2013-01-10 14:22:17 -0800</creation_ts>
          <short_desc>Setting a width on a table element overrides intrinsic min-width/max-width values</short_desc>
          <delta_ts>2025-11-29 12:20:16 -0800</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>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>12396</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=12396</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ojan Vafai">ojan</reporter>
          <assigned_to name="Ojan Vafai">ojan</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</cc>
    
    <cc>gur.trio</cc>
    
    <cc>karlcow</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>804719</commentid>
    <comment_count>0</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2013-01-10 14:22:17 -0800</bug_when>
    <thetext>Setting a width on a block overrides intrinsic min-width/max-width values</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>923946</commentid>
    <comment_count>1</comment_count>
    <who name="">gur.trio</who>
    <bug_when>2013-09-03 04:43:07 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; Setting a width on a block overrides intrinsic min-width/max-width values

Hi Ojan

I am trying to understand the bug and for that I have attached a test case for DIV and TABLE along with WIDTH and MAX-WIDTH.
Once you run the test case you will see that the alert will show the width of div and table.

So for div width is set to 500px and max-width to 200 px and it takes 200px and so max-width doesn&apos;t override width.

But for table width is 500px and max-width is 200px but still it takes 500px and hence max-width is overridden.

Is this the bug? If not then please attach test case explaining your issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>923947</commentid>
    <comment_count>2</comment_count>
      <attachid>210351</attachid>
    <who name="">gur.trio</who>
    <bug_when>2013-09-03 04:45:00 -0700</bug_when>
    <thetext>Created attachment 210351
To check if max-width overrides width</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1932646</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-02-10 06:58:44 -0800</bug_when>
    <thetext>I am able to reproduce this bug in Safari 16.3 and WebKit ToT and it shows 204 and 500 while all other browsers (Chrome Canary 112 and Firefox Nightly 111) show &apos;204&apos; and &apos;200&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1933049</commentid>
    <comment_count>4</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-02-12 18:32:35 -0800</bug_when>
    <thetext>In the test case:

The first div and the table have for style

div, table {
    width: 500px;
    max-width: 200px;
}

Results:

For Safari:
- div:
  max-width wins.
- table:
  width winds.


For Chrome and Firefox:
max-width always wins.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1968416</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-07-27 05:03:45 -0700</bug_when>
    <thetext>It might be somewhere here:

https://searchfox.org/wubkat/source/Source/WebCore/rendering/RenderTable.cpp#290

First - we do this &quot;Ensure we aren&apos;t bigger than our available width.&quot;

and then &quot;// Ensure we aren&apos;t bigger than our max-width style.&quot;

and then &quot;// Ensure we aren&apos;t smaller than our min-width style.&quot;

I think first thing, we should move &apos;min-width&apos; before &apos;max-width&apos;.

Also need to look into more about &apos;width&apos; here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2011953</commentid>
    <comment_count>6</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-02-08 15:29:55 -0800</bug_when>
    <thetext>&lt;rdar://problem/122587460&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2161942</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-11-29 12:20:16 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 12396 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>210351</attachid>
            <date>2013-09-03 04:45:00 -0700</date>
            <delta_ts>2013-09-03 04:45:00 -0700</delta_ts>
            <desc>To check if max-width overrides width</desc>
            <filename>max-width.html</filename>
            <type>text/html</type>
            <size>754</size>
            <attacher>gur.trio</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUw+DQo8aHRtbD4NCjxoZWFkPg0KPHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFz
Y3JpcHQiPg0KZnVuY3Rpb24gcnVuVGVzdCgpDQp7DQogIHZhciB4PWRvY3VtZW50LmdldEVsZW1l
bnRCeUlkKCJlbGVtMSIpOyAgIA0KICBhbGVydCh4Lm9mZnNldFdpZHRoKTsNCiAgdmFyIHg9ZG9j
dW1lbnQuZ2V0RWxlbWVudEJ5SWQoImVsZW0yIik7ICAgDQogIGFsZXJ0KHgub2Zmc2V0V2lkdGgp
OyAgDQp9ICANCjwvc2NyaXB0Pg0KPC9oZWFkPg0KPGJvZHk+DQo8ZGl2IGlkPSJlbGVtMSIgc3R5
bGU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