| 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 b128210c5d6e50d51d8e831fdba652d68cc79cc9..60f65c1595aade1110bb761b5254232dfef2ee3b 100644
|
| --- a/third_party/WebKit/Source/core/dom/Document.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp
|
| @@ -202,6 +202,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"
|
| @@ -1971,6 +1972,19 @@ void Document::InheritHtmlAndBodyElementStyles(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()) {
|
| + GetPage()->GetOverscrollController().SetScrollBoundaryBehavior(
|
| + WebScrollBoundaryBehavior(
|
| + static_cast<ScrollBoundaryBehaviorType>(scroll_boundary_behavior_x),
|
| + static_cast<ScrollBoundaryBehaviorType>(
|
| + scroll_boundary_behavior_y)));
|
| + }
|
|
|
| RefPtr<ComputedStyle> viewport_style = GetLayoutViewItem().MutableStyle();
|
| if (viewport_style->GetWritingMode() != root_writing_mode ||
|
| @@ -1983,7 +1997,9 @@ void Document::InheritHtmlAndBodyElementStyles(StyleRecalcChange change) {
|
| viewport_style->OverflowX() != overflow_x ||
|
| viewport_style->OverflowY() != overflow_y ||
|
| viewport_style->ColumnGap() != column_gap ||
|
| - viewport_style->GetScrollSnapType() != snap_type) {
|
| + viewport_style->GetScrollSnapType() != snap_type ||
|
| + viewport_style->ScrollBoundaryBehaviorX() != scroll_boundary_behavior_x ||
|
| + viewport_style->ScrollBoundaryBehaviorY() != scroll_boundary_behavior_y) {
|
| RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*viewport_style);
|
| new_style->SetWritingMode(root_writing_mode);
|
| new_style->SetDirection(root_direction);
|
| @@ -1995,6 +2011,8 @@ void Document::InheritHtmlAndBodyElementStyles(StyleRecalcChange change) {
|
| new_style->SetOverflowY(overflow_y);
|
| new_style->SetColumnGap(column_gap);
|
| new_style->SetScrollSnapType(snap_type);
|
| + new_style->SetScrollBoundaryBehaviorX(scroll_boundary_behavior_x);
|
| + new_style->SetScrollBoundaryBehaviorY(scroll_boundary_behavior_y);
|
| GetLayoutViewItem().SetStyle(new_style);
|
| SetupFontBuilder(*new_style);
|
| }
|
|
|