Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1448)

Unified Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 103583007: Ensure that if FrameView::isScrollable() is false, the assoc WebLayer is, too. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
index a1b1ee214807db01d3a9195c435bbbd7937d4147..e54d9b4d502314a27b0474dc4f03a33256387bb3 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -74,6 +74,13 @@ static WebLayer* scrollingWebLayerForGraphicsLayer(GraphicsLayer* layer)
return layer->platformLayer();
}
+static bool frameViewCouldBeScrolledByImplThread(FrameView* frameView)
+{
+ // A frame view will report that isScrollable is false if overflow is hidden, but it may still
+ // end up getting scrolled on the impl thread.
+ return frameView && frameView->hasOverflow() && frameView->isVisibleToHitTesting();
+}
+
WebLayer* ScrollingCoordinator::scrollingWebLayerForScrollableArea(ScrollableArea* scrollableArea)
{
GraphicsLayer* graphicsLayer = scrollLayerForScrollableArea(scrollableArea);
@@ -153,7 +160,7 @@ void ScrollingCoordinator::updateAfterCompositingChange()
}
FrameView* frameView = m_page->mainFrame()->view();
- bool frameIsScrollable = frameView && frameView->isScrollable();
+ bool frameIsScrollable = frameViewCouldBeScrolledByImplThread(frameView);
if (m_wasFrameScrollable != frameIsScrollable)
updateShouldUpdateScrollLayerPositionOnMainThread();
m_wasFrameScrollable = frameIsScrollable;
@@ -615,6 +622,8 @@ void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh
m_lastMainThreadScrollingReasons = reasons;
scrollLayer->setShouldScrollOnMainThread(reasons);
}
+
+ // We may be ignoring main thread scrolling reasons if the main thread claims it cannot be scrolled. Check for this case.
shawnsingh 2013/12/17 09:05:11 misplaced comment? or should this be labeled as a
}
void ScrollingCoordinator::pageDestroyed()
@@ -883,7 +892,7 @@ MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() co
// frame. If it does not exist or if it is not scrollable, there is no
// reason to force main thread scrolling.
FrameView* frameView = m_page->mainFrame()->view();
- if (!frameView || !frameView->isScrollable())
+ if (!frameView || !frameViewCouldBeScrolledByImplThread(frameView))
return static_cast<MainThreadScrollingReasons>(0);
MainThreadScrollingReasons mainThreadScrollingReasons = (MainThreadScrollingReasons)0;
@@ -925,7 +934,7 @@ String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const
bool ScrollingCoordinator::frameViewIsScrollableIsDirty() const
{
FrameView* frameView = m_page->mainFrame()->view();
- bool frameIsScrollable = frameView && frameView->isScrollable();
+ bool frameIsScrollable = frameViewCouldBeScrolledByImplThread(frameView);
return frameIsScrollable != m_wasFrameScrollable;
}
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698