1 Tests the behavior of DOMTokenList.toggle()
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 * Not enough parameters
7 PASS div.classList.toggle() threw exception TypeError: Not enough arguments.
9 * Token is an empty string
10 PASS div.classList.toggle('') threw exception Error: SyntaxError: DOM Exception 12.
12 Token contains an ASCII white space
13 PASS div.classList.toggle(stringWithSpace) threw exception Error: InvalidCharacterError: DOM Exception 5.
14 PASS div.classList.toggle(stringWithSpace) threw exception Error: InvalidCharacterError: DOM Exception 5.
15 PASS div.classList.toggle(stringWithSpace) threw exception Error: InvalidCharacterError: DOM Exception 5.
16 PASS div.classList.toggle(stringWithSpace) threw exception Error: InvalidCharacterError: DOM Exception 5.
17 PASS div.classList.toggle(stringWithSpace) threw exception Error: InvalidCharacterError: DOM Exception 5.
19 * 'force' parameter omitted, token does not exist
20 div.classList.toggle('a')
21 PASS div.classList[0] is "a"
23 * 'force' parameter omitted, token exists
24 div.classList.toggle('a')
25 PASS div.classList.length is 0
27 * 'force' parameter is undefined, token does not exist
28 div.classList.toggle('a', undefined)
29 PASS div.classList[0] is "a"
31 * 'force' parameter is undefined, token exists
32 div.classList.toggle('a', undefined)
33 PASS div.classList.length is 0
35 * 'force' parameter is false, token does not exist
36 div.classList.toggle('a', false)
37 PASS div.classList.length is 0
39 * 'force' parameter is true, token does not exist
40 div.classList.toggle('a', true)
41 PASS div.classList[0] is "a"
43 * 'force' parameter is true, token exists
44 div.classList.toggle('a', true)
45 PASS div.classList[0] is "a"
47 * 'force' parameter is false, token exists
48 div.classList.toggle('a', false)
49 PASS div.classList.length is 0
50 PASS successfullyParsed is true