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().
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@245368 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index bda82a3..3deb599 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -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
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index a2fbd8f..cecd766 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -6891,10 +6891,9 @@
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 @@
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 @@
options.add(StyleColor::Options::UseSystemAppearance);
if (useDarkAppearance(style))
options.add(StyleColor::Options::UseDarkAppearance);
+ if (useInactiveAppearance())
+ options.add(StyleColor::Options::UseInactiveAppearance);
return options;
}
diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h
index 135ef0b..971fe4c 100644
--- a/Source/WebCore/dom/Document.h
+++ b/Source/WebCore/dom/Document.h
@@ -567,6 +567,7 @@
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;