<?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>22321</bug_id>
          
          <creation_ts>2013-06-10 19:31:48 +0000</creation_ts>
          <short_desc>Spec for DOMTokenList.toggle is very confusing</short_desc>
          <delta_ts>2013-06-19 08:31:09 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>DOM</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Boris Zbarsky">bzbarsky</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
    
    <cc>www-dom</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>89007</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-06-10 19:31:48 +0000</bug_when>
    <thetext>The four consecutive if statements might be more clear as 3 nested ones... (so a toplevel if, and then one if in each branch).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89155</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-06-12 09:11:22 +0000</bug_when>
    <thetext>So like this?

3. If token is in the list of tokens, run these substeps:

  3.1 If force is not true (force is either false or omitted), then remove token from the list of tokens, run the update steps, and return false.

  3.2 Otherwise, return true.

4. Otherwise, run these substeps:

  4.1 If force is false (false is neither true nor omitted), return false.

  4.2 Otherwise, append token to the list of tokens, run the update steps, and return true.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89176</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-06-12 17:07:48 +0000</bug_when>
    <thetext>Yes, though I&apos;d probably invert the test in 3.1 to look more like 4.1 (so &quot;if force is false&quot;).

A terminology question: are we using &quot;omitted&quot; or &quot;not passed&quot; for optional arguments?  As in, could &quot;force is false (false is neither true nor omitted)&quot; be more clearly written as &quot;force was passed and is false&quot;?  Or &quot;force was not omitted and is false&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89567</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-06-19 08:31:09 +0000</bug_when>
    <thetext>So that &quot;is not true&quot; means something different from &quot;is false&quot; given the ability to be omitted, making it a tri-state effectively.

Thanks for the suggestion though, the new text seems much clearer:

https://github.com/whatwg/dom/commit/acbce28fb425dddaa657f5c3ee304c4bd3d67ea5</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>