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

Unified Diff: third_party/WebKit/Source/core/input/EventHandler.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: Created 4 years, 7 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/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index 0aa7ebcf9babbe3fcd8f9422e7bee6cf1f2b8303..435c8e7908f2aa5737c5d5c0a00431e0e8aeef07 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -602,10 +602,6 @@ ScrollResult EventHandler::scrollBox(LayoutBox* box,
return box->scroll(granularity, delta);
}
- // Viewport actions should only happen when scrolling an element in the
- // main frame.
- ASSERT(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.
@@ -2428,12 +2424,13 @@ WebInputEventResult EventHandler::handleGestureScrollBegin(const PlatformGesture
bool EventHandler::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));
esprehn 2016/05/11 17:37:05 your method should take a const Element&, then do
bokan 2016/06/02 15:49:55 Done.
}
WebInputEventResult EventHandler::handleGestureScrollUpdate(const PlatformGestureEvent& gestureEvent)

Powered by Google App Engine
This is Rietveld 408576698