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

Unified Diff: LayoutTests/fast/exclusions/shape-outside-floats/shape-outside-floats-diamond-margin-polygon.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: Updated per review feedback. 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-outside-floats/shape-outside-floats-diamond-margin-polygon.html
diff --git a/LayoutTests/fast/exclusions/shape-outside-floats/shape-outside-floats-diamond-margin-polygon.html b/LayoutTests/fast/exclusions/shape-outside-floats/shape-outside-floats-diamond-margin-polygon.html
index 213839cd85bb47cc7911aa0824848a29d8026f46..31d40cd8ec02dc316ad8ccce8b6c5ad4b1d71034 100644
--- a/LayoutTests/fast/exclusions/shape-outside-floats/shape-outside-floats-diamond-margin-polygon.html
+++ b/LayoutTests/fast/exclusions/shape-outside-floats/shape-outside-floats-diamond-margin-polygon.html
@@ -12,7 +12,7 @@
#container {
font: 20px/1 Ahem, sans-serif;
width: 200px;
- height: 300px;
+ height: 150px;
}
#float-left {
@@ -25,14 +25,14 @@
#svg-shape {
position: absolute;
- display:block;
+ display: block;
+ top: 0px;
+ left: 0px;
width: 100px;
height: 100px;
}
</style>
-
<body>
-<p></p>
<div id="container">
<div id="float-left">
<svg id="svg-shape" xmlns="http://www.w3.org/2000/">
@@ -41,9 +41,10 @@
</div>
<span id="l1">X</span></br><span id="l2">X</span><br/><span id="l3">X</span><br/><br/><span id="l4">X</span><br/><span id="l5">X</span><br/><span id="l6">X</span>
</div>
+<div id="console"></div>
</body>
<script>
-function elementRect(elementId)
+function elementRect(elementId)
{
var s = document.getElementById("container").getBoundingClientRect();
var r = document.getElementById(elementId).getBoundingClientRect();
@@ -58,27 +59,29 @@ function elementRect(elementId)
function marginLeftXIntercept(lineNumber)
{
- return SubPixelLayout.roundLineLeft(lineNumber * 20 + 20 * Math.sqrt(2) + 50);
+ var f = SubPixelLayout.snapToLayoutUnit(lineNumber * 20 + 20 * Math.sqrt(2) + 50);
+ return Math.round(f);
}
+var quiet = true; // PASS output depends on SubPixelLayout.isEnabled()
+
shouldBe("elementRect('l1').top", "0");
-shouldBeCloseTo("elementRect('l1').left", marginLeftXIntercept(1), 1);
+shouldBeCloseTo("elementRect('l1').left", marginLeftXIntercept(1), 1, quiet);
shouldBe("elementRect('l2').top", "20");
-shouldBeCloseTo("elementRect('l2').left", marginLeftXIntercept(2), 1);
+shouldBeCloseTo("elementRect('l2').left", marginLeftXIntercept(2), 1, quiet);
shouldBe("elementRect('l3').top", "40");
-shouldBeCloseTo("elementRect('l3').left", marginLeftXIntercept(3), 1);
+shouldBeCloseTo("elementRect('l3').left", marginLeftXIntercept(3), 1, quiet);
shouldBe("elementRect('l4').top", "80");
-shouldBeCloseTo("elementRect('l4').left", marginLeftXIntercept(3), 1);
+shouldBeCloseTo("elementRect('l4').left", marginLeftXIntercept(3), 1, quiet);
shouldBe("elementRect('l5').top", "100");
-shouldBeCloseTo("elementRect('l5').left", marginLeftXIntercept(2), 1);
+shouldBeCloseTo("elementRect('l5').left", marginLeftXIntercept(2), 1, quiet);
shouldBe("elementRect('l6').top", "120");
-shouldBeCloseTo("elementRect('l6').left", marginLeftXIntercept(1), 1);
+shouldBeCloseTo("elementRect('l6').left", marginLeftXIntercept(1), 1, quiet);
</script>
</html>
-

Powered by Google App Engine
This is Rietveld 408576698