<?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>20105</bug_id>
          
          <creation_ts>2012-11-27 18:56:53 +0000</creation_ts>
          <short_desc>Nothing in the spec really defines how changes to token lists change the underlying string</short_desc>
          <delta_ts>2012-12-07 13:17:46 +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>Windows 3.1</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>bugs</cc>
    
    <cc>erik.arvidsson</cc>
    
    <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>78939</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-11-27 18:56:53 +0000</bug_when>
    <thetext>In particular, I see the following problems:

1)  It&apos;s not clear at what point token list mutators call setAttribute in the case of .classList.  If I call remove(&quot;a&quot;, &quot;b&quot;), should that do two setAttribute calls or just one?  The difference is content-detectable using mutation records.

2)  Nothing really says that the underlying attribute is modified.  For example, http://dom.spec.whatwg.org/#dom-domtokenlist-remove just calls into http://dom.spec.whatwg.org/#remove-a-token-from-a-string which produces a string called &quot;output&quot; and never does anything with it.  So per spec as currently written, &quot;output&quot; should just be discarded, which is bogus.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78942</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-11-27 19:12:52 +0000</bug_when>
    <thetext>And here I was hoping nobody would notice. Do you support making it a single change to the attribute?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78948</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-11-27 19:30:49 +0000</bug_when>
    <thetext>Single change to the attribute would be fine by me, I think; it&apos;s just a bit more painful to implement.  Olli?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78949</commentid>
    <comment_count>3</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2012-11-27 19:43:46 +0000</bug_when>
    <thetext>Single change sounds good to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79409</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-12-04 15:57:02 +0000</bug_when>
    <thetext>I defined this to the extent that whenever DOMTokenList is mutated the corresponding attribute is mutated.

I still need to define the other way around, setting the attribute updating the DOMTokenList (the algorithm is already there, I just need to redo some of the infrastructure around attributes).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79410</commentid>
    <comment_count>5</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2012-12-04 15:58:11 +0000</bug_when>
    <thetext>WebKit implements this as a single change to the attribute. I think this is important for performance reasons too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79644</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-12-07 13:17:46 +0000</bug_when>
    <thetext>https://github.com/whatwg/dom/commit/25d3e7c0ec9cb92373e30c7bc9a3bc90840072e3
https://github.com/whatwg/dom/commit/8f66f8fe624978ecad6aa00e02db0203dbac14b2</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>