Bug 79046 - width of overflow:hidden blocks is wrong when their margins overlap floats
: width of overflow:hidden blocks is wrong when their margins overlap floats
Status: RESOLVED FIXED
: WebKit
Layout and Rendering
: 528+ (Nightly build)
: Unspecified Unspecified
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-02-20 14:39 PST by
Modified: 2012-02-21 09:18 PST (History)


Attachments
Patch (266.16 KB, patch)
2012-02-20 14:54 PST, Dave Hyatt
mitz: review+
webkit.review.bot: commit‑queue-
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2012-02-20 14:39:22 PST
width of overflow:hidden blocks is wrong when their margins overlap floats. There are a couple of cases that we get wrong, but they all basically boil down to the fact that we need to stop thinking about shrinking to avoid floats as reducing the available content width and instead start thinking about it as reducing the object's width instead.
------- Comment #1 From 2012-02-20 14:40:09 PST -------
The relevant thread for discussion is:

http://lists.w3.org/Archives/Public/www-style/2012Feb/0954.html

See additional tests mentioned here:

http://lists.w3.org/Archives/Public/www-style/2012Feb/1007.html
------- Comment #2 From 2012-02-20 14:54:33 PST -------
Created an attachment (id=127854) [details]
Patch
------- Comment #3 From 2012-02-20 15:13:52 PST -------
(From update of attachment 127854 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=127854&action=review

> Source/WebCore/rendering/RenderBox.cpp:1261
> +        LayoutUnit offsetFromLogicalTopOfRegion = region ? region->offsetFromLogicalTopOfFirstPage() - offsetFromLogicalTopOfFirstPage : 0;

No need to test region here.

> LayoutTests/fast/block/float/centered-float-avoidance-complexity.html:69
> +  <h3>The orange stripe has 'overflow: auto', 'margin-left: auto' and 'margin-right: auto'<br> The lime stripes are floats with various width (topmost is 0, bottommost is 150px)<br>The wrapping container has a solid silver border.</h3>

This text is lying about the margins of the orange stripe. Might as well get it right.
------- Comment #4 From 2012-02-20 15:37:42 PST -------
(From update of attachment 127854 [details])
Attachment 127854 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11546579

New failing tests:
fast/forms/float-before-fieldset.html
fast/block/float/centered-float-avoidance-complexity.html
fast/block/float/shrink-to-avoid-float-complexity.html
------- Comment #5 From 2012-02-20 16:46:53 PST -------
fwiw, older bug on this: bug 19123.
------- Comment #6 From 2012-02-20 20:00:36 PST -------
(In reply to comment #3)

> > LayoutTests/fast/block/float/centered-float-avoidance-complexity.html:69
> > +  <h3>The orange stripe has 'overflow: auto', 'margin-left: auto' and 'margin-right: auto'<br>

> This text is lying about the margins of the orange stripe.

I fixed that error in 

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/Floats-And-BFCs-With-Margins-AG.html

Gérard
------- Comment #7 From 2012-02-21 09:17:44 PST -------
Fixed in r108364.
------- Comment #8 From 2012-02-21 09:18:45 PST -------
*** Bug 19123 has been marked as a duplicate of this bug. ***