Title: [115159] trunk/Source/WebCore
Revision
115159
Author
[email protected]
Date
2012-04-24 19:07:58 -0700 (Tue, 24 Apr 2012)

Log Message

ScrollingCoordinator::setScrollParameters should take a single struct
https://bugs.webkit.org/show_bug.cgi?id=84816

Reviewed by Andreas Kling.

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::ScrollingCoordinator::setScrollParameters):
* page/scrolling/ScrollingCoordinator.h:
(ScrollingCoordinator):
(ScrollParameters):
* page/scrolling/ScrollingCoordinatorNone.cpp:
(WebCore::ScrollingCoordinator::setScrollParameters):
* page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
(WebCore::ScrollingCoordinator::setScrollParameters):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (115158 => 115159)


--- trunk/Source/WebCore/ChangeLog	2012-04-25 02:05:46 UTC (rev 115158)
+++ trunk/Source/WebCore/ChangeLog	2012-04-25 02:07:58 UTC (rev 115159)
@@ -1,3 +1,21 @@
+2012-04-24  Anders Carlsson  <[email protected]>
+
+        ScrollingCoordinator::setScrollParameters should take a single struct
+        https://bugs.webkit.org/show_bug.cgi?id=84816
+
+        Reviewed by Andreas Kling.
+
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
+        (WebCore::ScrollingCoordinator::setScrollParameters):
+        * page/scrolling/ScrollingCoordinator.h:
+        (ScrollingCoordinator):
+        (ScrollParameters):
+        * page/scrolling/ScrollingCoordinatorNone.cpp:
+        (WebCore::ScrollingCoordinator::setScrollParameters):
+        * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
+        (WebCore::ScrollingCoordinator::setScrollParameters):
+
 2012-04-24  Adam Klein  <[email protected]>
 
         Remove unused undefined() method from ScriptValue

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (115158 => 115159)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-04-25 02:05:46 UTC (rev 115158)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-04-25 02:07:58 UTC (rev 115159)
@@ -141,13 +141,16 @@
     if (!coordinatesScrollingForFrameView(frameView))
         return;
 
-    setScrollParameters(frameView->horizontalScrollElasticity(),
-                        frameView->verticalScrollElasticity(),
-                        frameView->horizontalScrollbar() && frameView->horizontalScrollbar()->enabled(),
-                        frameView->verticalScrollbar() && frameView->verticalScrollbar()->enabled(),
-                        IntRect(IntPoint(), frameView->visibleContentRect().size()),
-                        frameView->contentsSize());
+    ScrollParameters scrollParameters;
+    scrollParameters.horizontalScrollElasticity = frameView->horizontalScrollElasticity();
+    scrollParameters.verticalScrollElasticity = frameView->verticalScrollElasticity();
+    scrollParameters.hasEnabledHorizontalScrollbar = frameView->horizontalScrollbar() && frameView->horizontalScrollbar()->enabled();
+    scrollParameters.hasEnabledVerticalScrollbar = frameView->verticalScrollbar() && frameView->verticalScrollbar()->enabled();
 
+    scrollParameters.viewportRect = IntRect(IntPoint(), frameView->visibleContentRect().size());
+    scrollParameters.contentsSize = frameView->contentsSize();
+
+    setScrollParameters(scrollParameters);
 }
 
 void ScrollingCoordinator::frameViewWheelEventHandlerCountChanged(FrameView*)
@@ -352,20 +355,15 @@
     scheduleTreeStateCommit();
 }
 
-void ScrollingCoordinator::setScrollParameters(ScrollElasticity horizontalScrollElasticity,
-                                               ScrollElasticity verticalScrollElasticity,
-                                               bool hasEnabledHorizontalScrollbar,
-                                               bool hasEnabledVerticalScrollbar,
-                                               const IntRect& viewportRect,
-                                               const IntSize& contentsSize)
+void ScrollingCoordinator::setScrollParameters(const ScrollParameters& scrollParameters)
 {
-    m_scrollingTreeState->setHorizontalScrollElasticity(horizontalScrollElasticity);
-    m_scrollingTreeState->setVerticalScrollElasticity(verticalScrollElasticity);
-    m_scrollingTreeState->setHasEnabledHorizontalScrollbar(hasEnabledHorizontalScrollbar);
-    m_scrollingTreeState->setHasEnabledVerticalScrollbar(hasEnabledVerticalScrollbar);
+    m_scrollingTreeState->setHorizontalScrollElasticity(scrollParameters.horizontalScrollElasticity);
+    m_scrollingTreeState->setVerticalScrollElasticity(scrollParameters.verticalScrollElasticity);
+    m_scrollingTreeState->setHasEnabledHorizontalScrollbar(scrollParameters.hasEnabledHorizontalScrollbar);
+    m_scrollingTreeState->setHasEnabledVerticalScrollbar(scrollParameters.hasEnabledVerticalScrollbar);
 
-    m_scrollingTreeState->setViewportRect(viewportRect);
-    m_scrollingTreeState->setContentsSize(contentsSize);
+    m_scrollingTreeState->setViewportRect(scrollParameters.viewportRect);
+    m_scrollingTreeState->setContentsSize(scrollParameters.contentsSize);
     scheduleTreeStateCommit();
 }
 

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (115158 => 115159)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2012-04-25 02:05:46 UTC (rev 115158)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2012-04-25 02:07:58 UTC (rev 115159)
@@ -123,9 +123,19 @@
 
     void setScrollLayer(GraphicsLayer*);
     void setNonFastScrollableRegion(const Region&);
-    void setScrollParameters(ScrollElasticity horizontalScrollElasticity, ScrollElasticity verticalScrollElasticity,
-                             bool hasEnabledHorizontalScrollbar, bool hasEnabledVerticalScrollbar,
-                             const IntRect& viewportRect, const IntSize& contentsSize);
+
+    struct ScrollParameters {
+        ScrollElasticity horizontalScrollElasticity;
+        ScrollElasticity verticalScrollElasticity;
+
+        bool hasEnabledHorizontalScrollbar;
+        bool hasEnabledVerticalScrollbar;
+
+        IntRect viewportRect;
+        IntSize contentsSize;
+    };
+
+    void setScrollParameters(const ScrollParameters&);
     void setWheelEventHandlerCount(unsigned);
     void setShouldUpdateScrollLayerPositionOnMainThread(bool);
 

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorNone.cpp (115158 => 115159)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorNone.cpp	2012-04-25 02:05:46 UTC (rev 115158)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorNone.cpp	2012-04-25 02:07:58 UTC (rev 115159)
@@ -59,7 +59,7 @@
 {
 }
 
-void ScrollingCoordinator::setScrollParameters(ScrollElasticity, ScrollElasticity, bool, bool, const IntRect&, const IntSize&)
+void ScrollingCoordinator::setScrollParameters(const ScrollParameters&)
 {
 }
 

Modified: trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp (115158 => 115159)


--- trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp	2012-04-25 02:05:46 UTC (rev 115158)
+++ trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp	2012-04-25 02:07:58 UTC (rev 115159)
@@ -144,9 +144,7 @@
         layer->setNonFastScrollableRegion(region);
 }
 
-void ScrollingCoordinator::setScrollParameters(ScrollElasticity horizontalScrollElasticity, ScrollElasticity verticalScrollElasticity,
-                                               bool hasEnabledHorizontalScrollbar, bool hasEnabledVerticalScrollbar,
-                                               const IntRect& viewportRect, const IntSize& contentsSize)
+void ScrollingCoordinator::setScrollParameters(const ScrollParameters&)
 {
     // FIXME: Implement!
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to