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 "y" | 7 PASS String(element.classList) is "y" |
8 PASS String(element.className) is "y" | 8 PASS String(element.className) is "y" |
9 PASS element.classList.length is 0 | 9 PASS element.classList.length is 0 |
10 PASS element.classList.length is 1 | 10 PASS element.classList.length is 1 |
11 PASS element.classList.length is 2 | 11 PASS element.classList.length is 1 |
12 PASS element.classList.length is 2 | 12 PASS element.classList.length is 2 |
13 PASS element.className is "x" | 13 PASS element.className is "x" |
14 PASS element.className is "x" | 14 PASS element.className is "x" |
15 PASS element.className is "x x" | 15 PASS element.className is "x" |
16 PASS element.className is "y x" | 16 PASS element.className is "y x" |
17 PASS element.className is "" | 17 PASS element.className is "" |
18 PASS element.className is "" | 18 PASS element.className is "" |
19 PASS element.className is "y y" | 19 PASS element.className is "y" |
20 PASS element.className is "y" | 20 PASS element.className is "y" |
21 Ensure that we can handle empty class name correctly | 21 Ensure that we can handle empty class name correctly |
22 PASS element.classList.toggle('x') is true | 22 PASS element.classList.toggle('x') is true |
23 PASS element.className is "x" | 23 PASS element.className is "x" |
24 PASS element.classList.toggle('x') is false | 24 PASS element.classList.toggle('x') is false |
25 PASS element.className is "" | 25 PASS element.className is "" |
26 PASS element.classList.contains('x') is false | 26 PASS element.classList.contains('x') is false |
27 PASS element.classList[1] is undefined. | 27 PASS element.classList[1] is undefined. |
28 Test toggle with force argument | 28 Test toggle with force argument |
29 PASS element.classList.toggle('x', true) is true | 29 PASS element.classList.toggle('x', true) is true |
(...skipping 16 matching lines...) Expand all Loading... |
46 PASS element.classList.add('') threw expected DOMException with code 12 | 46 PASS element.classList.add('') threw expected DOMException with code 12 |
47 PASS element.classList.add('x y') threw expected DOMException with code 5 | 47 PASS element.classList.add('x y') threw expected DOMException with code 5 |
48 PASS element.classList.remove('') threw expected DOMException with code 12 | 48 PASS element.classList.remove('') threw expected DOMException with code 12 |
49 PASS element.classList.remove('x y') threw expected DOMException with code 5 | 49 PASS element.classList.remove('x y') threw expected DOMException with code 5 |
50 PASS element.classList.toggle('') threw expected DOMException with code 12 | 50 PASS element.classList.toggle('') threw expected DOMException with code 12 |
51 PASS element.classList.toggle('x y') threw expected DOMException with code 5 | 51 PASS element.classList.toggle('x y') threw expected DOMException with code 5 |
52 PASS element.classList.toggle() threw exception TypeError: Failed to execute 'to
ggle' on 'DOMTokenList': 1 argument required, but only 0 present.. | 52 PASS element.classList.toggle() threw exception TypeError: Failed to execute 'to
ggle' on 'DOMTokenList': 1 argument required, but only 0 present.. |
53 Indexing | 53 Indexing |
54 PASS element.classList[0] is "x" | 54 PASS element.classList[0] is "x" |
55 PASS element.classList.item(0) is "x" | 55 PASS element.classList.item(0) is "x" |
56 PASS element.classList[1] is "x" | 56 PASS element.classList[1] is undefined. |
57 PASS element.classList.item(1) is "x" | 57 PASS element.classList.item(1) is null |
58 PASS element.classList[1] is "y" | 58 PASS element.classList[1] is "y" |
59 PASS element.classList.item(1) is "y" | 59 PASS element.classList.item(1) is "y" |
60 PASS element.classList[0] is undefined. | 60 PASS element.classList[0] is undefined. |
61 PASS element.classList.item(0) is null | 61 PASS element.classList.item(0) is null |
62 PASS element.classList[4] is undefined. | 62 PASS element.classList[4] is undefined. |
63 PASS element.classList.item(4) is null | 63 PASS element.classList.item(4) is null |
64 PASS element.classList[-1] is undefined. | 64 PASS element.classList[-1] is undefined. |
65 PASS element.classList.item(-1) is null | 65 PASS element.classList.item(-1) is null |
66 PASS element.classList.item() threw exception TypeError: Failed to execute 'item
' on 'DOMTokenList': 1 argument required, but only 0 present.. | 66 PASS element.classList.item() threw exception TypeError: Failed to execute 'item
' on 'DOMTokenList': 1 argument required, but only 0 present.. |
67 Test case since DOMTokenList is case sensitive | 67 Test case since DOMTokenList is case sensitive |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 PASS element.className is "a b" | 111 PASS element.className is "a b" |
112 PASS element.classList.remove("a", {toString: function() { throw new Error("user
error"); }}, "b") threw exception Error: user error. | 112 PASS element.classList.remove("a", {toString: function() { throw new Error("user
error"); }}, "b") threw exception Error: user error. |
113 PASS element.className is "a b" | 113 PASS element.className is "a b" |
114 PASS element.classList.remove() did not throw exception. | 114 PASS element.classList.remove() did not throw exception. |
115 PASS observer.takeRecords().length is 1 | 115 PASS observer.takeRecords().length is 1 |
116 PASS areArraysEqual(seen, ['a', 'b', 'c']) is true | 116 PASS areArraysEqual(seen, ['a', 'b', 'c']) is true |
117 PASS successfullyParsed is true | 117 PASS successfullyParsed is true |
118 | 118 |
119 TEST COMPLETE | 119 TEST COMPLETE |
120 | 120 |
OLD | NEW |