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

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

Issue 1895323002: Viewport apply scroll should be on the document element not scrollingElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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 9ce97cf89da2077d300f3bf00b1e5bc9a316fe7a..2d6734fe3e55de31552918063107734b5633b74f 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -631,34 +631,17 @@ ScrollResult EventHandler::scrollBox(LayoutBox* box,
{
ASSERT(box);
Node* node = box->node();
- Document* document = m_frame->document();
- Element* scrollingElement = document->scrollingElement();
-
- bool isRootFrame = !document->ownerElement();
-
- // TODO(bokan): If the ViewportScrollCallback is installed on the body, we
- // can still hit the HTML element for scrolling in which case it'll bubble
- // up to the document node and try to scroll the LayoutView directly. Make
- // sure we never scroll the LayoutView like this by manually resetting the
- // scroll to happen on the scrolling element. This can also happen in
- // QuirksMode when the body is scrollable and scrollingElement == nullptr.
- if (node && node->isDocumentNode() && isRootFrame) {
- node = scrollingElement
- ? scrollingElement
- : document->documentElement();
- }
// If there's no ApplyScroll callback on the element, scroll as usuall in
// the non-scroll-customization case.
if (!node || !node->isElementNode() || !toElement(node)->getApplyScroll()) {
- ASSERT(!isRootFrame
- || node != scrollingElement
- || (!scrollingElement && node != document->documentElement()));
*wasRootScroller = false;
return box->scroll(granularity, delta);
}
- ASSERT(isRootFrame);
+ // 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

Powered by Google App Engine
This is Rietveld 408576698