Title: [115401] trunk/Source/WebCore/platform/ScrollView.cpp
Revision
115401
Author
[email protected]
Date
2012-04-26 20:08:47 -0700 (Thu, 26 Apr 2012)

Log Message

Unreviewed amend to bug 84873 (r115345).

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (115400 => 115401)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2012-04-27 02:44:05 UTC (rev 115400)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2012-04-27 03:08:47 UTC (rev 115401)
@@ -329,9 +329,15 @@
 
 int ScrollView::scrollSize(ScrollbarOrientation orientation) const
 {
-    IntSize scrollSize = m_contentsSize - visibleContentRect().size();
-    scrollSize.clampNegativeToZero();
-    return orientation == HorizontalScrollbar ? scrollSize.width() : scrollSize.height();
+    // If no scrollbars are present, it does not indicate content is not be scrollable.
+    if (!m_horizontalScrollbar && !m_verticalScrollbar && !prohibitsScrolling()) {
+        IntSize scrollSize = m_contentsSize - visibleContentRect().size();
+        scrollSize.clampNegativeToZero();
+        return orientation == HorizontalScrollbar ? scrollSize.width() : scrollSize.height();
+    }
+
+    Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_horizontalScrollbar : m_verticalScrollbar).get();
+    return scrollbar ? (scrollbar->totalSize() - scrollbar->visibleSize()) : 0;
 }
 
 void ScrollView::notifyPageThatContentAreaWillPaint() const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to