From 4a49a6612c977b69ac6e24aadb4748332221441e Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Mon, 16 Nov 2020 20:43:35 +0000 Subject: [PATCH] Bug 1676434 - Replace obsolete -moz-mac-yosemite-theme media query with a new -moz-mac-big-sur-theme media query. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D97089 --- layout/style/nsMediaFeatures.cpp | 4 ++-- .../test/chrome/test_chrome_only_media_queries.html | 2 +- layout/style/test/test_media_queries.html | 10 +++++----- servo/components/style/gecko/media_features.rs | 2 +- widget/LookAndFeel.h | 4 ++-- widget/cocoa/nsLookAndFeel.mm | 4 ++-- widget/headless/HeadlessLookAndFeelGTK.cpp | 2 +- xpcom/ds/StaticAtoms.py | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp index 4db9aa3a880a..6c9c09771b87 100644 --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp @@ -397,10 +397,10 @@ void nsMediaFeatures::InitSystemMetrics() { (nsStaticAtom*)nsGkAtoms::_moz_mac_graphite_theme); } - rv = LookAndFeel::GetInt(LookAndFeel::IntID::MacYosemiteTheme, &metricResult); + rv = LookAndFeel::GetInt(LookAndFeel::IntID::MacBigSurTheme, &metricResult); if (NS_SUCCEEDED(rv) && metricResult) { sSystemMetrics->AppendElement( - (nsStaticAtom*)nsGkAtoms::_moz_mac_yosemite_theme); + (nsStaticAtom*)nsGkAtoms::_moz_mac_big_sur_theme); } rv = LookAndFeel::GetInt(LookAndFeel::IntID::WindowsAccentColorInTitlebar, diff --git a/layout/style/test/chrome/test_chrome_only_media_queries.html b/layout/style/test/chrome/test_chrome_only_media_queries.html index 566ac84e4db7..6523b10a71b1 100644 --- a/layout/style/test/chrome/test_chrome_only_media_queries.html +++ b/layout/style/test/chrome/test_chrome_only_media_queries.html @@ -54,7 +54,7 @@ const TOGGLES = [ "-moz-overlay-scrollbars", "-moz-windows-default-theme", "-moz-mac-graphite-theme", - "-moz-mac-yosemite-theme", + "-moz-mac-big-sur-theme", "-moz-windows-accent-color-in-titlebar", "-moz-windows-compositor", "-moz-windows-classic", diff --git a/layout/style/test/test_media_queries.html b/layout/style/test/test_media_queries.html index f34974885243..573bd8349f28 100644 --- a/layout/style/test/test_media_queries.html +++ b/layout/style/test/test_media_queries.html @@ -697,7 +697,7 @@ function run() { expression_should_not_be_parseable("-moz-overlay-scrollbars"); expression_should_not_be_parseable("-moz-windows-default-theme"); expression_should_not_be_parseable("-moz-mac-graphite-theme"); - expression_should_not_be_parseable("-moz-mac-yosemite-theme"); + expression_should_not_be_parseable("-moz-mac-big-sur-theme"); expression_should_not_be_parseable("-moz-windows-accent-color-in-titlebar"); expression_should_not_be_parseable("-moz-windows-compositor"); expression_should_not_be_parseable("-moz-windows-classic"); @@ -719,7 +719,7 @@ function run() { expression_should_not_be_parseable("-moz-overlay-scrollbars: 0"); expression_should_not_be_parseable("-moz-windows-default-theme: 0"); expression_should_not_be_parseable("-moz-mac-graphite-theme: 0"); - expression_should_not_be_parseable("-moz-mac-yosemite-theme: 0"); + expression_should_not_be_parseable("-moz-mac-big-sur-theme: 0"); expression_should_not_be_parseable("-moz-windows-accent-color-in-titlebar: 0"); expression_should_not_be_parseable("-moz-windows-compositor: 0"); expression_should_not_be_parseable("-moz-windows-classic: 0"); @@ -741,7 +741,7 @@ function run() { expression_should_not_be_parseable("-moz-overlay-scrollbars: 1"); expression_should_not_be_parseable("-moz-windows-default-theme: 1"); expression_should_not_be_parseable("-moz-mac-graphite-theme: 1"); - expression_should_not_be_parseable("-moz-mac-yosemite-theme: 1"); + expression_should_not_be_parseable("-moz-mac-big-sur-theme: 1"); expression_should_not_be_parseable("-moz-windows-accent-color-in-titlebar: 1"); expression_should_not_be_parseable("-moz-windows-compositor: 1"); expression_should_not_be_parseable("-moz-windows-classic: 1"); @@ -763,7 +763,7 @@ function run() { expression_should_not_be_parseable("-moz-overlay-scrollbars: -1"); expression_should_not_be_parseable("-moz-windows-default-theme: -1"); expression_should_not_be_parseable("-moz-mac-graphite-theme: -1"); - expression_should_not_be_parseable("-moz-mac-yosemite-theme: -1"); + expression_should_not_be_parseable("-moz-mac-big-sur-theme: -1"); expression_should_not_be_parseable("-moz-windows-accent-color-in-titlebar: -1"); expression_should_not_be_parseable("-moz-windows-compositor: -1"); expression_should_not_be_parseable("-moz-windows-classic: -1"); @@ -785,7 +785,7 @@ function run() { expression_should_not_be_parseable("-moz-overlay-scrollbars: true"); expression_should_not_be_parseable("-moz-windows-default-theme: true"); expression_should_not_be_parseable("-moz-mac-graphite-theme: true"); - expression_should_not_be_parseable("-moz-mac-yosemite-theme: true"); + expression_should_not_be_parseable("-moz-mac-big-sur-theme: true"); expression_should_not_be_parseable("-moz-windows-accent-color-in-titlebar: true"); expression_should_not_be_parseable("-moz-windows-compositor: true"); expression_should_not_be_parseable("-moz-windows-classic: true"); diff --git a/servo/components/style/gecko/media_features.rs b/servo/components/style/gecko/media_features.rs index 4fd6e622ac62..d8a7f67157ed 100644 --- a/servo/components/style/gecko/media_features.rs +++ b/servo/components/style/gecko/media_features.rs @@ -816,7 +816,7 @@ pub static MEDIA_FEATURES: [MediaFeatureDescription; 55] = [ system_metric_feature!(atom!("-moz-overlay-scrollbars")), system_metric_feature!(atom!("-moz-windows-default-theme")), system_metric_feature!(atom!("-moz-mac-graphite-theme")), - system_metric_feature!(atom!("-moz-mac-yosemite-theme")), + system_metric_feature!(atom!("-moz-mac-big-sur-theme")), system_metric_feature!(atom!("-moz-windows-accent-color-in-titlebar")), system_metric_feature!(atom!("-moz-windows-compositor")), system_metric_feature!(atom!("-moz-windows-classic")), diff --git a/widget/LookAndFeel.h b/widget/LookAndFeel.h index 81ec00029359..581603189004 100644 --- a/widget/LookAndFeel.h +++ b/widget/LookAndFeel.h @@ -150,14 +150,14 @@ class LookAndFeel { MacGraphiteTheme, /* - * A Boolean value to determine whether the Mac OS X Yosemite-specific + * A Boolean value to determine whether the macOS Big Sur-specific * theming should be used. * * The value of this metric is not used on non-Mac platforms. These * platforms should return NS_ERROR_NOT_IMPLEMENTED when queried for this * metric. */ - MacYosemiteTheme, + MacBigSurTheme, /* * AlertNotificationOrigin indicates from which corner of the diff --git a/widget/cocoa/nsLookAndFeel.mm b/widget/cocoa/nsLookAndFeel.mm index 615954df1c81..1e2f221a70c6 100644 --- a/widget/cocoa/nsLookAndFeel.mm +++ b/widget/cocoa/nsLookAndFeel.mm @@ -514,8 +514,8 @@ nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) { case IntID::MacGraphiteTheme: aResult = [NSColor currentControlTint] == NSGraphiteControlTint; break; - case IntID::MacYosemiteTheme: - aResult = 1; + case IntID::MacBigSurTheme: + aResult = nsCocoaFeatures::OnBigSurOrLater(); break; case IntID::AlertNotificationOrigin: aResult = NS_ALERT_TOP; diff --git a/widget/headless/HeadlessLookAndFeelGTK.cpp b/widget/headless/HeadlessLookAndFeelGTK.cpp index 0907eb267e30..b0abc95036c8 100644 --- a/widget/headless/HeadlessLookAndFeelGTK.cpp +++ b/widget/headless/HeadlessLookAndFeelGTK.cpp @@ -219,7 +219,7 @@ nsresult HeadlessLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) { break; case IntID::TouchEnabled: case IntID::MacGraphiteTheme: - case IntID::MacYosemiteTheme: + case IntID::MacBigSurTheme: aResult = 0; res = NS_ERROR_NOT_IMPLEMENTED; break; diff --git a/xpcom/ds/StaticAtoms.py b/xpcom/ds/StaticAtoms.py index 4738645f43c2..5a6226d7afb7 100644 --- a/xpcom/ds/StaticAtoms.py +++ b/xpcom/ds/StaticAtoms.py @@ -2231,7 +2231,7 @@ STATIC_ATOMS = [ ), Atom("_moz_windows_default_theme", "-moz-windows-default-theme"), Atom("_moz_mac_graphite_theme", "-moz-mac-graphite-theme"), - Atom("_moz_mac_yosemite_theme", "-moz-mac-yosemite-theme"), + Atom("_moz_mac_big_sur_theme", "-moz-mac-big-sur-theme"), Atom("_moz_windows_compositor", "-moz-windows-compositor"), Atom("_moz_windows_classic", "-moz-windows-classic"), Atom("_moz_windows_glass", "-moz-windows-glass"),