window.matchMedia result doesn't match original query for aspect-ratio 1/1
Categories
(Core :: CSS Parsing and Computation, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: ksenia, Assigned: emilio)
References
()
Details
Attachments
(2 files)
This was originally reported in https://github.com/mozilla-mobile/fenix/issues/15124
When querying for window.matchMedia
for (max-aspect-ratio: 1/1)
the result contains a shorter version (max-aspect-ratio: 1)
. Even though the serialization is correct, the site expecting the result to match the original query.
Comment 1•5 years ago
|
||
https://drafts.csswg.org/css-values-4/#ratio-value
"The second <number> is optional, defaulting to 1. However, <ratio> is always serialized with both components."
![]() |
||
Updated•5 years ago
|
Comment 2•5 years ago
|
||
emilio: Is comment 1 contrary to what you wrote in https://github.com/mozilla-mobile/fenix/issues/15124#issuecomment-704845597?
Assignee | ||
Comment 3•5 years ago
|
||
So there are two issues here:
- The space around the slash. That is intentional per the discussion here: https://github.com/w3c/csswg-drafts/issues/4282
- The
/1
disappearing per the shortest serialization principle. That contradicts the spec. The sentence in comment 1 is from two weeks ago (https://github.com/w3c/csswg-drafts/issues/5561).
So we should:
- File a bug on chrome to add spaces around the
/
. - Adopt the resolution in https://github.com/w3c/csswg-drafts/issues/5561.
Assignee | ||
Comment 4•5 years ago
|
||
![]() |
||
Comment 5•5 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)
- File a bug on chrome to add spaces around the
/
.
Emilio opened https://bugs.chromium.org/p/chromium/issues/detail?id=1138849
Note that there is a third issue which is about the order.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 7•5 years ago
|
||
bugherder |
Description
•