aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2022-08-03 20:33:09 +0000
committerMartin Robinson <mrobinson@igalia.com>2023-10-02 14:37:19 +0000
commitbefb40705762fffba9182178d3fe175179e09330 (patch)
treeee59e3c51a956734fd3d3f65db1278371a2a7075 /components
parentf1e04f76f0064d85a83e5cbe46bb0aa7ca351a09 (diff)
downloadservo-befb40705762fffba9182178d3fe175179e09330.tar.gz
servo-befb40705762fffba9182178d3fe175179e09330.zip
style: Make color-scheme affect Windows' non-native menus
This matches what Linux and macOS do, and that allows the fix for bug 1782623 to work on Windows for unstyled selects. This also simplifies the CSS (though it adds a new system color which is a bit more annoying). I filed https://github.com/w3c/csswg-drafts/issues/7561 to propose adding a more generic way to do this in the future (not just for Firefox). Differential Revision: https://phabricator.services.mozilla.com/D153549
Diffstat (limited to 'components')
-rw-r--r--components/style/gecko/media_features.rs14
-rw-r--r--components/style/values/specified/color.rs3
2 files changed, 5 insertions, 12 deletions
diff --git a/components/style/gecko/media_features.rs b/components/style/gecko/media_features.rs
index 8c93dfa24ce..c939dea3577 100644
--- a/components/style/gecko/media_features.rs
+++ b/components/style/gecko/media_features.rs
@@ -496,18 +496,8 @@ fn eval_moz_platform(_: &Context, query_value: Option<Platform>) -> bool {
unsafe { bindings::Gecko_MediaFeatures_MatchesPlatform(query_value) }
}
-fn eval_moz_windows_non_native_menus(context: &Context) -> bool {
- let use_non_native_menus = match static_prefs::pref!("browser.display.windows.non_native_menus")
- {
- 0 => false,
- 1 => true,
- _ => {
- eval_moz_platform(context, Some(Platform::WindowsWin10)) &&
- get_lnf_int_as_bool(bindings::LookAndFeel_IntID::WindowsDefaultTheme as i32)
- },
- };
-
- use_non_native_menus
+fn eval_moz_windows_non_native_menus(_: &Context) -> bool {
+ unsafe { bindings::Gecko_MediaFeatures_WindowsNonNativeMenus() }
}
fn eval_moz_overlay_scrollbars(context: &Context) -> bool {
diff --git a/components/style/values/specified/color.rs b/components/style/values/specified/color.rs
index 84d1382582d..aba43f4f25b 100644
--- a/components/style/values/specified/color.rs
+++ b/components/style/values/specified/color.rs
@@ -198,6 +198,9 @@ pub enum SystemColor {
MozButtonhovertext,
/// Used for menu item backgrounds when hovered.
MozMenuhover,
+ /// Used for menu item backgrounds when hovered and disabled.
+ #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
+ MozMenuhoverdisabled,
/// Used for menu item text when hovered.
MozMenuhovertext,
/// Used for menubar item text.