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.

http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/stylesheets.html#StyleSheets-MediaList
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
http://lists.w3.org/Archives/Public/www-archive/2011Jul/att-0022/appendMedium.html
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.

-David

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

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:42 GMT