diff --git a/devtools/client/inspector/rules/constants.js b/devtools/client/inspector/rules/constants.js index b66a4eb67b63..53ba3abc622e 100644 --- a/devtools/client/inspector/rules/constants.js +++ b/devtools/client/inspector/rules/constants.js @@ -10,4 +10,4 @@ exports.ELEMENT_STYLE = 100; // An array of the possible color schemes that can be emulated. -exports.COLOR_SCHEMES = [null, "dark", "light", "no-preference"]; +exports.COLOR_SCHEMES = [null, "dark", "light"]; diff --git a/devtools/client/themes/rules.css b/devtools/client/themes/rules.css index fe41f68e422d..5e398fffa26f 100644 --- a/devtools/client/themes/rules.css +++ b/devtools/client/themes/rules.css @@ -775,10 +775,6 @@ fill: #bbb; } -#color-scheme-simulation-toggle[state="no-preference"]::before { - fill-opacity: 0.5; -} - .flash-out { transition: background 1s; } diff --git a/devtools/server/actors/emulation/content-viewer.js b/devtools/server/actors/emulation/content-viewer.js index 0cbb6a5225a4..3bbc6eeeaddf 100644 --- a/devtools/server/actors/emulation/content-viewer.js +++ b/devtools/server/actors/emulation/content-viewer.js @@ -83,10 +83,6 @@ const ContentViewerActor = protocol.ActorClassWithSpec(contentViewerSpec, { case "dark": internalColorScheme = Ci.nsIContentViewer.PREFERS_COLOR_SCHEME_DARK; break; - case "no-preference": - internalColorScheme = - Ci.nsIContentViewer.PREFERS_COLOR_SCHEME_NO_PREFERENCE; - break; default: internalColorScheme = Ci.nsIContentViewer.PREFERS_COLOR_SCHEME_NONE; } diff --git a/docshell/base/nsIContentViewer.idl b/docshell/base/nsIContentViewer.idl index 33f231d052c1..a02072c0a4b7 100644 --- a/docshell/base/nsIContentViewer.idl +++ b/docshell/base/nsIContentViewer.idl @@ -328,7 +328,6 @@ interface nsIContentViewer : nsISupports cenum PrefersColorScheme : 8 { PREFERS_COLOR_SCHEME_LIGHT, PREFERS_COLOR_SCHEME_DARK, - PREFERS_COLOR_SCHEME_NO_PREFERENCE, PREFERS_COLOR_SCHEME_NONE, /* This clears the override. */ }; diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index 351c44be37df..b5cb05bdc2f1 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -16379,20 +16379,9 @@ StylePrefersColorScheme Document::PrefersColorScheme( } } - // If LookAndFeel::eIntID_SystemUsesDarkTheme fails then return 2 - // (no-preference) - switch (LookAndFeel::GetInt(LookAndFeel::eIntID_SystemUsesDarkTheme, 2)) { - case 0: - return StylePrefersColorScheme::Light; - case 1: - return StylePrefersColorScheme::Dark; - case 2: - return StylePrefersColorScheme::NoPreference; - default: - // This only occurs if the user has set the ui.systemUsesDarkTheme pref to - // an invalid value. - return StylePrefersColorScheme::Light; - } + const bool dark = + !!LookAndFeel::GetInt(LookAndFeel::eIntID_SystemUsesDarkTheme, 0); + return dark ? StylePrefersColorScheme::Dark : StylePrefersColorScheme::Light; } // static diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index c07a8039b191..bd309ac00505 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -2739,8 +2739,6 @@ nsDocumentViewer::EmulatePrefersColorScheme(PrefersColorScheme aScheme) { return Some(StylePrefersColorScheme::Light); case PREFERS_COLOR_SCHEME_DARK: return Some(StylePrefersColorScheme::Dark); - case PREFERS_COLOR_SCHEME_NO_PREFERENCE: - return Some(StylePrefersColorScheme::NoPreference); case PREFERS_COLOR_SCHEME_NONE: return Nothing(); default: diff --git a/layout/base/tests/test_emulate_color_scheme.html b/layout/base/tests/test_emulate_color_scheme.html index d2f05e796678..94713e8644f1 100644 --- a/layout/base/tests/test_emulate_color_scheme.html +++ b/layout/base/tests/test_emulate_color_scheme.html @@ -10,9 +10,6 @@ @media (prefers-color-scheme: dark) { #test { color: rgb(0, 2, 0); } } -@media (prefers-color-scheme: no-preference) { - #test { color: rgb(0, 3, 0); } -}