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

Unified Diff: third_party/WebKit/Source/core/input/ScrollManager.cpp

Issue 1970763002: Fixed up root scroller API to be more webby (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sigh...fix test expectation again, fix crash when there's no renderer Created 4 years, 6 months 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
Index: third_party/WebKit/Source/core/input/ScrollManager.cpp
diff --git a/third_party/WebKit/Source/core/input/ScrollManager.cpp b/third_party/WebKit/Source/core/input/ScrollManager.cpp
index c6971393ecdca49667bbfb91f0cc808454d91103..423955a963ab735f4568640140b5f284c3dd6b0e 100644
--- a/third_party/WebKit/Source/core/input/ScrollManager.cpp
+++ b/third_party/WebKit/Source/core/input/ScrollManager.cpp
@@ -242,10 +242,6 @@ ScrollResult ScrollManager::scrollBox(LayoutBox* box,
return box->scroll(granularity, delta);
}
- // Viewport actions should only happen when scrolling an element in the
- // main frame.
- DCHECK(m_frame->isMainFrame());
-
// If there is an ApplyScroll callback, its because we placed one on the
// root scroller to control top controls and overscroll. Invoke a scroll
// using parts of the scroll customization framework on just this element.
@@ -492,10 +488,13 @@ bool ScrollManager::isRootScroller(const Node& node) const
{
// The root scroller is the one Element on the page designated to perform
// "viewport actions" like top controls movement and overscroll glow.
- if (!frameHost() || !frameHost()->rootScroller())
+ if (!m_frame->document())
+ return false;
+
+ if (!node.isElementNode())
return false;
- return frameHost()->rootScroller()->get() == &node;
+ return m_frame->document()->topDocument().isEffectiveRootScroller(toElement(node));
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.h ('k') | third_party/WebKit/Source/core/page/scrolling/RootScroller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698