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

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

Issue 1411123004: Handle extra whitespaces in the DOM token list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 shouldBeEqualToString('element.htmlFor.toString()', ''); 64 shouldBeEqualToString('element.htmlFor.toString()', '');
65 65
66 // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/010.htm 66 // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/010.htm
67 createElement('x'); 67 createElement('x');
68 element.htmlFor.remove('x'); 68 element.htmlFor.remove('x');
69 shouldBeEqualToString('element.htmlFor.toString()', ''); 69 shouldBeEqualToString('element.htmlFor.toString()', '');
70 70
71 // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/011.htm 71 // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/011.htm
72 createElement(' y x y '); 72 createElement(' y x y ');
73 element.htmlFor.remove('x'); 73 element.htmlFor.remove('x');
74 shouldBeEqualToString('element.htmlFor.toString()', ' y y '); 74 shouldBeEqualToString('element.htmlFor.toString()', 'y y');
75 75
76 // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/012.htm 76 // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/012.htm
77 createElement(' x y x '); 77 createElement(' x y x ');
78 element.htmlFor.remove('x'); 78 element.htmlFor.remove('x');
79 shouldBeEqualToString('element.htmlFor.toString()', 'y'); 79 shouldBeEqualToString('element.htmlFor.toString()', 'y');
80 80
81 81
82 debug('- Ensure that we can handle empty form attribute correctly'); 82 debug('- Ensure that we can handle empty form attribute correctly');
83 element = document.createElement('output'); 83 element = document.createElement('output');
84 var list = element.htmlFor; 84 var list = element.htmlFor;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 shouldBeTrue('\'undefined\' != typeof DOMSettableTokenList'); 246 shouldBeTrue('\'undefined\' != typeof DOMSettableTokenList');
247 247
248 shouldBeEqualToString('typeof DOMSettableTokenList.prototype', 'object'); 248 shouldBeEqualToString('typeof DOMSettableTokenList.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', 'DOMSettableTokenList');
254 254
255 shouldBeTrue('element.htmlFor === element.htmlFor'); 255 shouldBeTrue('element.htmlFor === element.htmlFor');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698