Skip to content

[cssom] [mediaqueries] Media query serialization doesn't work for newer spec features #5627

@emilio

Description

@emilio

I recently became confused because WebKit / Blink sorted the media features in media query lists, but @lilles did point out to me that https://drafts.csswg.org/cssom/#serialize-a-media-query does say that:

  1. Sort the media features in lexicographical order.

But this has gone very out of date with newer mediaqueries features (like nested expressions, etc), which for now only Gecko supports. This also gets more interesting when we support the multi-value expression syntax in #2791...

Gecko has never implemented the sorting step, so I'd propose to drop it: we don't know of any compat issue due to that, it was just that I was looking at interop around MediaQueryList as a result of a Gecko bug. Also, Gecko's behavior is more intuitive to me but maybe I'm biased :)

If we don't drop it, we need to define how the sorting works for stuff like nested expressions and such. Basically, we'd need to define sorting among two arbitrary <media-condition>s.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions