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 af710a5670f2b3475c8303f1f71f48bc76d84b35..34e34df6d64fb1d5768382103a1d7d8a4c96adbe 100644 |
| --- a/third_party/WebKit/Source/core/dom/Element.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Element.cpp |
| @@ -528,8 +528,9 @@ void Element::NativeDistributeScroll(ScrollState& scroll_state) { |
| CallApplyScroll(scroll_state); |
| - if (delta_x != scroll_state.deltaX() || delta_y != scroll_state.deltaY()) |
| + if (delta_x != scroll_state.deltaX() || delta_y != scroll_state.deltaY()) { |
| scroll_state.SetCurrentNativeScrollingElement(this); |
| + } |
|
bokan
2017/05/19 19:35:57
Nit: no braces
sunyunjia
2017/05/25 20:07:10
Done.
|
| } |
| void Element::CallDistributeScroll(ScrollState& scroll_state) { |
| @@ -593,8 +594,17 @@ void Element::NativeApplyScroll(ScrollState& scroll_state) { |
| scroll_state.deltaGranularity())), |
| delta); |
| - if (!result.DidScroll()) |
| + if (!result.DidScroll()) { |
| + if (GetComputedStyle()->ScrollBoundaryBehaviorX() != |
|
bokan
2017/05/19 19:35:57
Similarly, this should be done at the time that we
sunyunjia
2017/05/25 20:07:10
Done.
|
| + EScrollBoundaryBehavior::kAuto && |
| + std::abs(delta.Width()) > std::abs(delta.Height())) |
| + scroll_state.ConsumeDeltaNative(delta.Width(), 0); |
| + if (GetComputedStyle()->ScrollBoundaryBehaviorY() != |
| + EScrollBoundaryBehavior::kAuto && |
| + std::abs(delta.Height()) > std::abs(delta.Width())) |
| + scroll_state.ConsumeDeltaNative(0, delta.Height()); |
| return; |
| + } |
| // FIXME: Native scrollers should only consume the scroll they |
| // apply. See crbug.com/457765. |