Bug 19123 - An element with block formatting context adjacent to a floated block has phantom right margin.
Summary: An element with block formatting context adjacent to a floated block has phan...
Status: RESOLVED DUPLICATE of bug 79046
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-18 22:47 PDT by Philippe Wittenbergh
Modified: 2012-02-21 09:18 PST (History)
8 users (show)

See Also:


Attachments
testcase (811 bytes, text/html)
2008-05-18 22:47 PDT, Philippe Wittenbergh
no flags Details
testcase2 (772 bytes, text/html)
2008-05-19 06:11 PDT, Philippe Wittenbergh
no flags Details
Test case showing float-overflow-margin bug (933 bytes, text/html)
2009-12-16 07:50 PST, Jonas Munk
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Wittenbergh 2008-05-18 22:47:07 PDT
An element that establishes a new block formatting context – overflow:hidden in testcase – (per CSS2.1:9.4.1), has a left-margin, and is adjacent to a left floated block, has a phantom margin on the right side, equivalent in width to its left-margin.

Actual result: a 20px gap at the right of the element.

Expected result: no gap. Compare rendering in (recent) Gecko 1.9 builds.

tested with WebKit-SVN-r33561, Safari 3.1.1 and anything older

Note: with a right floated element and a right-margin on the element with block formatting, the margin is applied between the float and element, contradicting CSS2.1:9.5
Comment 1 Philippe Wittenbergh 2008-05-18 22:47:53 PDT
Created attachment 21225 [details]
testcase
Comment 2 Philippe Wittenbergh 2008-05-19 06:11:04 PDT
Created attachment 21227 [details]
testcase2

for completeness' sake, a testcase with float:right and margin right on the main block. The margin-box should slide under the floated block (per CSS2.1:9.5)
Comment 3 mitz 2008-05-19 07:51:44 PDT
I think this is a duplicate.
Comment 4 Oded Arbel 2009-06-04 13:26:41 PDT
I think this is the same issue I have - a floated element causes the elements it floats next to, if they have both margin and   overflow set to non-visible, to have a phantom right margin: http://geek.co.il/articles/webkit-margin-with-float-bug.html

As the testcase in this URL shows, the phantom margin is sized according to the size of the floated element.

I can reproduce this with all webkit installations (Safari/Win, Safari/MacOSX, Chrome/Win, Chromium/Linux and even Konqueror), including nightlies. Bug #22089 may also be related.
Comment 5 Paranoid Android 2009-07-19 03:27:41 PDT
Same as bug 22089 (which has a somewhat clearer test case).
Comment 6 Jonas Munk 2009-12-16 07:50:10 PST
Created attachment 44977 [details]
Test case showing float-overflow-margin bug

Thought i might as well attach this test case since I already made it, hope it helps :-)

This technique is very common so I would consider it to be fairly critical.
Comment 7 Darth 2011-01-29 20:59:29 PST
Similar downstream bug http://code.google.com/p/chromium/issues/detail?id=69052
Comment 8 Dave Hyatt 2012-02-21 09:18:45 PST

*** This bug has been marked as a duplicate of bug 79046 ***