Title: [98467] branches/safari-534.52-branch/Source/WebKit2

Diff

Modified: branches/safari-534.52-branch/Source/WebKit2/ChangeLog (98466 => 98467)


--- branches/safari-534.52-branch/Source/WebKit2/ChangeLog	2011-10-26 12:58:45 UTC (rev 98466)
+++ branches/safari-534.52-branch/Source/WebKit2/ChangeLog	2011-10-26 13:01:52 UTC (rev 98467)
@@ -1,3 +1,39 @@
+2011-10-26  Lucas Forschler  <[email protected]>
+
+    Merge 98113
+
+    2011-10-21  Anders Carlsson  <[email protected]>
+
+            Flash of white when loading a page after a web process crash
+            https://bugs.webkit.org/show_bug.cgi?id=70615
+            <rdar://problem/10306906>
+
+            Reviewed by Darin Adler.
+
+            * UIProcess/API/mac/WKView.mm:
+            (-[WKView _processDidCrash]):
+            (-[WKView _didRelaunchProcess]):
+            Remove calls to setNeedsDisplay here.
+
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::processDidCrash):
+            Call setNeedsDisplay, but only if calling out to the loader client didn't relaunch the web process.
+
+            * WebProcess/WebPage/DrawingArea.h:
+            (WebKit::DrawingArea::setPaintingEnabled):
+            * WebProcess/WebPage/DrawingAreaImpl.cpp:
+            (WebKit::DrawingAreaImpl::DrawingAreaImpl):
+            (WebKit::DrawingAreaImpl::setNeedsDisplay):
+            (WebKit::DrawingAreaImpl::scroll):
+            (WebKit::DrawingAreaImpl::setPaintingEnabled):
+            * WebProcess/WebPage/DrawingAreaImpl.h:
+            Add a way to disable painting completely for a drawing area.
+
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::WebPage):
+            Disable painting while setting up the web page, otherwise we'll get paint requests when we set the
+            active state of the web page.
+
 2011-10-21  Lucas Forschler  <[email protected]>
 
     Merge 98027

Modified: branches/safari-534.52-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (98466 => 98467)


--- branches/safari-534.52-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2011-10-26 12:58:45 UTC (rev 98466)
+++ branches/safari-534.52-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2011-10-26 13:01:52 UTC (rev 98467)
@@ -1996,7 +1996,6 @@
 
 - (void)_processDidCrash
 {
-    [self setNeedsDisplay:YES];
     [self _updateRemoteAccessibilityRegistration:NO];
 }
 
@@ -2007,7 +2006,6 @@
 
 - (void)_didRelaunchProcess
 {
-    [self setNeedsDisplay:YES];
 }
 
 - (void)_setCursor:(NSCursor *)cursor

Modified: branches/safari-534.52-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (98466 => 98467)


--- branches/safari-534.52-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2011-10-26 12:58:45 UTC (rev 98466)
+++ branches/safari-534.52-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2011-10-26 13:01:52 UTC (rev 98467)
@@ -2942,6 +2942,14 @@
     m_pageClient->processDidCrash();
     m_loaderClient.processDidCrash(this);
 
+    if (!m_isValid) {
+        // If the call out to the loader client didn't cause the web process to be relaunched, 
+        // we'll call setNeedsDisplay on the view so that we won't have the old contents showing.
+        // If the call did cause the web process to be relaunched, we'll keep the old page contents showing
+        // until the new web process has painted its contents.
+        setViewNeedsDisplay(IntRect(IntPoint(), viewSize()));
+    }
+
     // Can't expect DidReceiveEvent notifications from a crashed web process.
     m_keyEventQueue.clear();
     

Modified: branches/safari-534.52-branch/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (98466 => 98467)


--- branches/safari-534.52-branch/Source/WebKit2/WebProcess/WebPage/DrawingArea.h	2011-10-26 12:58:45 UTC (rev 98466)
+++ branches/safari-534.52-branch/Source/WebKit2/WebProcess/WebPage/DrawingArea.h	2011-10-26 13:01:52 UTC (rev 98467)
@@ -73,6 +73,8 @@
     virtual void didUninstallPageOverlay() { }
     virtual void setPageOverlayNeedsDisplay(const WebCore::IntRect&) { }
 
+    virtual void setPaintingEnabled(bool) { }
+
 #if USE(ACCELERATED_COMPOSITING)
     virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) = 0;
     virtual void scheduleCompositingLayerSync() = 0;

Modified: branches/safari-534.52-branch/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp (98466 => 98467)


--- branches/safari-534.52-branch/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2011-10-26 12:58:45 UTC (rev 98466)
+++ branches/safari-534.52-branch/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2011-10-26 13:01:52 UTC (rev 98467)
@@ -56,6 +56,7 @@
 DrawingAreaImpl::DrawingAreaImpl(WebPage* webPage, const WebPageCreationParameters& parameters)
     : DrawingArea(DrawingAreaTypeImpl, webPage)
     , m_backingStoreStateID(0)
+    , m_isPaintingEnabled(true) 
     , m_inUpdateBackingStoreState(false)
     , m_shouldSendDidUpdateBackingStoreState(false)
     , m_isWaitingForDidUpdate(false)
@@ -78,6 +79,9 @@
 
 void DrawingAreaImpl::setNeedsDisplay(const IntRect& rect)
 {
+    if (!m_isPaintingEnabled)
+        return;
+            
     IntRect dirtyRect = rect;
     dirtyRect.intersect(m_webPage->bounds());
 
@@ -100,6 +104,9 @@
 
 void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
 {
+    if (!m_isPaintingEnabled) 
+        return;
+ 
     if (m_layerTreeHost) {
         ASSERT(m_scrollRect.isEmpty());
         ASSERT(m_scrollOffset.isEmpty());
@@ -227,6 +234,11 @@
     }
 
     setNeedsDisplay(rect);
+} 
+
+void DrawingAreaImpl::setPaintingEnabled(bool paintingEnabled) 
+{ 
+    m_isPaintingEnabled = paintingEnabled;
 }
 
 void DrawingAreaImpl::setLayerHostNeedsDisplay()

Modified: branches/safari-534.52-branch/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h (98466 => 98467)


--- branches/safari-534.52-branch/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h	2011-10-26 12:58:45 UTC (rev 98466)
+++ branches/safari-534.52-branch/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h	2011-10-26 13:01:52 UTC (rev 98467)
@@ -63,7 +63,9 @@
     virtual void didInstallPageOverlay();
     virtual void didUninstallPageOverlay();
     virtual void setPageOverlayNeedsDisplay(const WebCore::IntRect&);
-    
+
+    virtual void setPaintingEnabled(bool);
+
     virtual void setRootCompositingLayer(WebCore::GraphicsLayer*);
     virtual void scheduleCompositingLayerSync();
     virtual void syncCompositingLayers();
@@ -98,6 +100,9 @@
     WebCore::IntRect m_scrollRect;
     WebCore::IntSize m_scrollOffset;
 
+    // Whether painting is enabled. If painting is disabled, any calls to setNeedsDisplay and scroll are ignored.
+    bool m_isPaintingEnabled;
+
     // Whether we're currently processing an UpdateBackingStoreState message.
     bool m_inUpdateBackingStoreState;
 

Modified: branches/safari-534.52-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (98466 => 98467)


--- branches/safari-534.52-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2011-10-26 12:58:45 UTC (rev 98466)
+++ branches/safari-534.52-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2011-10-26 13:01:52 UTC (rev 98467)
@@ -232,6 +232,8 @@
     platformInitialize();
 
     m_drawingArea = DrawingArea::create(this, parameters);
+    m_drawingArea->setPaintingEnabled(false);
+
     m_mainFrame = WebFrame::createMainFrame(this);
 
     setDrawsBackground(parameters.drawsBackground);
@@ -250,6 +252,8 @@
     if (!parameters.sessionState.isEmpty())
         restoreSession(parameters.sessionState);
 
+    m_drawingArea->setPaintingEnabled(true);
+
 #ifndef NDEBUG
     webPageCounter.increment();
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to