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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2069713002: Make all gesture scrolls use customization path internally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Gesture scrolls are now on scroll customization path 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/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index ebaa903a39c876845428c9f71fc889bc35ced02e..419782a00a570fcf513f96a2217ce0836403f50b 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -538,8 +538,6 @@ void Element::callDistributeScroll(ScrollState& scrollState)
void Element::nativeApplyScroll(ScrollState& scrollState)
{
- DCHECK(RuntimeEnabledFeatures::scrollCustomizationEnabled());
-
// All elements in the scroll chain should be boxes.
DCHECK(!layoutObject() || layoutObject()->isBox());
@@ -556,8 +554,9 @@ void Element::nativeApplyScroll(ScrollState& scrollState)
LayoutBox* boxToScroll = nullptr;
- // Handle the scrollingElement separately, as it should scroll the viewport.
- if (this == document().scrollingElement())
+ // We should only ever scroll the effective root scroller this way when the
+ // page removes the default applyScroll (ViewportScrollCallback).
+ if (document().effectiveRootScroller() == this)
tdresser 2016/06/23 14:34:29 Nit: we don't normally use yoda style conditionals
bokan 2016/06/23 16:12:30 Hah, never heard yoda conditionals before :) Woul
tdresser 2016/06/23 16:16:51 Hmmm, I was thinking about it the other way, but I
boxToScroll = document().layoutView();
else if (layoutObject())
boxToScroll = toLayoutBox(layoutObject());
@@ -567,7 +566,7 @@ void Element::nativeApplyScroll(ScrollState& scrollState)
ScrollResult result =
LayoutBoxItem(boxToScroll).enclosingBox().scroll(
- ScrollByPrecisePixel,
+ ScrollGranularity(static_cast<int>(scrollState.deltaGranularity())),
delta);
if (!result.didScroll())

Powered by Google App Engine
This is Rietveld 408576698