OLD | NEW |
1 var namespaces = { | 1 var namespaces = { |
2 "html":"http://www.w3.org/1999/xhtml", | 2 "html":"http://www.w3.org/1999/xhtml", |
| 3 "math":"http://www.w3.org/1998/Math/MathML", |
3 "mathml":"http://www.w3.org/1998/Math/MathML", | 4 "mathml":"http://www.w3.org/1998/Math/MathML", |
4 "svg":"http://www.w3.org/2000/svg", | 5 "svg":"http://www.w3.org/2000/svg", |
5 "xlink":"http://www.w3.org/1999/xlink", | 6 "xlink":"http://www.w3.org/1999/xlink", |
6 "xml":"http://www.w3.org/XML/1998/namespace", | 7 "xml":"http://www.w3.org/XML/1998/namespace", |
7 "xmlns":"http://www.w3.org/2000/xmlns/" | 8 "xmlns":"http://www.w3.org/2000/xmlns/" |
8 }; | 9 }; |
9 | 10 |
10 var prefixes = {}; | 11 var prefixes = {}; |
11 for (var prefix in namespaces) { | 12 for (var prefix in namespaces) { |
12 if (namespaces.hasOwnProperty(prefix)) { | 13 if (namespaces.hasOwnProperty(prefix)) { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 88 } |
88 return x > y ? 1 : -1; | 89 return x > y ? 1 : -1; |
89 }); | 90 }); |
90 | 91 |
91 attributes.forEach( | 92 attributes.forEach( |
92 function(attr) { | 93 function(attr) { |
93 var indent_spaces = (new Array(indent + 2)).join(" "); | 94 var indent_spaces = (new Array(indent + 2)).join(" "); |
94 lines.push(format("|%s%s=\"%s\"", indent_spaces, attr[0], attr[1])); | 95 lines.push(format("|%s%s=\"%s\"", indent_spaces, attr[0], attr[1])); |
95 } | 96 } |
96 ); | 97 ); |
| 98 if ("HTMLTemplateElement" in window && |
| 99 Object.prototype.toString.call(element) === "[object HTMLTemplateEle
ment]") { |
| 100 indent += 2; |
| 101 indent_spaces = (new Array(indent)).join(" "); |
| 102 lines.push(format("|%scontent", indent_spaces)); |
| 103 indent += 2; |
| 104 Array.prototype.forEach.call(element.content.childNodes, |
| 105 function(node) { |
| 106 serialize_element(node, indent); |
| 107 }); |
| 108 indent -= 4; |
| 109 } |
97 break; | 110 break; |
98 } | 111 } |
99 indent += 2; | 112 indent += 2; |
100 Array.prototype.forEach.call(element.childNodes, | 113 Array.prototype.forEach.call(element.childNodes, |
101 function(node) { | 114 function(node) { |
102 serialize_element(node, indent); | 115 serialize_element(node, indent); |
103 }); | 116 }); |
104 } | 117 } |
105 serialize_element(element, 0); | 118 serialize_element(element, 0); |
106 return lines.join("\n"); | 119 return lines.join("\n"); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 | 335 |
323 onload = function() { | 336 onload = function() { |
324 Array.prototype.forEach.call(document.getElementsByTagName("iframe"), | 337 Array.prototype.forEach.call(document.getElementsByTagName("iframe"), |
325 function(iframe) { | 338 function(iframe) { |
326 if (tests_started<order.length) { | 339 if (tests_started<order.length) { |
327 test_next(iframe); | 340 test_next(iframe); |
328 } | 341 } |
329 }); | 342 }); |
330 }; | 343 }; |
331 } | 344 } |
OLD | NEW |