style: Reject non-positive resolution values in media queries.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1366961
See: https://github.com/w3c/csswg-drafts/issues/1454
This commit is contained in:
Emilio Cobos Álvarez 2017-05-23 15:49:46 +02:00
parent e24d96cdd0
commit fa93d82041
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -181,6 +181,10 @@ impl Resolution {
_ => return Err(()),
};
if value <= 0. {
return Err(())
}
Ok(match_ignore_ascii_case! { &unit,
"dpi" => Resolution::Dpi(value),
"dppx" => Resolution::Dppx(value),