Title: [107429] trunk/Source/WebCore
Revision
107429
Author
ander...@apple.com
Date
2012-02-10 12:49:45 -0800 (Fri, 10 Feb 2012)

Log Message

Minor ScrollableArea cleanup
https://bugs.webkit.org/show_bug.cgi?id=78372

Reviewed by Beth Dakin.

Get rid of scrollToXOffsetWithoutAnimation and scrollToYOffsetWithoutAnimation.

* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
* platform/ScrollableArea.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::computeLogicalHeight):
(WebCore::RenderListBox::scrollToRevealElementAtListIndex):
(WebCore::RenderListBox::setScrollTop):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107428 => 107429)


--- trunk/Source/WebCore/ChangeLog	2012-02-10 20:17:49 UTC (rev 107428)
+++ trunk/Source/WebCore/ChangeLog	2012-02-10 20:49:45 UTC (rev 107429)
@@ -1,3 +1,20 @@
+2012-02-10  Anders Carlsson  <ander...@apple.com>
+
+        Minor ScrollableArea cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=78372
+
+        Reviewed by Beth Dakin.
+
+        Get rid of scrollToXOffsetWithoutAnimation and scrollToYOffsetWithoutAnimation.
+
+        * platform/ScrollableArea.cpp:
+        (WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
+        * platform/ScrollableArea.h:
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::computeLogicalHeight):
+        (WebCore::RenderListBox::scrollToRevealElementAtListIndex):
+        (WebCore::RenderListBox::setScrollTop):
+
 2012-02-10  Benjamin Poulain  <bpoul...@apple.com>
 
         [Mac] DYLIB_INSTALL_NAME_BASE should not be prefixed by the SDKROOT

Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (107428 => 107429)


--- trunk/Source/WebCore/platform/ScrollableArea.cpp	2012-02-10 20:17:49 UTC (rev 107428)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp	2012-02-10 20:49:45 UTC (rev 107429)
@@ -133,21 +133,11 @@
 void ScrollableArea::scrollToOffsetWithoutAnimation(ScrollbarOrientation orientation, float offset)
 {
     if (orientation == HorizontalScrollbar)
-        scrollToXOffsetWithoutAnimation(offset);
+        scrollToOffsetWithoutAnimation(FloatPoint(offset, scrollAnimator()->currentPosition().y()));
     else
-        scrollToYOffsetWithoutAnimation(offset);
+        scrollToOffsetWithoutAnimation(FloatPoint(scrollAnimator()->currentPosition().x(), offset));
 }
 
-void ScrollableArea::scrollToXOffsetWithoutAnimation(float x)
-{
-    scrollToOffsetWithoutAnimation(FloatPoint(x, scrollAnimator()->currentPosition().y()));
-}
-
-void ScrollableArea::scrollToYOffsetWithoutAnimation(float y)
-{
-    scrollToOffsetWithoutAnimation(FloatPoint(scrollAnimator()->currentPosition().x(), y));
-}
-
 void ScrollableArea::zoomAnimatorTransformChanged(float, float, float, ZoomAnimationState)
 {
     // Requires FrameView to override this.

Modified: trunk/Source/WebCore/platform/ScrollableArea.h (107428 => 107429)


--- trunk/Source/WebCore/platform/ScrollableArea.h	2012-02-10 20:17:49 UTC (rev 107428)
+++ trunk/Source/WebCore/platform/ScrollableArea.h	2012-02-10 20:49:45 UTC (rev 107429)
@@ -47,8 +47,6 @@
     bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
     void scrollToOffsetWithoutAnimation(const FloatPoint&);
     void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset);
-    void scrollToXOffsetWithoutAnimation(float x);
-    void scrollToYOffsetWithoutAnimation(float x);
 
     virtual void zoomAnimatorTransformChanged(float, float, float, ZoomAnimationState);
 

Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (107428 => 107429)


--- trunk/Source/WebCore/rendering/RenderListBox.cpp	2012-02-10 20:17:49 UTC (rev 107428)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp	2012-02-10 20:49:45 UTC (rev 107429)
@@ -255,7 +255,7 @@
         m_vBar->setSteps(1, max(1, numVisibleItems() - 1), itemHeight);
         m_vBar->setProportion(numVisibleItems(), numItems());
         if (!enabled) {
-            scrollToYOffsetWithoutAnimation(0);
+            scrollToOffsetWithoutAnimation(VerticalScrollbar, 0);
             m_indexOffset = 0;
         }
     }
@@ -579,7 +579,7 @@
     else
         newOffset = index - numVisibleItems() + 1;
 
-    ScrollableArea::scrollToYOffsetWithoutAnimation(newOffset);
+    scrollToOffsetWithoutAnimation(VerticalScrollbar, newOffset);
 
     return true;
 }
@@ -675,7 +675,7 @@
     if (index < 0 || index >= numItems() || index == m_indexOffset)
         return;
     
-    ScrollableArea::scrollToYOffsetWithoutAnimation(index);
+    scrollToOffsetWithoutAnimation(VerticalScrollbar, index);
 }
 
 bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to