Re: [csswg-drafts] [mediaqueries] How do media queries with calc() where it can be resolved early serialize?

It seems like dropping `calc()` lead to a risk of producing something that's syntactically invalid.  For example, the `aspect-ratio` media feature requires positive integers, but range restrictions generally change from parse-time to compute-time inside of `calc()` (although is this still true for `calc()` in media queries?).

This means, I think (but maybe I'm wrong??), that:

```css
@media (aspect-ratio: calc(-1) / calc(-1)) { ... }
```

is syntactically valid, but if it were serialized as:

```css
@media (aspect-ratio: -1 / -1) { ... }
```

then that would be an invalid media feature value, which when reparsed and serialized again would produce:

```css
@media not all { ... }
```

This breaks two of the fundamental principles of serialization (always serialize to valid syntax, serialize to something that when reparsed will serialize to the same thing).

-- 
GitHub Notification of comment by dbaron
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1968#issuecomment-363607954 using your GitHub account

Received on Wednesday, 7 February 2018 00:00:55 UTC