[Bug 13999] DOMTokenList (e.g., element.classList): allow to add/remove multiple tokens at once

https://www.w3.org/Bugs/Public/show_bug.cgi?id=13999

Rick Waldron <waldron.rick@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |waldron.rick@gmail.com

--- Comment #11 from Rick Waldron <waldron.rick@gmail.com> 2012-03-05 04:02:48 UTC ---
Another possible approach would be to follow the precedent set by
Array.prototype.push: make classList.add() a variable arity function - after
all, it's essentially "push"ing onto the token list.

el.classList.add( token[, token... ] );

This also allows a user to do fun stuff like...

var classes = [ "foo", "bar", "baz" ];

// ... some program stuff that adds or substracts tokens from `classes`...

el.classList.add.apply( null, classes );

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 5 March 2012 04:02:50 UTC