REGRESSION (115573): Incorrect rounding of margins for floats
authoreae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 May 2012 00:15:34 +0000 (00:15 +0000)
committereae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 May 2012 00:15:34 +0000 (00:15 +0000)
commitd8487c76dd12b0c33fa8efaed2e7d563535aef2a
treec377a7e82f800ee90f8c81ca00f23c8609f5d2e6
parentb90e2a531f5a38ee5cdb1678b527723d8429f977
REGRESSION (115573): Incorrect rounding of margins for floats
https://bugs.webkit.org/show_bug.cgi?id=87319

Reviewed by Eric Seidel.

Source/WebCore:

In RenderBlock::computeInlinePreferredLogicalWidths we used a float to
accumulate margins for floating children while the children themselves
represent their margins as LayoutUnits. Due to lack of rounding this can
cause the block to be too small at certain certain zoom levels, causing
unwanted wrapping.

This patch changes computeInlinePreferredLogicalWidths to use a
LayoutUnit to accumulate the margins and thus ensures that the margin
values are rounded the same way.

Test: fast/block/float/floats-with-margin-should-not-wrap.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeInlinePreferredLogicalWidths):

LayoutTests:

Add new test ensuring that using margins with floats doesn't cause
undesired wrapping.

* fast/block/float/floats-with-margin-should-not-wrap-expected.txt: Added.
* fast/block/float/floats-with-margin-should-not-wrap.html: Added.
* platform/mac/fast/forms/001-expected.txt:
* platform/mac/fast/html/details-position-expected.txt:
* platform/mac/fast/replaced/width100percent-checkbox-expected.txt:
* platform/mac/fast/replaced/width100percent-radio-expected.txt:
* platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt:
* platform/mac/tables/mozilla/bugs/bug1318-expected.txt:
* platform/mac/tables/mozilla/bugs/bug4527-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/block/float/floats-with-margin-should-not-wrap-expected.txt [new file with mode: 0644]
LayoutTests/fast/block/float/floats-with-margin-should-not-wrap.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/001-expected.txt
LayoutTests/platform/mac/fast/html/details-position-expected.txt
LayoutTests/platform/mac/fast/replaced/width100percent-checkbox-expected.txt
LayoutTests/platform/mac/fast/replaced/width100percent-radio-expected.txt
LayoutTests/platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt
LayoutTests/platform/mac/tables/mozilla/bugs/bug1318-expected.txt
LayoutTests/platform/mac/tables/mozilla/bugs/bug4527-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp