diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-11 19:54:20 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-11 19:54:20 +0200 |
commit | 88a04ac016f57c2d78e714682445dff2e7db4ade (patch) | |
tree | a48ca81ee3b29953121308168db22532d5b57fe2 /Source/WebCore/page/Page.cpp | |
parent | 284837daa07b29d6a63a748544a90b1f5842ac5c (diff) | |
download | qtwebkit-88a04ac016f57c2d78e714682445dff2e7db4ade.tar.gz |
Imported WebKit commit 42d95198c30c2d1a94a5081181aad0b2be7c316c (http://svn.webkit.org/repository/webkit/trunk@128206)
This includes the rewrite of the configure part of the build system which should fix the QtQuick2 detection
and allow for further simplifications in the future
Diffstat (limited to 'Source/WebCore/page/Page.cpp')
-rw-r--r-- | Source/WebCore/page/Page.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp index 2983808ea..8578d33d2 100644 --- a/Source/WebCore/page/Page.cpp +++ b/Source/WebCore/page/Page.cpp @@ -144,6 +144,7 @@ Page::Page(PageClients& pageClients) , m_mediaVolume(1) , m_pageScaleFactor(1) , m_deviceScaleFactor(1) + , m_suppressScrollbarAnimations(false) , m_javaScriptURLsAreAllowed(true) , m_didLoadUserStyleSheet(false) , m_userStyleSheetModificationTime(0) @@ -693,6 +694,46 @@ void Page::setDeviceScaleFactor(float scaleFactor) pageCache()->markPagesForFullStyleRecalc(this); } +void Page::setShouldSuppressScrollbarAnimations(bool suppressAnimations) +{ + if (suppressAnimations == m_suppressScrollbarAnimations) + return; + + if (!suppressAnimations) { + // If animations are not going to be suppressed anymore, then there is nothing to do here but + // change the cached value. + m_suppressScrollbarAnimations = suppressAnimations; + return; + } + + // On the other hand, if we are going to start suppressing animations, then we need to make sure we + // finish any current scroll animations first. + FrameView* view = mainFrame()->view(); + if (!view) + return; + + view->finishCurrentScrollAnimations(); + + for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) { + FrameView* frameView = frame->view(); + if (!frameView) + continue; + + const HashSet<ScrollableArea*>* scrollableAreas = frameView->scrollableAreas(); + if (!scrollableAreas) + continue; + + for (HashSet<ScrollableArea*>::const_iterator it = scrollableAreas->begin(), end = scrollableAreas->end(); it != end; ++it) { + ScrollableArea* scrollableArea = *it; + ASSERT(scrollableArea->scrollbarsCanBeActive()); + + scrollableArea->finishCurrentScrollAnimations(); + } + } + + m_suppressScrollbarAnimations = suppressAnimations; +} + void Page::setPagination(const Pagination& pagination) { if (m_pagination == pagination) |