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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/script-tests/dom-token-list.js

Issue 1629403003: Merge DOMSettableTokensList into DOMTokensList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed non-oilpan inheritance Created 4 years, 10 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 // This test mostly comes from fast/dom/HTMLElement/script-tests/class-list.js 1 // This test mostly comes from fast/dom/HTMLElement/script-tests/class-list.js
2 description('Tests the htmlFor attribute and its properties.'); 2 description('Tests the htmlFor attribute and its properties.');
3 3
4 var container = document.createElement('div'); 4 var container = document.createElement('div');
5 document.body.appendChild(container); 5 document.body.appendChild(container);
6 6
7 var element; 7 var element;
8 8
9 function createElement(tokenList) 9 function createElement(tokenList)
10 { 10 {
11 container.innerHTML = '<output for="' + tokenList + '"></output>'; 11 container.innerHTML = '<output for="' + tokenList + '"></output>';
12 element = container.lastChild; 12 element = container.lastChild;
13 } 13 }
14 14
15 debug('- Tests from http://simon.html5.org/test/html/dom/reflecting/DOMTokenList /'); 15 debug('- Tests from http://simon.html5.org/test/html/dom/reflecting/DOMTokenList /');
16 16
17 // HTMLOutputElement::htmlFor setter is forwarding assignment to DOMSettableToke nList.value attribute. 17 // HTMLOutputElement::htmlFor setter is forwarding assignment to DOMTokenList.va lue attribute.
18 createElement('x'); 18 createElement('x');
19 shouldBeEqualToString('element.htmlFor.value', 'x'); 19 shouldBeEqualToString('element.htmlFor.value', 'x');
20 shouldBeEqualToString('String(element.htmlFor)', 'x'); 20 shouldBeEqualToString('String(element.htmlFor)', 'x');
21 element.htmlFor = 'y'; 21 element.htmlFor = 'y';
22 shouldBeEqualToString('element.htmlFor.value', 'y'); 22 shouldBeEqualToString('element.htmlFor.value', 'y');
23 shouldBeEqualToString('String(element.htmlFor)', 'y'); 23 shouldBeEqualToString('String(element.htmlFor)', 'y');
24 24
25 // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/001.htm 25 // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/001.htm
26 createElement(''); 26 createElement('');
27 shouldEvaluateTo('element.htmlFor.length', 0); 27 shouldEvaluateTo('element.htmlFor.length', 0);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 createElement('x\u000Ay'); 228 createElement('x\u000Ay');
229 shouldEvaluateTo('element.htmlFor.length', 2); 229 shouldEvaluateTo('element.htmlFor.length', 2);
230 230
231 createElement('x\u000Cy'); 231 createElement('x\u000Cy');
232 shouldEvaluateTo('element.htmlFor.length', 2); 232 shouldEvaluateTo('element.htmlFor.length', 2);
233 233
234 createElement('x\u000Dy'); 234 createElement('x\u000Dy');
235 shouldEvaluateTo('element.htmlFor.length', 2); 235 shouldEvaluateTo('element.htmlFor.length', 2);
236 236
237 237
238 debug('- DOMSettableTokenList presence and type'); 238 debug('- DOMTokenList presence and type');
239 239
240 240
241 // Safari returns object 241 // Safari returns object
242 // Firefox returns object 242 // Firefox returns object
243 // IE8 returns object 243 // IE8 returns object
244 // Chrome returns function 244 // Chrome returns function
245 // assertEquals('object', typeof DOMSettableTokenList); 245 // assertEquals('object', typeof DOMTokenList);
246 shouldBeTrue('\'undefined\' != typeof DOMSettableTokenList'); 246 shouldBeTrue('\'undefined\' != typeof DOMTokenList');
247 247
248 shouldBeEqualToString('typeof DOMSettableTokenList.prototype', 'object'); 248 shouldBeEqualToString('typeof DOMTokenList.prototype', 'object');
249 249
250 createElement('x'); 250 createElement('x');
251 shouldBeEqualToString('typeof element.htmlFor', 'object'); 251 shouldBeEqualToString('typeof element.htmlFor', 'object');
252 252
253 shouldEvaluateTo('element.htmlFor.constructor', 'DOMSettableTokenList'); 253 shouldEvaluateTo('element.htmlFor.constructor', 'DOMTokenList');
254 254
255 shouldBeTrue('element.htmlFor === element.htmlFor'); 255 shouldBeTrue('element.htmlFor === element.htmlFor');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698