<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>23415</bug_id>
          
          <creation_ts>2013-10-01 23:21:51 +0000</creation_ts>
          <short_desc>DOMTokenList#toggle should be able to accept multiple classes to toggle</short_desc>
          <delta_ts>2016-04-28 15:57:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML.next</product>
          <component>default</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michał Z. Gołębiowski">m.goleb</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>chaals</cc>
    
    <cc>mike</cc>
    
    <cc>robin</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>94129</commentid>
    <comment_count>0</comment_count>
    <who name="Michał Z. Gołębiowski">m.goleb</who>
    <bug_when>2013-10-01 23:21:51 +0000</bug_when>
    <thetext>Current DOMTokenList spec lets add/remove methods to be passed multiple classes. However, the toggle method didn&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126267</commentid>
    <comment_count>1</comment_count>
    <who name="Charles McCathieNevile">chaals</who>
    <bug_when>2016-04-28 15:57:13 +0000</bug_when>
    <thetext>https://github.com/w3c/dom/issues/7 (It&apos;s actually a DOM issue)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>