Chromium Code Reviews| 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()) |