OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <import src="../resources/dump-as-text.sky" /> | 3 <import src="../resources/dump-as-text.sky" /> |
4 <style> | 4 <style> |
5 #id1 { order: 1; } | 5 #id1 { order: 1; } |
6 .class2 { order: 2; } | 6 .class2 { order: 2; } |
7 tag-name-3 { order: 3; } | 7 tag-name-3 { order: 3; } |
8 .class4.class4 { order: 4; } | 8 .class4.class4 { order: 4; } |
9 .class5#id5 { order: 5; } | 9 .class5#id5 { order: 5; } |
10 tag-name-6.class6#id6 { order: 6; } | 10 tag-name-6.class6#id6 { order: 6; } |
11 </style> | 11 </style> |
12 <body> | 12 <body> |
13 <div id="tests"> | 13 <div id="tests"> |
14 <div id="id1"></div> | 14 <div id="id1"></div> |
15 <div class="class2"></div> | 15 <div class="class2"></div> |
16 <tag-name-3></tag-name-3> | 16 <tag-name-3></tag-name-3> |
17 <div class="class4 class4"></div> | 17 <div class="class4 class4"></div> |
18 <div class="class5" id="id5"></div> | 18 <div class="class5" id="id5"></div> |
19 <tag-name-6 class="class6" id="id6"></tag-name-6> | 19 <tag-name-6 class="class6" id="id6"></tag-name-6> |
20 </div> | 20 </div> |
21 <div id="log"></div> | 21 <div id="log"></div> |
22 <script> | 22 <script> |
| 23 import "dart:sky"; |
| 24 |
| 25 main() { |
23 var tests = document.getElementById("tests"); | 26 var tests = document.getElementById("tests"); |
24 var log = document.getElementById("log"); | 27 var log = document.getElementById("log"); |
25 var i = 1; | 28 var i = 1; |
26 for (var element = tests.firstElementChild; element; element = element.n
extElementSibling, ++i) { | 29 for (var element = tests.firstElementChild; element != null; element = e
lement.nextElementSibling) { |
27 var order = getComputedStyle(element).order; | 30 var order = int.parse(window.getComputedStyle(element).getPropertyVa
lue("order")); |
28 var div = document.createElement("div"); | 31 var div = document.createElement("div"); |
29 var text = (order == i) ? "PASS" : "FAIL"; | 32 var text = (order == i) ? "PASS" : "FAIL"; |
30 text += ": <" | 33 text += ": <" |
31 + element.tagName | 34 + element.tagName |
32 + " class=" | 35 + " class=" |
33 + element.classList | 36 + element.classList.toString() |
34 + " id=" + element.id | 37 + " id=" + element.id |
35 + "> order was " | 38 + "> order was " |
36 + order; | 39 + order.toString(); |
37 if (order != i) | 40 if (order != i) |
38 text += " expected " + i; | 41 text += " expected " + i; |
39 div.textContent = text; | 42 div.textContent = text; |
40 log.appendChild(div); | 43 log.appendChild(div); |
| 44 ++i; |
41 } | 45 } |
| 46 } |
42 </script> | 47 </script> |
43 </body> | 48 </body> |
44 </html> | 49 </html> |
OLD | NEW |