W3C home > Mailing lists > Public > public-html-commits@w3.org > August 2009

html5/spec Overview.html,1.2815,1.2816

From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
Date: Sat, 15 Aug 2009 11:32:01 +0000
To: public-html-commits@w3.org
Message-Id: <E1McHUQ-0007T9-3K@lionel-hutz.w3.org>
Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv28697

Modified Files:
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 15 August 2009 11:32:11 GMT