style: Update the prefers-contrast media query to use the new more/less keywords.

Per the resolution here:
https://github.com/w3c/csswg-drafts/issues/2943#issuecomment-672994920

Differential Revision: https://phabricator.services.mozilla.com/D86848
This commit is contained in:
Zeke Medley 2020-08-17 01:41:16 +00:00 committed by Emilio Cobos Álvarez
parent 9d55296893
commit 25de2a406e

View file

@ -313,8 +313,8 @@ fn eval_prefers_reduced_motion(device: &Device, query_value: Option<PrefersReduc
#[repr(u8)] #[repr(u8)]
#[allow(missing_docs)] #[allow(missing_docs)]
enum PrefersContrast { enum PrefersContrast {
High, More,
Low, Less,
NoPreference, NoPreference,
Forced, Forced,
} }
@ -326,12 +326,11 @@ enum PrefersContrast {
#[derive(Clone, Copy, Debug, FromPrimitive, PartialEq)] #[derive(Clone, Copy, Debug, FromPrimitive, PartialEq)]
#[repr(u8)] #[repr(u8)]
pub enum ContrastPref { pub enum ContrastPref {
/// High contrast is prefered. Corresponds to an accessibility theme /// More contrast is prefered. Corresponds to an accessibility theme
/// being enabled or firefox forcing high contrast colors. /// being enabled or firefox forcing high contrast colors.
High, More,
/// Low contrast is prefered. Corresponds to the /// Low contrast is prefered.
/// browser.display.prefers_low_contrast pref being true. Less,
Low,
/// The default value if neither high or low contrast is enabled. /// The default value if neither high or low contrast is enabled.
NoPreference, NoPreference,
} }
@ -344,8 +343,8 @@ fn eval_prefers_contrast(device: &Device, query_value: Option<PrefersContrast>)
if let Some(query_value) = query_value { if let Some(query_value) = query_value {
match query_value { match query_value {
PrefersContrast::Forced => forced_colors, PrefersContrast::Forced => forced_colors,
PrefersContrast::High => contrast_pref == ContrastPref::High, PrefersContrast::More => contrast_pref == ContrastPref::More,
PrefersContrast::Low => contrast_pref == ContrastPref::Low, PrefersContrast::Less => contrast_pref == ContrastPref::Less,
PrefersContrast::NoPreference => contrast_pref == ContrastPref::NoPreference, PrefersContrast::NoPreference => contrast_pref == ContrastPref::NoPreference,
} }
} else { } else {