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 3d1d8c156dea95fb3f0e265d4764c7a7e405806a..fff48c235e1ccde663663c406023bda44526daae 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" |
| @@ -1950,6 +1951,20 @@ void Document::PropagateStyleToViewport() { |
| } |
| 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), |
|
dtapuska
2017/08/22 14:51:04
Is there someone where asserting that the CSS cast
sunyunjia
2017/08/22 23:55:37
Yes see https://cs.chromium.org/chromium/src/third
|
| + static_cast<ScrollBoundaryBehaviorType>( |
| + scroll_boundary_behavior_y))); |
| + } |
| RefPtr<ComputedStyle> viewport_style = GetLayoutViewItem().MutableStyle(); |
| if (viewport_style->GetWritingMode() != root_writing_mode || |
| @@ -1962,7 +1977,9 @@ void Document::PropagateStyleToViewport() { |
| 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); |
| @@ -1974,6 +1991,8 @@ void Document::PropagateStyleToViewport() { |
| 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); |
| } |