Skip to content

Commit 25de2a4

Browse files
0xekezemilio
authored andcommitted
style: Update the prefers-contrast media query to use the new more/less keywords.
Per the resolution here: w3c/csswg-drafts#2943 (comment) Differential Revision: https://phabricator.services.mozilla.com/D86848
1 parent 9d55296 commit 25de2a4

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

components/style/gecko/media_features.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ fn eval_prefers_reduced_motion(device: &Device, query_value: Option
313313
#[repr(u8)]
314314
#[allow(missing_docs)]
315315
enum PrefersContrast {
316-
High,
317-
Low,
316+
More,
317+
Less,
318318
NoPreference,
319319
Forced,
320320
}
@@ -326,12 +326,11 @@ enum PrefersContrast {
326326
#[derive(Clone, Copy, Debug, FromPrimitive, PartialEq)]
327327
#[repr(u8)]
328328
pub enum ContrastPref {
329-
/// High contrast is prefered. Corresponds to an accessibility theme
329+
/// More contrast is prefered. Corresponds to an accessibility theme
330330
/// being enabled or firefox forcing high contrast colors.
331-
High,
332-
/// Low contrast is prefered. Corresponds to the
333-
/// browser.display.prefers_low_contrast pref being true.
334-
Low,
331+
More,
332+
/// Low contrast is prefered.
333+
Less,
335334
/// The default value if neither high or low contrast is enabled.
336335
NoPreference,
337336
}
@@ -344,8 +343,8 @@ fn eval_prefers_contrast(device: &Device, query_value: Option)
344343
if let Some(query_value) = query_value {
345344
match query_value {
346345
PrefersContrast::Forced => forced_colors,
347-
PrefersContrast::High => contrast_pref == ContrastPref::High,
348-
PrefersContrast::Low => contrast_pref == ContrastPref::Low,
346+
PrefersContrast::More => contrast_pref == ContrastPref::More,
347+
PrefersContrast::Less => contrast_pref == ContrastPref::Less,
349348
PrefersContrast::NoPreference => contrast_pref == ContrastPref::NoPreference,
350349
}
351350
} else {

0 commit comments

Comments
 (0)