| 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 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 PASS element.className is " y" | 41 PASS element.className is " y" |
| 42 Test invalid tokens | 42 Test invalid tokens |
| 43 PASS element.classList.contains('') threw expected DOMException with code 12 | 43 PASS element.classList.contains('') threw expected DOMException with code 12 |
| 44 PASS element.classList.contains('x y') threw expected DOMException with code 5 | 44 PASS element.classList.contains('x y') threw expected DOMException with code 5 |
| 45 PASS element.classList.add('') threw expected DOMException with code 12 | 45 PASS element.classList.add('') threw expected DOMException with code 12 |
| 46 PASS element.classList.add('x y') threw expected DOMException with code 5 | 46 PASS element.classList.add('x y') threw expected DOMException with code 5 |
| 47 PASS element.classList.remove('') threw expected DOMException with code 12 | 47 PASS element.classList.remove('') threw expected DOMException with code 12 |
| 48 PASS element.classList.remove('x y') threw expected DOMException with code 5 | 48 PASS element.classList.remove('x y') threw expected DOMException with code 5 |
| 49 PASS element.classList.toggle('') threw expected DOMException with code 12 | 49 PASS element.classList.toggle('') threw expected DOMException with code 12 |
| 50 PASS element.classList.toggle('x y') threw expected DOMException with code 5 | 50 PASS element.classList.toggle('x y') threw expected DOMException with code 5 |
| 51 PASS element.classList.toggle() threw exception TypeError: Not enough arguments. | 51 PASS element.classList.toggle() threw exception TypeError: Failed to execute 'to
ggle' on 'DOMTokenList': 1 argument required, but only 0 present.. |
| 52 Indexing | 52 Indexing |
| 53 PASS element.classList[0] is "x" | 53 PASS element.classList[0] is "x" |
| 54 PASS element.classList.item(0) is "x" | 54 PASS element.classList.item(0) is "x" |
| 55 PASS element.classList[1] is "x" | 55 PASS element.classList[1] is "x" |
| 56 PASS element.classList.item(1) is "x" | 56 PASS element.classList.item(1) is "x" |
| 57 PASS element.classList[1] is "y" | 57 PASS element.classList[1] is "y" |
| 58 PASS element.classList.item(1) is "y" | 58 PASS element.classList.item(1) is "y" |
| 59 PASS element.classList[0] is undefined. | 59 PASS element.classList[0] is undefined. |
| 60 PASS element.classList.item(0) is null | 60 PASS element.classList.item(0) is null |
| 61 PASS element.classList[4] is undefined. | 61 PASS element.classList[4] is undefined. |
| 62 PASS element.classList.item(4) is null | 62 PASS element.classList.item(4) is null |
| 63 PASS element.classList[-1] is undefined. | 63 PASS element.classList[-1] is undefined. |
| 64 PASS element.classList.item(-1) is null | 64 PASS element.classList.item(-1) is null |
| 65 PASS element.classList.item() threw exception TypeError: Not enough arguments. | 65 PASS element.classList.item() threw exception TypeError: Failed to execute 'item
' on 'DOMTokenList': 1 argument required, but only 0 present.. |
| 66 Test case since DOMTokenList is case sensitive | 66 Test case since DOMTokenList is case sensitive |
| 67 PASS element.classList.contains('x') is true | 67 PASS element.classList.contains('x') is true |
| 68 PASS element.classList.contains('X') is false | 68 PASS element.classList.contains('X') is false |
| 69 PASS element.classList[0] is "x" | 69 PASS element.classList[0] is "x" |
| 70 PASS element.classList.contains() threw exception TypeError: Not enough argument
s. | 70 PASS element.classList.contains() threw exception TypeError: Failed to execute '
contains' on 'DOMTokenList': 1 argument required, but only 0 present.. |
| 71 PASS element.classList.contains('X') is true | 71 PASS element.classList.contains('X') is true |
| 72 PASS element.classList.contains('x') is false | 72 PASS element.classList.contains('x') is false |
| 73 PASS element.classList[0] is "X" | 73 PASS element.classList[0] is "X" |
| 74 Testing whitespace | 74 Testing whitespace |
| 75 PASS element.classList.length is 2 | 75 PASS element.classList.length is 2 |
| 76 PASS element.classList.length is 2 | 76 PASS element.classList.length is 2 |
| 77 PASS element.classList.length is 2 | 77 PASS element.classList.length is 2 |
| 78 PASS element.classList.length is 2 | 78 PASS element.classList.length is 2 |
| 79 PASS element.classList.length is 2 | 79 PASS element.classList.length is 2 |
| 80 DOMTokenList presence and type | 80 DOMTokenList presence and type |
| (...skipping 25 matching lines...) Expand all Loading... |
| 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 successfullyParsed is true | 112 PASS successfullyParsed is true |
| 113 | 113 |
| 114 TEST COMPLETE | 114 TEST COMPLETE |
| 115 | 115 |
| OLD | NEW |