Bug 106374 - REGRESSION(r136967): margin-top + overflow:hidden causes incorrect layout for internal floated elements
Summary: REGRESSION(r136967): margin-top + overflow:hidden causes incorrect layout for...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Robert Hogan
URL: http://codepen.io/weshardee/pen/jqDvd
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-08 13:45 PST by Tony Chang
Modified: 2013-01-10 10:40 PST (History)
5 users (show)

See Also:


Attachments
Patch (4.97 KB, patch)
2013-01-08 15:21 PST, Robert Hogan
no flags Details | Formatted Diff | Diff
Patch (5.20 KB, patch)
2013-01-09 11:03 PST, Robert Hogan
no flags Details | Formatted Diff | Diff
Patch (5.37 KB, patch)
2013-01-09 13:35 PST, Robert Hogan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chang 2013-01-08 13:45:01 PST
This was reported at http://crbug.com/168511.

The test case is in the URL.  It looks like we're getting the wrong margin top for the second float?  In Firefox, the 3 white boxes are on the same horizontal line.

Robert, can you take a look?
Comment 1 Robert Hogan 2013-01-08 15:21:17 PST
Created attachment 181782 [details]
Patch
Comment 2 Tony Chang 2013-01-08 17:18:54 PST
Comment on attachment 181782 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=181782&action=review

Looks good to me, but might want to have hyatt take a quick peek.

> LayoutTests/fast/block/margin-collapse/self-collapsing-block-with-overflow-hidden-and-float-child.html:21
> +<div class="outside">
> +    <div class="inside"></div>
> +    <div class="inside"></div>
> +</div>

Nit: Can you either add some text saying what the expected output should be or change this to a js test (e.g., using check-layout.js) that will print PASS/FAIL?  Ref-tests are also slower than dumpAsText tests.
Comment 3 Robert Hogan 2013-01-09 11:03:35 PST
Created attachment 181952 [details]
Patch
Comment 4 Dave Hyatt 2013-01-09 12:49:09 PST
Comment on attachment 181952 [details]
Patch

This will break the case where the overflow:hidden self-collapsing block legitimately has to clear a float because it doesn't fit, etc. This is the reason we don't just check style()->clear(), since you can clear for other reasons besides just having the style set. The more interesting question to me is why this block is claiming that it has clearance when it obviously shouldn't.
Comment 5 Robert Hogan 2013-01-09 13:35:36 PST
Created attachment 181975 [details]
Patch
Comment 6 Dave Hyatt 2013-01-09 13:53:55 PST
Comment on attachment 181975 [details]
Patch

r=me
Comment 7 WebKit Review Bot 2013-01-10 10:40:42 PST
Comment on attachment 181975 [details]
Patch

Clearing flags on attachment: 181975

Committed r139337: <http://trac.webkit.org/changeset/139337>
Comment 8 WebKit Review Bot 2013-01-10 10:40:46 PST
All reviewed patches have been landed.  Closing bug.