Fix a few media query parsing bugs.

MozReview-Commit-ID: 6nUd2vA6zO
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-04-10 18:23:29 +08:00
parent ca3cd64d6b
commit 78a3408405
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 25 additions and 13 deletions

View file

@ -409,11 +409,12 @@ impl Expression {
// If there's no colon, this is a media query of the form
// '(<feature>)', that is, there's no value specified.
//
// FIXME(emilio): We need to check for range operators too here when
// we support them, see:
//
// https://drafts.csswg.org/mediaqueries/#mq-ranges
// Gecko doesn't allow ranged expressions without a value, so just
// reject them here too.
if input.try(|i| i.expect_colon()).is_err() {
if range != nsMediaExpression_Range::eEqual {
return Err(())
}
return Ok(Expression::new(feature, None, range));
}