Background width (or height) is wrong if width (or height) * zoom < 1.
authorshinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 08:39:58 +0000 (08:39 +0000)
committershinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 08:39:58 +0000 (08:39 +0000)
commita2bc0bdcf3b0bfafdd848506605c93b97b8a5266
tree8b4e2e429dcea4c6cf15d24e44dec9831fcedad5
parent0aef935e1a6de1f3d6af4db9449052d690d36775
Background width (or height) is wrong if width (or height) * zoom < 1.
https://bugs.webkit.org/show_bug.cgi?id=83350

Reviewed by Nikolas Zimmermann.

Source/WebCore:

calculateImageIntrinsicDimension will return wrong size if the calculated size is 0.
0 is used for expressing unspecfied, so the method returns the box width(height) instead.

Since CachedImage has already similar code, we moved it to IntSize and shared it.

Tests: fast/css/zoom-background-repeat-x-expected.html
       fast/css/zoom-background-repeat-x.html
       fast/css/zoom-background-repeat-y-expected.html
       fast/css/zoom-background-repeat-y.html

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::imageSizeForRenderer):
* platform/graphics/IntSize.h:
(IntSize):
(WebCore::IntSize::scale):
(WebCore::IntSize::clampToMinimumSize):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):

LayoutTests:

* fast/css/zoom-background-repeat-x-expected.html: Added.
* fast/css/zoom-background-repeat-x.html: Added.
* fast/css/zoom-background-repeat-y-expected.html: Added.
* fast/css/zoom-background-repeat-y.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114095 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/zoom-background-repeat-x-expected.html [new file with mode: 0644]
LayoutTests/fast/css/zoom-background-repeat-x.html [new file with mode: 0644]
LayoutTests/fast/css/zoom-background-repeat-y-expected.html [new file with mode: 0644]
LayoutTests/fast/css/zoom-background-repeat-y.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/platform/graphics/IntSize.h
Source/WebCore/rendering/RenderBoxModelObject.cpp