<?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>97747</bug_id>
          
          <creation_ts>2012-09-26 18:08:08 -0700</creation_ts>
          <short_desc>width on a flexitem should not affect the min-width: auto constraint</short_desc>
          <delta_ts>2013-03-07 16:25:22 -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>111790</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>106143</dependson>
          <blocked>62048</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Holbert">dholbert</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>kennyluck</cc>
    
    <cc>ojan</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>729111</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2012-09-26 18:08:08 -0700</bug_when>
    <thetext>Midori 0.4.3
Chrome Version 23.0.1271.6 dev</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>729112</commentid>
    <comment_count>1</comment_count>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2012-09-26 18:11:31 -0700</bug_when>
    <thetext>(sorry, accidentally bumped &quot;enter&quot; key while typing bug summary &amp; filed bug prematurely)

The flexbox spec says that &quot;min-width:auto&quot; on a flex item is supposed to resolve to the min-content width.

However, when there&apos;s a &quot;width&quot; property-value specified on the item, webkit appears to be clamping to that width, instead of to the min-content width.

Testcases coming up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>729115</commentid>
    <comment_count>2</comment_count>
      <attachid>165909</attachid>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2012-09-26 18:19:03 -0700</bug_when>
    <thetext>Created attachment 165909
testcase 1

This testcase has a block with:
        flex: 1 1 0px;
        width: 1000px;
inside of a 50px-wide flexbox. (with -webkit and -moz prefixes on flex properties)

I believe the &quot;width: 1000px&quot; there should have no effect. It&apos;s not used as the flex-base, clearly, because we have &quot;0px&quot; in the flex specification.  It&apos;s also not part of the block&apos;s min-content width, unless I&apos;m misunderstanding what the spec authors had in mind with &quot;min-content width&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>729122</commentid>
    <comment_count>3</comment_count>
      <attachid>165910</attachid>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2012-09-26 18:29:30 -0700</bug_when>
    <thetext>Created attachment 165910
reference case 1

Here&apos;s a reference case, with the &quot;width: 1000px&quot; removed.

I&apos;d expect the testcase to render just like this reference case -- the 1000px shouldn&apos;t impact the minimum size that we clamp shrinkage at.

Relevant spec text:
  # auto
  #  When used as the value of a flex item&apos;s min main size property,
  # this keyword indicates a minimum of the min-content size, to help
  # ensure that the item is large enough to fit its contents.
  #
  # It is intended that this will compute to the ‘min-content’ keyword
  # when the specification defining it (Writing Modes Appendix D) is
  # sufficiently mature. 

So &quot;min-width: auto&quot; is supposed to effectively compute to &quot;min-width: min-content&quot;.

And when we resolve &quot;min-width: min-content&quot;, I believe we&apos;re supposed to only use the contents of the block -- the computed value of &quot;width&quot; shouldn&apos;t affect the calculation.  (If it did, then &quot;width: min-content&quot; would have a circular dependency.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>729182</commentid>
    <comment_count>4</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2012-09-26 21:15:20 -0700</bug_when>
    <thetext>Thanks for filing the bug! I think we just didn&apos;t test cases of setting both the flex-basis and the width to fixed values</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>729195</commentid>
    <comment_count>5</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2012-09-26 21:37:48 -0700</bug_when>
    <thetext>I take it back. You&apos;re totally right. We&apos;re using the width value for min-width:auto.

Same as testcase 1, but with min-width:0 on the flex items:
http://plexode.com/u/#N!(-webkit-Qj!dotted!b2_div2Z%3C2X%3EYW)height659)EVwidth62U(!!2R%0AIPH61!1!92O%3BrM4%22HboxKU4%22ELhould!EK%22XQJ)display66HflexEGaaaaaaE90pxOb8Z%2F_X66%3A!n4Z_!class%3DA)U!!I(R!!!!2!%20~http://plexode.com/eval3/#ht=!!ZstyleXU_.Hbox!%7BWV59R)border62pxjlackORJ-moz-HOJ!(HOJHOU%7DU_.a!%7B)-moz-P)!(P)PR)V1009!%2F*!SLhave!no!effect!*%2F)min-V0OWbackground6tealOU%7D(Z%2FstyleX(This!sLbe!a!50px-by-50px!teal!square.!ZbrX(No!teal!sLbe!outside!thejorder.(MaKaaa8(8R(This!_!sLonly!be!as!wide!as!the!text!it!contains.(MaKGGGGGG8(8R</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>818190</commentid>
    <comment_count>6</comment_count>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2013-01-28 15:34:53 -0800</bug_when>
    <thetext>It&apos;s been ~4 months since the last comment here -- any updates / ETA for this?  Just want to make sure this doesn&apos;t fall off the radar, since I think this could lead to interop issues &amp; developer confusion.

(I just received an email today regarding a testcase that rendered differently in Gecko vs. WebKit, and it ended up being due to this bug.)

Per comment 5, it seems like this should at least be upgraded from UNCONFIRMED to NEW or something. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>818194</commentid>
    <comment_count>7</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2013-01-28 15:38:32 -0800</bug_when>
    <thetext>Ojan is working on this, he got side tracked by mathml :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>818227</commentid>
    <comment_count>8</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2013-01-28 16:06:48 -0800</bug_when>
    <thetext>Yup. I&apos;m finally getting back to this. FWIW, I have been working on this and committing related patches. It&apos;s just that the fix requires rewriting a bunch of code. The final patch will be the one that fixes this as a one-liner. :) I&apos;ll try to get this done ASAP.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>850599</commentid>
    <comment_count>9</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2013-03-07 16:25:22 -0800</bug_when>
    <thetext>The spec has changed and this will be fixed with bug 111790.

*** This bug has been marked as a duplicate of bug 111790 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>165909</attachid>
            <date>2012-09-26 18:19:03 -0700</date>
            <delta_ts>2012-09-26 18:19:03 -0700</delta_ts>
            <desc>testcase 1</desc>
            <filename>flexbox-minsize-bug.html</filename>
            <type>text/html</type>
            <size>958</size>
            <attacher name="Daniel Holbert">dholbert</attacher>
            
              <data encoding="base64">PGh0bWw+CjwhLS0KICAgICBUaGlzIHRlc3QgY2hlY2tzIHRoYXQgYSBibG9jaydzIHJlc29sdmVk
ICJtaW4td2lkdGg6IGF1dG8iIHZhbHVlCiAgICAgaXMgaGFuZGxlZCBjb3JyZWN0bHkgKGkuZS4g
aXNuJ3QgaW5mbHVlbmNlZCBieSB0aGUgIndpZHRoIiBwcm9wZXJ0eSkuCi0tPgogIDxoZWFkPgog
ICAgPHN0eWxlPgogICAgICBkaXYuZmxleGJveCB7CiAgICAgICAgaGVpZ2h0OiA1MHB4OwogICAg
ICAgIHdpZHRoOiA1MHB4OwoKICAgICAgICBib3JkZXI6IDJweCBkb3R0ZWQgYmxhY2s7CgogICAg
ICAgIGRpc3BsYXk6IC1tb3otZmxleDsKICAgICAgICBkaXNwbGF5OiAtd2Via2l0LWZsZXg7CiAg
ICAgICAgZGlzcGxheTogZmxleDsKICAgICAgfQogICAgICBkaXYuYSB7CiAgICAgICAgLW1vei1m
bGV4OiAxIDEgMHB4OwogICAgICAgIC13ZWJraXQtZmxleDogMSAxIDBweDsKICAgICAgICBmbGV4
OiAxIDEgMHB4OwoKICAgICAgICB3aWR0aDogMTAwMHB4OyAvKiBTaG91bGQgaGF2ZSBubyBlZmZl
Y3QgKi8KCiAgICAgICAgaGVpZ2h0OiA1MHB4OwogICAgICAgIGJhY2tncm91bmQ6IHRlYWw7CiAg
ICAgIH0KICAgIDwvc3R5bGU+CiAgPC9oZWFkPgogIDxib2R5PgogICAgVGhpcyBzaG91bGQgYmUg
YSA1MHB4LWJ5LTUwcHggdGVhbCBzcXVhcmUuIDxicj4KICAgIE5vIHRlYWwgc2hvdWxkIGJlIG91
dHNpZGUgdGhlIGRvdHRlZCBib3JkZXIuCiAgICA8ZGl2IGNsYXNzPSJmbGV4Ym94Ij4KICAgICAg
PGRpdiBjbGFzcz0iYSI+YWFhPC9kaXY+CiAgICA8L2Rpdj4KCiAgICBUaGlzIGRpdiBzaG91bGQg
b25seSBiZSBhcyB3aWRlIGFzIHRoZSB0ZXh0IGl0IGNvbnRhaW5zLgogICAgPGRpdiBjbGFzcz0i
ZmxleGJveCI+CiAgICAgIDxkaXYgY2xhc3M9ImEiPmFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh
YWFhYWFhYWFhYTwvZGl2PgogICAgPC9kaXY+CiAgPC9ib2R5Pgo8L2h0bWw+Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>165910</attachid>
            <date>2012-09-26 18:29:30 -0700</date>
            <delta_ts>2012-09-26 18:29:30 -0700</delta_ts>
            <desc>reference case 1</desc>
            <filename>flexbox-minsize-reference.html</filename>
            <type>text/html</type>
            <size>905</size>
            <attacher name="Daniel Holbert">dholbert</attacher>
            
              <data encoding="base64">PGh0bWw+CjwhLS0KICAgICBUaGlzIHRlc3QgY2hlY2tzIHRoYXQgYSBibG9jaydzIHJlc29sdmVk
ICJtaW4td2lkdGg6IGF1dG8iIHZhbHVlCiAgICAgaXMgaGFuZGxlZCBjb3JyZWN0bHkgKGkuZS4g
aXNuJ3QgaW5mbHVlbmNlZCBieSB0aGUgIndpZHRoIiBwcm9wZXJ0eSkuCi0tPgogIDxoZWFkPgog
ICAgPHN0eWxlPgogICAgICBkaXYuZmxleGJveCB7CiAgICAgICAgaGVpZ2h0OiA1MHB4OwogICAg
ICAgIHdpZHRoOiA1MHB4OwoKICAgICAgICBib3JkZXI6IDJweCBkb3R0ZWQgYmxhY2s7CgogICAg
ICAgIGRpc3BsYXk6IC1tb3otZmxleDsKICAgICAgICBkaXNwbGF5OiAtd2Via2l0LWZsZXg7CiAg
ICAgICAgZGlzcGxheTogZmxleDsKICAgICAgfQogICAgICBkaXYuYSB7CiAgICAgICAgLW1vei1m
bGV4OiAxIDEgMHB4OwogICAgICAgIC13ZWJraXQtZmxleDogMSAxIDBweDsKICAgICAgICBmbGV4
OiAxIDEgMHB4OwogICAgICAgIGhlaWdodDogNTBweDsKICAgICAgICBiYWNrZ3JvdW5kOiB0ZWFs
OwogICAgICB9CiAgICA8L3N0eWxlPgogIDwvaGVhZD4KICA8Ym9keT4KICAgIFRoaXMgc2hvdWxk
IGJlIGEgNTBweC1ieS01MHB4IHRlYWwgc3F1YXJlLiA8YnI+CiAgICBObyB0ZWFsIHNob3VsZCBi
ZSBvdXRzaWRlIHRoZSBkb3R0ZWQgYm9yZGVyLgogICAgPGRpdiBjbGFzcz0iZmxleGJveCI+CiAg
ICAgIDxkaXYgY2xhc3M9ImEiPmFhYTwvZGl2PgogICAgPC9kaXY+CgogICAgVGhpcyBkaXYgc2hv
dWxkIG9ubHkgYmUgYXMgd2lkZSBhcyB0aGUgdGV4dCBpdCBjb250YWlucy4KICAgIDxkaXYgY2xh
c3M9ImZsZXhib3giPgogICAgICA8ZGl2IGNsYXNzPSJhIj5hYWFhYWFhYWFhYWFhYWFhYWFhYWFh
YWFhYWFhYWFhYWFhYWE8L2Rpdj4KICAgIDwvZGl2PgogIDwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>