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

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

Issue 2769793002: Implement CSS: scroll-boundary-behavior (Closed)
Patch Set: update the tests Created 3 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/input/ScrollManager.cpp
diff --git a/third_party/WebKit/Source/core/input/ScrollManager.cpp b/third_party/WebKit/Source/core/input/ScrollManager.cpp
index 0d4a7cb180e276e187db3c6488917ace6589fea7..5a349f7fd3a88c8bc651f895e2111e3dbc66e05c 100644
--- a/third_party/WebKit/Source/core/input/ScrollManager.cpp
+++ b/third_party/WebKit/Source/core/input/ScrollManager.cpp
@@ -6,6 +6,7 @@
#include <memory>
#include "core/dom/DOMNodeIds.h"
+#include "core/dom/NodeComputedStyle.h"
#include "core/events/GestureEvent.h"
#include "core/frame/BrowserControls.h"
#include "core/frame/LocalFrameView.h"
@@ -93,6 +94,8 @@ void ScrollManager::RecomputeScrollChain(const Node& start_node,
DCHECK(start_node.GetLayoutObject());
LayoutBox* cur_box = start_node.GetLayoutObject()->EnclosingBox();
Element* document_element = frame_->GetDocument()->documentElement();
+ bool x_dominated =
+ std::abs(scroll_state.deltaXHint()) > std::abs(scroll_state.deltaYHint());
// Scrolling propagates along the containing block chain and ends at the
// RootScroller element. The RootScroller element will have a custom
@@ -117,6 +120,14 @@ void ScrollManager::RecomputeScrollChain(const Node& start_node,
if (IsViewportScrollingElement(*cur_element) ||
cur_element == document_element)
break;
+
+ if ((x_dominated &&
+ cur_element->GetComputedStyle()->ScrollBoundaryBehaviorX() !=
+ EScrollBoundaryBehavior::kAuto) ||
+ (!x_dominated &&
+ cur_element->GetComputedStyle()->ScrollBoundaryBehaviorY() !=
+ EScrollBoundaryBehavior::kAuto))
+ break;
}
cur_box = cur_box->ContainingBlock();

Powered by Google App Engine
This is Rietveld 408576698