Skip to content
  • leviw@chromium.org's avatar
    Background images can incorrectly repeat with sub-pixel layout · 89962e34
    leviw@chromium.org authored
    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: http://svn.webkit.org/repository/webkit/trunk@132731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    89962e34