2010-12-01 Simon Fraser <simon.fraser@apple.com>
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Dec 2010 23:04:01 +0000 (23:04 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Dec 2010 23:04:01 +0000 (23:04 +0000)
        Reviewed by Anders Carlsson.

        Size changes on layer-backed drawing areas don't always end up with the correct value
        https://bugs.webkit.org/show_bug.cgi?id=50351
        <rdar://problem/8692966>

        When the UI process does not receive didSetSize messages promptly,
        LayerBackedDrawingAreaProxy::setSize() bails early based on the
        m_isWaitingForDidSetFrameNotification flag.

        In this situation, the final size may be incorrect. didSetSize()
        needs to compare the size that the web process has to the expected size,
        and send a final setSize if they differ.

        * UIProcess/LayerBackedDrawingAreaProxy.cpp:
        (WebKit::LayerBackedDrawingAreaProxy::didSetSize):
        (WebKit::LayerBackedDrawingAreaProxy::didReceiveMessage):
        * UIProcess/LayerBackedDrawingAreaProxy.h:
        * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
        (WebKit::LayerBackedDrawingArea::setSize):

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

WebKit2/ChangeLog
WebKit2/UIProcess/LayerBackedDrawingAreaProxy.cpp
WebKit2/UIProcess/LayerBackedDrawingAreaProxy.h
WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.cpp

index 6ff85c1d81df52fe0cefd65ff24c70fd80fa27bb..34c676c7d2a20705981c7b21358c300eeed44665 100644 (file)
         * win/WebKit2WebProcess.vcproj: Added property svn:eol-style.
         * win/WebKit2WebProcessCommon.vsprops: Added property svn:eol-style.
 
+2010-12-01  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Size changes on layer-backed drawing areas don't always end up with the correct value
+        https://bugs.webkit.org/show_bug.cgi?id=50351
+        <rdar://problem/8692966>
+        
+        When the UI process does not receive didSetSize messages promptly, 
+        LayerBackedDrawingAreaProxy::setSize() bails early based on the
+        m_isWaitingForDidSetFrameNotification flag.
+        
+        In this situation, the final size may be incorrect. didSetSize()
+        needs to compare the size that the web process has to the expected size,
+        and send a final setSize if they differ.
+
+        * UIProcess/LayerBackedDrawingAreaProxy.cpp:
+        (WebKit::LayerBackedDrawingAreaProxy::didSetSize):
+        (WebKit::LayerBackedDrawingAreaProxy::didReceiveMessage):
+        * UIProcess/LayerBackedDrawingAreaProxy.h:
+        * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
+        (WebKit::LayerBackedDrawingArea::setSize):
+
 2010-12-01  Simon Fraser  <simon.fraser@apple.com>
 
         Reviewed by Anders Carlsson.
index 9e709cff5006b255437f5b9b3cef6b288995bcfd..00954dfd980665728bbb8c8ce73e266948f5b486 100644 (file)
@@ -78,6 +78,7 @@ void LayerBackedDrawingAreaProxy::setSize(const IntSize& viewSize)
 
     if (m_isWaitingForDidSetFrameNotification)
         return;
+
     m_isWaitingForDidSetFrameNotification = true;
 
     page->process()->responsivenessTimer()->start();
@@ -113,10 +114,13 @@ void LayerBackedDrawingAreaProxy::setPageIsVisible(bool isVisible)
     // FIXME: We should request a full repaint here if needed.
 }
     
-void LayerBackedDrawingAreaProxy::didSetSize()
+void LayerBackedDrawingAreaProxy::didSetSize(const IntSize& size)
 {
     m_isWaitingForDidSetFrameNotification = false;
 
+    if (size != m_lastSetViewSize)
+        setSize(m_lastSetViewSize);
+
     WebPageProxy* page = this->page();
     page->process()->responsivenessTimer()->stop();
 }
@@ -135,7 +139,10 @@ void LayerBackedDrawingAreaProxy::didReceiveMessage(CoreIPC::Connection*, CoreIP
             break;
         }
         case DrawingAreaProxyMessage::DidSetSize: {
-            didSetSize();
+            IntSize size;
+            if (!arguments->decode(CoreIPC::Out(size)))
+                return;
+            didSetSize(size);
             break;
         }
         default:
index a37b6b3755b713fb805d0f5d1059c2d42d0d040e..f7499d677aaed0470089294d186c0a8ccc90eab4 100644 (file)
@@ -74,7 +74,7 @@ private:
     virtual void attachCompositingContext(uint32_t contextID);
     virtual void detachCompositingContext();
     
-    void didSetSize();
+    void didSetSize(const WebCore::IntSize&);
     void update();
     
     void platformSetSize();
index 4895ce03b7eac961e6855509816f0d0ace797c69..3745ef77f90bbbdced2c47dfeba5fdd415bdde17 100644 (file)
@@ -115,7 +115,7 @@ void LayerBackedDrawingArea::setSize(const IntSize& viewSize)
         return;
     }
     
-    WebProcess::shared().connection()->send(DrawingAreaProxyMessage::DidSetSize, m_webPage->pageID(), CoreIPC::In());
+    WebProcess::shared().connection()->send(DrawingAreaProxyMessage::DidSetSize, m_webPage->pageID(), CoreIPC::In(viewSize));
 }
 
 void LayerBackedDrawingArea::suspendPainting()