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

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

Issue 2884423003: Use scroll-boundary-behavior to control overscroll-refresh/glow on android. (Closed)
Patch Set: rebase and update comments Created 3 years, 4 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/ScrollManager.cpp
diff --git a/third_party/WebKit/Source/core/input/ScrollManager.cpp b/third_party/WebKit/Source/core/input/ScrollManager.cpp
index ec6c58ab46b0aeff70daf543c4fe97ad78bc7aff..96bd5fc9d5ad501ca66ffbc3bf1274e68c216d73 100644
--- a/third_party/WebKit/Source/core/input/ScrollManager.cpp
+++ b/third_party/WebKit/Source/core/input/ScrollManager.cpp
@@ -85,8 +85,8 @@ AutoscrollController* ScrollManager::GetAutoscrollController() const {
return nullptr;
}
-static bool CanPropagate(const ScrollState& scroll_state,
- const Element& element) {
+bool ScrollManager::CanPropagate(const ScrollState& scroll_state,
+ const Element& element) {
// ScrollBoundaryBehavior may have different values on x-axis and y-axis.
// We need to find out the dominant axis of user's intended scroll to decide
// which node's ScrollBoundaryBehavior should be applied, i.e. which the
@@ -95,7 +95,8 @@ static bool CanPropagate(const ScrollState& scroll_state,
// axis of scroll gesture.
bool x_dominant =
std::abs(scroll_state.deltaXHint()) > std::abs(scroll_state.deltaYHint());
- return (x_dominant && element.GetComputedStyle()->ScrollBoundaryBehaviorX() ==
+ return (element == frame_->GetDocument()->ViewportDefiningElement(nullptr)) ||
+ (x_dominant && element.GetComputedStyle()->ScrollBoundaryBehaviorX() ==
EScrollBoundaryBehavior::kAuto) ||
(!x_dominant &&
element.GetComputedStyle()->ScrollBoundaryBehaviorY() ==

Powered by Google App Engine
This is Rietveld 408576698