Expose SPI to disable synchronously blocking on painting after parenting a WKWebView
[WebKit-https.git] / Source / WebKit2 / UIProcess / WebPageProxy.cpp
index 764c6d3..3a4974a 100644 (file)
@@ -357,6 +357,7 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, uin
     , m_initialCapitalizationEnabled(m_configuration->initialCapitalizationEnabled())
     , m_backForwardList(WebBackForwardList::create(*this))
     , m_maintainsInactiveSelection(false)
+    , m_shouldWaitForPaintAfterViewDidMoveToWindow(m_configuration->shouldWaitForPaintAfterViewDidMoveToWindow())
     , m_isEditable(false)
     , m_textZoomFactor(1)
     , m_pageZoomFactor(1)
@@ -1524,7 +1525,7 @@ void WebPageProxy::dispatchViewStateChange()
 
     bool isNowInWindow = (changed & ViewState::IsInWindow) && isInWindow();
     // We always want to wait for the Web process to reply if we've been in-window before and are coming back in-window.
-    if (m_viewWasEverInWindow && isNowInWindow && m_drawingArea->hasVisibleContent())
+    if (m_viewWasEverInWindow && isNowInWindow && m_drawingArea->hasVisibleContent() && m_shouldWaitForPaintAfterViewDidMoveToWindow)
         m_viewStateChangeWantsSynchronousReply = true;
 
     // Don't wait synchronously if the view state is not visible. (This matters in particular on iOS, where a hidden page may be suspended.)