diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-05-24 22:20:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-24 22:20:37 -0500 |
commit | 8d950bd62036cebeb6596e74f412444061e59512 (patch) | |
tree | 3183ba9cfbbf3e9653bdaf2918bfd3d0f5f2a157 /components | |
parent | 1f323f8848e47b01779de5145dd21d0f74ed16ca (diff) | |
parent | fa93d820413224fffe759999ade98897846a202e (diff) | |
download | servo-8d950bd62036cebeb6596e74f412444061e59512.tar.gz servo-8d950bd62036cebeb6596e74f412444061e59512.zip |
Auto merge of #17006 - emilio:negative-resolution, r=upsuper
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
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17006)
<!-- Reviewable:end -->
Diffstat (limited to 'components')
-rw-r--r-- | components/style/gecko/media_queries.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/style/gecko/media_queries.rs b/components/style/gecko/media_queries.rs index 4105e685cb2..cdf79c27079 100644 --- a/components/style/gecko/media_queries.rs +++ b/components/style/gecko/media_queries.rs @@ -185,6 +185,10 @@ impl Resolution { _ => return Err(()), }; + if value <= 0. { + return Err(()) + } + Ok(match_ignore_ascii_case! { &unit, "dpi" => Resolution::Dpi(value), "dppx" => Resolution::Dppx(value), |