Chromium Code Reviews| 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> |