Commit 588b6e43 authored by zalan@apple.com's avatar zalan@apple.com

[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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162559 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7e1519a7
2014-01-22 Zalan Bujtas <zalan@apple.com>
[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.
* fast/shapes/shape-inside/shape-inside-subpixel-rectangle-top-expected.html:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
2014-01-22 Zalan Bujtas <zalan@apple.com>
Subpixel Layout: SimpleLineLayout needs more position rounding to match InlineFlowBox layout.
<!DOCTYPE html>
<html>
<head>
<script src="../resources/subpixel-utils.js"></script>
<style>
#shape-inside {
font: 100px/1 Ahem, sans-serif;
......@@ -8,12 +9,19 @@
color: green;
background-color: grey;
width: 200px;
height: 198px;
padding-top: 2px;
height: 198.7px;
padding-top: 1.3px;
}
</style>
</head>
<body>
<div id="shape-inside">X</div>
<script>
if (!SubPixelLayout.isEnabled()) {
var divX = document.getElementById("shape-inside");
divX.style.paddingTop = "2px";
divX.offsetHeight;
}
</script>
</body>
</html>
......@@ -1334,9 +1334,6 @@ webkit.org/b/117756 media/track/media-element-enqueue-event-crash.html [ Skip ]
webkit.org/b/126889 fast/forms/input-widths.html [ Failure ]
webkit.org/b/126889 fast/forms/number/number-size.html [ Failure ]
# webkit.org/b/124784 needs revisiting.
webkit.org/b/124784 fast/shapes/shape-inside/shape-inside-subpixel-rectangle-top.html [ ImageOnlyFailure ]
# Subpixel: off-by-1 pixel rendering on mathml
webkit.org/b/126897 mathml/presentation/bug95015.html [ ImageOnlyFailure ]
......
......@@ -2870,9 +2870,6 @@ media/media-source [ Failure ]
webkit.org/b/125855 accessibility/aria-checked-mixed-value.html [ Skip ]
# Subpixel failures
# webkit.org/b/124784 needs revisiting.
webkit.org/b/124784 fast/shapes/shape-inside/shape-inside-subpixel-rectangle-top.html [ ImageOnlyFailure ]
# Subpixel: off-by-1 pixel rendering on mathml
webkit.org/b/126897 mathml/presentation/bug95015.html [ ImageOnlyFailure ]
......
2014-01-22 Zalan Bujtas <zalan@apple.com>
[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.
* rendering/shapes/RectangleShape.cpp:
(WebCore::RectangleShape::firstIncludedIntervalLogicalTop):
2014-01-22 Jochen Eisinger <jochen@chromium.org>
Add protocolIsInHTTPFamily for strings and use it where appropriate
......@@ -173,7 +173,7 @@ bool RectangleShape::firstIncludedIntervalLogicalTop(LayoutUnit minLogicalInterv
if (bounds.isEmpty() || minIntervalWidth > bounds.width())
return false;
float minY = LayoutUnit::fromFloatCeil(std::max(bounds.y(), minIntervalTop));
float minY = std::max(bounds.y(), minIntervalTop);
float maxY = minY + minIntervalHeight;
if (maxY > bounds.maxY())
......@@ -186,7 +186,7 @@ bool RectangleShape::firstIncludedIntervalLogicalTop(LayoutUnit minLogicalInterv
bool intervalOverlapsMaxCorner = maxY > bounds.maxY() - paddingRadiusY;
if (!intervalOverlapsMinCorner && !intervalOverlapsMaxCorner) {
result = minY;
result = ceiledLayoutUnit(minY);
return true;
}
......@@ -197,18 +197,18 @@ bool RectangleShape::firstIncludedIntervalLogicalTop(LayoutUnit minLogicalInterv
if (intervalOverlapsMinCorner && (!intervalOverlapsMaxCorner || minCornerDefinesX)) {
if (intervalFitsWithinCorners || bounds.y() + cornerIntercept.y() < minY) {
result = minY;
result = ceiledLayoutUnit(minY);
return true;
}
if (minIntervalHeight < bounds.height() - (2 * cornerIntercept.y())) {
result = LayoutUnit::fromFloatCeil(bounds.y() + cornerIntercept.y());
result = ceiledLayoutUnit(bounds.y() + cornerIntercept.y());
return true;
}
}
if (intervalOverlapsMaxCorner && (!intervalOverlapsMinCorner || !minCornerDefinesX)) {
if (intervalFitsWithinCorners || minY <= bounds.maxY() - cornerIntercept.y() - minIntervalHeight) {
result = minY;
result = ceiledLayoutUnit(minY);
return true;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment