Float imprecision causes incorrect wrapping in LineLayout with subpixel layout
authoreae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Aug 2012 04:03:52 +0000 (04:03 +0000)
committereae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Aug 2012 04:03:52 +0000 (04:03 +0000)
commitcf2f22e359d66c5ebb32ee39ffe25da87cf5fd50
tree75cb9d25fd4ae7d51402dea2ee468a62e06329db
parentccd2586ffdc7b44d59cff28f67284e6e511805ea
Float imprecision causes incorrect wrapping in LineLayout with subpixel layout
https://bugs.webkit.org/show_bug.cgi?id=92778

Reviewed by Eric Seidel.

Source/WebCore:

Due to float imprecision an incorrect wrapping decision is made in
certain cases where the values being compare are close but not exactly
the same. This can happen as the size of blocks is represented in layout
units while line layout uses floats.

Test: fast/sub-pixel/inline-block-should-not-wrap.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::LineWidth::fitsOnLine):
Use LayoutUnit::epsilon when comparing values as that is the maximum
precision we support.

LayoutTests:

Add test ensuring that an inline block isn't wrapped incorrectly.

* fast/sub-pixel/inline-block-should-not-wrap-expected.html: Added.
* fast/sub-pixel/inline-block-should-not-wrap.html: Added.
* platform/mac-lion/Skipped:
* platform/mac-snowleopard/Skipped:
* platform/mac-wk2/Skipped:
* platform/mac/Skipped:
* platform/qt-4.8/Skipped:
* platform/qt/Skipped:
* platform/win-wk2/Skipped:
* platform/win-xp/Skipped:
* platform/win/Skipped:
* platform/wincairo/Skipped:
* platform/wk2/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/sub-pixel/inline-block-should-not-wrap-expected.html [new file with mode: 0644]
LayoutTests/fast/sub-pixel/inline-block-should-not-wrap.html [new file with mode: 0644]
LayoutTests/platform/mac-lion/Skipped
LayoutTests/platform/mac-snowleopard/Skipped
LayoutTests/platform/mac-wk2/Skipped
LayoutTests/platform/mac/Skipped
LayoutTests/platform/qt-4.8/Skipped
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win-wk2/Skipped
LayoutTests/platform/win-xp/Skipped
LayoutTests/platform/win/Skipped
LayoutTests/platform/wincairo/Skipped
LayoutTests/platform/wk2/Skipped
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlockLineLayout.cpp