Commit 66eb3cbb authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Promote fixed-position elements with compositing descendants.

This code was accidentally removed in an earlier commit (*).
It seems fixed-position elements with compositing descendants
need to be promoted for the existing compositing system to work.

(*) https://chromium-review.googlesource.com/c/chromium/src/+/1407922

Bug: 950418

Change-Id: Iec04435bb1a20a17c54ce4f5ff35f4e00704e6b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1574686
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652637}
parent b93aae7c
...@@ -184,6 +184,11 @@ static CompositingReasons SubtreeReasonsForCompositing( ...@@ -184,6 +184,11 @@ static CompositingReasons SubtreeReasonsForCompositing(
subtree_reasons |= CompositingReason::kIsolateCompositedDescendants; subtree_reasons |= CompositingReason::kIsolateCompositedDescendants;
} }
if (layer->GetLayoutObject().StyleRef().GetPosition() == EPosition::kFixed) {
subtree_reasons |=
CompositingReason::kPositionFixedWithCompositedDescendants;
}
// A layer with preserve-3d or perspective only needs to be composited if // A layer with preserve-3d or perspective only needs to be composited if
// there are descendant layers that will be affected by the preserve-3d or // there are descendant layers that will be affected by the preserve-3d or
// perspective. // perspective.
......
...@@ -105,10 +105,9 @@ constexpr CompositingReasonStringMap kCompositingReasonsStringMap[] = { ...@@ -105,10 +105,9 @@ constexpr CompositingReasonStringMap kCompositingReasonsStringMap[] = {
{CompositingReason::kIsolateCompositedDescendants, {CompositingReason::kIsolateCompositedDescendants,
"isolateCompositedDescendants", "isolateCompositedDescendants",
"Should isolate descendants to apply a blend effect"}, "Should isolate descendants to apply a blend effect"},
{CompositingReason::kPositionFixedOrStickyWithCompositedDescendants, {CompositingReason::kPositionFixedWithCompositedDescendants,
"positionFixedOrStickyWithCompositedDescendants" "positionFixedWithCompositedDescendants"
"Is a position:fixed or position:sticky element with composited " "Is a position:fixed element with composited descendants"},
"descendants"},
{CompositingReason::kRoot, "root", "Is the root layer"}, {CompositingReason::kRoot, "root", "Is the root layer"},
{CompositingReason::kLayerForAncestorClip, "layerForAncestorClip", {CompositingReason::kLayerForAncestorClip, "layerForAncestorClip",
"Secondary layer, applies a clip due to a sibling in the compositing " "Secondary layer, applies a clip due to a sibling in the compositing "
......
...@@ -61,7 +61,7 @@ using CompositingReasons = uint64_t; ...@@ -61,7 +61,7 @@ using CompositingReasons = uint64_t;
V(Preserve3DWith3DDescendants) \ V(Preserve3DWith3DDescendants) \
V(ReflectionOfCompositedParent) \ V(ReflectionOfCompositedParent) \
V(IsolateCompositedDescendants) \ V(IsolateCompositedDescendants) \
V(PositionFixedOrStickyWithCompositedDescendants) \ V(PositionFixedWithCompositedDescendants) \
\ \
/* The root layer is a special case. It may be forced to be a layer, but it \ /* The root layer is a special case. It may be forced to be a layer, but it \
also needs to be a layer if anything else in the subtree is composited. */ \ also needs to be a layer if anything else in the subtree is composited. */ \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment