Input form controls have a white background in dark mode, when they should not.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2018 20:26:32 +0000 (20:26 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2018 20:26:32 +0000 (20:26 +0000)
commit1168ef2ec75355252792f7a726e801a7ca41a6df
treef9d6ff92cd442b069e85769f9d64bad61b8af291
parent3ced7f06f51bf844a90f195819dbe02e091a844f
Input form controls have a white background in dark mode, when they should not.

https://bugs.webkit.org/show_bug.cgi?id=186577
rdar://problem/39258325

Reviewed by Tim Horton.

Source/WebCore:

* DerivedSources.make: Allow WTF_PLATFORM_MAC ifdefs to preprocess in html.css.
* css/CSSValueKeywords.in: Added -apple-system-control-background.
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent): Allow dark mode media query in user agent stylesheets.
(WebCore::isFeatureValidWithoutValue): Ditto.
* css/MediaQueryParserContext.cpp:
(WebCore::MediaQueryParserContext::MediaQueryParserContext): Transfer the CSSParserMode from CSSParserContext.
* css/MediaQueryParserContext.h:
* css/html.css: Set color and background-color to semantic colors for input, textarea, and select.
Make input background-color transparent in dark mode to match AppKit.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const): Added -apple-system-control-background.
(WebCore::RenderThemeMac::paintTextField): Adjust the drawing rect to match new artwork in macOS 10.14.

LayoutTests:

* fast/css/apple-system-control-colors-expected.txt: Updated.
* fast/css/apple-system-control-colors.html: Added -apple-system-control-background.
* platform/gtk/fast/css/apple-system-control-colors-expected.txt: Updated.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232806 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/apple-system-control-colors-expected.txt
LayoutTests/fast/css/apple-system-control-colors.html
LayoutTests/platform/gtk/fast/css/apple-system-control-colors-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/MediaQueryExpression.cpp
Source/WebCore/css/MediaQueryParserContext.cpp
Source/WebCore/css/MediaQueryParserContext.h
Source/WebCore/css/html.css
Source/WebCore/rendering/RenderThemeMac.mm