Commit 71e2c3fd authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Invalidate the graphics layer subtree on stacking change of descendant PaintLayer.

This is because change of stacking may result in a change of the size
or position of a composited layer.

Bug: 916896

Change-Id: I44d42efc84df892c9e6cbf04f9dcb9ee34a803d9
Reviewed-on: https://chromium-review.googlesource.com/c/1392363Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619544}
parent 842b75c6
......@@ -50,6 +50,7 @@
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/core/layout/layout_multi_column_flow_thread.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h"
#include "third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
......@@ -129,8 +130,19 @@ void PaintLayerStackingNode::DirtyZOrderLists() {
void PaintLayerStackingNode::DirtyStackingContextZOrderLists(
PaintLayer* layer) {
if (PaintLayerStackingNode* stacking_node =
AncestorStackingContextNode(layer))
AncestorStackingContextNode(layer)) {
// This invalidation code intentionally refers to stale state.
DisableCompositingQueryAsserts disabler;
// Changes of stacking may result in graphics layers changing size
// due to new contents painting into them.
PaintLayer* ancestor_layer = stacking_node->Layer();
if (auto* mapping = ancestor_layer->GetCompositedLayerMapping()) {
mapping->SetNeedsGraphicsLayerUpdate(kGraphicsLayerUpdateSubtree);
}
stacking_node->DirtyZOrderLists();
}
}
void PaintLayerStackingNode::RebuildZOrderLists() {
......
<!doctype HTML>
<title>CSS Test Reference</title>
<link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org" />
<div style="width: 100px; height: 100px; background: lightblue; will-change: transform; position: absolute">
<div id=target style="backface-visibility: hidden">
<div style="width: 50px; height: 50px; background: lightgray; top: 75px; position: relative">
</div>
</div>
<!doctype HTML>
<title>CSS Test: Test for re-paint after stacking context removal due to opacity</title>
<link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org" />
<link rel="help" href="https://www.w3.org/TR/CSS2/zindex.html">
<link rel="match" href="opacity-change-parent-stacking-context-ref.html">
<div style="width: 100px; height: 100px; background: lightblue; will-change: transform; position: absolute">
<div id=target style="opacity: 0; backface-visibility: hidden">
<div style="width: 50px; height: 50px; background: lightgray; top: 75px; position: relative">
</div>
</div>
<script>
onload = function() {
requestAnimationFrame(() => requestAnimationFrame(() => {
target.style.opacity = 1;
}));
}
</script>
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