Index: LayoutTests/fast/multicol/vertical-rl/image-inside-nested-blocks-with-border.html |
diff --git a/LayoutTests/fast/multicol/vertical-rl/image-inside-nested-blocks-with-border.html b/LayoutTests/fast/multicol/vertical-rl/image-inside-nested-blocks-with-border.html |
index 3caf8c1563b3f4210937ffa083c4d2441e20d781..dff7293726df5c99a3b703304b74d7148794e8a3 100644 |
--- a/LayoutTests/fast/multicol/vertical-rl/image-inside-nested-blocks-with-border.html |
+++ b/LayoutTests/fast/multicol/vertical-rl/image-inside-nested-blocks-with-border.html |
@@ -1,46 +1,25 @@ |
-<html> |
-<body style="-webkit-writing-mode: vertical-rl"> |
-<div id="tests" style="-webkit-column-count:2; -webkit-column-gap:0; column-count:2; column-gap:0; column-fill:auto; width:300px; height:600px;"> |
-<div style="width:280px"></div> |
-<div id="f1" style="border:5px solid black; float:left"> |
-<img style="display:block;height:140px;width:80px;"> |
-</div> |
-</div> |
-<div id="result"></div> |
+<!DOCTYPE html> |
+<script src="../../../resources/js-test.js"></script> |
<script> |
+ description("Test that getBoundingClientRect works as expected on a float in the second column - writing-mode is vertical-rl."); |
+</script> |
+<body style="-webkit-writing-mode:vertical-rl;"> |
+ <div id="multicol" style="-webkit-column-count:2; -webkit-column-gap:0; column-fill:auto; width:300px; height:600px;"> |
+ <div style="width:280px;"></div> |
+ <div id="f1" style="border:5px solid black; float:left;"> |
+ <img style="display:block; height:140px; width:80px;"> |
+ </div> |
+ </div> |
+ <script> |
function floatOffset(float) |
{ |
- var parentRect = document.getElementById('tests').getBoundingClientRect(); |
+ var parentRect = document.getElementById("multicol").getBoundingClientRect(); |
var rect = float.getBoundingClientRect(); |
- return { width: rect.left - parentRect.left, height: rect.top - parentRect.top }; |
- } |
- |
- var tests = [ |
- ["f1", 0, 300] |
- ]; |
- |
- var test; |
- var failures = 0; |
- while (test = tests.shift()) { |
- var float = document.getElementById(test[0]); |
- var result = floatOffset(float); |
- var passed = result.width === test[1] && result.height === test[2] |
- float.style.backgroundColor = passed ? "green" : "red"; |
- if (!passed) { |
- failures++ |
- alert(result.width + " " + result.height) |
- } |
- } |
- |
- if (window.testRunner) { |
- testRunner.dumpAsText(); |
- document.getElementById("tests").style.display = "none"; |
+ return { left: rect.left - parentRect.left, top: rect.top - parentRect.top }; |
} |
- document.getElementById("result").innerText = failures ? "FAIL: " + failures + " cases failed" : "PASS"; |
-</script> |
- |
- |
- |
+ var result = floatOffset(document.getElementById("f1")); |
+ shouldBe("result.left", "210"); |
+ shouldBe("result.top", "300"); |
+ </script> |
</body> |
-</html> |