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)
commit5f75b7876905c45f44cba3024899b55c03c7f95e
treea47a1057635cc59164e37b9769f0f9d562771a90
parent0a70ed2296b62f2cae13f21708a2c219bae21457
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.

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