Skip to content
  • rniwa@webkit.org's avatar
    The computed values of fix length padding should be subpixel precision like margin · 5088c1d5
    rniwa@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=118936
    
    Reviewed by Simon Fraser.
    
    Source/WebCore: 
    
    The bug was caused by ComputedStyleExtractor::propertyValue always returning the used value
    for padding. Fixed the bug by returning the computed value when they're of fixed length.
    
    This aligns the behaviors of getComputedStyle(~).padding~ with getComputedStyle(~).margin~,
    which had been fixed in r102149. While the current CSSOM specification says getComputedStyle
    should return the used values for margins when display property is set to anything but none,
    new behavior matches that of Chrome, Firefox, and Internet Explorer.
    
    Also extracted zoomAdjustedPaddingOrMarginPixelValue to reduce the code duplication.
    
    Test: fast/css/getComputedStyle/getComputedStyle-padding-margin-subpixel-length.html
    
    * css/CSSComputedStyleDeclaration.cpp:
    (WebCore::zoomAdjustedPaddingOrMarginPixelValue): Extracted.
    (WebCore::ComputedStyleExtractor::propertyValue):
    
    LayoutTests: 
    
    Add a regression test for obtaining the computed values of floating point padding and margin.
    They shouldn't be rounded to whole pixels.
    
    * fast/css/getComputedStyle/getComputedStyle-padding-margin-subpixel-length-expected.txt: Added.
    * fast/css/getComputedStyle/getComputedStyle-padding-margin-subpixel-length.html: Added.
    * fast/shapes/shape-inside/shape-inside-shape-logical-top-expected.html: Use a different technique to detect
    the subpixel layout since paddings
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    5088c1d5