W3C home > Mailing lists > Public > www-style@w3.org > July 2011

[cssom] appendMedium() and ensuring uniqueness

From: L. David Baron <dbaron@dbaron.org>
Date: Sat, 23 Jul 2011 15:28:50 -0700
To: www-style@w3.org
Message-ID: <20110723222850.GA8587@pickering.dbaron.org>
http://dev.w3.org/csswg/cssom/#dom-medialist-appendmedium says:
  # If comparing m with any of the media queries in the collection
  # of media queries returns true terminate these steps.
this ensures that media lists don't have the same query twice.

says, on the other hand:
  # If the newMedium is already used, it is first removed. 
This also ensures uniqueness, but gives a different resulting order.

I'm not so convinced that ensuring uniqueness is a good thing.  It
requires extra complexity in browsers -- it's the only thing that
requires the definition of "comparison of media queries" in the
cssom spec.  And it's not clear to me that it's good for authors,
and I could certainly imagine it being confusing to authors.

A quick test at
shows that Gecko and Opera follow DOM-Level-2-Style (not cssom),
while WebKit doesn't ensure uniqueness at all.

I'm curious what IE does, but I'd suggest that we should at least
consider not maintaining uniqueness at all.


𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla Corporation               http://www.mozilla.com/   𝄂
Received on Saturday, 23 July 2011 22:29:22 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:02 UTC