Chromium Code Reviews| 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 79e6b56486abab423bf7ca695de6a19b9bb20670..cc54cf2b04e920c28e1d939b9abebb8d81903b88 100644 | 
| --- a/third_party/WebKit/Source/core/dom/Document.cpp | 
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp | 
| @@ -201,6 +201,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( | 
| 
 
majidvp
2017/07/21 15:24:12
If I understand this correctly, the current logic
 
sunyunjia
2017/07/25 20:20:55
Done.
 
 | 
| + 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); | 
| } |