html5/spec Overview.html,1.2815,1.2816

Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv28697

Modified Files:
	Overview.html 
Log Message:
Add an example of how DOMTokenList works when reflecting attributes that aren't there. (whatwg r3628)

Index: Overview.html
===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.2815
retrieving revision 1.2816
diff -u -d -r1.2815 -r1.2816
--- Overview.html	15 Aug 2009 11:12:48 -0000	1.2815
+++ Overview.html	15 Aug 2009 11:31:59 -0000	1.2816
@@ -4797,6 +4797,18 @@
   empty string. The same <code><a href="#domtokenlist-0">DOMTokenList</a></code> object must be
   returned every time for each attribute.</p>
 
+  <div class="example">
+
+   <p>If an element with no attributes has its <code title="dom-tokenlist-remove"><a href="#dom-tokenlist-remove">element.classList.remove()</a></code>
+   method invoked, the underlying string won't be changed, since the
+   result of removing any token from the empty string is still the
+   empty string. However, if the <code title="dom-tokenlist-add"><a href="#dom-tokenlist-add">element.classList.add()</a></code> method is
+   then invoked, a <code title="attr-class"><a href="#classes">class</a></code> attribute
+   will be added to the element with the value of the token to be
+   added.</p>
+
+  </div>
+
   <p>If a reflecting DOM attribute has the type
   <code><a href="#htmlelement">HTMLElement</a></code>, or an interface that descends from
   <code><a href="#htmlelement">HTMLElement</a></code>, then, on getting, it must run the

Received on Saturday, 15 August 2009 11:32:11 UTC