W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > October 2013

[Bug 23415] New: DOMTokenList#toggle should be able to accept multiple classes to toggle

From: <bugzilla@jessica.w3.org>
Date: Tue, 01 Oct 2013 23:21:51 +0000
To: public-html-bugzilla@w3.org
Message-ID: <bug-23415-2486@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=23415

            Bug ID: 23415
           Summary: DOMTokenList#toggle should be able to accept multiple
                    classes to toggle
           Product: HTML.next
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dave.null@w3.org
          Reporter: m.goleb@gmail.com
        QA Contact: public-html-bugzilla@w3.org
                CC: mike@w3.org, robin@w3.org

Current DOMTokenList spec lets add/remove methods to be passed multiple
classes. However, the toggle method didn't get such a possibility due to the
second boolean  optional parameter.

This is inconsequent and limiting. I propose to change the signature to:

    boolean toggle(DOMString... tokens, optional boolean force);

The change would mean that the `force` parameter is not necessarily the second
one but the last one on the list of parameters, e.g. in JavaScript the `force`
parameter would be equal to:

    arguments[arguments.length - 1]

within the function body.

Not adding such support would still require libraries like jQuery to patch the
classList.toggle method to fulfill its semantics of being able to accept
multiple classes.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 1 October 2013 23:21:52 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 16:31:44 UTC