W3C home > Mailing lists > Public > public-css-archive@w3.org > September 2016

[csswg-drafts] [cssom] clarification needed on sort order and lowercasing of media features

From: Jack Moffitt via GitHub <sysbot+gh@w3.org>
Date: Mon, 26 Sep 2016 18:22:34 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-179301468-1474914152-sysbot+gh@w3.org>
metajack has just created a new issue for 

== [cssom] clarification needed on sort order and lowercasing of media
 features ==
In https://drafts.csswg.org/cssom/#serialize-a-media-query-list, it 

> Sort the media features in lexicographical order.

The example shows it also deduplicating which is not in the spec. 
Also, if deduplication is needed, it is probably necessary to define 
how to deduplicate. For example, use the first and use the last both 
produce arbitrary results, so I think you'd need to actually do the 
calculation for each feature for which duplicates exist. For example, 
`min-width` would need to choose the largest I guess.

Also, it does not specify whether a "feature" includes the possible 
modifiers (width vs. min-width/max-width), although the examples seem 
to indicate that the modifier is included.

Finally, it does not specify lowercasing before sorting, so the sort 
order will not necessarily be stable, which I assume is the intended 
point of sorting before serialization.

Also, this sorting seems like it could be expensive, and probably 
means implementations will have to cache the serialization or use more
 sophisticated data structures during parsing.

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/533 using your GitHub 
Received on Monday, 26 September 2016 18:22:42 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:03 UTC