Changeset 162559 in webkit


Ignore:
Timestamp:
Jan 22, 2014 2:56:17 PM (10 years ago)
Author:
Alan Bujtas
Message:

[CSS Shapes] shape-inside rectangle layout can fail
https://bugs.webkit.org/show_bug.cgi?id=124784

Reviewed by Darin Adler.

Early subpixel rounding/flooring/ceiling can have unwanted
side effect on the final pixel value. Delay pixel
conversions as much as possible.

Existing test is changed to reflect subpixel functionality.

Source/WebCore:

  • rendering/shapes/RectangleShape.cpp:

(WebCore::RectangleShape::firstIncludedIntervalLogicalTop):

LayoutTests:

  • fast/shapes/shape-inside/shape-inside-subpixel-rectangle-top-expected.html:
  • platform/mac/TestExpectations:
  • platform/win/TestExpectations:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r162553 r162559  
     12014-01-22  Zalan Bujtas  <zalan@apple.com>
     2
     3        [CSS Shapes] shape-inside rectangle layout can fail
     4        https://bugs.webkit.org/show_bug.cgi?id=124784
     5
     6        Reviewed by Darin Adler.
     7
     8        Early subpixel rounding/flooring/ceiling can have unwanted
     9        side effect on the final pixel value. Delay pixel
     10        conversions as much as possible.
     11
     12        Existing test is changed to reflect subpixel functionality.
     13
     14        * fast/shapes/shape-inside/shape-inside-subpixel-rectangle-top-expected.html:
     15        * platform/mac/TestExpectations:
     16        * platform/win/TestExpectations:
     17
    1182014-01-22  Zalan Bujtas  <zalan@apple.com>
    219
  • trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-subpixel-rectangle-top-expected.html

    r159821 r162559  
    22<html>
    33<head>
     4<script src="../resources/subpixel-utils.js"></script>
    45<style>
    56    #shape-inside {
     
    910        background-color: grey;
    1011        width: 200px;
    11         height: 198px;
    12         padding-top: 2px;
     12        height: 198.7px;
     13        padding-top: 1.3px;
    1314    }
    1415</style>
     
    1617<body>
    1718    <div id="shape-inside">X</div>
     19<script>
     20    if (!SubPixelLayout.isEnabled()) {
     21        var divX = document.getElementById("shape-inside");
     22        divX.style.paddingTop = "2px";
     23        divX.offsetHeight;
     24        }
     25</script>
    1826</body>
    1927</html>
  • trunk/LayoutTests/platform/mac/TestExpectations

    r162494 r162559  
    13351335webkit.org/b/126889 fast/forms/number/number-size.html [ Failure ]
    13361336
    1337 # webkit.org/b/124784 needs revisiting.
    1338 webkit.org/b/124784 fast/shapes/shape-inside/shape-inside-subpixel-rectangle-top.html [ ImageOnlyFailure ]
    1339 
    13401337# Subpixel: off-by-1 pixel rendering on mathml
    13411338webkit.org/b/126897 mathml/presentation/bug95015.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/platform/win/TestExpectations

    r162425 r162559  
    28712871
    28722872# Subpixel failures
    2873 # webkit.org/b/124784 needs revisiting.
    2874 webkit.org/b/124784 fast/shapes/shape-inside/shape-inside-subpixel-rectangle-top.html [ ImageOnlyFailure ]
    2875 
    28762873# Subpixel: off-by-1 pixel rendering on mathml
    28772874webkit.org/b/126897 mathml/presentation/bug95015.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r162555 r162559  
     12014-01-22  Zalan Bujtas  <zalan@apple.com>
     2
     3        [CSS Shapes] shape-inside rectangle layout can fail
     4        https://bugs.webkit.org/show_bug.cgi?id=124784
     5
     6        Reviewed by Darin Adler.
     7
     8        Early subpixel rounding/flooring/ceiling can have unwanted
     9        side effect on the final pixel value. Delay pixel
     10        conversions as much as possible.
     11
     12        Existing test is changed to reflect subpixel functionality.
     13
     14        * rendering/shapes/RectangleShape.cpp:
     15        (WebCore::RectangleShape::firstIncludedIntervalLogicalTop):
     16
    1172014-01-22  Jochen Eisinger  <jochen@chromium.org>
    218
  • trunk/Source/WebCore/rendering/shapes/RectangleShape.cpp

    r161604 r162559  
    174174        return false;
    175175
    176     float minY = LayoutUnit::fromFloatCeil(std::max(bounds.y(), minIntervalTop));
     176    float minY = std::max(bounds.y(), minIntervalTop);
    177177    float maxY = minY + minIntervalHeight;
    178178
     
    187187
    188188    if (!intervalOverlapsMinCorner && !intervalOverlapsMaxCorner) {
    189         result = minY;
     189        result = ceiledLayoutUnit(minY);
    190190        return true;
    191191    }
     
    198198    if (intervalOverlapsMinCorner && (!intervalOverlapsMaxCorner || minCornerDefinesX)) {
    199199        if (intervalFitsWithinCorners || bounds.y() + cornerIntercept.y() < minY) {
    200             result = minY;
     200            result = ceiledLayoutUnit(minY);
    201201            return true;
    202202        }
    203203        if (minIntervalHeight < bounds.height() - (2 * cornerIntercept.y())) {
    204             result = LayoutUnit::fromFloatCeil(bounds.y() + cornerIntercept.y());
     204            result = ceiledLayoutUnit(bounds.y() + cornerIntercept.y());
    205205            return true;
    206206        }
     
    209209    if (intervalOverlapsMaxCorner && (!intervalOverlapsMinCorner || !minCornerDefinesX)) {
    210210        if (intervalFitsWithinCorners || minY <=  bounds.maxY() - cornerIntercept.y() - minIntervalHeight) {
    211             result = minY;
     211            result = ceiledLayoutUnit(minY);
    212212            return true;
    213213        }
Note: See TracChangeset for help on using the changeset viewer.