| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>CSS Writing Modes Test: Shrink-to-fit inline-block with a child of orthog
onal block in inline-block</title> | 2 <title>CSS Writing Modes Test: Shrink-to-fit inline-block with a child of orthog
onal block in inline-block</title> |
| 3 <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#orthogonal-flow
s"> | 3 <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#orthogonal-flow
s"> |
| 4 <meta name="assert" content="Shrink-to-fit inline-block with a child of orthogon
al block in inline-block"> | 4 <meta name="assert" content="Shrink-to-fit inline-block with a child of orthogon
al block in inline-block"> |
| 5 <meta name="flags" content="ahem"> | 5 <meta name="flags" content="ahem"> |
| 6 <link rel="author" title="Koji Ishii" href="mailto:kojiishi@gmail.com"> | 6 <link rel="author" title="Koji Ishii" href="mailto:kojiishi@gmail.com"> |
| 7 <script src="../../../resources/testharness.js"></script> | 7 <script src="../../../resources/testharness.js"></script> |
| 8 <script src="../../../resources/testharnessreport.js"></script> | 8 <script src="../../../resources/testharnessreport.js"></script> |
| 9 <link rel="stylesheet" href="../../../resources/testharness.css"> | 9 <link rel="stylesheet" href="../../../resources/testharness.css"> |
| 10 <style> | 10 <style> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 if (window.location.search == "?wait") { | 57 if (window.location.search == "?wait") { |
| 58 console.log("Sleeping 5 secs for debug"); | 58 console.log("Sleeping 5 secs for debug"); |
| 59 setup({explicit_done:true}); | 59 setup({explicit_done:true}); |
| 60 window.setTimeout(run, 5000); | 60 window.setTimeout(run, 5000); |
| 61 } else { | 61 } else { |
| 62 run(); | 62 run(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 function run() { | 65 function run() { |
| 66 Array.prototype.forEach.call(document.querySelectorAll(".test"), function (n
ode) { | 66 Array.prototype.forEach.call(document.querySelectorAll(".test"), function (n
ode) { |
| 67 var title = node.previousElementSibling.innerText; | 67 var title = node.previousElementSibling.textContent; |
| 68 test(function () { | 68 test(function () { |
| 69 try { | 69 try { |
| 70 var targetNode = node.querySelector(".target"); | 70 var targetNode = node.querySelector(".target"); |
| 71 var fontSize = parseFloat(getComputedStyle(targetNode).fontSize)
; | 71 var fontSize = parseFloat(getComputedStyle(targetNode).fontSize)
; |
| 72 var targetBounds = targetNode.getBoundingClientRect(); | 72 var targetBounds = targetNode.getBoundingClientRect(); |
| 73 assert_less_than_equal(targetBounds.width, fontSize * 2.01, "wri
ting-mode is vertical") | 73 assert_less_than_equal(targetBounds.width, fontSize * 2.01, "wri
ting-mode is vertical") |
| 74 var nextNode = node.querySelector(".next"); | 74 var nextNode = node.querySelector(".next"); |
| 75 var nextBounds = nextNode.getBoundingClientRect(); | 75 var nextBounds = nextNode.getBoundingClientRect(); |
| 76 assert_equals(nextBounds.left - targetBounds.right, 0, "the left
edge of the orange box touches the right edge of the blue box"); | 76 assert_equals(nextBounds.left - targetBounds.right, 0, "the left
edge of the orange box touches the right edge of the blue box"); |
| 77 } catch (e) { | 77 } catch (e) { |
| 78 node.previousElementSibling.classList.add("fail"); | 78 node.previousElementSibling.classList.add("fail"); |
| 79 throw e; | 79 throw e; |
| 80 } | 80 } |
| 81 }, title); | 81 }, title); |
| 82 }); | 82 }); |
| 83 if (window.testRunner) | 83 if (window.testRunner) |
| 84 container.style.display = "none"; | 84 container.style.display = "none"; |
| 85 done(); | 85 done(); |
| 86 } | 86 } |
| 87 </script> | 87 </script> |
| OLD | NEW |