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
This commit is contained in:
Zeke Medley 2020-08-17 20:50:49 +00:00 committed by Emilio Cobos Álvarez
parent cf496e4727
commit 9fd3d9a5e9
2 changed files with 30 additions and 1 deletions

View file

@ -224,6 +224,9 @@ fn disabled_by_pref(feature: &Atom, context: &ParserContext) -> bool {
if *feature == atom!("-moz-touch-enabled") {
return !static_prefs::pref!("layout.css.moz-touch-enabled.enabled");
}
if *feature == atom!("forced-colors") {
return !static_prefs::pref!("layout.css.forced-colors.enabled");
}
// prefers-contrast is always enabled in the ua and chrome. On
// the web it is hidden behind a preference.
if *feature == atom!("prefers-contrast") {