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 13912 - What order are attributes in?
Summary: What order are attributes in?
Status: RESOLVED DUPLICATE of bug 17871
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-26 00:36 UTC by Ian 'Hixie' Hickson
Modified: 2014-02-13 11:39 UTC (History)
6 users (show)

See Also:


Attachments

Description Ian 'Hixie' Hickson 2011-08-26 00:36:29 UTC
This doesn't define the order of the array:
"The attributes attribute must return a read only array of the context object's associated attributes."
Comment 1 Ms2ger 2011-08-26 12:39:47 UTC
The order in which they were added to the element. In particular, setAttribute/setAttributeNS say "*Append* this attribute to the context object's attributes."

I've tried to make this cleared by using "list of attributes" instead of "collection of attributes": <http://dvcs.w3.org/hg/domcore/rev/f1ac828a0830>.

I've filed bug 13917 to fix the "create an element for a token" definition in HTML, which doesn't define in what the order the attributes are added.
Comment 2 Ian 'Hixie' Hickson 2013-11-25 18:53:38 UTC
Bug 13917 was WONTFIXed. Attributes in markup are conceptually unordered. If the API exposes an order, it's the API that should define the order, IMHO.
Comment 3 Anne 2013-11-26 13:05:59 UTC
So if we have multiple disparate APIs they can all do their own thing? 

I think either we have a consistent order, we have a random order, or we have it implementation-defined and hope nobody starts depending on anything. I vastly prefer consistent order over the alternatives.
Comment 4 Anne 2014-02-13 11:38:09 UTC

*** This bug has been marked as a duplicate of bug 17871 ***