W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2009

[whatwg] DOMTokenList is unordered but yet requires sorting

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 15 Jun 2009 19:22:35 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0906151810150.1648@hixie.dreamhostps.com>
On Wed, 10 Jun 2009, Jo?o Eiras wrote:
> > 
> > Ensuring consistency between browsers, to reduce the likelihood that 
> > any particular browser's ordering becomes important and then forcing 
> > that browser's ordering (which could be some arbitrary ordering 
> > dependent on some particular hash function, say) into the platform de 
> > facto.
> > 
> > This is similar to what happened to ES property names -- they were 
> > supposedly unordered, UAs were allowed to sort them however they 
> > liked, and now we are locked in to a particular order.
> 
> I strongly think the order should not be sorted, but should reflect the 
> order of the token in original string which was broken down into tokens. 
> It would also make implementations much simpler and sane, and would 
> spare extra cpu cycles by avoiding the sort operations.

On Tue, 9 Jun 2009, Erik Arvidsson wrote:
>
> I was about to follow up on this. Requiring sorting which is O(n log n) 
> for something that can be done in O(n) makes thing slower without any 
> real benefit. Like Jo?o said the order should be defined as the order 
> of the class content attribute.

Fair enough. Done.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 15 June 2009 12:22:35 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:13 UTC