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; } |
(...skipping 10 matching lines...) Expand all Loading... |
21 <div id="log"></div> | 21 <div id="log"></div> |
22 <script> | 22 <script> |
23 import "dart:sky"; | 23 import "dart:sky"; |
24 | 24 |
25 main() { | 25 main() { |
26 var tests = document.getElementById("tests"); | 26 var tests = document.getElementById("tests"); |
27 var log = document.getElementById("log"); | 27 var log = document.getElementById("log"); |
28 var i = 1; | 28 var i = 1; |
29 for (Element element = tests.firstElementChild; element != null; element
= element.nextElementSibling) { | 29 for (Element element = tests.firstElementChild; element != null; element
= element.nextElementSibling) { |
30 var order = int.parse(window.getComputedStyle(element)["order"]); | 30 var order = int.parse(window.getComputedStyle(element)["order"]); |
31 var div = document.createElement("div"); | 31 var p = document.createElement("p"); |
32 var text = (order == i) ? "PASS" : "FAIL"; | 32 var text = (order == i) ? "PASS" : "FAIL"; |
33 text += ": <" | 33 text += ": <" |
34 + element.tagName | 34 + element.tagName |
35 + " class=" | 35 + " class=" |
36 + element.classList.toString() | 36 + element.classList.toString() |
37 + " id=" + element.getAttribute("id").toString() | 37 + " id=" + element.getAttribute("id").toString() |
38 + "> order was " | 38 + "> order was " |
39 + order.toString(); | 39 + order.toString(); |
40 if (order != i) | 40 if (order != i) |
41 text += " expected " + i; | 41 text += " expected " + i; |
42 div.textContent = text; | 42 p.textContent = text; |
43 log.appendChild(div); | 43 log.appendChild(p); |
44 ++i; | 44 ++i; |
45 } | 45 } |
46 } | 46 } |
47 </script> | 47 </script> |
48 </body> | 48 </body> |
49 </html> | 49 </html> |
OLD | NEW |