Have prefers-color-scheme: light always match on macOS versions before Mojave.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 Jan 2019 05:54:06 +0000 (05:54 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 Jan 2019 05:54:06 +0000 (05:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191655
rdar://problem/46074680

Reviewed by Megan Gardner.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.

Source/WebCore:

Tests: css-dark-mode/older-systems/prefers-color-scheme.html
       css-dark-mode/older-systems/supported-color-schemes-css.html
       css-dark-mode/older-systems/supported-color-schemes.html

Use new HAVE(OS_DARK_MODE_SUPPORT) to make it easier to find code.
Added HAVE(OS_DARK_MODE_SUPPORT) around more bits to make it work on older systems.

* Configurations/FeatureDefines.xcconfig:
* dom/Document.cpp:
(WebCore::Document::useDarkAppearance const):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::enable):
* page/Page.cpp:
(WebCore::Page::setUseDarkAppearance):
(WebCore::Page::useDarkAppearance const):
(WebCore::Page::setUseDarkAppearanceOverride):
* platform/mac/LocalDefaultSystemAppearance.h:
(WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const):
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
(WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
* platform/mac/ScrollAnimatorMac.mm:
* rendering/RenderThemeMac.mm:
(-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
(-[WebListButtonCell drawWithFrame:inView:]):
(WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeMac::systemColor const):

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.

Source/WebKit:

* Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::effectiveAppearanceIsDark):
* UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
* WebView/WebView.mm:
(-[WebView _effectiveAppearanceIsDark]):

Source/WTF:

* wtf/Platform.h: Define HAVE_OS_DARK_MODE_SUPPORT on macOS 10.14.

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
* TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm:

LayoutTests:

* css-dark-mode/older-systems/prefers-color-scheme-expected.txt: Added.
* css-dark-mode/older-systems/prefers-color-scheme.html: Added.
* css-dark-mode/older-systems/supported-color-schemes-css-expected.txt: Added.
* css-dark-mode/older-systems/supported-color-schemes-css.html: Added.
* css-dark-mode/older-systems/supported-color-schemes-expected.txt: Added.
* css-dark-mode/older-systems/supported-color-schemes.html: Added.
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239904 268f45cc-cd09-0410-ab3c-d52691b4dbfc

33 files changed:
LayoutTests/ChangeLog
LayoutTests/css-dark-mode/older-systems/prefers-color-scheme-expected.txt [new file with mode: 0644]
LayoutTests/css-dark-mode/older-systems/prefers-color-scheme.html [new file with mode: 0644]
LayoutTests/css-dark-mode/older-systems/supported-color-schemes-css-expected.txt [new file with mode: 0644]
LayoutTests/css-dark-mode/older-systems/supported-color-schemes-css.html [new file with mode: 0644]
LayoutTests/css-dark-mode/older-systems/supported-color-schemes-expected.txt [new file with mode: 0644]
LayoutTests/css-dark-mode/older-systems/supported-color-schemes.html [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig
Source/WebCore/dom/Document.cpp
Source/WebCore/inspector/agents/InspectorPageAgent.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/platform/mac/LocalDefaultSystemAppearance.h
Source/WebCore/platform/mac/LocalDefaultSystemAppearance.mm
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebKit/ChangeLog
Source/WebKit/Configurations/FeatureDefines.xcconfig
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollerMac.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig
Source/WebKitLegacy/mac/WebView/WebView.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig
Tools/TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm

index 71f9b15..f2101ba 100644 (file)
@@ -1,3 +1,19 @@
+2019-01-12  Timothy Hatcher  <timothy@apple.com>
+
+        Have prefers-color-scheme: light always match on macOS versions before Mojave.
+        https://bugs.webkit.org/show_bug.cgi?id=191655
+        rdar://problem/46074680
+
+        Reviewed by Megan Gardner.
+
+        * css-dark-mode/older-systems/prefers-color-scheme-expected.txt: Added.
+        * css-dark-mode/older-systems/prefers-color-scheme.html: Added.
+        * css-dark-mode/older-systems/supported-color-schemes-css-expected.txt: Added.
+        * css-dark-mode/older-systems/supported-color-schemes-css.html: Added.
+        * css-dark-mode/older-systems/supported-color-schemes-expected.txt: Added.
+        * css-dark-mode/older-systems/supported-color-schemes.html: Added.
+        * platform/mac/TestExpectations:
+
 2019-01-11  John Wilander  <wilander@apple.com>
 
         Compile out Web API Statistics Collection
diff --git a/LayoutTests/css-dark-mode/older-systems/prefers-color-scheme-expected.txt b/LayoutTests/css-dark-mode/older-systems/prefers-color-scheme-expected.txt
new file mode 100644 (file)
index 0000000..4cfbac7
--- /dev/null
@@ -0,0 +1,4 @@
+
+PASS Element colors are correct in light color scheme 
+PASS Element colors are correct in light color scheme with boolean context query 
+
diff --git a/LayoutTests/css-dark-mode/older-systems/prefers-color-scheme.html b/LayoutTests/css-dark-mode/older-systems/prefers-color-scheme.html
new file mode 100644 (file)
index 0000000..e970c3e
--- /dev/null
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+
+<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
+
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<style>
+div {
+    background-color: red;
+    color: text;
+}
+
+@media (prefers-color-scheme: light) {
+    #test1 {
+        background-color: lime;
+    }
+}
+
+@media (prefers-color-scheme: dark) {
+    /* This is valid, but should not apply for us since there is no dark mode support. */
+    #test1 {
+        background-color: blue;
+    }
+}
+
+@media (prefers-color-scheme: no-preference) {
+    /* This is valid, but should not apply for us since there is no option for no user preference. */
+    #test1 {
+        background-color: cyan;
+    }
+}
+
+@media (prefers-color-scheme: foo) {
+    /* This is invalid and should not apply. */
+    #test1 {
+        background-color: yellow;
+    }
+}
+
+@media (prefers-color-scheme) {
+    /* This is valid and should always apply for us, since there is always a user preference currently. */
+    #test2 {
+        background-color: lime;
+    }
+}
+</style>
+
+<div id="test1"></div>
+<div id="test2"></div>
+
+<script>
+function test_prop(id, prop, expected) {
+    assert_equals(window.getComputedStyle(document.getElementById(id)).getPropertyValue(prop).trim(), expected);
+}
+
+test(function() {
+    // Styled background-color in media query should be lime green.
+    test_prop("test1", "background-color", "rgb(0, 255, 0)");
+
+    // The semantic text color should be black.
+    test_prop("test1", "color", "rgb(0, 0, 0)");
+}, "Element colors are correct in light color scheme");
+
+test(function() {
+    // Styled background-color in media query should be lime green.
+    test_prop("test2", "background-color", "rgb(0, 255, 0)");
+
+    // The semantic text color should be black.
+    test_prop("test2", "color", "rgb(0, 0, 0)");
+}, "Element colors are correct in light color scheme with boolean context query");
+</script>
diff --git a/LayoutTests/css-dark-mode/older-systems/supported-color-schemes-css-expected.txt b/LayoutTests/css-dark-mode/older-systems/supported-color-schemes-css-expected.txt
new file mode 100644 (file)
index 0000000..a66c52d
--- /dev/null
@@ -0,0 +1,20 @@
+
+PASS Element colors are correct in light color scheme with only light supported color scheme 
+PASS Supported color schemes changed to light and dark 
+PASS Element colors are correct in light color scheme with light and dark supported color scheme 
+PASS Supported color schemes changed to dark 
+PASS Element colors are correct in light color scheme with only dark supported color scheme 
+PASS Supported color schemes changed to light and a bogus value 
+PASS Element colors are correct in light color scheme with only light supported color scheme 
+PASS Supported color schemes changed to auto value 
+PASS Element colors are correct in light color scheme with implicit light supported color scheme 
+PASS Supported color schemes changed to light and dark via <meta> element 
+PASS Element colors are correct in light color scheme with light and dark supported color scheme via <meta> element 
+PASS Supported color schemes changed to light value 
+PASS Element colors are correct in light color scheme with explicit light, overriding <meta> element 
+PASS Remove test meta element 
+PASS Supported color schemes changed to light and dark 
+PASS Element colors are correct in light color scheme with light and dark supported color scheme 
+PASS Supported color schemes changed to a bogus value and dark 
+PASS Element colors are correct in light color scheme with dark supported color scheme 
+
diff --git a/LayoutTests/css-dark-mode/older-systems/supported-color-schemes-css.html b/LayoutTests/css-dark-mode/older-systems/supported-color-schemes-css.html
new file mode 100644 (file)
index 0000000..1dc31b4
--- /dev/null
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+
+<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
+
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<style>
+#test1 {
+    color: text;
+}
+</style>
+
+<div id="test1"></div>
+
+<script>
+function test_prop(id, prop, expected) {
+    assert_equals(window.getComputedStyle(document.getElementById(id)).getPropertyValue(prop), expected);
+}
+
+function test_color_is_black(id) {
+    test_prop("test1", "color", "rgb(0, 0, 0)");
+}
+
+test(function() {
+    // The semantic text color should be black.
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with only light supported color scheme");
+
+test(function() {
+    document.body.style.setProperty("supported-color-schemes", "light dark");
+}, "Supported color schemes changed to light and dark");
+
+test(function() {
+    // The semantic text color should be black.
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with light and dark supported color scheme");
+
+test(function() {
+    document.body.style.setProperty("supported-color-schemes", "dark");
+}, "Supported color schemes changed to dark");
+
+test(function() {
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with only dark supported color scheme");
+
+test(function() {
+    document.body.style.setProperty("supported-color-schemes", "light foo");
+}, "Supported color schemes changed to light and a bogus value");
+
+test(function() {
+    // The semantic text color should be black again.
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with only light supported color scheme");
+
+test(function() {
+    document.body.style.setProperty("supported-color-schemes", "auto");
+}, "Supported color schemes changed to auto value");
+
+test(function() {
+    // The semantic text color should be black still.
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with implicit light supported color scheme");
+
+test(function() {
+    let meta = document.createElement("meta");
+    meta.id = "test-meta";
+    meta.name = "supported-color-schemes";
+    meta.content = "light dark";
+    document.head.appendChild(meta);
+}, "Supported color schemes changed to light and dark via <meta> element");
+
+test(function() {
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with light and dark supported color scheme via <meta> element");
+
+test(function() {
+    document.body.style.setProperty("supported-color-schemes", "light");
+}, "Supported color schemes changed to light value");
+
+test(function() {
+    // The semantic text color should be black again.
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with explicit light, overriding <meta> element");
+
+test(function() {
+    document.getElementById("test-meta").remove();
+}, "Remove test meta element");
+
+test(function() {
+    document.body.style.setProperty("supported-color-schemes", "light dark");
+}, "Supported color schemes changed to light and dark");
+
+test(function() {
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with light and dark supported color scheme");
+
+test(function() {
+    document.body.style.setProperty("supported-color-schemes", "foo dark");
+}, "Supported color schemes changed to a bogus value and dark");
+
+test(function() {
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with dark supported color scheme");
+</script>
diff --git a/LayoutTests/css-dark-mode/older-systems/supported-color-schemes-expected.txt b/LayoutTests/css-dark-mode/older-systems/supported-color-schemes-expected.txt
new file mode 100644 (file)
index 0000000..274122b
--- /dev/null
@@ -0,0 +1,15 @@
+
+PASS Element colors are correct in light color scheme with only light supported color scheme 
+PASS Supported color schemes changed to light and dark 
+PASS Element colors are correct in light color scheme with light and dark supported color scheme 
+PASS Supported color schemes changed to dark 
+PASS Element colors are correct in light color scheme with only dark supported color scheme 
+PASS Supported color schemes changed to light and a bogus value 
+PASS Element colors are correct in light color scheme with only light supported color scheme 
+PASS Supported color schemes changed to empty value 
+PASS Element colors are correct in light color scheme with implicit light supported color scheme 
+PASS Supported color schemes changed to light and dark 
+PASS Element colors are correct in light color scheme with light and dark supported color scheme 
+PASS Supported color schemes changed to a bogus value and dark 
+PASS Element colors are correct in light color scheme with dark supported color scheme 
+
diff --git a/LayoutTests/css-dark-mode/older-systems/supported-color-schemes.html b/LayoutTests/css-dark-mode/older-systems/supported-color-schemes.html
new file mode 100644 (file)
index 0000000..d1a7267
--- /dev/null
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+
+<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
+
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<style>
+#test1 {
+    color: text;
+}
+</style>
+
+<meta id="meta" name="supported-color-schemes" content="light">
+
+<div id="test1"></div>
+
+<script>
+function test_prop(id, prop, expected) {
+    assert_equals(window.getComputedStyle(document.getElementById(id)).getPropertyValue(prop).trim(), expected);
+}
+
+function test_color_is_black(id) {
+    test_prop("test1", "color", "rgb(0, 0, 0)");
+}
+
+test(function() {
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with only light supported color scheme");
+
+test(function() {
+    document.getElementById("meta").content = "light dark";
+}, "Supported color schemes changed to light and dark");
+
+test(function() {
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with light and dark supported color scheme");
+
+test(function() {
+    document.getElementById("meta").content = "dark";
+}, "Supported color schemes changed to dark");
+
+test(function() {
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with only dark supported color scheme");
+
+test(function() {
+    document.getElementById("meta").content = "light ,foo ";
+}, "Supported color schemes changed to light and a bogus value");
+
+test(function() {
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with only light supported color scheme");
+
+test(function() {
+    document.getElementById("meta").content = "";
+}, "Supported color schemes changed to empty value");
+
+test(function() {
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with implicit light supported color scheme");
+
+test(function() {
+    document.getElementById("meta").content = "   light, dark ";
+}, "Supported color schemes changed to light and dark");
+
+test(function() {
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with light and dark supported color scheme");
+
+test(function() {
+    document.getElementById("meta").content = ", foo dark";
+}, "Supported color schemes changed to a bogus value and dark");
+
+test(function() {
+    test_color_is_black("test1");
+}, "Element colors are correct in light color scheme with dark supported color scheme");
+</script>
index efcda9f..f896ddf 100644 (file)
@@ -1767,8 +1767,12 @@ webkit.org/b/187393 imported/w3c/web-platform-tests/2dcontext/imagebitmap/create
 
 # Dark Mode is Mojave and later.
 [ Mojave+ ] css-dark-mode [ Pass ]
+[ Mojave+ ] css-dark-mode/older-systems [ Skip ]
 [ Mojave+ ] inspector/css/force-page-appearance.html [ Pass ]
 
+# Test Dark Mode CSS support for light mode on older systems.
+[ Sierra HighSierra ] css-dark-mode/older-systems [ Pass ]
+
 webkit.org/b/185651 legacy-animation-engine/animations/play-state-in-shorthand.html [ Pass Failure ]
 
 webkit.org/b/189686 webgl/2.0.0/conformance/textures/misc/tex-image-and-sub-image-2d-with-array-buffer-view.html [ Slow ]
index 9c91d16..df78949 100644 (file)
@@ -1,3 +1,13 @@
+2019-01-12  Timothy Hatcher  <timothy@apple.com>
+
+        Have prefers-color-scheme: light always match on macOS versions before Mojave.
+        https://bugs.webkit.org/show_bug.cgi?id=191655
+        rdar://problem/46074680
+
+        Reviewed by Megan Gardner.
+
+        * Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
+
 2019-01-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
 
         Unreviewed, fix scope check assertions
index 22481d3..6073393 100644 (file)
@@ -113,8 +113,7 @@ ENABLE_CURSOR_VISIBILITY = ENABLE_CURSOR_VISIBILITY;
 ENABLE_CUSTOM_SCHEME_HANDLER = ;
 
 ENABLE_DARK_MODE_CSS = $(ENABLE_DARK_MODE_CSS_$(WK_PLATFORM_NAME));
-ENABLE_DARK_MODE_CSS_macosx = $(ENABLE_DARK_MODE_CSS$(WK_MACOS_1014));
-ENABLE_DARK_MODE_CSS_MACOS_SINCE_1014 = ENABLE_DARK_MODE_CSS;
+ENABLE_DARK_MODE_CSS_macosx = ENABLE_DARK_MODE_CSS;
 
 ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(WK_PLATFORM_NAME));
 ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
index 407a293..9d0ae3e 100644 (file)
@@ -1,3 +1,13 @@
+2019-01-12  Timothy Hatcher  <timothy@apple.com>
+
+        Have prefers-color-scheme: light always match on macOS versions before Mojave.
+        https://bugs.webkit.org/show_bug.cgi?id=191655
+        rdar://problem/46074680
+
+        Reviewed by Megan Gardner.
+
+        * wtf/Platform.h: Define HAVE_OS_DARK_MODE_SUPPORT on macOS 10.14.
+
 2019-01-11  David Kilzer  <ddkilzer@apple.com>
 
         Follow-up: WorkQueue::concurrentApply() passes a raw pointer to a temporary String to Thread::create().
index 8df952e..c8fe6ba 100644 (file)
 #endif
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#define HAVE_OS_DARK_MODE_SUPPORT 1
+#endif
+
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
 #define HAVE_CG_FONT_RENDERING_GET_FONT_SMOOTHING_DISABLED 1
 #endif
 
index 3d27a2e..4c23442 100644 (file)
@@ -1,3 +1,43 @@
+2019-01-12  Timothy Hatcher  <timothy@apple.com>
+
+        Have prefers-color-scheme: light always match on macOS versions before Mojave.
+        https://bugs.webkit.org/show_bug.cgi?id=191655
+        rdar://problem/46074680
+
+        Reviewed by Megan Gardner.
+
+        Tests: css-dark-mode/older-systems/prefers-color-scheme.html
+               css-dark-mode/older-systems/supported-color-schemes-css.html
+               css-dark-mode/older-systems/supported-color-schemes.html
+
+        Use new HAVE(OS_DARK_MODE_SUPPORT) to make it easier to find code.
+        Added HAVE(OS_DARK_MODE_SUPPORT) around more bits to make it work on older systems.
+
+        * Configurations/FeatureDefines.xcconfig:
+        * dom/Document.cpp:
+        (WebCore::Document::useDarkAppearance const):
+        * inspector/agents/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::enable):
+        * page/Page.cpp:
+        (WebCore::Page::setUseDarkAppearance):
+        (WebCore::Page::useDarkAppearance const):
+        (WebCore::Page::setUseDarkAppearanceOverride):
+        * platform/mac/LocalDefaultSystemAppearance.h:
+        (WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const):
+        * platform/mac/LocalDefaultSystemAppearance.mm:
+        (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
+        (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
+        * platform/mac/ScrollAnimatorMac.mm:
+        * rendering/RenderThemeMac.mm:
+        (-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
+        (-[WebListButtonCell drawWithFrame:inView:]):
+        (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
+        (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
+        (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
+        (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
+        (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
+        (WebCore::RenderThemeMac::systemColor const):
+
 2019-01-12  Zalan Bujtas  <zalan@apple.com>
 
         [LFC] Block/InlinFormattingContext should take Block/InlineFormattingState
index 22481d3..6073393 100644 (file)
@@ -113,8 +113,7 @@ ENABLE_CURSOR_VISIBILITY = ENABLE_CURSOR_VISIBILITY;
 ENABLE_CUSTOM_SCHEME_HANDLER = ;
 
 ENABLE_DARK_MODE_CSS = $(ENABLE_DARK_MODE_CSS_$(WK_PLATFORM_NAME));
-ENABLE_DARK_MODE_CSS_macosx = $(ENABLE_DARK_MODE_CSS$(WK_MACOS_1014));
-ENABLE_DARK_MODE_CSS_MACOS_SINCE_1014 = ENABLE_DARK_MODE_CSS;
+ENABLE_DARK_MODE_CSS_macosx = ENABLE_DARK_MODE_CSS;
 
 ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(WK_PLATFORM_NAME));
 ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
index 58fdc59..7dfd670 100644 (file)
@@ -1,3 +1,13 @@
+2019-01-12  Timothy Hatcher  <timothy@apple.com>
+
+        Have prefers-color-scheme: light always match on macOS versions before Mojave.
+        https://bugs.webkit.org/show_bug.cgi?id=191655
+        rdar://problem/46074680
+
+        Reviewed by Megan Gardner.
+
+        * Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
+
 2019-01-12  Dan Bernstein  <mitz@apple.com>
 
         [Cocoa] Avoid importing directly from subumbrella frameworks
index 22481d3..6073393 100644 (file)
@@ -113,8 +113,7 @@ ENABLE_CURSOR_VISIBILITY = ENABLE_CURSOR_VISIBILITY;
 ENABLE_CUSTOM_SCHEME_HANDLER = ;
 
 ENABLE_DARK_MODE_CSS = $(ENABLE_DARK_MODE_CSS_$(WK_PLATFORM_NAME));
-ENABLE_DARK_MODE_CSS_macosx = $(ENABLE_DARK_MODE_CSS$(WK_MACOS_1014));
-ENABLE_DARK_MODE_CSS_MACOS_SINCE_1014 = ENABLE_DARK_MODE_CSS;
+ENABLE_DARK_MODE_CSS_macosx = ENABLE_DARK_MODE_CSS;
 
 ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(WK_PLATFORM_NAME));
 ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
index 74fe607..c7b21da 100644 (file)
@@ -7419,6 +7419,7 @@ bool Document::useSystemAppearance() const
 
 bool Document::useDarkAppearance(const RenderStyle* style) const
 {
+#if HAVE(OS_DARK_MODE_SUPPORT)
 #if ENABLE(DARK_MODE_CSS)
     OptionSet<ColorSchemes> supportedColorSchemes;
 
@@ -7447,6 +7448,9 @@ bool Document::useDarkAppearance(const RenderStyle* style) const
     if (supportedColorSchemes.contains(ColorSchemes::Dark))
         return pageUsesDarkAppearance;
 #endif
+#else
+    UNUSED_PARAM(style);
+#endif
 
     return false;
 }
index 5c1ca92..74deed5 100644 (file)
@@ -301,7 +301,7 @@ void InspectorPageAgent::enable(ErrorString&)
     stopwatch->reset();
     stopwatch->start();
 
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
     defaultAppearanceDidChange(m_page.defaultUseDarkAppearance());
 #endif
 }
index e81cb23..da009b5 100644 (file)
@@ -2666,6 +2666,7 @@ void Page::setUseSystemAppearance(bool value)
 
 void Page::setUseDarkAppearance(bool value)
 {
+#if HAVE(OS_DARK_MODE_SUPPORT)
     if (m_useDarkAppearance == value)
         return;
 
@@ -2674,26 +2675,37 @@ void Page::setUseDarkAppearance(bool value)
     InspectorInstrumentation::defaultAppearanceDidChange(*this, value);
 
     appearanceDidChange();
+#else
+    UNUSED_PARAM(value);
+#endif
 }
 
 bool Page::useDarkAppearance() const
 {
+#if HAVE(OS_DARK_MODE_SUPPORT)
     FrameView* view = mainFrame().view();
     if (!view || !equalLettersIgnoringASCIICase(view->mediaType(), "screen"))
         return false;
     if (m_useDarkAppearanceOverride)
         return m_useDarkAppearanceOverride.value();
     return m_useDarkAppearance;
+#else
+    return false;
+#endif
 }
 
 void Page::setUseDarkAppearanceOverride(Optional<bool> valueOverride)
 {
+#if HAVE(OS_DARK_MODE_SUPPORT)
     if (valueOverride == m_useDarkAppearanceOverride)
         return;
 
     m_useDarkAppearanceOverride = valueOverride;
 
     appearanceDidChange();
+#else
+    UNUSED_PARAM(valueOverride);
+#endif
 }
 
 void Page::setFullscreenInsets(const FloatBoxExtent& insets)
index 1cb1b2b..d99b822 100644 (file)
@@ -45,7 +45,7 @@ public:
 
     bool usingDarkAppearance() const
     {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
         return m_usingDarkAppearance;
 #else
         return false;
@@ -53,7 +53,7 @@ public:
     }
 
 private:
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
     RetainPtr<NSAppearance> m_savedSystemAppearance;
     bool m_usingDarkAppearance { false };
 #endif
index 6b6821e..f645fb7 100644 (file)
@@ -33,7 +33,7 @@ namespace WebCore {
 
 LocalDefaultSystemAppearance::LocalDefaultSystemAppearance(bool useDarkAppearance)
 {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
     m_savedSystemAppearance = [NSAppearance currentAppearance];
     m_usingDarkAppearance = useDarkAppearance;
 
@@ -45,7 +45,7 @@ LocalDefaultSystemAppearance::LocalDefaultSystemAppearance(bool useDarkAppearanc
 
 LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance()
 {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
     [NSAppearance setCurrentAppearance:m_savedSystemAppearance.get()];
 #endif
 }
index c9143ee..e0cf532 100644 (file)
@@ -527,7 +527,7 @@ enum FeatureToAnimate {
     return _scrollbar->supportsUpdateOnSecondaryThread();
 }
 
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
 - (NSAppearance *)effectiveAppearanceForScrollerImp:(NSScrollerImp *)scrollerImp
 {
     UNUSED_PARAM(scrollerImp);
index 9b80c02..afee9d0 100644 (file)
@@ -162,7 +162,7 @@ static const double progressAnimationNumFrames = 256;
 
 - (CFDictionaryRef)_adjustedCoreUIDrawOptionsForDrawingBordersOnly:(CFDictionaryRef)defaultOptions
 {
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
     // Dark mode controls don't have borders, just a semi-transparent background of shadows.
     // In the dark mode case we can't disable borders, or we will not paint anything for the control.
     NSAppearanceName appearance = [self.controlView.effectiveAppearance bestMatchFromAppearancesWithNames:@[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]];
@@ -235,7 +235,7 @@ static const CGFloat listButtonCornerRadius = 5.0f;
 
     // FIXME: Obtain the gradient colors from CoreUI or AppKit
     RetainPtr<NSGradient> gradient;
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
     NSUserAccentColor accentColor = NSColorGetUserAccentColor();
     if (accentColor == NSUserAccentColorRed)
         gradient = adoptNS([[NSGradient alloc] initWithStartingColor:[NSColor colorWithRed:(212.0 / 255) green:(122.0 / 255) blue:(117.0 / 255) alpha:1.0] endingColor:[NSColor colorWithRed:(189.0 / 255) green:(34.0 / 255) blue:(23.0 / 255) alpha:1.0]]);
@@ -398,7 +398,7 @@ Color RenderThemeMac::platformActiveSelectionBackgroundColor(OptionSet<StyleColo
 
 Color RenderThemeMac::platformInactiveSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const
 {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
     LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance));
     return colorFromNSColor([NSColor unemphasizedSelectedTextBackgroundColor]);
 #else
@@ -435,7 +435,7 @@ Color RenderThemeMac::platformActiveSelectionForegroundColor(OptionSet<StyleColo
 
 Color RenderThemeMac::platformInactiveSelectionForegroundColor(OptionSet<StyleColor::Options> options) const
 {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
     LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance));
     if (localAppearance.usingDarkAppearance())
         return colorFromNSColor([NSColor unemphasizedSelectedTextColor]);
@@ -448,7 +448,7 @@ Color RenderThemeMac::platformInactiveSelectionForegroundColor(OptionSet<StyleCo
 
 Color RenderThemeMac::platformActiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const
 {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
     LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance));
     return colorFromNSColor([NSColor selectedContentBackgroundColor]);
 #else
@@ -459,7 +459,7 @@ Color RenderThemeMac::platformActiveListBoxSelectionBackgroundColor(OptionSet<St
 
 Color RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const
 {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
     LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance));
     return colorFromNSColor([NSColor unemphasizedSelectedContentBackgroundColor]);
 #else
@@ -476,7 +476,7 @@ Color RenderThemeMac::platformActiveListBoxSelectionForegroundColor(OptionSet<St
 
 Color RenderThemeMac::platformInactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options> options) const
 {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
     LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance));
     return colorFromNSColor([NSColor unemphasizedSelectedTextColor]);
 #else
@@ -659,7 +659,7 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
             return focusRingColor(options);
 
         case CSSValueAppleSystemControlAccent:
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
             return systemAppearanceColor(cache.systemControlAccentColor, @selector(controlAccentColor));
 #else
             return systemAppearanceColor(cache.systemControlAccentColor, @selector(alternateSelectedControlColor));
@@ -740,7 +740,7 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
             case CSSValueAppleSystemAlternateSelectedText:
                 return @selector(alternateSelectedControlTextColor);
             case CSSValueAppleSystemUnemphasizedSelectedContentBackground:
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
                 return @selector(unemphasizedSelectedContentBackgroundColor);
 #else
                 return @selector(secondarySelectedControlColor);
@@ -748,13 +748,13 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
             case CSSValueAppleSystemSelectedText:
                 return @selector(selectedTextColor);
             case CSSValueAppleSystemUnemphasizedSelectedText:
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
                 return @selector(unemphasizedSelectedTextColor);
 #else
                 return @selector(textColor);
 #endif
             case CSSValueAppleSystemUnemphasizedSelectedTextBackground:
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
                 return @selector(unemphasizedSelectedTextBackgroundColor);
 #else
                 return @selector(secondarySelectedControlColor);
@@ -769,7 +769,7 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
                 return nullptr;
 #endif
             case CSSValueAppleSystemContainerBorder:
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
                 return @selector(containerBorderColor);
 #else
                 // Handled below.
@@ -786,7 +786,7 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
             case CSSValueAppleSystemGrid:
                 return @selector(gridColor);
             case CSSValueAppleSystemSeparator:
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
                 return @selector(separatorColor);
 #else
                 return @selector(gridColor);
@@ -869,13 +869,13 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
             return platformActiveTextSearchHighlightColor(options);
 #endif
 
-#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101400
+#if !HAVE(OS_DARK_MODE_SUPPORT)
         case CSSValueAppleSystemContainerBorder:
             return 0xFFC5C5C5;
 #endif
 
         case CSSValueAppleSystemEvenAlternatingContentBackground: {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
             NSArray<NSColor *> *alternateColors = [NSColor alternatingContentBackgroundColors];
 #else
             NSArray<NSColor *> *alternateColors = [NSColor controlAlternatingRowBackgroundColors];
@@ -885,7 +885,7 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
         }
 
         case CSSValueAppleSystemOddAlternatingContentBackground: {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
             NSArray<NSColor *> *alternateColors = [NSColor alternatingContentBackgroundColors];
 #else
             NSArray<NSColor *> *alternateColors = [NSColor controlAlternatingRowBackgroundColors];
index 0656152..9cf5967 100644 (file)
@@ -1,3 +1,16 @@
+2019-01-12  Timothy Hatcher  <timothy@apple.com>
+
+        Have prefers-color-scheme: light always match on macOS versions before Mojave.
+        https://bugs.webkit.org/show_bug.cgi?id=191655
+        rdar://problem/46074680
+
+        Reviewed by Megan Gardner.
+
+        * Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::effectiveAppearanceIsDark):
+        * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
+
 2019-01-12  Dan Bernstein  <mitz@apple.com>
 
         [Cocoa] Avoid importing directly from subumbrella frameworks
index 22481d3..6073393 100644 (file)
@@ -113,8 +113,7 @@ ENABLE_CURSOR_VISIBILITY = ENABLE_CURSOR_VISIBILITY;
 ENABLE_CUSTOM_SCHEME_HANDLER = ;
 
 ENABLE_DARK_MODE_CSS = $(ENABLE_DARK_MODE_CSS_$(WK_PLATFORM_NAME));
-ENABLE_DARK_MODE_CSS_macosx = $(ENABLE_DARK_MODE_CSS$(WK_MACOS_1014));
-ENABLE_DARK_MODE_CSS_MACOS_SINCE_1014 = ENABLE_DARK_MODE_CSS;
+ENABLE_DARK_MODE_CSS_macosx = ENABLE_DARK_MODE_CSS;
 
 ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(WK_PLATFORM_NAME));
 ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
index d4eb467..7f512db 100644 (file)
@@ -5328,7 +5328,7 @@ void WebViewImpl::effectiveAppearanceDidChange()
 
 bool WebViewImpl::effectiveAppearanceIsDark()
 {
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
     NSAppearanceName appearance = [[m_view effectiveAppearance] bestMatchFromAppearancesWithNames:@[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]];
     return [appearance isEqualToString:NSAppearanceNameDarkAqua];
 #else
index d964f57..daf9c9b 100644 (file)
@@ -195,7 +195,7 @@ enum class FeatureToAnimate {
     return true;
 }
 
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
 - (NSAppearance *)effectiveAppearanceForScrollerImp:(NSScrollerImp *)scrollerImp
 {
     UNUSED_PARAM(scrollerImp);
index e596ff4..e54b8f0 100644 (file)
@@ -1,3 +1,15 @@
+2019-01-12  Timothy Hatcher  <timothy@apple.com>
+
+        Have prefers-color-scheme: light always match on macOS versions before Mojave.
+        https://bugs.webkit.org/show_bug.cgi?id=191655
+        rdar://problem/46074680
+
+        Reviewed by Megan Gardner.
+
+        * Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
+        * WebView/WebView.mm:
+        (-[WebView _effectiveAppearanceIsDark]):
+
 2019-01-12  Dan Bernstein  <mitz@apple.com>
 
         [Cocoa] Avoid importing directly from subumbrella frameworks
index 22481d3..6073393 100644 (file)
@@ -113,8 +113,7 @@ ENABLE_CURSOR_VISIBILITY = ENABLE_CURSOR_VISIBILITY;
 ENABLE_CUSTOM_SCHEME_HANDLER = ;
 
 ENABLE_DARK_MODE_CSS = $(ENABLE_DARK_MODE_CSS_$(WK_PLATFORM_NAME));
-ENABLE_DARK_MODE_CSS_macosx = $(ENABLE_DARK_MODE_CSS$(WK_MACOS_1014));
-ENABLE_DARK_MODE_CSS_MACOS_SINCE_1014 = ENABLE_DARK_MODE_CSS;
+ENABLE_DARK_MODE_CSS_macosx = ENABLE_DARK_MODE_CSS;
 
 ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(WK_PLATFORM_NAME));
 ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
index 9397866..ab83845 100644 (file)
@@ -5297,7 +5297,7 @@ static Vector<String> toStringVector(NSArray* patterns)
 
 - (bool)_effectiveAppearanceIsDark
 {
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if HAVE(OS_DARK_MODE_SUPPORT)
     NSAppearanceName appearance = [[self effectiveAppearance] bestMatchFromAppearancesWithNames:@[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]];
     return [appearance isEqualToString:NSAppearanceNameDarkAqua];
 #else
index 8e0b368..73a2cca 100644 (file)
@@ -1,3 +1,14 @@
+2019-01-12  Timothy Hatcher  <timothy@apple.com>
+
+        Have prefers-color-scheme: light always match on macOS versions before Mojave.
+        https://bugs.webkit.org/show_bug.cgi?id=191655
+        rdar://problem/46074680
+
+        Reviewed by Megan Gardner.
+
+        * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
+        * TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm:
+
 2019-01-12  Dan Bernstein  <mitz@apple.com>
 
         [Cocoa] Avoid importing directly from subumbrella frameworks
index 22481d3..6073393 100644 (file)
@@ -113,8 +113,7 @@ ENABLE_CURSOR_VISIBILITY = ENABLE_CURSOR_VISIBILITY;
 ENABLE_CUSTOM_SCHEME_HANDLER = ;
 
 ENABLE_DARK_MODE_CSS = $(ENABLE_DARK_MODE_CSS_$(WK_PLATFORM_NAME));
-ENABLE_DARK_MODE_CSS_macosx = $(ENABLE_DARK_MODE_CSS$(WK_MACOS_1014));
-ENABLE_DARK_MODE_CSS_MACOS_SINCE_1014 = ENABLE_DARK_MODE_CSS;
+ENABLE_DARK_MODE_CSS_macosx = ENABLE_DARK_MODE_CSS;
 
 ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(WK_PLATFORM_NAME));
 ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
index b02bd56..99ec8d0 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "config.h"
 
-#if ENABLE(DARK_MODE_CSS) && WK_HAVE_C_SPI
+#if ENABLE(DARK_MODE_CSS) && HAVE(OS_DARK_MODE_SUPPORT) && WK_HAVE_C_SPI
 
 #include "PlatformUtilities.h"
 #include "PlatformWebView.h"