Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/html/resources/common.js

Issue 1899623002: Import latest web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: handle new failures Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698