Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variable number of tokens for .add() and .remove() #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

w8r
Copy link

@w8r w8r commented Sep 11, 2014

No description provided.

@jerone
Copy link

jerone commented Sep 11, 2014

MDN isn't clear about this (pages haven't been documented), but do toggle and contains support variable number of tokes too?

A comment on https://developer.mozilla.org/en-US/docs/Web/API/Element.classList looks like toggle supports it:

Versions of Firefox before 26 do not implement the use of several arguments in the add/remove/toggle methods. See https://bugzilla.mozilla.org/show_bug.cgi?id=814014

@w8r
Copy link
Author

w8r commented Sep 11, 2014

There's W3C on this: http://www.w3.org/TR/dom/#interface-domtokenlist. Which is as well not consistent, but it makes sense this way and is supported by at least Chrome and FF

@w8r
Copy link
Author

w8r commented Sep 11, 2014

According to that spec no, .contains() and .toggle() both take only one argument

@w8r
Copy link
Author

w8r commented Sep 11, 2014

However, the problem does not end here, IE10+ supports DOMTokenList, but unlike the others(as always), these methods take one argument only, so I came up with this. Should work for FF<26 as well in that case

@remy
Copy link
Owner

remy commented Dec 27, 2014

Sorry for the late pick up, but do we want this merged in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants