This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20660 - DOMTokenList list of tokens isn't properly initialised
Summary: DOMTokenList list of tokens isn't properly initialised
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
: 23915 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-01-14 12:50 UTC by contributor
Modified: 2015-11-11 14:42 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2013-01-14 12:50:09 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/
Multipage: http://www.whatwg.org/C#reflecting-content-attributes-in-idl-attributes
Complete: http://www.whatwg.org/c#reflecting-content-attributes-in-idl-attributes

Comment:
DOMTokenList example conflicts with current DOM Standard's definition

Posted from: 121.102.72.108
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
Comment 1 Ms2ger 2013-02-14 16:03:47 UTC
How so?
Comment 2 Ian 'Hixie' Hickson 2013-04-10 22:07:59 UTC
DOMTokenList apparently changed from mutating an underlying string to directly mutating an attribute. However, in doing this, the definition was broken — the list of tokens is no longer properly initialised.

I've updated the HTML spec to use DOMTokenList as currently specified (which is a normative change, it's not just the example that was wrong). Would be nice if you'd file bugs on the HTML spec when you make API changes like this. Would be even nicer not to make API changes like this. :-)
Comment 3 contributor 2013-04-10 22:09:11 UTC
Checked in as WHATWG revision r7801.
Check-in comment: Update integration with DOM for DOMTokenList and DOMSettableTokenList
http://html5.org/tools/web-apps-tracker?from=7800&to=7801
Comment 4 Anne 2013-04-11 05:37:59 UTC
The API changed per bug 20104 comment 4. The interface changed out of necessity, but my plan was to have the API change land in browsers first before bugging HTML about it.

Why was this assigned to DOM?
Comment 5 Ian 'Hixie' Hickson 2013-04-12 06:23:56 UTC
See comment 2 paragraph 1 — the DOM spec doesn't initialise the list of tokens properly. (e.g. if you get .relList on a <a rel="a b"> element, it will act as if the list is empty.)
Comment 6 Anne 2013-05-21 03:37:17 UTC
The idea is that HTML initializes the set. See the text around http://dom.spec.whatwg.org/#concept-class how the DOM does this for the class attribute. I'm happy to take suggestions for alternate solutions.
Comment 7 Ian 'Hixie' Hickson 2013-06-10 21:37:51 UTC
It's going to be the same for every attribute, no? Since DOMTokenList has an attribute associated with it, why not just factor out all the stuff that's going to be the same for every attribute?

I don't understand what's special about, say, "rel" vs, say, "class", that should require that we have all the same algorithms defined again for each one.
Comment 8 Anne 2014-02-13 11:36:12 UTC
*** Bug 23915 has been marked as a duplicate of this bug. ***