Allow non-borders to be adjusted to less than 1 when zoomed out
authoreae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 23:26:06 +0000 (23:26 +0000)
committereae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 23:26:06 +0000 (23:26 +0000)
commit6d00283c56f6a5674746b545dea8e9005922d7fd
tree8368ff72a05c9f75b22686ba507e8ced49f83c68
parent03418681cad27720b4d0df5366beb046a3e59d0e
Allow non-borders to be adjusted to less than 1 when zoomed out
https://bugs.webkit.org/show_bug.cgi?id=90104

Reviewed by Eric Seidel.

Source/WebCore:

Change CSSPrimitiveValue::computeLengthDouble to allow values to be
adjusted to less than 1.0 when zoomed out. This avoids an off by one
error for floats with margins when zoomed out that can cause floats to
wrap and break pages.

The logic that prevents the value from being adjusted to less than 1 was
added to ensure that borders are still painted even when zoomed out.
By moving the logic to ApplyPropertyComputeLength::applyValue, which is
used for borders and outlines, that functionality is preserved.

Test: fast/sub-pixel/float-with-margin-in-container.html

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::computeLengthDouble):
* css/StyleBuilder.cpp:
(WebCore::ApplyPropertyComputeLength::applyValue):

LayoutTests:

Add test ensuring that floats with margins do not wrap in fixed sized
containers and update existing results as needed.

* fast/css/zoom-background-repeat-x.html:
* fast/sub-pixel/float-with-margin-in-container-expected.txt: Added.
* fast/sub-pixel/float-with-margin-in-container.html: Added.
* platform/chromium-linux/fast/reflections/reflection-with-zoom-expected.png:
* platform/chromium-linux/fast/transforms/bounding-rect-zoom-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.png:
* platform/chromium-mac/fast/transforms/bounding-rect-zoom-expected.txt:
* platform/chromium-mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt:
* platform/chromium-mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt:
* platform/chromium-win/fast/transforms/bounding-rect-zoom-expected.txt:
* platform/chromium-win/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt:
* platform/chromium-win/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt:
* platform/mac/fast/transforms/bounding-rect-zoom-expected.txt:
* platform/mac/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt:
* platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt:
* platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121599 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/zoom-background-repeat-x.html
LayoutTests/fast/sub-pixel/float-with-margin-in-container-expected.txt [new file with mode: 0644]
LayoutTests/fast/sub-pixel/float-with-margin-in-container.html [new file with mode: 0644]
LayoutTests/platform/chromium-linux/fast/reflections/reflection-with-zoom-expected.png
LayoutTests/platform/chromium-linux/fast/transforms/bounding-rect-zoom-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.png
LayoutTests/platform/chromium-mac/fast/transforms/bounding-rect-zoom-expected.txt
LayoutTests/platform/chromium-mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt
LayoutTests/platform/chromium-mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt
LayoutTests/platform/chromium-win/fast/transforms/bounding-rect-zoom-expected.txt
LayoutTests/platform/chromium-win/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt
LayoutTests/platform/chromium-win/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt
LayoutTests/platform/mac/fast/transforms/bounding-rect-zoom-expected.txt
LayoutTests/platform/mac/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2-expected.txt
LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt
LayoutTests/platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/StyleBuilder.cpp