OLD | NEW |
1 Tests the classList attribute and its properties. | 1 Tests the classList attribute and its properties. |
2 | 2 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
4 | 4 |
5 | 5 |
6 Tests from http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/ | 6 Tests from http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/ |
7 PASS String(element.classList) is "x" | 7 PASS String(element.classList) is "x" |
8 PASS element.classList.length is 0 | 8 PASS element.classList.length is 0 |
9 PASS element.classList.length is 1 | 9 PASS element.classList.length is 1 |
10 PASS element.classList.length is 2 | 10 PASS element.classList.length is 2 |
11 PASS element.classList.length is 2 | 11 PASS element.classList.length is 2 |
12 PASS element.className is "x" | 12 PASS element.className is "x" |
13 PASS element.className is "x" | 13 PASS element.className is "x" |
14 PASS element.className is "x x" | 14 PASS element.className is "x x" |
15 PASS element.className is "y x" | 15 PASS element.className is "y x" |
16 PASS element.className is "" | 16 PASS element.className is "" |
17 PASS element.className is "" | 17 PASS element.className is "" |
18 PASS element.className is " y y " | 18 PASS element.className is "y y" |
19 PASS element.className is "y" | 19 PASS element.className is "y" |
20 Ensure that we can handle empty class name correctly | 20 Ensure that we can handle empty class name correctly |
21 PASS element.classList.toggle('x') is true | 21 PASS element.classList.toggle('x') is true |
22 PASS element.className is "x" | 22 PASS element.className is "x" |
23 PASS element.classList.toggle('x') is false | 23 PASS element.classList.toggle('x') is false |
24 PASS element.className is "" | 24 PASS element.className is "" |
25 PASS element.classList.contains('x') is false | 25 PASS element.classList.contains('x') is false |
26 PASS element.classList[1] is undefined. | 26 PASS element.classList[1] is undefined. |
27 Test toggle with force argument | 27 Test toggle with force argument |
28 PASS element.classList.toggle('x', true) is true | 28 PASS element.classList.toggle('x', true) is true |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 PASS element.className is "a b c null d undefined 0 false" | 91 PASS element.className is "a b c null d undefined 0 false" |
92 PASS element.className is "a b" | 92 PASS element.className is "a b" |
93 PASS element.classList.add('a', 'b', '') threw expected DOMException with code 1
2 | 93 PASS element.classList.add('a', 'b', '') threw expected DOMException with code 1
2 |
94 PASS element.className is "" | 94 PASS element.className is "" |
95 PASS element.classList.add('a', 'b', 'c d') threw expected DOMException with cod
e 5 | 95 PASS element.classList.add('a', 'b', 'c d') threw expected DOMException with cod
e 5 |
96 PASS element.className is "" | 96 PASS element.className is "" |
97 PASS element.classList.add("a", {toString: function() { throw new Error("user er
ror"); }}, "b") threw exception Error: user error. | 97 PASS element.classList.add("a", {toString: function() { throw new Error("user er
ror"); }}, "b") threw exception Error: user error. |
98 PASS element.className is "" | 98 PASS element.className is "" |
99 PASS element.classList.add() did not throw exception. | 99 PASS element.classList.add() did not throw exception. |
100 PASS observer.takeRecords().length is 1 | 100 PASS observer.takeRecords().length is 1 |
101 PASS element.className is "b d " | 101 PASS element.className is "b d" |
102 PASS element.className is "d " | 102 PASS element.className is "d" |
103 PASS element.className is "a b c" | 103 PASS element.className is "a b c" |
104 PASS element.classList.remove('a', 'b', '') threw expected DOMException with cod
e 12 | 104 PASS element.classList.remove('a', 'b', '') threw expected DOMException with cod
e 12 |
105 PASS element.className is "a b" | 105 PASS element.className is "a b" |
106 PASS element.classList.remove('a', 'b', 'c d') threw expected DOMException with
code 5 | 106 PASS element.classList.remove('a', 'b', 'c d') threw expected DOMException with
code 5 |
107 PASS element.className is "a b" | 107 PASS element.className is "a b" |
108 PASS element.classList.remove("a", {toString: function() { throw new Error("user
error"); }}, "b") threw exception Error: user error. | 108 PASS element.classList.remove("a", {toString: function() { throw new Error("user
error"); }}, "b") threw exception Error: user error. |
109 PASS element.className is "a b" | 109 PASS element.className is "a b" |
110 PASS element.classList.remove() did not throw exception. | 110 PASS element.classList.remove() did not throw exception. |
111 PASS observer.takeRecords().length is 1 | 111 PASS observer.takeRecords().length is 1 |
112 PASS areArraysEqual(seen, ['a', 'b', 'c']) is true | 112 PASS areArraysEqual(seen, ['a', 'b', 'c']) is true |
113 PASS successfullyParsed is true | 113 PASS successfullyParsed is true |
114 | 114 |
115 TEST COMPLETE | 115 TEST COMPLETE |
116 | 116 |
OLD | NEW |