Commit graph

18 commits

Author SHA1 Message Date
chansuke
8dab4d659a
Format style component. 2018-09-09 16:24:45 +02:00
Emilio Cobos Álvarez
38a00745e2
Appease tidy. 2018-08-18 18:41:40 +02:00
Emilio Cobos Álvarez
935b5393a9
Port servo to the new media query system.
Port `width`, and also add the `scan` media feature so I don't need to add
ugliness just to workaround the unused keyword_evaluator macro.
2018-08-18 18:23:26 +02:00
Xidorn Quan
c9c5e56079
style: Use AspectRatio directly for RangeOrOperator::evaluate.
Differential Revision: https://phabricator.services.mozilla.com/D3587
2018-08-18 17:54:54 +02:00
Emilio Cobos Álvarez
dc0f937224
style: Rewrite media queries so that they work on an evaluator function.
This moves most of the code to be Rust, except potentially some evaluator
functions, and allows to unblock the use case from any-hover / any-pointer and
remove nsMediaFeatures.

Differential Revision: https://phabricator.services.mozilla.com/D2976
2018-08-18 17:54:54 +02:00
Emilio Cobos Álvarez
8e5c853fca
style: Appease tidy. 2018-07-01 01:01:46 +02:00
Emilio Cobos Álvarez
2d2e84aad5
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
2018-07-01 00:04:48 +02:00
Emilio Cobos Álvarez
3a92fd1cfc
style: Evaluate MediaConditions, and glue it all together.
Bug: 1422225
Reviewed-by: xidorn
MozReview-Commit-ID: 3MThE2FvfDf
2018-07-01 00:04:35 +02:00
Emilio Cobos Álvarez
d2a1895752
style: Add serialization code for MediaCondition.
Bug: 1422225
Reviewed-by: xidorn
MozReview-Commit-ID: AxQQottV1hG
2018-07-01 00:04:21 +02:00
Emilio Cobos Álvarez
0b49a3701a
style: Add code to parse media conditions.
Still unused.

Bug: 1422225
Reviewed-by: xidorn
MozReview-Commit-ID: IQfxObw9BV5
2018-07-01 00:04:07 +02:00
Emilio Cobos Álvarez
e7cc548c35
style: Rename Expression to MediaFeatureExpression.
Which is more appropriate, given it represents a `<media-feature>` per spec, and
expression is a bit overloaded :)

Bug: 1422225
Reviewed-by: xidorn
MozReview-Commit-ID: Fed1nJhHxDu
2018-07-01 00:03:54 +02:00
Emilio Cobos Álvarez
82db42390d
style: Better debugging for media-query related code and ua-cache.
Bug: 1470145
Reviewed-by: xidorn
MozReview-Commit-ID: 3XHAxK2BOTS
2018-06-23 20:37:16 +02:00
Emilio Cobos Álvarez
3a0c3224b9
style: Move the error reporter into ParserContext.
Summary:
This should make it easier to report errors, and also reduce codesize.

The reason this was so generic is that error reporting was unconditionally
enabled and was super-hot, but now that's no longer the case after bug 1452143,
so we can afford the virtual call in the "error reporting enabled" case.

This opens the possibility of simplifying a lot the error setup as well, though
this patch doesn't do it.

Test Plan: No behavior change, so no new tests.

Reviewers: xidorn

Bug #: 1469957

Differential Revision: https://phabricator.services.mozilla.com/D1734

MozReview-Commit-ID: F3wTdhX9MB5
2018-06-23 20:36:23 +02:00
Emilio Cobos Álvarez
d9d9fed7d5
style: Fix tidy. 2018-06-18 19:17:37 +02:00
Emilio Cobos Álvarez
ba5be8d0eb
style: Move MediaQuery and friends to its own module.
Bug: 1468846
Reviewed-by: xidorn
MozReview-Commit-ID: 3FRMnIHFwR3
2018-06-18 19:16:51 +02:00
Emilio Cobos Álvarez
67d8bfb720
style: Introduce Qualifier::parse.
Bug: 1468846
Reviewed-by: xidorn
MozReview-Commit-ID: 4IOJpaS9ijI
2018-06-18 19:16:38 +02:00
Emilio Cobos Álvarez
c7b36fb43f
style: Move MediaList to its own module.
And move the parsing from a free function to MediaList::parse.

Bug: 1468846
Reviewed-by: xidorn
MozReview-Commit-ID: 75ES6I2EEOE
2018-06-18 19:16:23 +02:00
Emilio Cobos Álvarez
ddf386b02b
style: Move media_queries module to be a directory.
Bug: 1468846
Reviewed-by: xidorn
MozReview-Commit-ID: 7H93L6f0bAl
2018-06-18 19:16:10 +02:00