diff options
author | Steve Block <steveblock@google.com> | 2010-02-02 14:57:50 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-04 15:06:55 +0000 |
commit | d0825bca7fe65beaee391d30da42e937db621564 (patch) | |
tree | 7461c49eb5844ffd1f35d1ba2c8b7584c1620823 /WebCore/platform/ScrollView.cpp | |
parent | 3db770bd97c5a59b6c7574ca80a39e5a51c1defd (diff) | |
download | external_webkit-d0825bca7fe65beaee391d30da42e937db621564.zip external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.gz external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.bz2 |
Merge webkit.org at r54127 : Initial merge by git
Change-Id: Ib661abb595522f50ea406f72d3a0ce17f7193c82
Diffstat (limited to 'WebCore/platform/ScrollView.cpp')
-rw-r--r-- | WebCore/platform/ScrollView.cpp | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp index 19a1dca..c8230a6 100644 --- a/WebCore/platform/ScrollView.cpp +++ b/WebCore/platform/ScrollView.cpp @@ -429,9 +429,7 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset) if (m_horizontalScrollbar) { int clientWidth = visibleWidth(); m_horizontalScrollbar->setEnabled(contentsWidth() > clientWidth); - int pageStep = (clientWidth - cAmountToKeepWhenPaging); - if (pageStep < 0) - pageStep = clientWidth; + int pageStep = max(clientWidth * cFractionToStepWhenPaging, 1.f); IntRect oldRect(m_horizontalScrollbar->frameRect()); IntRect hBarRect = IntRect(0, height() - m_horizontalScrollbar->height(), @@ -453,7 +451,7 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset) if (m_verticalScrollbar) { int clientHeight = visibleHeight(); m_verticalScrollbar->setEnabled(contentsHeight() > clientHeight); - int pageStep = (clientHeight - cAmountToKeepWhenPaging); + int pageStep = max(clientHeight * cFractionToStepWhenPaging, 1.f); if (pageStep < 0) pageStep = clientHeight; IntRect oldRect(m_verticalScrollbar->frameRect()); @@ -517,7 +515,7 @@ void ScrollView::scrollContents(const IntSize& scrollDelta) hostWindow()->repaint(panScrollIconDirtyRect, true); } - if (canBlitOnScroll() && !rootPreventsBlitting()) { // The main frame can just blit the WebView window + if (canBlitOnScroll()) { // The main frame can just blit the WebView window // FIXME: Find a way to blit subframes without blitting overlapping content hostWindow()->scroll(-scrollDelta, scrollViewRect, clipRect); } else { @@ -607,14 +605,6 @@ void ScrollView::setParent(ScrollView* parentView) if (m_scrollbarsAvoidingResizer && parent()) parent()->adjustScrollbarsAvoidingResizerCount(-m_scrollbarsAvoidingResizer); -#if PLATFORM(QT) - if (m_widgetsPreventingBlitting && parent()) - parent()->adjustWidgetsPreventingBlittingCount(-m_widgetsPreventingBlitting); - - if (m_widgetsPreventingBlitting && parentView) - parentView->adjustWidgetsPreventingBlittingCount(m_widgetsPreventingBlitting); -#endif - Widget::setParent(parentView); if (m_scrollbarsAvoidingResizer && parent()) @@ -677,7 +667,7 @@ void ScrollView::wheelEvent(PlatformWheelEvent& e) if (e.granularity() == ScrollByPageWheelEvent) { ASSERT(deltaX == 0); bool negative = deltaY < 0; - deltaY = max(0, visibleHeight() - cAmountToKeepWhenPaging); + deltaY = max(visibleHeight() * cFractionToStepWhenPaging, 1.f); if (negative) deltaY = -deltaY; } @@ -973,7 +963,7 @@ void ScrollView::platformDestroy() #endif -#if (!PLATFORM(WX) && !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(MAC)) || ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE) +#if !PLATFORM(WX) && !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(MAC) void ScrollView::platformAddChild(Widget*) { @@ -985,15 +975,15 @@ void ScrollView::platformRemoveChild(Widget*) #endif -#if !PLATFORM(MAC) || ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE) +#if !PLATFORM(MAC) -void ScrollView::platformSetScrollbarsSuppressed(bool repaintOnUnsuppress) +void ScrollView::platformSetScrollbarsSuppressed(bool) { } #endif -#if (!PLATFORM(MAC) && !PLATFORM(WX)) || ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE) +#if !PLATFORM(MAC) && !PLATFORM(WX) void ScrollView::platformSetScrollbarModes() { |