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; |
} |