Add plumbing for inactive system colors in RenderTheme cache.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 May 2019 22:24:56 +0000 (22:24 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 May 2019 22:24:56 +0000 (22:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197699
rdar://problem/49406936

Reviewed by Tim Horton.

Source/WebCore:

* css/StyleColor.h:
* page/Page.cpp:
(WebCore::Page::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
* page/Page.h:
(WebCore::Page::useInactiveAppearance const):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::purgeCaches):
(WebCore::RenderTheme::platformColorsDidChange):
(WebCore::RenderTheme::colorCache const):
* rendering/RenderTheme.h:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setUseDarkAppearanceInternal):

Source/WebKit:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::effectiveAppearanceIsInactive):
* UIProcess/PageClient.h:
(WebKit::PageClient::effectiveAppearanceIsInactive const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::useInactiveAppearance const):
(WebKit::WebPageProxy::effectiveAppearanceDidChange):
* UIProcess/WebPageProxy.h:
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::effectiveAppearanceIsInactive const):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetUseDarkAppearance):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shrinkToFitContentTimer):
(WebKit::WebPage::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _setUseDarkAppearance:]):
(-[WebView _useInactiveAppearance]):
(-[WebView _setUseInactiveAppearance:]):
(-[WebView _setUseDarkAppearance:useInactiveAppearance:]):
(-[WebView _effectiveAppearanceIsInactive]):
(-[WebView viewDidChangeEffectiveAppearance]):
* WebView/WebViewPrivate.h:

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

25 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/StyleColor.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPageCreationParameters.cpp
Source/WebKit/Shared/WebPageCreationParameters.h
Source/WebKit/UIProcess/Cocoa/WebViewImpl.h
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/PageClient.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/mac/PageClientImplMac.h
Source/WebKit/UIProcess/mac/PageClientImplMac.mm
Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/WebPage.messages.in
Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/mac/WebView/WebViewPrivate.h

index a745934..2c4faf7 100644 (file)
@@ -1,3 +1,24 @@
+2019-05-08  Timothy Hatcher  <timothy@apple.com>
+
+        Add plumbing for inactive system colors in RenderTheme cache.
+        https://bugs.webkit.org/show_bug.cgi?id=197699
+        rdar://problem/49406936
+
+        Reviewed by Tim Horton.
+
+        * css/StyleColor.h:
+        * page/Page.cpp:
+        (WebCore::Page::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
+        * page/Page.h:
+        (WebCore::Page::useInactiveAppearance const):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::purgeCaches):
+        (WebCore::RenderTheme::platformColorsDidChange):
+        (WebCore::RenderTheme::colorCache const):
+        * rendering/RenderTheme.h:
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::setUseDarkAppearanceInternal):
+
 2019-05-08  Robin Morisset  <rmorisset@apple.com>
 
         All prototypes should call didBecomePrototype()
index d7bf5a5..853e4ab 100644 (file)
@@ -54,7 +54,8 @@ public:
     enum class Options : uint8_t {
         ForVisitedLink = 1 << 0,
         UseSystemAppearance = 1 << 1,
-        UseDarkAppearance = 1 << 2
+        UseDarkAppearance = 1 << 2,
+        UseInactiveAppearance = 1 << 3
     };
 
     static Color colorFromKeyword(CSSValueID, OptionSet<Options>);
index c9e7722..6d0bdfd 100644 (file)
@@ -2726,19 +2726,27 @@ void Page::setUseSystemAppearance(bool value)
     }
 }
 
-void Page::setUseDarkAppearance(bool value)
+void Page::effectiveAppearanceDidChange(bool useDarkAppearance, bool useInactiveAppearance)
 {
 #if HAVE(OS_DARK_MODE_SUPPORT)
-    if (m_useDarkAppearance == value)
+    if (m_useDarkAppearance == useDarkAppearance && m_useInactiveAppearance == useInactiveAppearance)
         return;
 
-    m_useDarkAppearance = value;
+    m_useDarkAppearance = useDarkAppearance;
+    m_useInactiveAppearance = useInactiveAppearance;
 
-    InspectorInstrumentation::defaultAppearanceDidChange(*this, value);
+    InspectorInstrumentation::defaultAppearanceDidChange(*this, useDarkAppearance);
 
     appearanceDidChange();
 #else
-    UNUSED_PARAM(value);
+    UNUSED_PARAM(useDarkAppearance);
+
+    if (m_useInactiveAppearance == useInactiveAppearance)
+        return;
+
+    m_useInactiveAppearance = useInactiveAppearance;
+
+    appearanceDidChange();
 #endif
 }
 
index fcf3f77..ec3f53c 100644 (file)
@@ -380,7 +380,8 @@ public:
     WEBCORE_EXPORT void setUseSystemAppearance(bool);
     
     WEBCORE_EXPORT bool useDarkAppearance() const;
-    WEBCORE_EXPORT void setUseDarkAppearance(bool);
+    bool useInactiveAppearance() const { return m_useInactiveAppearance; }
+    WEBCORE_EXPORT void effectiveAppearanceDidChange(bool useDarkAppearance, bool useInactiveAppearance);
     bool defaultUseDarkAppearance() const { return m_useDarkAppearance; }
     void setUseDarkAppearanceOverride(Optional<bool>);
 
@@ -834,6 +835,7 @@ private:
 #endif
     
     bool m_useSystemAppearance { false };
+    bool m_useInactiveAppearance { false };
     bool m_useDarkAppearance { false };
     Optional<bool> m_useDarkAppearanceOverride;
 
index 585ef88..437f4c5 100644 (file)
@@ -1212,23 +1212,24 @@ void RenderTheme::adjustSearchFieldResultsButtonStyle(StyleResolver&, RenderStyl
 
 void RenderTheme::purgeCaches()
 {
-    m_colorCache = ColorCache();
-    m_darkColorCache = ColorCache();
+    m_colorCacheMap.clear();
 }
 
 void RenderTheme::platformColorsDidChange()
 {
-    m_colorCache = ColorCache();
-    m_darkColorCache = ColorCache();
+    m_colorCacheMap.clear();
 
     Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment();
 }
 
 auto RenderTheme::colorCache(OptionSet<StyleColor::Options> options) const -> ColorCache&
 {
-    if (options.contains(StyleColor::Options::UseDarkAppearance))
-        return m_darkColorCache;
-    return m_colorCache;
+    auto optionsIgnoringVisitedLink = options;
+    optionsIgnoringVisitedLink.remove(StyleColor::Options::ForVisitedLink);
+
+    return m_colorCacheMap.ensure(optionsIgnoringVisitedLink.toRaw(), [] {
+        return ColorCache();
+    }).iterator->value;
 }
 
 FontCascadeDescription& RenderTheme::cachedSystemFontDescription(CSSValueID systemFontID) const
index 471a9a3..1d61e48 100644 (file)
@@ -441,8 +441,7 @@ protected:
     virtual ColorCache& colorCache(OptionSet<StyleColor::Options>) const;
 
 private:
-    mutable ColorCache m_colorCache;
-    mutable ColorCache m_darkColorCache;
+    mutable HashMap<uint8_t, ColorCache, DefaultHash<uint8_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint8_t>> m_colorCacheMap;
 };
 
 } // namespace WebCore
index 39cffd5..16353d9 100644 (file)
@@ -548,7 +548,7 @@ void InternalSettings::setUseDarkAppearanceInternal(bool useDarkAppearance)
     }
 #endif
     ASSERT(m_page);
-    m_page->setUseDarkAppearance(useDarkAppearance);
+    m_page->effectiveAppearanceDidChange(useDarkAppearance, m_page->useInactiveAppearance());
 }
 
 ExceptionOr<void> InternalSettings::setUseDarkAppearance(bool useDarkAppearance)
index fab063e..eb799bf 100644 (file)
@@ -1,3 +1,38 @@
+2019-05-08  Timothy Hatcher  <timothy@apple.com>
+
+        Add plumbing for inactive system colors in RenderTheme cache.
+        https://bugs.webkit.org/show_bug.cgi?id=197699
+        rdar://problem/49406936
+
+        Reviewed by Tim Horton.
+
+        * Shared/WebPageCreationParameters.cpp:
+        (WebKit::WebPageCreationParameters::encode const):
+        (WebKit::WebPageCreationParameters::decode):
+        * Shared/WebPageCreationParameters.h:
+        * UIProcess/Cocoa/WebViewImpl.h:
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::effectiveAppearanceIsInactive):
+        * UIProcess/PageClient.h:
+        (WebKit::PageClient::effectiveAppearanceIsInactive const):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::creationParameters):
+        (WebKit::WebPageProxy::useInactiveAppearance const):
+        (WebKit::WebPageProxy::effectiveAppearanceDidChange):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/mac/PageClientImplMac.h:
+        * UIProcess/mac/PageClientImplMac.mm:
+        (WebKit::PageClientImpl::effectiveAppearanceIsInactive const):
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageSetUseDarkAppearance):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::m_shrinkToFitContentTimer):
+        (WebKit::WebPage::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
+        (WebKit::WebPage::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
+
 2019-05-08  Chris Dumez  <cdumez@apple.com>
 
         Regression: Crash at WebKit: PAL::HysteresisActivity::start
index 47c6ed6..bd9db40 100644 (file)
@@ -77,6 +77,7 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const
     encoder << controlledByAutomation;
     encoder << isProcessSwap;
     encoder << useDarkAppearance;
+    encoder << useInactiveAppearance;
 
 #if PLATFORM(MAC)
     encoder << colorSpace;
@@ -247,6 +248,8 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod
         return WTF::nullopt;
     if (!decoder.decode(parameters.useDarkAppearance))
         return WTF::nullopt;
+    if (!decoder.decode(parameters.useInactiveAppearance))
+        return WTF::nullopt;
 
 #if PLATFORM(MAC)
     if (!decoder.decode(parameters.colorSpace))
index 159fdee..0243bd1 100644 (file)
@@ -136,6 +136,7 @@ struct WebPageCreationParameters {
     bool isProcessSwap { false };
 
     bool useDarkAppearance { false };
+    bool useInactiveAppearance { false };
 
 #if PLATFORM(MAC)
     ColorSpaceData colorSpace;
index 44d9c9d..dfa37ab 100644 (file)
@@ -598,6 +598,7 @@ public:
 
     void effectiveAppearanceDidChange();
     bool effectiveAppearanceIsDark();
+    bool effectiveAppearanceIsInactive();
 
     void takeFocus(WebCore::FocusDirection);
 
index 0044be5..338d107 100644 (file)
@@ -5316,6 +5316,12 @@ bool WebViewImpl::effectiveAppearanceIsDark()
 #endif
 }
 
+bool WebViewImpl::effectiveAppearanceIsInactive()
+{
+    // FIXME: Use the window isKeyWindow state or view first responder status?
+    return false;
+}
+
 } // namespace WebKit
 
 #endif // PLATFORM(MAC)
index c89cbb1..e767f5e 100644 (file)
@@ -327,6 +327,7 @@ public:
 #endif
 
     virtual bool effectiveAppearanceIsDark() const { return false; }
+    virtual bool effectiveAppearanceIsInactive() const { return false; }
 
     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) = 0;
     virtual void exitAcceleratedCompositingMode() = 0;
index 313a9fa..fa100aa 100644 (file)
@@ -7105,6 +7105,7 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc
     parameters.layerHostingMode = m_layerHostingMode;
     parameters.controlledByAutomation = m_controlledByAutomation;
     parameters.useDarkAppearance = useDarkAppearance();
+    parameters.useInactiveAppearance = useInactiveAppearance();
 #if PLATFORM(MAC)
     parameters.colorSpace = pageClient().colorSpace();
     parameters.useSystemAppearance = m_useSystemAppearance;
@@ -8592,12 +8593,17 @@ bool WebPageProxy::useDarkAppearance() const
     return pageClient().effectiveAppearanceIsDark();
 }
 
+bool WebPageProxy::useInactiveAppearance() const
+{
+    return pageClient().effectiveAppearanceIsInactive();
+}
+
 void WebPageProxy::effectiveAppearanceDidChange()
 {
     if (!hasRunningProcess())
         return;
 
-    m_process->send(Messages::WebPage::SetUseDarkAppearance(useDarkAppearance()), m_pageID);
+    m_process->send(Messages::WebPage::EffectiveAppearanceDidChange(useDarkAppearance(), useInactiveAppearance()), m_pageID);
 }
 
 #if PLATFORM(COCOA)
index f2c4315..190b9c1 100644 (file)
@@ -943,6 +943,7 @@ public:
 
     void effectiveAppearanceDidChange();
     bool useDarkAppearance() const;
+    bool useInactiveAppearance() const;
 
 #if PLATFORM(COCOA)
     // Called by the web process through a message.
index 8dea5e2..b767fa9 100644 (file)
@@ -241,6 +241,7 @@ private:
 
     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override;
     bool effectiveAppearanceIsDark() const override;
+    bool effectiveAppearanceIsInactive() const override;
 
 #if ENABLE(DRAG_SUPPORT)
     void didPerformDragOperation(bool handled) final;
index 38f1cfb..8124ec4 100644 (file)
@@ -944,6 +944,11 @@ bool PageClientImpl::effectiveAppearanceIsDark() const
     return m_impl->effectiveAppearanceIsDark();
 }
 
+bool PageClientImpl::effectiveAppearanceIsInactive() const
+{
+    return m_impl->effectiveAppearanceIsInactive();
+}
+
 void PageClientImpl::takeFocus(WebCore::FocusDirection direction)
 {
     m_impl->takeFocus(direction);
index 7471bce..ac7be19 100644 (file)
@@ -593,7 +593,7 @@ void WKBundlePageSetUseDarkAppearance(WKBundlePageRef pageRef, bool useDarkAppea
 {
     WebKit::WebPage* webPage = WebKit::toImpl(pageRef);
     if (WebCore::Page* page = webPage ? webPage->corePage() : nullptr)
-        page->setUseDarkAppearance(useDarkAppearance);
+        page->effectiveAppearanceDidChange(useDarkAppearance, page->useInactiveAppearance());
 }
 
 bool WKBundlePageIsUsingDarkAppearance(WKBundlePageRef pageRef)
index a5250b7..44c8e4f 100644 (file)
@@ -557,7 +557,7 @@ WebPage::WebPage(uint64_t pageID, WebPageCreationParameters&& parameters)
     setGapBetweenPages(parameters.gapBetweenPages);
     setPaginationLineGridEnabled(parameters.paginationLineGridEnabled);
 
-    setUseDarkAppearance(parameters.useDarkAppearance);
+    effectiveAppearanceDidChange(parameters.useDarkAppearance, parameters.useInactiveAppearance);
 
     if (parameters.isEditable)
         setEditable(true);
@@ -4621,9 +4621,9 @@ void WebPage::setUseSystemAppearance(bool useSystemAppearance)
 #endif
 
 #if !PLATFORM(GTK)
-void WebPage::setUseDarkAppearance(bool useDarkAppearance)
+void WebPage::effectiveAppearanceDidChange(bool useDarkAppearance, bool useInactiveAppearance)
 {
-    corePage()->setUseDarkAppearance(useDarkAppearance);
+    corePage()->effectiveAppearanceDidChange(useDarkAppearance, useInactiveAppearance);
 }
 #endif
 
index 4b07cde..a18c226 100644 (file)
@@ -547,7 +547,7 @@ public:
     void setUseSystemAppearance(bool);
 #endif
 
-    void setUseDarkAppearance(bool);
+    void effectiveAppearanceDidChange(bool useDarkAppearance, bool useInactiveAppearance);
 
     bool windowIsFocused() const;
     bool windowAndWebPageAreFocused() const;
index c012631..f81d027 100644 (file)
@@ -488,7 +488,7 @@ messages -> WebPage LegacyReceiver {
     SetFooterBannerHeightForTesting(int height);
 #endif
 
-    SetUseDarkAppearance(bool useDarkAppearance);
+    EffectiveAppearanceDidChange(bool useDarkAppearance, bool useInactiveAppearance);
 
 #if PLATFORM(COCOA)
     RequestActiveNowPlayingSessionInfo(WebKit::CallbackID callbackID)
index b46699f..47e2532 100644 (file)
@@ -195,11 +195,11 @@ void WebPage::collapseSelectionInFrame(uint64_t frameID)
     frame->coreFrame()->selection().setBase(selection.extent(), selection.affinity());
 }
 
-void WebPage::setUseDarkAppearance(bool useDarkAppearance)
+void WebPage::effectiveAppearanceDidChange(bool useDarkAppearance, bool useInactiveAppearance)
 {
     if (auto* settings = gtk_settings_get_default())
         g_object_set(settings, "gtk-application-prefer-dark-theme", useDarkAppearance, nullptr);
-    corePage()->setUseDarkAppearance(useDarkAppearance);
+    corePage()->effectiveAppearanceDidChange(useDarkAppearance, useInactiveAppearance);
 }
 
 } // namespace WebKit
index 69e1577..bc0a178 100644 (file)
@@ -1,3 +1,21 @@
+2019-05-08  Timothy Hatcher  <timothy@apple.com>
+
+        Add plumbing for inactive system colors in RenderTheme cache.
+        https://bugs.webkit.org/show_bug.cgi?id=197699
+        rdar://problem/49406936
+
+        Reviewed by Tim Horton.
+
+        * WebView/WebView.mm:
+        (-[WebView _commonInitializationWithFrameName:groupName:]):
+        (-[WebView _setUseDarkAppearance:]):
+        (-[WebView _useInactiveAppearance]):
+        (-[WebView _setUseInactiveAppearance:]):
+        (-[WebView _setUseDarkAppearance:useInactiveAppearance:]):
+        (-[WebView _effectiveAppearanceIsInactive]):
+        (-[WebView viewDidChangeEffectiveAppearance]):
+        * WebView/WebViewPrivate.h:
+
 2019-05-03  Daniel Bates  <dabates@apple.com>
 
         Pass KeyboardEvent by reference in more places
index 16dd65b..9d6eea4 100644 (file)
@@ -1589,7 +1589,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
 #endif
 
 #if HAVE(OS_DARK_MODE_SUPPORT) && PLATFORM(MAC)
-    _private->page->setUseDarkAppearance(self._effectiveAppearanceIsDark);
+    _private->page->effectiveAppearanceDidChange(self._effectiveAppearanceIsDark, self._effectiveAppearanceIsInactive);
 #endif
 
     _private->page->settings().setContentDispositionAttachmentSandboxEnabled(true);
@@ -2500,7 +2500,28 @@ ALLOW_DEPRECATED_DECLARATIONS_END
 {
     if (!_private || !_private->page)
         return;
-    _private->page->setUseDarkAppearance(useDarkAppearance);
+    [self _setUseDarkAppearance:useDarkAppearance useInactiveAppearance:_private->page->useInactiveAppearance()];
+}
+
+- (BOOL)_useInactiveAppearance
+{
+    if (!_private || !_private->page)
+        return NO;
+    return _private->page->useInactiveAppearance();
+}
+
+- (void)_setUseInactiveAppearance:(BOOL)useInactiveAppearance
+{
+    if (!_private || !_private->page)
+        return;
+    [self _setUseDarkAppearance:_private->page->useDarkAppearance() useInactiveAppearance:useInactiveAppearance];
+}
+
+- (void)_setUseDarkAppearance:(BOOL)useDarkAppearance useInactiveAppearance:(BOOL)useInactiveAppearance
+{
+    if (!_private || !_private->page)
+        return;
+    _private->page->effectiveAppearanceDidChange(useDarkAppearance, useInactiveAppearance);
 }
 
 + (void)_setIconLoadingEnabled:(BOOL)enabled
@@ -5330,6 +5351,12 @@ static Vector<String> toStringVector(NSArray* patterns)
     NSAppearanceName appearance = [[self effectiveAppearance] bestMatchFromAppearancesWithNames:@[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]];
     return [appearance isEqualToString:NSAppearanceNameDarkAqua];
 }
+
+- (bool)_effectiveAppearanceIsInactive
+{
+    // FIXME: Use the window isKeyWindow state or view first responder status?
+    return false;
+}
 #endif
 
 - (void)_setUseSystemAppearance:(BOOL)useSystemAppearance
@@ -5354,7 +5381,7 @@ static Vector<String> toStringVector(NSArray* patterns)
     if (!_private || !_private->page)
         return;
 
-    _private->page->setUseDarkAppearance(self._effectiveAppearanceIsDark);
+    _private->page->effectiveAppearanceDidChange(self._effectiveAppearanceIsDark, self._effectiveAppearanceIsInactive);
 }
 #endif
 
index c25ee83..8db2159 100644 (file)
@@ -323,6 +323,9 @@ typedef enum {
 + (BOOL)_isIconLoadingEnabled;
 
 @property (nonatomic, assign, setter=_setUseDarkAppearance:) BOOL _useDarkAppearance;
+@property (nonatomic, assign, setter=_setUseInactiveAppearance:) BOOL _useInactiveAppearance;
+
+- (void)_setUseDarkAppearance:(BOOL)useDarkAppearance useInactiveAppearance:(BOOL)useInactiveAppearance;
 
 - (WebInspector *)inspector;