<?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>77811</bug_id>
          
          <creation_ts>2012-02-04 12:04:03 -0800</creation_ts>
          <short_desc>auto-margin-centered block does not update when parent&apos;s padding-right changes</short_desc>
          <delta_ts>2013-09-16 11:27:57 -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>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yann Kaiser">kaiser.yann</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bobby</cc>
    
    <cc>robert</cc>
    
    <cc>shanestephens</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>549451</commentid>
    <comment_count>0</comment_count>
      <attachid>125498</attachid>
    <who name="Yann Kaiser">kaiser.yann</who>
    <bug_when>2012-02-04 12:04:03 -0800</bug_when>
    <thetext>Created attachment 125498
Test case

Consider the following:
* A block, let&apos;s call it container is positioned relatively.
* Inside it, we center horizontally another block using auto margins.
* We set padding-right on the container to a positive value
* The inner block is expected to shift to the left. It does not in WebKit.

The error is present in the r106740 nightly build of WebKit and in Chromium 16.0.912.77.
Firefox displays the inner block shifted to the left as expected.

The bug does not happen when changing padding-left.

Attached is a test case. For your convenience I hosted it on a web server here:
http://epsy.net46.net/stuff/webkit-margins-not-updating.html

If your browser/window manager allows it, you can try switching to the inspector while hovering. The inner box updates to the correct position if you change the selection in the Elements tab.

Another workaround I found was to also set a margin. Setting padding-left instead has no other effect than its own.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>552762</commentid>
    <comment_count>1</comment_count>
    <who name="Shane Stephens">shanestephens</who>
    <bug_when>2012-02-08 19:16:51 -0800</bug_when>
    <thetext>Confirmed present in Chrome 19.0.1035.0 canary</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>685788</commentid>
    <comment_count>2</comment_count>
    <who name="">bobby</who>
    <bug_when>2012-08-02 14:02:03 -0700</bug_when>
    <thetext>Just thought I&apos;d add another live test-case for this since we&apos;re running into it:

http://jsfiddle.net/YFGyp/5/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>929829</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Hogan">robert</who>
    <bug_when>2013-09-16 11:27:57 -0700</bug_when>
    <thetext>I can&apos;t reproduce this on trunk. Comment or re-open if you&apos;re still seeing this issue.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>125498</attachid>
            <date>2012-02-04 12:04:03 -0800</date>
            <delta_ts>2012-02-04 12:04:03 -0800</delta_ts>
            <desc>Test case</desc>
            <filename>webkit-margins-not-updating.html</filename>
            <type>text/html</type>
            <size>747</size>
            <attacher name="Yann Kaiser">kaiser.yann</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPHRpdGxlPldlYmtpdDogd2lkdGgg
bm90IHVwZGF0aW5nPC90aXRsZT4KICAgIDxtZXRhIGh0dHAtZXF1aXY9IkNvbnRlbnQtRW5jb2Rp
bmciIGNvbnRlbnQ9InV0ZjgiLz4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+CgojY29udGFp
bmVyCnsKICBiYWNrZ3JvdW5kOiBibHVlOwogIGRpc3BsYXk6IHJlbGF0aXZlOwp9CiNjb250YWlu
ZXI6aG92ZXIKewogIHBhZGRpbmctcmlnaHQ6IDMwJTsKfQojY2VudGVyZWQKewogIGJhY2tncm91
bmQ6IHJlZDsKICBtYXJnaW46IDAgYXV0bzsKICBoZWlnaHQ6IDEwMHB4OwogIHdpZHRoOiAxMDBw
eDsKfQojY29udGFpbmVyOmhvdmVyICNjZW50ZXJlZAp7CiAgcGFkZGluZzogMHB4Owp9CiAgICA8
L3N0eWxlPgogIDwvaGVhZD4KICA8Ym9keT4KICAgIDxkaXYgaWQ9ImNvbnRhaW5lciI+CiAgICAg
IDxkaXYgaWQ9ImNlbnRlcmVkIj48L2Rpdj4KICAgIDwvZGl2PgogICAgPG9sPgogICAgICA8bGk+
SG92ZXIgdGhlIGJsdWUgY29udGFpbmVyLiBUaGUgcmVkIHNxdWFyZSBkb2VzIG5vdCBtb3ZlLjwv
bGk+CiAgICAgIDxsaT5Td2l0Y2ggdG8gdGhlIGluc3BlY3RvciB3aXRob3V0IGxlYXZpbmcgdGhl
IGJsdWUgYXJlYS48L2xpPgogICAgICA8bGk+Q2hhbmdlIHRoZSBzZWxlY3Rpb24gaW4gdGhlIEVs
ZW1lbnRzIHRhYi4gVGhlIHNxdWFyZSBtb3ZlZC48L2xpPgogICAgPC9vbD4KICA8L2JvZHk+Cjwv
aHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>