Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Unified Diff: LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-layout.html

Issue 14959014: [CSS Exclusions] Programmatic layout tests fail when subpixel layout is disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-layout.html
diff --git a/LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-layout.html b/LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-layout.html
index 967a2060e87727d8ec6724e643c5adc93d4b7d9a..c7f64fdcb5173dd259a61ac4c57c08e813d4f4d7 100644
--- a/LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-layout.html
+++ b/LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-layout.html
@@ -2,6 +2,7 @@
<html>
<head>
<script src="../../js/resources/js-test-pre.js"></script>
+<script src="../resources/subpixel-utils.js"></script>
<script>
if (window.internals)
window.internals.settings.setCSSExclusionsEnabled(true);
@@ -47,11 +48,17 @@
return {left: r.left - s.left, top: r.top - s.top, width: r.width, height: r.height};
}
- /* Verify that all four one-character lines are vertically adjacent and 15 pixels high. */
- shouldBe("shapeInsideRect('a').top", "7");
- shouldBe("shapeInsideRect('b').top", "22");
- shouldBe("shapeInsideRect('c').top", "37");
- shouldBe("shapeInsideRect('d').top", "52");
+ // The top of the polygon is a horzontal edge at y=1.42%, and its parent's height is 500px. The top of
+ // the first line, span "a", will align with the top of the polygon. The ExclusionShape::firstIncludedIntervalLogicalTop()
+ // methods use ceiledLayoutUnit() to ensure that their return value is within the shape.
+
+ var lineATop = Math.floor(SubPixelLayout.ceilSnapToLayoutUnit(.0142 * 500));
+
+ // Verify that all four one-character lines are vertically adjacent and 15 pixels high.
+ var quiet = true; // PASS output depends on SubPixelLayout.isEnabled()
+ shouldBe("shapeInsideRect('a').top", String(lineATop), quiet);
+ shouldBe("shapeInsideRect('b').top", String(lineATop + 15), quiet);
+ shouldBe("shapeInsideRect('c').top", String(lineATop + 30), quiet);
+ shouldBe("shapeInsideRect('d').top", String(lineATop + 45), quiet);
</script>
</html>
-

Powered by Google App Engine
This is Rietveld 408576698