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 13917 - [create an element for a token] Should use getAttribute/setAttribute or define order of attributes manually.
Summary: [create an element for a token] Should use getAttribute/setAttribute or defin...
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-26 12:36 UTC by contributor
Modified: 2011-10-24 18:15 UTC (History)
9 users (show)

See Also:


Attachments

Description contributor 2011-08-26 12:36:38 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html
Multipage: http://www.whatwg.org/C#creating-and-inserting-elements
Complete: http://www.whatwg.org/c#creating-and-inserting-elements

Comment:
[create an element for a token] Should use getAttribute/setAttribute or define
order of attributes manually.

Posted from: 91.181.110.19 by ms2ger@gmail.com
User agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/13.0.761.0 Safari/534.35
Comment 1 Tab Atkins Jr. 2011-08-26 14:38:28 UTC
When an element is being created from markup the attributes are added all at once.
Comment 2 Ms2ger 2011-08-26 14:59:04 UTC
Yes, but in what order? The spec needs to define the order of the attributes in element.attributes.
Comment 3 Tab Atkins Jr. 2011-08-26 15:22:05 UTC
Ah, indeed.  Agreed, then.  (And obviously it should be source-order.)
Comment 4 Henri Sivonen 2011-08-31 12:56:52 UTC
(In reply to comment #3)
> (And obviously it should be source-order.)

"Obviously"? On the Web?

See http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1125 in Firefox or IE.

It's not clear to me that requiring a particular order is necessary or has positive effects that outweigh negative effects.
Comment 5 Ian 'Hixie' Hickson 2011-10-12 19:37:00 UTC
Hm, yeah. Having the order exposed anywhere is unfortunate, but I guess it is exposed in the DOM since you can enumerate them... Maybe the enumeration should have a fixed order (alphabetical?) or some such? Seems bad to make the parser have to track order, and it seems bad that UAs would have to keep track of the order (since for some elements, UAs might want to store certain attribute values in custom ways rather than keeping them in an ordered map with all the other attributes).
Comment 6 Anne 2011-10-12 20:17:35 UTC
Order is exposed in the DOM and in serialization. Alphabetical order is not compatible with anyone, but then I do not really care strongly here.
Comment 7 Ian 'Hixie' Hickson 2011-10-24 18:15:43 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: I think we should fix this at the points where it can be observed, if at all, not at the points where the attributes are added. In principle, attributes are unordered, and it's only an artefact of the APIs that let you read the attributes that let you observe an order at all.