OLD | NEW |
1 /* | 1 /* |
2 Distributed under both the W3C Test Suite License [1] and the W3C | 2 Distributed under both the W3C Test Suite License [1] and the W3C |
3 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the | 3 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the |
4 policies and contribution forms [3]. | 4 policies and contribution forms [3]. |
5 | 5 |
6 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license | 6 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license |
7 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license | 7 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license |
8 [3] http://www.w3.org/2004/10/27-testcases | 8 [3] http://www.w3.org/2004/10/27-testcases |
9 */ | 9 */ |
10 | 10 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 break; | 150 break; |
151 } | 151 } |
152 } | 152 } |
153 if (!found) { | 153 if (!found) { |
154 assert_unreached(message + ". Fail reason: element not found: " | 154 assert_unreached(message + ". Fail reason: element not found: " |
155 + expected[i]); | 155 + expected[i]); |
156 } | 156 } |
157 } | 157 } |
158 } | 158 } |
159 | 159 |
160 function isVisible(el) { | |
161 return el.offsetTop != 0; | |
162 } | |
163 | |
164 function isVoidElement(elementName) { | 160 function isVoidElement(elementName) { |
165 return HTML5_VOID_ELEMENTS.indexOf(elementName) >= 0; | 161 return HTML5_VOID_ELEMENTS.indexOf(elementName) >= 0; |
166 } | 162 } |
167 | 163 |
168 function checkTemplateContent(d, obj, html, id, nodeName) { | 164 function checkTemplateContent(d, obj, html, id, nodeName) { |
169 | 165 |
170 obj.innerHTML = '<template id="tmpl">' + html + '</template>'; | 166 obj.innerHTML = '<template id="tmpl">' + html + '</template>'; |
171 | 167 |
172 var t = d.querySelector('#tmpl'); | 168 var t = d.querySelector('#tmpl'); |
173 | 169 |
174 if (id != null) { | 170 if (id != null) { |
175 assert_equals(t.content.childNodes.length, 1, 'Element ' + nodeName | 171 assert_equals(t.content.childNodes.length, 1, 'Element ' + nodeName |
176 + ' should present among template nodes'); | 172 + ' should present among template nodes'); |
177 assert_equals(t.content.firstChild.id, id, 'Wrong element ID'); | 173 assert_equals(t.content.firstChild.id, id, 'Wrong element ID'); |
178 } | 174 } |
179 if (nodeName != null) { | 175 if (nodeName != null) { |
180 assert_equals(t.content.firstChild.nodeName, nodeName.toUpperCase(), | 176 assert_equals(t.content.firstChild.nodeName, nodeName.toUpperCase(), |
181 'Wrong node name'); | 177 'Wrong node name'); |
182 } | 178 } |
183 } | 179 } |
184 | 180 |
185 function checkBodyTemplateContent(d, html, id, nodeName) { | 181 function checkBodyTemplateContent(d, html, id, nodeName) { |
186 checkTemplateContent(d, d.body, html, id, nodeName); | 182 checkTemplateContent(d, d.body, html, id, nodeName); |
187 } | 183 } |
188 | 184 |
189 function checkHeadTemplateContent(d, html, id, nodeName) { | 185 function checkHeadTemplateContent(d, html, id, nodeName) { |
190 checkTemplateContent(d, d.head, html, id, nodeName); | 186 checkTemplateContent(d, d.head, html, id, nodeName); |
191 } | 187 } |
OLD | NEW |