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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2769793002: Implement CSS: scroll-boundary-behavior (Closed)
Patch Set: Update WebScrollBoundaryBehavior. Created 3 years, 7 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
Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 3f7a58cdc7346e28159fd34c773fd4ea38c416e9..c26c6a2b799fc67b9dae8647d2401d272196efca 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -79,6 +79,7 @@
#include "platform/wtf/CurrentTime.h"
#include "platform/wtf/text/StringBuilder.h"
#include "public/platform/WebLayerStickyPositionConstraint.h"
+#include "public/platform/WebScrollBoundaryBehavior.h"
namespace blink {
@@ -1155,11 +1156,27 @@ void CompositedLayerMapping::UpdateGraphicsLayerGeometry(
UpdateShouldFlattenTransform();
UpdateChildrenTransform();
UpdateScrollParent(ScrollParent());
+ UpdateScrollBoundaryBehavior();
RegisterScrollingLayers();
UpdateCompositingReasons();
}
+void CompositedLayerMapping::UpdateScrollBoundaryBehavior() {
+ EScrollBoundaryBehavior behavior_x =
+ GetLayoutObject().StyleRef().ScrollBoundaryBehaviorX();
+ EScrollBoundaryBehavior behavior_y =
+ GetLayoutObject().StyleRef().ScrollBoundaryBehaviorY();
+ if (scrolling_contents_layer_) {
+ using ScrollBoundaryBehavior =
+ WebScrollBoundaryBehavior::ScrollBoundaryBehaviorType;
+ scrolling_contents_layer_->SetScrollBoundaryBehavior(
+ WebScrollBoundaryBehavior(
+ static_cast<ScrollBoundaryBehavior>(behavior_x),
+ static_cast<ScrollBoundaryBehavior>(behavior_y)));
+ }
+}
+
void CompositedLayerMapping::UpdateMainGraphicsLayerGeometry(
const IntRect& relative_compositing_bounds,
const IntRect& local_compositing_bounds,

Powered by Google App Engine
This is Rietveld 408576698