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

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: 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
« no previous file with comments | « content/test/BUILD.gn ('k') | third_party/WebKit/Source/core/exported/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4695fdeb8e093a17162267aa562e2a5f3ed7ef10..6717d6cf5333d621c08b1a7a090429bd96e676b3 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"
@@ -2018,6 +2019,21 @@ void Document::PropagateStyleToViewport(StyleRecalcChange change) {
ScrollSnapType snap_type = overflow_style->GetScrollSnapType();
ScrollBehavior scroll_behavior = document_element_style->GetScrollBehavior();
+ 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()) {
viewport_style = StyleResolver::StyleForViewport(*this);
@@ -2035,7 +2051,9 @@ void Document::PropagateStyleToViewport(StyleRecalcChange change) {
old_style.HasNormalColumnGap() == column_gap_normal &&
old_style.ColumnGap() == column_gap &&
old_style.GetScrollSnapType() == snap_type &&
- old_style.GetScrollBehavior() == scroll_behavior) {
+ old_style.GetScrollBehavior() == scroll_behavior &&
+ old_style.ScrollBoundaryBehaviorX() == scroll_boundary_behavior_x &&
+ old_style.ScrollBoundaryBehaviorY() == scroll_boundary_behavior_y) {
return;
}
viewport_style = ComputedStyle::Clone(old_style);
@@ -2054,6 +2072,8 @@ void Document::PropagateStyleToViewport(StyleRecalcChange change) {
viewport_style->SetColumnGap(column_gap);
viewport_style->SetScrollSnapType(snap_type);
viewport_style->SetScrollBehavior(scroll_behavior);
+ viewport_style->SetScrollBoundaryBehaviorX(scroll_boundary_behavior_x);
+ viewport_style->SetScrollBoundaryBehaviorY(scroll_boundary_behavior_y);
GetLayoutViewItem().SetStyle(viewport_style);
SetupFontBuilder(*viewport_style);
}
« no previous file with comments | « content/test/BUILD.gn ('k') | third_party/WebKit/Source/core/exported/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698