W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > September 2011

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

From: <bugzilla@jessica.w3.org>
Date: Thu, 01 Sep 2011 17:50:45 +0000
To: public-html-bugzilla@w3.org
Message-ID: <bug-13999-2486@http.www.w3.org/Bugs/Public/>

           Summary: DOMTokenList (e.g., element.classList): allow to
                    add/remove multiple tokens at once
           Product: HTML WG
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LC1 HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: mtanalin@yandex.ru
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,


DOMTokenList should be able to add/remove multiple tokens at once. In
particular, element.classList should be able to add or remove more than one
class at once.

For example, following should be possible:

element.classList.add("lorem ipsum dolor");
element.classList.remove("lorem ipsum dolor");

Additionally, it may make sense to allow to use Array instead of string as

element.classList.add(["lorem", "ipsum", "dolor"]);
element.classList.remove(["lorem", "ipsum", "dolor"]);

Currently, DOMTokenList is almost useless since element.classList is _slower_
than pure-script implementation when adding/removing multiple classes at once.

For example, jQuery _intentionally drops_ using element.classList exactly for
this reason:

Adding multiple classes is widely used, for example, in jQuery UI.


Configure bugmail: http://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 Thursday, 1 September 2011 17:50:51 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:02:03 UTC