style: Serialize a 0/0 ratio as 0/0 in all value stages.

Based on the update of github.com/w3c/csswg-drafts/issues/5084,
a 0/0 ratio will serialize as 0/0 in all value stages.

Differential Revision: https://phabricator.services.mozilla.com/D93182
This commit is contained in:
Boris Chiou 2020-10-12 15:05:46 +00:00 committed by Emilio Cobos Álvarez
parent 436632f378
commit 61685ca9b3
3 changed files with 17 additions and 10 deletions

View file

@ -87,8 +87,12 @@ fn eval_aspect_ratio_for<F>(
where
F: FnOnce(&Device) -> Size2D<Au>,
{
// A ratio of 0/0 behaves as the ratio 1/0, so we need to call used_value()
// to convert it if necessary.
// FIXME: we may need to update here once
// https://github.com/w3c/csswg-drafts/issues/4954 got resolved.
let query_value = match query_value {
Some(v) => v,
Some(v) => v.used_value(),
None => return true,
};