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

Unified Diff: LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border.html

Issue 1173313003: Correct fast/multicol/vertical-rl/image-inside-nested-blocks-with-border.html (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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/multicol/vertical-lr/image-inside-nested-blocks-with-border.html
diff --git a/LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border.html b/LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border.html
index 3ea6fc6fe5b6c6cdce5471e681f1edf29d5ac474..e9a6e703a30c829deb254d118b3ed33fee5e0b4d 100644
--- a/LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border.html
+++ b/LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border.html
@@ -1,44 +1,25 @@
-<html>
-<body style="-webkit-writing-mode: vertical-lr">
-<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-lr.");
+</script>
+<body style="-webkit-writing-mode:vertical-lr;">
+ <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++
- }
-
- 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", "0");
+ shouldBe("result.top", "300");
+ </script>
</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698