OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>CSS Writing Modes Test: Shrink-to-fit with orthogonal children</title> | 2 <title>CSS Writing Modes Test: Shrink-to-fit with orthogonal children</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 with orthogonal children"> | 4 <meta name="assert" content="Shrink-to-fit with orthogonal children"> |
5 <meta name="flags" content="ahem combo"> | 5 <meta name="flags" content="ahem combo"> |
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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 if (window.location.search == "?wait") { | 149 if (window.location.search == "?wait") { |
150 console.log("Sleeping 5 secs for debug"); | 150 console.log("Sleeping 5 secs for debug"); |
151 setup({explicit_done:true}); | 151 setup({explicit_done:true}); |
152 window.setTimeout(run, 5000); | 152 window.setTimeout(run, 5000); |
153 } else { | 153 } else { |
154 run(); | 154 run(); |
155 } | 155 } |
156 | 156 |
157 function run() { | 157 function run() { |
158 Array.prototype.forEach.call(document.querySelectorAll(".test"), function (n
ode) { | 158 Array.prototype.forEach.call(document.querySelectorAll(".test"), function (n
ode) { |
159 var title = node.previousElementSibling.innerText; | 159 var title = node.previousElementSibling.textContent; |
160 test(function () { | 160 test(function () { |
161 try { | 161 try { |
162 var targetNode = node.querySelector(".target"); | 162 var targetNode = node.querySelector(".target"); |
163 var fontSize = parseFloat(getComputedStyle(targetNode).fontSize)
; | 163 var fontSize = parseFloat(getComputedStyle(targetNode).fontSize)
; |
164 var targetBounds = targetNode.getBoundingClientRect(); | 164 var targetBounds = targetNode.getBoundingClientRect(); |
165 assert_less_than_equal(targetBounds.width, fontSize * 2.01, "wri
ting-mode is vertical") | 165 assert_less_than_equal(targetBounds.width, fontSize * 2.01, "wri
ting-mode is vertical") |
166 var nextNode = node.querySelector(".next"); | 166 var nextNode = node.querySelector(".next"); |
167 var nextBounds = nextNode.getBoundingClientRect(); | 167 var nextBounds = nextNode.getBoundingClientRect(); |
168 assert_equals(nextBounds.left - targetBounds.right, 0, "the left
edge of the orange box touches the right edge of the blue box"); | 168 assert_equals(nextBounds.left - targetBounds.right, 0, "the left
edge of the orange box touches the right edge of the blue box"); |
169 } catch (e) { | 169 } catch (e) { |
170 node.previousElementSibling.classList.add("fail"); | 170 node.previousElementSibling.classList.add("fail"); |
171 throw e; | 171 throw e; |
172 } | 172 } |
173 }, title); | 173 }, title); |
174 }); | 174 }); |
175 if (window.testRunner) | 175 if (window.testRunner) |
176 container.style.display = "none"; | 176 container.style.display = "none"; |
177 done(); | 177 done(); |
178 } | 178 } |
179 </script> | 179 </script> |
OLD | NEW |