[BlackBerry] Implement ScrollingCoordinator::frameViewLayoutUpdated()
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2013 12:16:41 +0000 (12:16 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2013 12:16:41 +0000 (12:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=113763

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2013-04-02
Reviewed by Rob Buis.

PR 318945
Internally reviewed by Jakob Petsovits.

And remove the BlackBerry specific methods
frameViewFrameRectDidChange and frameViewContentsSizeDidChange.

* page/scrolling/blackberry/ScrollingCoordinatorBlackBerry.cpp:
(WebCore::ScrollingCoordinatorBlackBerry::frameViewLayoutUpdated):
Called when the frame view has been laid out. Update the contents
rectangle and visible area of the scroll layer for the given frame
view.
* page/scrolling/blackberry/ScrollingCoordinatorBlackBerry.h:
(ScrollingCoordinatorBlackBerry):
* platform/graphics/blackberry/LayerWebKitThread.h:
(WebCore::LayerWebKitThread::setFrameVisibleRect): Return early if
value hasn't changed.
(WebCore::LayerWebKitThread::setFrameContentsSize): Ditto.

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

Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/blackberry/ScrollingCoordinatorBlackBerry.cpp
Source/WebCore/page/scrolling/blackberry/ScrollingCoordinatorBlackBerry.h
Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.h

index 2b6568f4842b82be99d5ed31362508d6776b4d48..b129126866b4a6fc584b325c9cec167f0f744fcf 100644 (file)
@@ -1,3 +1,28 @@
+2013-04-02  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [BlackBerry] Implement ScrollingCoordinator::frameViewLayoutUpdated()
+        https://bugs.webkit.org/show_bug.cgi?id=113763
+
+        Reviewed by Rob Buis.
+
+        PR 318945
+        Internally reviewed by Jakob Petsovits.
+
+        And remove the BlackBerry specific methods
+        frameViewFrameRectDidChange and frameViewContentsSizeDidChange.
+
+        * page/scrolling/blackberry/ScrollingCoordinatorBlackBerry.cpp:
+        (WebCore::ScrollingCoordinatorBlackBerry::frameViewLayoutUpdated):
+        Called when the frame view has been laid out. Update the contents
+        rectangle and visible area of the scroll layer for the given frame
+        view.
+        * page/scrolling/blackberry/ScrollingCoordinatorBlackBerry.h:
+        (ScrollingCoordinatorBlackBerry):
+        * platform/graphics/blackberry/LayerWebKitThread.h:
+        (WebCore::LayerWebKitThread::setFrameVisibleRect): Return early if
+        value hasn't changed.
+        (WebCore::LayerWebKitThread::setFrameContentsSize): Ditto.
+
 2013-04-02  Andrey Lushnikov  <lushnikov@chromium.org>
 
         Web Inspector: Separate JavaScriptSourceFrame popover from knowledge of editor's DOM
index edc5783ed58600aab01affa3255f2b8c85be3b2d..39d902711c84184f55867c971fd680c685ad939e 100644 (file)
@@ -67,16 +67,12 @@ void ScrollingCoordinatorBlackBerry::setLayerFixedToContainerLayerEdge(GraphicsL
     layer->platformLayer()->setFixedToLeft(fixedToLeft);
 }
 
-void ScrollingCoordinatorBlackBerry::frameViewFrameRectDidChange(FrameView* view)
+void ScrollingCoordinatorBlackBerry::frameViewLayoutUpdated(FrameView* frameView)
 {
-    if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(view))
-        scrollLayer->platformLayer()->setFrameVisibleRect(view->visibleContentRect());
-}
-
-void ScrollingCoordinatorBlackBerry::frameViewContentsSizeDidChange(FrameView* view)
-{
-    if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(view))
-        scrollLayer->platformLayer()->setFrameContentsSize(view->contentsSize());
+    if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView)) {
+        scrollLayer->platformLayer()->setFrameContentsSize(frameView->contentsSize());
+        scrollLayer->platformLayer()->setFrameVisibleRect(frameView->visibleContentRect());
+    }
 }
 
 }
index 7c849a0044ff887dbfd8807768806c618a9ae6e9..1e6fcd509e7905e1cf0027b6db1d58db87f6e538 100644 (file)
@@ -34,6 +34,9 @@ class ScrollingCoordinatorBlackBerry : public ScrollingCoordinator {
 public:
     explicit ScrollingCoordinatorBlackBerry(Page*);
 
+    // Should be called whenever the given frame view has been laid out.
+    virtual void frameViewLayoutUpdated(FrameView*);
+
     // Return whether this scrolling coordinator can keep fixed position layers fixed to their
     // containers while scrolling.
     virtual bool supportsFixedPositionLayers() const { return true; }
@@ -46,9 +49,6 @@ public:
 
     // Whether the layer is fixed the top or bottom edge, left or right edge.
     void setLayerFixedToContainerLayerEdge(GraphicsLayer*, bool fixedToTop, bool fixedToLeft);
-
-    virtual void frameViewFrameRectDidChange(FrameView*);
-    virtual void frameViewContentsSizeDidChange(FrameView*);
 };
 
 } // namespace WebCore
index 3fc5ce50760dfca91a84da1799f9f0aeb7634a63..01af9f58a83806b419847f2139db3a74eb729392 100644 (file)
@@ -160,8 +160,21 @@ public:
         setNeedsCommit();
     }
 
-    void setFrameVisibleRect(const IntRect& rect) { m_frameVisibleRect = rect; setNeedsCommit(); }
-    void setFrameContentsSize(const IntSize& size) { m_frameContentsSize = size; setNeedsCommit(); }
+    void setFrameVisibleRect(const IntRect& rect)
+    {
+        if (m_frameVisibleRect == rect)
+            return;
+        m_frameVisibleRect = rect;
+        setNeedsCommit();
+    }
+
+    void setFrameContentsSize(const IntSize& size)
+    {
+        if (m_frameContentsSize == size)
+            return;
+        m_frameContentsSize = size;
+        setNeedsCommit();
+    }
 
     void setContents(Image*);
     Image* contents() const { return m_contents.get(); }