Background images can incorrectly repeat with sub-pixel layout
authorleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 27 Oct 2012 17:18:12 +0000 (17:18 +0000)
committerleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 27 Oct 2012 17:18:12 +0000 (17:18 +0000)
commit5a8b292908465dd840ea744883f2b8a01e7c1a07
tree1e6e47d30c7e1bc7bf0bfb540fc4664569e164a7
parent03e129099723d3d55324a5458bab0fe0cf648316
Background images can incorrectly repeat with sub-pixel layout
https://bugs.webkit.org/show_bug.cgi?id=94622

Reviewed by Emil A Eklund.

Source/WebCore:

Attempting to better match author expectations when painting tiled background images. When under
the effects of zoom with sub-pixel layout enabled, the drawn size of a rendered element can
differ depending on its location. This change looks at the size of the scaled tiled background
image size, and either ceils or floors that value depending on if tiling that value will
result in us being one pixel or less short of covering the background size. This is a heuristic,
as sub-pixel/zooming isn't specced.

Test: fast/sub-pixel/scaled-background-image.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::applySubPixelHeuristicForTileSize):
(WebCore):
(WebCore::RenderBoxModelObject::calculateFillTileSize):

LayoutTests:

* fast/sub-pixel/scaled-background-image-expected.html: Added.
* fast/sub-pixel/scaled-background-image.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/sub-pixel/scaled-background-image-expected.html [new file with mode: 0644]
LayoutTests/fast/sub-pixel/scaled-background-image.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBoxModelObject.cpp