Commit graph

42 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
0f512b4432
style: Fix Servo build. 2019-11-04 13:41:55 +01:00
Emilio Cobos Álvarez
ca05003ef6 style: Simplify media query code now that lifetimes are non-lexical.
We can deindent and simplify a bunch of this code now.

Differential Revision: https://phabricator.services.mozilla.com/D49509
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
11c1317c37 style: Remove useless conditional compilation.
Servo doesn't use this flag or -webkit- prefixed media queries, so no point in
doing this conditionally.

Differential Revision: https://phabricator.services.mozilla.com/D49508
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
70dda74b0f style: Remove layout.css.prefixes.device-pixel-ratio-webkit.
There's no effort to disable it any time soon, so I don't think it's useful to
keep the pref around.

Differential Revision: https://phabricator.services.mozilla.com/D49507
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
b98ac61a70 style: Hide -moz-touch-enabled media query in Nightly and Early Beta.
This is effectively superseded by the hover / any-hover media queries, which
actually are standard, and is also causing trouble in the wild.

Not even the browser fronted uses it, so we should be able to just remove it
everywhere at once.

Differential Revision: https://phabricator.services.mozilla.com/D49506
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
7d23cfb91e style: Always serialize aspect-ratio and font shorthand with spaces around the slash.
Differential Revision: https://phabricator.services.mozilla.com/D46568
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
cd3b0c23fa
style: Fix Servo build, and rustfmt recent changes. 2019-09-12 23:04:56 +02:00
Joel Olsson
1406ae7f39 style: Media Query - Enable single <number> and <number>/<number> for <aspect-ratio>.
Differential Revision: https://phabricator.services.mozilla.com/D41557
2019-09-12 22:34:16 +02:00
Nicholas Nethercote
bb032c1ddc
style: Use static_prefs::pref!.
It's much nicer.

One nice thing about this is that the new code is subject to the existing
threadedness checking, which identified that several of these should be atomic
because they're accessed off the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D40792
2019-08-15 17:00:37 +02:00
Nicholas Nethercote
323221051f
style: Change StaticPrefs from a class to a namespace.
This doesn't change the way C++ code uses static prefs. But it does slightly
change how Rust code uses static prefs, specifically the name generated by
bindgen is slightly different.

The commit also improves some comments.

Differential Revision: https://phabricator.services.mozilla.com/D35764
2019-07-08 12:42:58 +02:00
Emilio Cobos Álvarez
ed2e9ce482
Rustfmt and fix tidy on recent changes. 2019-06-25 13:11:31 +02:00
Daniel Holbert
e9b0d54a95
style: Remove support for the layout.css.prefixes.webkit pref.
From this point on, the webkit-prefixed CSS features that were previously
protected by this pref will now be unconditionally enabled.

Differential Revision: https://phabricator.services.mozilla.com/D33807
2019-06-25 13:11:26 +02:00
Cameron McCormack
40248ae5fd style: Add derived ToShmem implementations.
Differential Revision: https://phabricator.services.mozilla.com/D17197
2019-04-12 12:19:52 +02:00
Emilio Cobos Álvarez
bd77cd64b9 style: Refactor some enabledness checks.
There are some common checks that could get some easy-to-use aliases.

Differential Revision: https://phabricator.services.mozilla.com/D25117
2019-04-12 12:19:38 +02:00
Emilio Cobos Álvarez
7d01114cbf style: Add a Zero trait that doesn't require Add, and use it in place of num_traits and IsZeroLength.
Use it to be consistent in InsetRect serialization and storage between Servo and
Gecko.

Differential Revision: https://phabricator.services.mozilla.com/D21493
2019-03-13 15:08:14 +01:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
Emilio Cobos Álvarez
06fe0a1fc0
style: Fix formatting. 2018-11-17 09:56:05 +01:00
Cameron McCormack
dad9ad6b31
style: Store MediaFeatureDescription references as an index into the MEDIA_FEATURES array.
The current use of a static reference is incompatible with sharing style sheet data
across processes.

Differential Revision: https://phabricator.services.mozilla.com/D11845
2018-11-17 09:56:02 +01:00
Emilio Cobos Álvarez
212b3e1311
style: Revert try -> r#try change.
Since we're in an inconsistent state because mako files weren't updated, and
it's really really ugly.
2018-11-10 21:42:17 +01:00
Simon Sapin
b1822a39fa cargo fix --edition --features gecko 2018-11-10 17:47:28 +01:00
Simon Sapin
a15d33a10e cargo fix --edition 2018-11-10 17:47:28 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Pyfisch
cb07debcb6 Format remaining files 2018-11-06 22:30:31 +01:00
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