REGRESSION (r232806): Facebook login fields have blue fill background instead of...
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Jun 2018 03:02:24 +0000 (03:02 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Jun 2018 03:02:24 +0000 (03:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187207
Source/WebCore:

<rdar://problem/41606349>

Reviewed by Tim Horton.

This happens because a 'prefers-dark-interface' media query on UA sheet always evaluates to true in dark mode.

Tests: fast/forms/input-background-ua-media-query.html

* css/MediaQueryEvaluator.cpp:
(WebCore::prefersDarkInterfaceEvaluate):

Make prefers-dark-interface media query match only when using system appearance.

LayoutTests:

Reviewed by Tim Horton.

* fast/forms/input-background-ua-media-query-expected.html: Added.
* fast/forms/input-background-ua-media-query.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/forms/input-background-ua-media-query-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/input-background-ua-media-query.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/MediaQueryEvaluator.cpp

index bbc31d9..10c9ed7 100644 (file)
@@ -1,3 +1,13 @@
+2018-06-29  Antti Koivisto  <antti@apple.com>
+
+        REGRESSION (r232806): Facebook login fields have blue fill background instead of white
+        https://bugs.webkit.org/show_bug.cgi?id=187207
+
+        Reviewed by Tim Horton.
+
+        * fast/forms/input-background-ua-media-query-expected.html: Added.
+        * fast/forms/input-background-ua-media-query.html: Added.
+
 2018-06-29  Daniel Bates  <dabates@apple.com>
 
         REGRESSION (r230921): Cannot log in to forums.swift.org using GitHub account
diff --git a/LayoutTests/fast/forms/input-background-ua-media-query-expected.html b/LayoutTests/fast/forms/input-background-ua-media-query-expected.html
new file mode 100644 (file)
index 0000000..8b3ef65
--- /dev/null
@@ -0,0 +1,4 @@
+<style>
+body { background-color: green }
+</style>
+<input value=foo style="background-color:white">
diff --git a/LayoutTests/fast/forms/input-background-ua-media-query.html b/LayoutTests/fast/forms/input-background-ua-media-query.html
new file mode 100644 (file)
index 0000000..1372473
--- /dev/null
@@ -0,0 +1,5 @@
+<style>
+body { background-color: green }
+</style>
+<input value=foo>
+
index db0c522..ebe65e0 100644 (file)
@@ -1,3 +1,20 @@
+2018-06-29  Antti Koivisto  <antti@apple.com>
+
+        REGRESSION (r232806): Facebook login fields have blue fill background instead of white
+        https://bugs.webkit.org/show_bug.cgi?id=187207
+        <rdar://problem/41606349>
+
+        Reviewed by Tim Horton.
+
+        This happens because a 'prefers-dark-interface' media query on UA sheet always evaluates to true in dark mode.
+
+        Tests: fast/forms/input-background-ua-media-query.html
+
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::prefersDarkInterfaceEvaluate):
+
+        Make prefers-dark-interface media query match only when using system appearance.
+
 2018-06-29  Daniel Bates  <dabates@apple.com>
 
         REGRESSION (r230921): Cannot log in to forums.swift.org using GitHub account
index cc6eb1b..4117778 100644 (file)
@@ -717,7 +717,7 @@ static bool prefersDarkInterfaceEvaluate(CSSValue* value, const CSSToLengthConve
 {
     bool prefersDarkInterface = false;
 
-    if (!frame.page()->defaultAppearance())
+    if (frame.page()->useSystemAppearance() && !frame.page()->defaultAppearance())
         prefersDarkInterface = true;
 
     if (!value)