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

metajack has just created a new issue for 
https://github.com/w3c/csswg-drafts:

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

> 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 
account

Received on Monday, 26 September 2016 18:22:42 UTC