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

[whatwg] DOMTokenList is unordered but yet requires sorting

From: Erik Arvidsson <erik.arvidsson@gmail.com>
Date: Mon, 18 May 2009 09:36:52 -0700
Message-ID: <6eeb8bd10905180936l1211c492meb6134d78c054514@mail.gmail.com>
On Mon, May 18, 2009 at 00:18, Simon Pieters <simonp at opera.com> wrote:
> Immagine if it is specified that the order is not relevant and
> implementations can use any order (so long as it's stable). So one UA uses
> one order and another uses another. Then one of those UAs becomes very
> popular. Web pages start to depend on the order of the popular UA (e.g. they
> use the first item and expect it to be the "right" one). Now those pages
> don't work in the less popular UA and that UA vendor has to reverse engineer
> the popular UA and implement the same order.
>
> The above has happened with the DOM Core .attributes attribute, IIRC.

It also happened to for in order for JS objects.

Simon, I think you have convinced me at least. I therefore think that
a better wording in the spec is to say that DOMTokenList acts as a
sorted set.

-- 
erik
Received on Monday, 18 May 2009 09:36:52 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:49 UTC