| Tests the behavior of DOMTokenList.toggle() |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| * Not enough parameters |
| PASS div.classList.toggle() threw exception TypeError: Not enough arguments. |
| |
| * Token is an empty string |
| PASS div.classList.toggle('') threw exception SyntaxError: The string did not match the expected pattern.. |
| |
| Token contains an ASCII white space |
| PASS div.classList.toggle(stringWithSpace) threw exception InvalidCharacterError: The string contains invalid characters.. |
| PASS div.classList.toggle(stringWithSpace) threw exception InvalidCharacterError: The string contains invalid characters.. |
| PASS div.classList.toggle(stringWithSpace) threw exception InvalidCharacterError: The string contains invalid characters.. |
| PASS div.classList.toggle(stringWithSpace) threw exception InvalidCharacterError: The string contains invalid characters.. |
| PASS div.classList.toggle(stringWithSpace) threw exception InvalidCharacterError: The string contains invalid characters.. |
| |
| * 'force' parameter omitted, token does not exist |
| div.classList.toggle('a') |
| PASS div.classList[0] is "a" |
| |
| * 'force' parameter omitted, token exists |
| div.classList.toggle('a') |
| PASS div.classList.length is 0 |
| |
| * 'force' parameter is undefined, token does not exist |
| div.classList.toggle('a', undefined) |
| PASS div.classList[0] is "a" |
| |
| * 'force' parameter is undefined, token exists |
| div.classList.toggle('a', undefined) |
| PASS div.classList.length is 0 |
| |
| * 'force' parameter is false, token does not exist |
| div.classList.toggle('a', false) |
| PASS div.classList.length is 0 |
| |
| * 'force' parameter is true, token does not exist |
| div.classList.toggle('a', true) |
| PASS div.classList[0] is "a" |
| |
| * 'force' parameter is true, token exists |
| div.classList.toggle('a', true) |
| PASS div.classList[0] is "a" |
| |
| * 'force' parameter is false, token exists |
| div.classList.toggle('a', false) |
| PASS div.classList.length is 0 |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |