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

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

Issue 2884423003: Use scroll-boundary-behavior to control overscroll-refresh/glow on android. (Closed)
Patch Set: Fix nits and rebase 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/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index fa0bb415a3264d29edc8712a604fe0a2e872d47b..f44a65686f013b2bdc8651124bc56d4b485c66b4 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -204,6 +204,7 @@
#include "core/page/FrameTree.h"
#include "core/page/Page.h"
#include "core/page/PointerLockController.h"
+#include "core/page/scrolling/OverscrollController.h"
#include "core/page/scrolling/RootScrollerController.h"
#include "core/page/scrolling/ScrollStateCallback.h"
#include "core/page/scrolling/ScrollingCoordinator.h"
@@ -1995,6 +1996,20 @@ void Document::PropagateStyleToViewport(StyleRecalcChange change) {
}
ScrollSnapType snap_type = overflow_style->GetScrollSnapType();
+ EScrollBoundaryBehavior scroll_boundary_behavior_x =
+ overflow_style->ScrollBoundaryBehaviorX();
+ EScrollBoundaryBehavior scroll_boundary_behavior_y =
+ overflow_style->ScrollBoundaryBehaviorY();
+ using ScrollBoundaryBehaviorType =
+ WebScrollBoundaryBehavior::ScrollBoundaryBehaviorType;
+ if (RuntimeEnabledFeatures::CSSScrollBoundaryBehaviorEnabled() &&
+ IsInMainFrame()) {
+ GetPage()->GetOverscrollController().SetScrollBoundaryBehavior(
+ WebScrollBoundaryBehavior(
+ static_cast<ScrollBoundaryBehaviorType>(scroll_boundary_behavior_x),
+ static_cast<ScrollBoundaryBehaviorType>(
+ scroll_boundary_behavior_y)));
+ }
RefPtr<ComputedStyle> viewport_style;
if (change == kForce || !GetLayoutViewItem().Style()) {
@@ -2012,7 +2027,9 @@ void Document::PropagateStyleToViewport(StyleRecalcChange change) {
old_style.OverflowY() == overflow_y &&
old_style.HasNormalColumnGap() == column_gap_normal &&
old_style.ColumnGap() == column_gap &&
- old_style.GetScrollSnapType() == snap_type) {
+ old_style.GetScrollSnapType() == snap_type &&
+ old_style.ScrollBoundaryBehaviorX() == scroll_boundary_behavior_x &&
+ old_style.ScrollBoundaryBehaviorY() == scroll_boundary_behavior_y) {
return;
}
viewport_style = ComputedStyle::Clone(old_style);
@@ -2030,6 +2047,8 @@ void Document::PropagateStyleToViewport(StyleRecalcChange change) {
else
viewport_style->SetColumnGap(column_gap);
viewport_style->SetScrollSnapType(snap_type);
+ viewport_style->SetScrollBoundaryBehaviorX(scroll_boundary_behavior_x);
+ viewport_style->SetScrollBoundaryBehaviorY(scroll_boundary_behavior_y);
GetLayoutViewItem().SetStyle(viewport_style);
SetupFontBuilder(*viewport_style);
}

Powered by Google App Engine
This is Rietveld 408576698