REGRESSION (r245072): Missing code in Document::styleColorOptions to propagate StyleC...
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 May 2019 23:50:34 +0000 (23:50 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 May 2019 23:50:34 +0000 (23:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197930
rdar://problem/49833954

Reviewed by Wenson Hsieh and Megan Gardner.

Add some code that was missing from Document in my original patch for r245072.

* dom/Document.cpp:
(WebCore::Document::useSystemAppearance const): Drive-by fix code style.
(WebCore::Document::useInactiveAppearance const): Added.
(WebCore::Document::styleColorOptions const): Add StyleColor::Options::UseInactiveAppearance.
* dom/Document.h: Added useInactiveAppearance().

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

Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h

index bda82a3..3deb599 100644 (file)
@@ -1,3 +1,19 @@
+2019-05-15  Timothy Hatcher  <timothy@apple.com>
+
+        REGRESSION (r245072): Missing code in Document::styleColorOptions to propagate StyleColor::Options::UseInactiveAppearance
+        https://bugs.webkit.org/show_bug.cgi?id=197930
+        rdar://problem/49833954
+
+        Reviewed by Wenson Hsieh and Megan Gardner.
+
+        Add some code that was missing from Document in my original patch for r245072.
+
+        * dom/Document.cpp:
+        (WebCore::Document::useSystemAppearance const): Drive-by fix code style.
+        (WebCore::Document::useInactiveAppearance const): Added.
+        (WebCore::Document::styleColorOptions const): Add StyleColor::Options::UseInactiveAppearance.
+        * dom/Document.h: Added useInactiveAppearance().
+
 2019-05-15  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: user gesture toggle should also force user interaction flag
index a2fbd8f..cecd766 100644 (file)
@@ -6891,10 +6891,9 @@ float Document::deviceScaleFactor() const
 
 bool Document::useSystemAppearance() const
 {
-    bool useSystemAppearance = false;
-    if (Page* documentPage = page())
-        useSystemAppearance = documentPage->useSystemAppearance();
-    return useSystemAppearance;
+    if (auto* documentPage = page())
+        return documentPage->useSystemAppearance();
+    return false;
 }
 
 bool Document::useDarkAppearance(const RenderStyle* style) const
@@ -6935,6 +6934,13 @@ bool Document::useDarkAppearance(const RenderStyle* style) const
     return false;
 }
 
+bool Document::useInactiveAppearance() const
+{
+    if (auto* documentPage = page())
+        return documentPage->useInactiveAppearance();
+    return false;
+}
+
 OptionSet<StyleColor::Options> Document::styleColorOptions(const RenderStyle* style) const
 {
     OptionSet<StyleColor::Options> options;
@@ -6942,6 +6948,8 @@ OptionSet<StyleColor::Options> Document::styleColorOptions(const RenderStyle* st
         options.add(StyleColor::Options::UseSystemAppearance);
     if (useDarkAppearance(style))
         options.add(StyleColor::Options::UseDarkAppearance);
+    if (useInactiveAppearance())
+        options.add(StyleColor::Options::UseInactiveAppearance);
     return options;
 }
 
index 135ef0b..971fe4c 100644 (file)
@@ -567,6 +567,7 @@ public:
     float deviceScaleFactor() const;
 
     WEBCORE_EXPORT bool useSystemAppearance() const;
+    WEBCORE_EXPORT bool useInactiveAppearance() const;
     WEBCORE_EXPORT bool useDarkAppearance(const RenderStyle*) const;
 
     OptionSet<StyleColor::Options> styleColorOptions(const RenderStyle*) const;