Commit graph

35 commits

Author SHA1 Message Date
Oriol Brufau
43cec05c04 style: Don't allow whitespace between media query operator delim tokens
Differential Revision: https://phabricator.services.mozilla.com/D113648
2023-05-19 19:06:08 +02:00
Oriol Brufau
7425f2d922 style: Enable forced-colors in UA and chrome always
Differential Revision: https://phabricator.services.mozilla.com/D112069
2023-05-17 02:12:40 +02:00
Boris Chiou
52d39fc1bc style: Move Ratio into independent files.
Based on https://drafts.csswg.org/css-values/#ratios, <ratio> should be
a general types in css values, and now the media query and the position use
this type, so let's move it into the independent files.

Differential Revision: https://phabricator.services.mozilla.com/D106218
2021-02-26 16:44:05 +01:00
tobar2018
4a625be8ad style: Remove all references to the preference 'layout.css.moz-touch-enabled.enabled'.
Differential Revision: https://phabricator.services.mozilla.com/D91401
2021-02-26 16:44:05 +01:00
Zeke Medley
9fd3d9a5e9 style: Support forced colors media feature.
Enabled behind layout.css.forced-colors.enabled pending finalization
of the spec:

<https://drafts.csswg.org/mediaqueries-5/#forced-colors>

Differential Revision: https://phabricator.services.mozilla.com/D87147
2021-02-26 16:44:05 +01:00
Zeke Medley
8ff565c86b style: Implement the prefers-contrast media-query.
Differential Revision: https://phabricator.services.mozilla.com/D79553
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
685e749cfc
style: Switch all callsites of try() to try_parse() in the style crate.
Fully automated via:

  $ rg -l '\.try\(' | xargs sed -i 's/\.try(/.try_parse(/g'
  $ cd servo/components/style && cargo +nightly fmt

Differential Revision: https://phabricator.services.mozilla.com/D80099
2020-06-18 23:51:14 +02:00
Boris Chiou
7022f451e1 style: Replace AspectRatio with computed::position::Ratio in media-queries.
Also, we drop the pref, layout.css.aspect-ratio-number.enabled, becacuse
the spec of css-sizing-4 uses Number now.

Differential Revision: https://phabricator.services.mozilla.com/D75233
2020-06-04 01:50:36 +02:00
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
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
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