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 4c5698d9b2f75ecd9beedc41ca75cfde121445cf..e65e9c56cbd7da9da4c7a4a2832a6a1802e47354 100644 |
| --- a/third_party/WebKit/Source/core/dom/Document.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp |
| @@ -203,6 +203,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" |
| @@ -1940,6 +1941,16 @@ void Document::InheritHtmlAndBodyElementStyles(StyleRecalcChange change) { |
| ScrollSnapType snap_type = overflow_style->GetScrollSnapType(); |
| const LengthPoint& snap_destination = overflow_style->ScrollSnapDestination(); |
| + EScrollBoundaryBehavior scroll_boundary_behavior_x = |
| + overflow_style->ScrollBoundaryBehaviorX(); |
| + EScrollBoundaryBehavior scroll_boundary_behavior_y = |
| + overflow_style->ScrollBoundaryBehaviorY(); |
| + using ScrollBoundaryBehavior = |
| + WebScrollBoundaryBehavior::ScrollBoundaryBehaviorType; |
|
majidvp
2017/05/18 15:26:10
Why not ScrollBoundaryBehaviorType? this seems in
sunyunjia
2017/05/19 20:14:23
Done.
|
| + GetPage()->GetOverscrollController().SetScrollBoundaryBehavior( |
| + WebScrollBoundaryBehavior( |
| + static_cast<ScrollBoundaryBehavior>(scroll_boundary_behavior_x), |
| + static_cast<ScrollBoundaryBehavior>(scroll_boundary_behavior_y))); |
| RefPtr<ComputedStyle> document_style = GetLayoutViewItem().MutableStyle(); |
| if (document_style->GetWritingMode() != root_writing_mode || |
| @@ -1953,7 +1964,9 @@ void Document::InheritHtmlAndBodyElementStyles(StyleRecalcChange change) { |
| document_style->OverflowY() != overflow_y || |
| document_style->ColumnGap() != column_gap || |
| document_style->GetScrollSnapType() != snap_type || |
| - document_style->ScrollSnapDestination() != snap_destination) { |
| + document_style->ScrollSnapDestination() != snap_destination || |
| + document_style->ScrollBoundaryBehaviorX() != scroll_boundary_behavior_x || |
| + document_style->ScrollBoundaryBehaviorY() != scroll_boundary_behavior_y) { |
| RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*document_style); |
| new_style->SetWritingMode(root_writing_mode); |
| new_style->SetDirection(root_direction); |
| @@ -1966,6 +1979,8 @@ void Document::InheritHtmlAndBodyElementStyles(StyleRecalcChange change) { |
| new_style->SetColumnGap(column_gap); |
| new_style->SetScrollSnapType(snap_type); |
| new_style->SetScrollSnapDestination(snap_destination); |
| + new_style->SetScrollBoundaryBehaviorX(scroll_boundary_behavior_x); |
| + new_style->SetScrollBoundaryBehaviorY(scroll_boundary_behavior_y); |
| GetLayoutViewItem().SetStyle(new_style); |
| SetupFontBuilder(*new_style); |
| } |