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

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

Issue 2846313002: [blink] Perspective layer should be considered fixed-pos container layer (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/transforms/perspective-fixed-pos-descendant-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4113f099d81c63b52f95a89b7dd3474585c1c687..57770c68278be276b7df58440deb630337fe7040 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -1593,26 +1593,6 @@ void CompositedLayerMapping::UpdateDecorationOutlineLayerGeometry(
graphics_layer_->OffsetFromLayoutObject());
}
-void CompositedLayerMapping::RegisterScrollingLayers() {
- // Register fixed position layers and their containers with the scrolling
- // coordinator.
- ScrollingCoordinator* scrolling_coordinator =
- owning_layer_.GetScrollingCoordinator();
- if (!scrolling_coordinator)
- return;
-
- scrolling_coordinator->UpdateLayerPositionConstraint(&owning_layer_);
-
- // Page scale is applied as a transform on the root layout view layer. Because
- // the scroll layer is further up in the hierarchy, we need to avoid marking
- // the root layout view layer as a container.
- bool is_container =
- owning_layer_.GetLayoutObject().CanContainFixedPositionObjects() &&
- !owning_layer_.IsRootLayer();
- scrolling_coordinator->SetLayerIsContainerForFixedPositionLayers(
- graphics_layer_.get(), is_container);
-}
-
void CompositedLayerMapping::UpdateInternalHierarchy() {
// m_foregroundLayer has to be inserted in the correct order with child
// layers, so it's not inserted here.
@@ -2487,6 +2467,37 @@ void CompositedLayerMapping::UpdateClipParent(const PaintLayer* scroll_parent) {
}
}
+void CompositedLayerMapping::RegisterScrollingLayers() {
+ // Register fixed position layers and their containers with the scrolling
+ // coordinator.
+ ScrollingCoordinator* scrolling_coordinator =
+ owning_layer_.GetScrollingCoordinator();
+ if (!scrolling_coordinator)
+ return;
+
+ scrolling_coordinator->UpdateLayerPositionConstraint(&owning_layer_);
+
+ // Page scale is applied as a transform on the root layout view layer. Because
+ // the scroll layer is further up in the hierarchy, we need to avoid marking
+ // the root layout view layer as a container.
+ bool is_container =
+ owning_layer_.GetLayoutObject().CanContainFixedPositionObjects() &&
+ !owning_layer_.IsRootLayer();
+ scrolling_coordinator->SetLayerIsContainerForFixedPositionLayers(
+ graphics_layer_.get(), is_container);
+ // Fixed-pos descendants inherits the space that has all CSS property applied,
+ // including perspective, overflow scroll/clip. Thus we also mark every layers
+ // below the main graphics layer so transforms implemented by them don't get
+ // skipped.
+ ApplyToGraphicsLayers(
+ this,
+ [scrolling_coordinator, is_container](GraphicsLayer* layer) {
+ scrolling_coordinator->SetLayerIsContainerForFixedPositionLayers(
+ layer, is_container);
+ },
+ kApplyToChildContainingLayers);
+}
+
bool CompositedLayerMapping::UpdateSquashingLayers(
bool needs_squashing_layers) {
bool layers_changed = false;
« no previous file with comments | « third_party/WebKit/LayoutTests/transforms/perspective-fixed-pos-descendant-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698