Index: LayoutTests/fast/writing-mode/orthogonal-parent-width-min-content.html |
diff --git a/LayoutTests/fast/writing-mode/orthogonal-parent-width-min-content.html b/LayoutTests/fast/writing-mode/orthogonal-parent-width-min-content.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d3fd27e054cf2e07c3226d390af05102aa6df124 |
--- /dev/null |
+++ b/LayoutTests/fast/writing-mode/orthogonal-parent-width-min-content.html |
@@ -0,0 +1,87 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<style> |
+.test { |
+ font:25px Ahem; |
+ clear:both; |
+ margin-top:.2em; |
+} |
+.target { |
+ color:blue; |
+ -webkit-writing-mode:vertical-rl; |
+} |
+.border { |
+ border-right:blue solid 1em; |
+} |
+.next { |
+ color:orange; |
+} |
+.inline-block { |
+ display:inline-block; |
+} |
+.float { |
+ float:left; |
+} |
+table { |
+ border-spacing:0px; |
+} |
+td { |
+ padding:0px; |
+} |
+</style> |
+<div id="container"> |
+<p>Test passes if the <b>left</b> edge of the orange box <b>touches</b> the <b>right</b> edge of the blue box. |
+ There should be no spaces nor overlaps. |
+<p>If script is enabled, there should be one or more PASS and no FAIL. |
+<div class="test" title="Orthogonal block in inline-block"> |
+ <div class="inline-block"><div class="target">XX</div></div><span class="next">YY</span> |
+</div> |
+<div class="test" title="Orthogonal inline in inline-block"> |
+ <div class="inline-block"><span class="target">XX</span></div><span class="next">YY</span> |
+</div> |
+<div class="test" title="Orthogonal inline in float"> |
+ <div class="float"><span class="target">XX</span></div><span class="next">YY</span> |
+</div> |
+<div class="test" title="Orthogonal block in float"> |
+ <div class="float"><div class="target">XX</div></div><span class="next">YY</span> |
+</div> |
+<div class="test" title="Orthogonal block in table-cell"> |
+ <table> |
+ <tr> |
+ <td><div class="target">XX</div></td> |
+ <td class="next">YY</td> |
+ </tr> |
+ </table> |
+</div> |
+<div class="test" title="Orthogonal inline in table-cell"> |
+ <table> |
+ <tr> |
+ <td><span class="target">XX</span></td> |
+ <td class="next">YY</td> |
+ </tr> |
+ </table> |
+</div> |
+<div class="test" title="Orthogonal block with borders in inline-block"> |
+ <div class="inline-block"><div class="target border">XX</div></div><span class="next">YY</span> |
+</div> |
+</div> |
+<script> |
+runTests(); |
+function runTests() { |
+ Array.prototype.forEach.call(document.querySelectorAll(".test"), function (node) { |
+ test(function () { |
+ var targetNode = node.querySelector(".target"); |
+ var targetBounds = targetNode.getBoundingClientRect(); |
+ var border = parseFloat(getComputedStyle(targetNode).borderRightWidth); |
+ assert_equals(targetBounds.height, (targetBounds.width - border) * 2, "writing-mode is vertical") |
+ var nextNode = node.querySelector(".next"); |
+ var nextBounds = nextNode.getBoundingClientRect(); |
+ assert_equals(nextBounds.left - targetBounds.right, 0, "the left edge of the orange box touches the right edge of the blue box"); |
+ }, node.title); |
+ }); |
+ if (window.testRunner) |
+ container.style.display = "none"; |
+ done(); |
+} |
+</script> |