Index: Source/core/platform/ScrollView.cpp |
diff --git a/Source/core/platform/ScrollView.cpp b/Source/core/platform/ScrollView.cpp |
index 67382df3ce5fa01bef3a3f530315221e5d5ff54f..4e63f66e5f178cc01f946f1abcebbb4ae81a9529 100644 |
--- a/Source/core/platform/ScrollView.cpp |
+++ b/Source/core/platform/ScrollView.cpp |
@@ -43,7 +43,6 @@ ScrollView::ScrollView() |
, m_verticalScrollbarMode(ScrollbarAuto) |
, m_horizontalScrollbarLock(false) |
, m_verticalScrollbarLock(false) |
- , m_prohibitsScrolling(false) |
, m_canBlitOnScroll(true) |
, m_scrollbarsAvoidingResizer(0) |
, m_scrollbarsSuppressed(false) |
@@ -284,15 +283,16 @@ IntPoint ScrollView::adjustScrollPositionWithinRange(const IntPoint& scrollPoint |
int ScrollView::scrollSize(ScrollbarOrientation orientation) const |
{ |
+ Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_horizontalScrollbar : m_verticalScrollbar).get(); |
+ |
// If no scrollbars are present, it does not indicate content is not be scrollable. |
- if (!m_horizontalScrollbar && !m_verticalScrollbar && !prohibitsScrolling()) { |
+ if (!scrollbar) { |
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; |
+ return scrollbar->totalSize() - scrollbar->visibleSize(); |
} |
void ScrollView::notifyPageThatContentAreaWillPaint() const |
@@ -330,9 +330,6 @@ int ScrollView::scrollPosition(Scrollbar* scrollbar) const |
void ScrollView::setScrollPosition(const IntPoint& scrollPoint) |
{ |
- if (prohibitsScrolling()) |
- return; |
- |
IntPoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint); |
if (newScrollPosition == scrollPosition()) |
@@ -374,7 +371,7 @@ static const unsigned cMaxUpdateScrollbarsPass = 2; |
void ScrollView::updateScrollbars(const IntSize& desiredOffset) |
{ |
- if (m_inUpdateScrollbars || prohibitsScrolling()) |
+ if (m_inUpdateScrollbars) |
return; |
// If we came in here with the view already needing a layout, then go ahead and do that |
@@ -484,7 +481,6 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset) |
if (m_horizontalScrollbar) { |
int clientWidth = visibleWidth(); |
- int pageStep = max(max<int>(clientWidth * Scrollbar::minFractionToStepWhenPaging(), clientWidth - Scrollbar::maxOverlapBetweenPages()), 1); |
IntRect oldRect(m_horizontalScrollbar->frameRect()); |
IntRect hBarRect(0, |
height() - m_horizontalScrollbar->height(), |
@@ -497,7 +493,6 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset) |
if (m_scrollbarsSuppressed) |
m_horizontalScrollbar->setSuppressInvalidation(true); |
m_horizontalScrollbar->setEnabled(contentsWidth() > clientWidth); |
- m_horizontalScrollbar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep); |
m_horizontalScrollbar->setProportion(clientWidth, contentsWidth()); |
if (m_scrollbarsSuppressed) |
m_horizontalScrollbar->setSuppressInvalidation(false); |
@@ -505,7 +500,6 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset) |
if (m_verticalScrollbar) { |
int clientHeight = visibleHeight(); |
- int pageStep = max(max<int>(clientHeight * Scrollbar::minFractionToStepWhenPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1); |
IntRect oldRect(m_verticalScrollbar->frameRect()); |
IntRect vBarRect(width() - m_verticalScrollbar->width(), |
0, |
@@ -518,7 +512,6 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset) |
if (m_scrollbarsSuppressed) |
m_verticalScrollbar->setSuppressInvalidation(true); |
m_verticalScrollbar->setEnabled(contentsHeight() > clientHeight); |
- m_verticalScrollbar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep); |
m_verticalScrollbar->setProportion(clientHeight, contentsHeight()); |
if (m_scrollbarsSuppressed) |
m_verticalScrollbar->setSuppressInvalidation(false); |
@@ -822,6 +815,14 @@ void ScrollView::positionScrollbarLayers() |
positionScrollCornerLayer(layerForScrollCorner(), scrollCornerRect()); |
} |
+bool ScrollView::userInputScrollable(ScrollbarOrientation orientation) const |
+{ |
+ ScrollbarMode mode = (orientation == HorizontalScrollbar) ? |
+ m_horizontalScrollbarMode : m_verticalScrollbarMode; |
+ |
+ return mode == ScrollbarAuto || mode == ScrollbarAlwaysOn; |
+} |
+ |
void ScrollView::repaintContentRectangle(const IntRect& rect) |
{ |
IntRect paintRect = rect; |