style: Don't reject negative resolutions either

This unveils an issue with image-set() tests, which expect 0x to not
parse (inconsistently with media queries).

Fix the test, since the spec doesn't restrict the range of <resolution>
values (and more importantly, it shouldn't allow open ranges).

Differential Revision: https://phabricator.services.mozilla.com/D170762
This commit is contained in:
Emilio Cobos Álvarez 2023-02-26 00:15:25 +00:00 committed by Martin Robinson
parent d68bd45cc3
commit 6e128b6512

View file

@ -60,10 +60,6 @@ impl Parse for Resolution {
ref t => return Err(location.new_unexpected_token_error(t.clone())),
};
if value <= 0. {
return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
}
match_ignore_ascii_case! { &unit,
"dpi" => Ok(Resolution::Dpi(value)),
"dppx" => Ok(Resolution::Dppx(value)),