Update prefers-color-scheme media query matching based on GitHub issue #3278.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2018 22:24:09 +0000 (22:24 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2018 22:24:09 +0000 (22:24 +0000)
commitb5e58d358b2b1d16df6ed73b35411ae7ec5baab1
treea29e2b14739c13c4e2a4a1728698a59e87ffc64b
parentc93fda9df5d27279e43e3915d4784f9ecda5767e
Update prefers-color-scheme media query matching based on GitHub issue #3278.
https://bugs.webkit.org/show_bug.cgi?id=191654
rdar://problem/46074307

Reviewed by Simon Fraser.

Source/WebCore:

Test: css-dark-mode/prefers-color-scheme.html

* css/MediaQueryEvaluator.cpp:
(WebCore::prefersColorSchemeEvaluate): Return true when there is no value. Return false
for `no-preference` since there is no macOS option for no user preference.
* css/MediaQueryExpression.cpp:
(WebCore::isFeatureValidWithoutValue): Added prefers-color-scheme.

LayoutTests:

* css-dark-mode/prefers-color-scheme-expected.txt: Rebaseline.
* css-dark-mode/prefers-color-scheme.html: Updates to better match the spec.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css-dark-mode/prefers-color-scheme-expected.txt
LayoutTests/css-dark-mode/prefers-color-scheme.html
Source/WebCore/ChangeLog
Source/WebCore/css/MediaQueryEvaluator.cpp
Source/WebCore/css/MediaQueryExpression.cpp