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

Unified Diff: LayoutTests/fast/multicol/break-properties.html

Issue 764503002: Make fast/multicol/break-properties independent of the size of <body>. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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/multicol/break-properties.html
diff --git a/LayoutTests/fast/multicol/break-properties.html b/LayoutTests/fast/multicol/break-properties.html
index e1a32b37ac984777a5feda84a42a3849c2f88f91..dd73a3ae555e6e48846452a35f3d5c2abc6312d2 100644
--- a/LayoutTests/fast/multicol/break-properties.html
+++ b/LayoutTests/fast/multicol/break-properties.html
@@ -1,9 +1,11 @@
+<!DOCTYPE html>
<style>
+ body { margin: 5px; }
mstensho (USE GERRIT) 2014/11/27 10:37:53 Being explicit about the body margin is good, so t
andersr 2014/11/27 11:03:03 Done.
div.box { -webkit-box-sizing: border; border: solid blue; }
div.shorter { height: 54px; }
div.taller { height: 72px; }
</style>
-<div style="height: 100px; width: 630; -webkit-columns:6; -webkit-column-gap:5px; columns:6; column-gap:5px;">
+<div style="height: 100px; width: 325px; -webkit-columns:6; -webkit-column-gap:5px; columns:6; column-gap:5px;">
<div class="taller box"></div>
<div class="taller box"></div>
<div id="break-before" class="shorter box" style="-webkit-column-break-before: always;"></div>
@@ -21,16 +23,18 @@
document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
}
- function testBoxPosition(id, expectedLeft, expectedTop)
- {
+ function testBoxColumn(id, expectedColumn) {
mstensho (USE GERRIT) 2014/11/27 10:37:53 Can you start counting from 0 instead of 1? That's
andersr 2014/11/27 11:03:03 Done.
var rect = document.getElementById(id).getBoundingClientRect();
- if (Math.round(rect.left) === expectedLeft && Math.round(rect.top) === expectedTop)
- log("PASS: '" + id + "' is at (" + expectedLeft + ", " + expectedTop + ")");
+ var actualPosition = Math.round(rect.left);
+ var expectedPosition = (expectedColumn - 1) * 50 + expectedColumn * 5;
mstensho (USE GERRIT) 2014/11/27 10:37:53 Could be "8 + 55 * expectedColumn" (if you start n
andersr 2014/11/27 11:03:03 Done. (Went for the explicit version).
+
+ if (actualPosition == expectedPosition)
+ log("PASS: '" + id + "' is in column " + expectedColumn);
else
- log("FAIL: '" + id + "' is at (" + Math.round(rect.left) + ", " + Math.round(rect.top) + ") instead of (" + expectedLeft + " ," + expectedTop + ")");
+ log("FAIL: '" + id + "' is at position " + actualPosition + " instead of " + expectedPosition);
}
- testBoxPosition("break-before", 220, 8);
- testBoxPosition("after-break", 431, 8);
- testBoxPosition("no-break", 537, 8);
+ testBoxColumn("break-before", 3);
+ testBoxColumn("after-break", 5);
+ testBoxColumn("no-break", 6);
</script>

Powered by Google App Engine
This is Rietveld 408576698