Title: [115345] trunk/Source/WebCore
Revision
115345
Author
[email protected]
Date
2012-04-26 13:14:41 -0700 (Thu, 26 Apr 2012)

Log Message

Make ScrollView::scrollSize scrollbar-independent
https://bugs.webkit.org/show_bug.cgi?id=84873

Reviewed by Anders Carlsson.
Patch by Antonio Gomes <[email protected]>

For ports that disable scrollbars creation at FrameView creation time
ScrollView::scrollSize should still return the scrollable ammount of
content (if any) if scrolling is not prohibted.

No new test, but it makes ScrollAnimator work for the BlackBerry port.

* platform/ScrollView.cpp:
(WebCore::ScrollView::scrollSize):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (115344 => 115345)


--- trunk/Source/WebCore/ChangeLog	2012-04-26 20:01:44 UTC (rev 115344)
+++ trunk/Source/WebCore/ChangeLog	2012-04-26 20:14:41 UTC (rev 115345)
@@ -1,3 +1,19 @@
+2012-04-25  Antonio Gomes  <[email protected]>
+
+        Make ScrollView::scrollSize scrollbar-independent
+        https://bugs.webkit.org/show_bug.cgi?id=84873
+
+        Reviewed by Anders Carlsson.
+
+        For ports that disable scrollbars creation at FrameView creation time
+        ScrollView::scrollSize should still return the scrollable ammount of
+        content (if any) if scrolling is not prohibted.
+
+        No new test, but it makes ScrollAnimator work for the BlackBerry port.
+
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::scrollSize):
+
 2012-04-25  Anders Carlsson  <[email protected]>
 
         The tile cache should know if a frame view can ever have scrollbars

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (115344 => 115345)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2012-04-26 20:01:44 UTC (rev 115344)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2012-04-26 20:14:41 UTC (rev 115345)
@@ -329,8 +329,9 @@
 
 int ScrollView::scrollSize(ScrollbarOrientation orientation) const
 {
-    Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_horizontalScrollbar : m_verticalScrollbar).get();
-    return scrollbar ? (scrollbar->totalSize() - scrollbar->visibleSize()) : 0;
+    IntSize scrollSize = m_contentsSize - visibleContentRect().size();
+    scrollSize.clampNegativeToZero();
+    return orientation == HorizontalScrollbar ? scrollSize.width() : scrollSize.height();
 }
 
 void ScrollView::notifyPageThatContentAreaWillPaint() const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to