snapToSize rounds the incorrectly for negative locations
authoreae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2012 15:35:12 +0000 (15:35 +0000)
committereae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2012 15:35:12 +0000 (15:35 +0000)
commit11009034342f66544142f6403e4544b4139e73f2
tree4f822ed38312221eb5f28e948b035c9a73d76ff8
parent6df62548347e9025872720f649eb00f9e4e7201e
snapToSize rounds the incorrectly for negative locations
https://bugs.webkit.org/show_bug.cgi?id=97265

Reviewed by Eric Seidel.

Source/WebCore:

Change snapSizeToPixel to preserve sign for location which
affects rounding.

Test: fast/sub-pixel/snap-negative-location.html

* platform/FractionalLayoutUnit.h:
(WebCore::snapSizeToPixel):

LayoutTests:

Add test for snapSizeToPixel handling of negative locations.
Skipped on platforms that do not enable subpixel layout.

* fast/sub-pixel/snap-negative-location-expected.html: Added.
* fast/sub-pixel/snap-negative-location.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@129370 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/sub-pixel/snap-negative-location-expected.html [new file with mode: 0644]
LayoutTests/fast/sub-pixel/snap-negative-location.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/platform/FractionalLayoutUnit.h