Don't call RenderTheme::platformColorsDidChange() during printing.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jul 2018 18:23:36 +0000 (18:23 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jul 2018 18:23:36 +0000 (18:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188181
rdar://problem/42360070

Reviewed by Tim Horton.

* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setEmulatedMedia): Call m_page.updateStyleAfterChangeInEnvironment()
instead of going to styleStope() and remove call to RenderTheme::platformColorsDidChange().
* page/FrameView.cpp:
(WebCore::FrameView::adjustMediaTypeForPrinting): Remove call RenderTheme::platformColorsDidChange().

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

Source/WebCore/ChangeLog
Source/WebCore/inspector/agents/InspectorPageAgent.cpp
Source/WebCore/page/FrameView.cpp

index b2be801..43ffdfe 100644 (file)
@@ -1,3 +1,17 @@
+2018-07-31  Timothy Hatcher  <timothy@apple.com>
+
+        Don't call RenderTheme::platformColorsDidChange() during printing.
+        https://bugs.webkit.org/show_bug.cgi?id=188181
+        rdar://problem/42360070
+
+        Reviewed by Tim Horton.
+
+        * inspector/agents/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::setEmulatedMedia): Call m_page.updateStyleAfterChangeInEnvironment()
+        instead of going to styleStope() and remove call to RenderTheme::platformColorsDidChange().
+        * page/FrameView.cpp:
+        (WebCore::FrameView::adjustMediaTypeForPrinting): Remove call RenderTheme::platformColorsDidChange().
+
 2018-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         Use static const global variable for TransformationMatrix instead of NeverDestroyed
index a0eb648..507ffba 100644 (file)
@@ -802,12 +802,10 @@ void InspectorPageAgent::setEmulatedMedia(ErrorString&, const String& media)
 
     m_emulatedMedia = media;
 
-    RenderTheme::singleton().platformColorsDidChange();
+    m_page.updateStyleAfterChangeInEnvironment();
 
-    if (auto document = m_page.mainFrame().document()) {
-        document->styleScope().didChangeStyleSheetEnvironment();
+    if (auto* document = m_page.mainFrame().document())
         document->updateLayout();
-    }
 }
 
 void InspectorPageAgent::applyEmulatedMedia(String& media)
index 5189acd..1ef032d 100644 (file)
@@ -1388,8 +1388,6 @@ void FrameView::adjustMediaTypeForPrinting(bool printing)
             setMediaType(m_mediaTypeWhenNotPrinting);
         m_mediaTypeWhenNotPrinting = String();
     }
-
-    RenderTheme::singleton().platformColorsDidChange();
 }
 
 bool FrameView::useSlowRepaints(bool considerOverlap) const