Bug 77811 - auto-margin-centered block does not update when parent's padding-right changes
Summary: auto-margin-centered block does not update when parent's padding-right changes
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Major
Assignee: Nobody
Depends on:
Reported: 2012-02-04 12:04 PST by Yann Kaiser
Modified: 2013-09-16 11:27 PDT (History)
3 users (show)

See Also:

Test case (747 bytes, text/html)
2012-02-04 12:04 PST, Yann Kaiser
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yann Kaiser 2012-02-04 12:04:03 PST
Created attachment 125498 [details]
Test case

Consider the following:
* A block, let'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:

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.
Comment 1 Shane Stephens 2012-02-08 19:16:51 PST
Confirmed present in Chrome 19.0.1035.0 canary
Comment 2 bobby 2012-08-02 14:02:03 PDT
Just thought I'd add another live test-case for this since we're running into it:

Comment 3 Robert Hogan 2013-09-16 11:27:57 PDT
I can't reproduce this on trunk. Comment or re-open if you're still seeing this issue.