style: Error reporting fixes for media queries.

Do it so that we always try to evaluate the media expression and the modern
syntax last, so that the most specific error message comes up.

Bug: 1422225
Reviewed-by: xidorn
MozReview-Commit-ID: 2tqdAsWh6Kh
This commit is contained in:
Emilio Cobos Álvarez 2018-06-21 19:35:35 +02:00
parent 3a92fd1cfc
commit 2d2e84aad5
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 28 additions and 56 deletions

View file

@ -106,12 +106,12 @@ pub enum StyleParseErrorKind<'i> {
PropertyDeclarationValueNotExhausted,
/// An unexpected dimension token was encountered.
UnexpectedDimension(CowRcStr<'i>),
/// Expected identifier not found.
ExpectedIdentifier(Token<'i>),
/// Missing or invalid media feature name.
MediaQueryExpectedFeatureName(CowRcStr<'i>),
/// Missing or invalid media feature value.
MediaQueryExpectedFeatureValue,
/// A media feature range operator was not expected.
MediaQueryUnexpectedOperator,
/// min- or max- properties must have a value.
RangedExpressionWithNoValue,
/// A function was encountered that was not expected.