- From: poot <cvsmail@w3.org>
- Date: Sat, 15 Aug 2009 20:32:24 +0900 (JST)
- To: public-html-diffs@w3.org
hixie: Add an example of how DOMTokenList works when reflecting attributes that aren't there. (whatwg r3628) http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.2815&r2=1.2816&f=h http://html5.org/tools/web-apps-tracker?from=3627&to=3628 =================================================================== 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:33:01 UTC