Bug 58532 - Inconsistent calculation of the position of centered items
Summary: Inconsistent calculation of the position of centered items
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-14 05:29 PDT by Rimas Kudelis
Modified: 2011-07-15 15:47 PDT (History)
0 users

See Also:


Attachments
Test case (1.35 KB, text/html)
2011-04-14 05:29 PDT, Rimas Kudelis
no flags Details
A test case for the bug. Resize your window horizontally to see the inconsistency. (58 bytes, text/plain)
2011-07-15 15:47 PDT, Ian Storm Taylor
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rimas Kudelis 2011-04-14 05:29:18 PDT
Created attachment 89561 [details]
Test case

There is an inconsistency in WebKit between calculating the position of centered background image and centered (using margin: auto) block-level elements. When the size of a centered background or element differs from the size of what it is being centered in by an odd number (e.g. the element/background is 100px wide, and its parent is 151px wide), the centered backgound will be offset 0.5px to the right from the exact center, but a centered block-level element will be offset to the 0.5px to the left from it.

This inconsistency slightly breaks design of websites which expect those calculations to be consistent.

Test case attached. If everything looks fine in it, try resizing your window horizontally.
Comment 1 Ian Storm Taylor 2011-07-15 15:47:06 PDT
Created attachment 101058 [details]
A test case for the bug. Resize your window horizontally to see the inconsistency.

Added another test case that makes the problem really obvious. Just resize your browser.