<?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>4379</bug_id>
          
          <creation_ts>2005-08-10 18:55:01 -0700</creation_ts>
          <short_desc>negative margins allowed where they should not</short_desc>
          <delta_ts>2005-08-19 15:11:43 -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>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Antti Koivisto">koivisto</reporter>
          <assigned_to name="Dave Hyatt">hyatt</assigned_to>
          <cc>darin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>16400</commentid>
    <comment_count>0</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2005-08-10 18:55:01 -0700</bug_when>
    <thetext>When making window narrow, the navigation bar on top of moneycentral.msn.com
flows out of the view from left. The behavior is different from Gecko/IE where
it stays fully in the view even when window is narrow. The problem is that in
webcore a table with margin-left:auto is allowed to have negative calculated
margin. 

Acutally, it seems that the following rule (css2.1, 10.3.3) is not respected,
even with normal block boxes:

If &apos;width&apos; is not &apos;auto&apos; and &apos;border-left-width&apos; + &apos;padding-left&apos; + &apos;width&apos; +
&apos;padding-right&apos; + &apos;border-right-width&apos; (plus any of &apos;margin-left&apos; or
&apos;margin-right&apos; that are not &apos;auto&apos;) is larger than the width of the containing
block, then any &apos;auto&apos; values for &apos;margin-left&apos; or &apos;margin-right&apos; are, for the
following rules, treated as zero.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16401</commentid>
    <comment_count>1</comment_count>
      <attachid>3330</attachid>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2005-08-10 19:00:53 -0700</bug_when>
    <thetext>Created attachment 3330
test case for tables

make page narrow to see the problem</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16402</commentid>
    <comment_count>2</comment_count>
      <attachid>3331</attachid>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2005-08-10 19:01:35 -0700</bug_when>
    <thetext>Created attachment 3331
test case for blocks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16462</commentid>
    <comment_count>3</comment_count>
      <attachid>3347</attachid>
    <who name="David Carson">dacarson</who>
    <bug_when>2005-08-11 17:00:22 -0700</bug_when>
    <thetext>Created attachment 3347
margin calculation patch

for boxes in normal flow with non-auto width, treat auto margins as 0 if
width&gt;containing width</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16471</commentid>
    <comment_count>4</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2005-08-11 22:56:17 -0700</bug_when>
    <thetext>Yup, this patch is a flawless fix.  Good job.  r=me
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16472</commentid>
    <comment_count>5</comment_count>
      <attachid>3347</attachid>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2005-08-11 22:58:02 -0700</bug_when>
    <thetext>Comment on attachment 3347
margin calculation patch

r=me.  Might be worth adding a comment that when you fall into the final else
case, auto margins will end up being 0 when you call minWidth and assign into
m_marginLeft and m_marginRight.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16540</commentid>
    <comment_count>6</comment_count>
      <attachid>3356</attachid>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2005-08-12 12:13:14 -0700</bug_when>
    <thetext>Created attachment 3356
margin calculation patch with comment

(i was apparently logged in as David when submitting the patch)

Added comment</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16673</commentid>
    <comment_count>7</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2005-08-14 20:41:01 -0700</bug_when>
    <thetext>I&apos;m ready to land this, but I&apos;ll need to change the test cases into suitable files for the layout-tests directory 
(explaining what they are testing and what good vs. bad results look like).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16685</commentid>
    <comment_count>8</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2005-08-14 22:02:57 -0700</bug_when>
    <thetext>I tried, but I can&apos;t figure out the desired results from the test cases. I&apos;m going to leave this patch until 
someone who does understand them (Antti or Dave perhaps?) turns them into suitable layout tests by 
adding some explanation, or puts notes here enough to let me do that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16686</commentid>
    <comment_count>9</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2005-08-14 22:03:12 -0700</bug_when>
    <thetext>I tried, but I can&apos;t figure out the desired results from the test cases. I&apos;m going to leave this patch until 
someone who does understand them (Antti or Dave perhaps?) turns them into suitable layout tests by 
adding some explanation, or puts notes here enough to let me do that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16752</commentid>
    <comment_count>10</comment_count>
      <attachid>3417</attachid>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2005-08-15 21:29:45 -0700</bug_when>
    <thetext>Created attachment 3417
cleaned up test case with an explanation</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3330</attachid>
            <date>2005-08-10 19:00:53 -0700</date>
            <delta_ts>2005-08-15 21:29:45 -0700</delta_ts>
            <desc>test case for tables</desc>
            <filename>msn.html</filename>
            <type>text/html</type>
            <size>413</size>
            <attacher name="Antti Koivisto">koivisto</attacher>
            
              <data encoding="base64">PGh0bWw+PGhlYWQ+DQo8c3R5bGU+DQp0YWJsZXttYXJnaW46MCAwIDAgYXV0b30NCnRke3doaXRl
LXNwYWNlOm5vd3JhcDsgZm9udC1zaXplOiAzMHB4fQ0KPC9zdHlsZT4NCg0KPGJvZHkgc3R5bGU9
ImJvcmRlcjogMnB4IHNvbGlkIGJsdWUiPg0KCTx0YWJsZSBzdHlsZT0iYm9yZGVyOiAycHggc29s
aWQgcmVkIj4NCgkJPHRib2R5Pg0KCQkJPHRyPg0KCQkJCTx0ZD4NCgkJCQkJTVNOIEhvbWUNCgkJ
CQkJTXkgTVNODQoJCQkJCUhvdG1haWwNCgkJCQkJU2hvcHBpbmcNCgkJCQkJTW9uZXkgYWZldWFr
ZndlYQ0KCQkJCQlQZW9wbGUgQ2hhdA0KCQkJCQlTaG9wcGluZw0KCQkJCQlNb25leSBhZmV1YWtm
d2VhDQoJCQkJCVANCgkJCQk8L3RkPg0KCQkJPC90cj4NCgkJPC90Ym9keT4NCgk8L3RhYmxlPg0K
PC9ib2R5PjwvaHRtbD4=
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3331</attachid>
            <date>2005-08-10 19:01:35 -0700</date>
            <delta_ts>2005-08-15 21:29:45 -0700</delta_ts>
            <desc>test case for blocks</desc>
            <filename>msn2.html</filename>
            <type>text/html</type>
            <size>252</size>
            <attacher name="Antti Koivisto">koivisto</attacher>
            
              <data encoding="base64">PGh0bWwgPjxoZWFkPg0KPHN0eWxlPg0KI04xYSBkaXZ7bWFyZ2luOjAgMCAwIGF1dG87IGJvcmRl
cjogMnB4IHNvbGlkIHJlZDsgZm9udC1zaXplOiAzMHB4OyB3aWR0aDogODAwcHh9DQo8L3N0eWxl
Pg0KDQo8Ym9keSBpZD0iTjFhIiBzdHlsZT0iYm9yZGVyOiAycHggc29saWQgYmx1ZSI+DQoNCgk8
ZGl2Pg0KCQkJCQlNU05Ib21lTXlNU05Ib3RtYWlsU2hvcHBpbmdNb25leWFmZXVha2Z3ZWENCg0K
PC9kaXY+DQoNCjwvYm9keT48L2h0bWw+
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>3347</attachid>
            <date>2005-08-11 17:00:22 -0700</date>
            <delta_ts>2005-08-14 20:40:19 -0700</delta_ts>
            <desc>margin calculation patch</desc>
            <filename>margin.diff</filename>
            <type>text/plain</type>
            <size>1591</size>
            <attacher name="David Carson">dacarson</attacher>
            
              <data encoding="base64">SW5kZXg6IGtodG1sL3JlbmRlcmluZy9yZW5kZXJfYm94LmNwcAo9PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxl
OiAvY3ZzL3Jvb3QvV2ViQ29yZS9raHRtbC9yZW5kZXJpbmcvcmVuZGVyX2JveC5jcHAsdgpyZXRy
aWV2aW5nIHJldmlzaW9uIDEuMTYwCmRpZmYgLXAgLXUgLXIxLjE2MCBraHRtbC9yZW5kZXJpbmcv
cmVuZGVyX2JveC5jcHAKLS0tIGtodG1sL3JlbmRlcmluZy9yZW5kZXJfYm94LmNwcAkzMCBKdWwg
MjAwNSAwMjozMzoyMiAtMDAwMAkxLjE2MAorKysga2h0bWwvcmVuZGVyaW5nL3JlbmRlcl9ib3gu
Y3BwCTExIEF1ZyAyMDA1IDIzOjQ2OjEyIC0wMDAwCkBAIC05MjAsNyArOTIwLDcgQEAgdm9pZCBS
ZW5kZXJCb3g6OmNhbGNIb3Jpem9udGFsTWFyZ2lucyhjbwogICAgIH0KICAgICBlbHNlCiAgICAg
ewotICAgICAgICBpZiAoIChtbC50eXBlID09IFZhcmlhYmxlICYmIG1yLnR5cGUgPT0gVmFyaWFi
bGUpIHx8CisgICAgICAgIGlmICggKG1sLnR5cGUgPT0gVmFyaWFibGUgJiYgbXIudHlwZSA9PSBW
YXJpYWJsZSAmJiBtX3dpZHRoPGN3KSB8fAogICAgICAgICAgICAgIChtbC50eXBlICE9IFZhcmlh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JiBjb250YWluaW5nQmxvY2soKS0+c3R5bGUoKS0+
ZGlyZWN0aW9uKCkgPT0gTFRSICYmCiAgICAgICAgICAgICAgICAgICBjb250YWluaW5nQmxvY2so
KS0+c3R5bGUoKS0+dGV4dEFsaWduKCkgPT0gS0hUTUxfUklHSFQpKQogICAgICAgICB7Cg==
</data>
<flag name="review"
          id="356"
          type_id="1"
          status="+"
          setter="hyatt"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>3356</attachid>
            <date>2005-08-12 12:13:14 -0700</date>
            <delta_ts>2005-08-14 20:40:10 -0700</delta_ts>
            <desc>margin calculation patch with comment</desc>
            <filename>margin2.diff</filename>
            <type>text/plain</type>
            <size>1886</size>
            <attacher name="Antti Koivisto">koivisto</attacher>
            
              <data encoding="base64">SW5kZXg6IGtodG1sL3JlbmRlcmluZy9yZW5kZXJfYm94LmNwcAo9PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxl
OiAvY3ZzL3Jvb3QvV2ViQ29yZS9raHRtbC9yZW5kZXJpbmcvcmVuZGVyX2JveC5jcHAsdgpyZXRy
aWV2aW5nIHJldmlzaW9uIDEuMTYwCmRpZmYgLXAgLXUgLXIxLjE2MCBraHRtbC9yZW5kZXJpbmcv
cmVuZGVyX2JveC5jcHAKLS0tIGtodG1sL3JlbmRlcmluZy9yZW5kZXJfYm94LmNwcAkzMCBKdWwg
MjAwNSAwMjozMzoyMiAtMDAwMAkxLjE2MAorKysga2h0bWwvcmVuZGVyaW5nL3JlbmRlcl9ib3gu
Y3BwCTEyIEF1ZyAyMDA1IDE5OjA4OjE5IC0wMDAwCkBAIC05MjAsNyArOTIwLDcgQEAgdm9pZCBS
ZW5kZXJCb3g6OmNhbGNIb3Jpem9udGFsTWFyZ2lucyhjbwogICAgIH0KICAgICBlbHNlCiAgICAg
ewotICAgICAgICBpZiAoIChtbC50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dDsKICAgICAgICAg
fQotICAgICAgICBlbHNlIGlmIChtbC50eXBlID09IFZhcmlhYmxlIHx8CisgICAgICAgIGVsc2Ug
aWYgKCAobWwudHlwZSA9PSBWYXJpYWJsZSAmJiBtX3dpZHRoPGN3KSB8fAogICAgICAgICAgICAg
ICAgICAobXIudHlwZSAhPSBWYXJpYWJsZSAmJiBjb250YWluaW5nQmxvY2soKS0+c3R5bGUoKS0+
ZGlyZWN0aW9uKCkgPT0gTFRSICYmCiAgICAgICAgICAgICAgICAgICBjb250YWluaW5nQmxvY2so
KS0+c3R5bGUoKS0+dGV4dEFsaWduKCkgPT0gS0hUTUxfUklHSFQpKQogICAgICAgICB7CkBAIC05
NDQsNiArOTQ0LDcgQEAgdm9pZCBSZW5kZXJCb3g6OmNhbGNIb3Jpem9udGFsTWFyZ2lucyhjbwog
ICAgICAgICB9CiAgICAgICAgIGVsc2UKICAgICAgICAgeworICAgICAgICAgICAgLy8gdGhpcyBt
YWtlcyBhdXRvIG1hcmdpbnMgMCBpZiB3ZSBmYWlsZWQgYSBtX3dpZHRoPGN3IHRlc3QgYWJvdmUg
KGNzczIuMSwgMTAuMy4zKQogICAgICAgICAgICAgbV9tYXJnaW5MZWZ0ID0gbWwubWluV2lkdGgo
Y3cpOwogICAgICAgICAgICAgbV9tYXJnaW5SaWdodCA9IG1yLm1pbldpZHRoKGN3KTsKICAgICAg
ICAgfQo=
</data>
<flag name="review"
          id="371"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3417</attachid>
            <date>2005-08-15 21:29:45 -0700</date>
            <delta_ts>2005-08-15 21:29:45 -0700</delta_ts>
            <desc>cleaned up test case with an explanation</desc>
            <filename>margin-auto.html</filename>
            <type>text/html</type>
            <size>747</size>
            <attacher name="Antti Koivisto">koivisto</attacher>
            
              <data encoding="base64">PGh0bWw+PGhlYWQ+CjxzdHlsZT4KI2NvbnRhaW5lciB7Ym9yZGVyOiAycHggc29saWQgYmx1ZX0K
dGFibGV7bWFyZ2luOiAwIDAgMCBhdXRvIDsgYm9yZGVyOiAycHggc29saWQgcmVkfQp0ZHt3aGl0
ZS1zcGFjZTogbm93cmFwO30KI2Ige21hcmdpbjogMCAwIDAgYXV0bzsgd2lkdGg6IDkwMHB4OyBi
b3JkZXI6IDJweCBzb2xpZCByZWQ7fQo8L3N0eWxlPgoKPGJvZHk+CjxkaXYgaWQ9Y29udGFpbmVy
PgoJUmVzaXplIHRoZSB3aW5kb3cuIFJlZCBib3hlcyBiZWxvdyBtdXN0IG5vdCBvdmVyZmxvdyB0
aGUgYmx1ZSBib3ggKG9yIHdpbmRvdykgZnJvbSB0aGUgCglsZWZ0IHNpZGUsIHRob3VnaCB0aGV5
IG1heSBvdmVyZmxvdyBmcm9tIHJpZ2h0Ljxicj48YnI+Cgk8dGFibGU+CgkJPHRib2R5PgoJCQk8
dHI+CgkJCQk8dGQ+CgkJCQlCbGFibGEgYmxhaC4gQmxhYmxhIGJsYWguIEJsYWJsYSBibGFoLiBC
bGFibGEgYmxhaC4gQmxhYmxhIGJsYWguIEJsYWJsYSBibGFoLgoJCQkJQmxhYmxhIGJsYWguIEJs
YWJsYSBibGFoLiBCbGFibGEgYmxhaC4gQmxhYmxhIGJsYWguIEJsYWJsYSBibGFoLiBCbGFibGEg
YmxhaC4KCQkJCTwvdGQ+CgkJCTwvdHI+CgkJPC90Ym9keT4KCTwvdGFibGU+CgkKCTxkaXYgaWQ9
Yj4KCQkJQmxhYmxhIGJsYWguIEJsYWJsYSBibGFoLiBCbGFibGEgYmxhaC4gQmxhYmxhIGJsYWgu
IEJsYWJsYSBibGFoLiBCbGFibGEgYmxhaC4KICAgPC9kaXY+CQo8L2Rpdj4gICAKPC9ib2R5Pgo8
L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>