Making DOMTokenList.toggle() work correctly