Commit 5976ffc3 authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Mark self as needing compositing requirements on stacking change, not just ancestors.

The elements which may become stacked underneath a PaintLayer also need to be traversed.

Bug: 856756

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iacecf53886a04ac1bb554a63162ae9aff4e6f4de
Reviewed-on: https://chromium-review.googlesource.com/1117629Reviewed-by: default avatarTien-Ren Chen <trchen@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570921}
parent 416c439d
<!doctype HTML>
<div style="transform: translateZ(0)"></div>
<div id=target style="overflow: hidden;">
<div style="position: relative"></div>
</div>
Passes if it does not crash.
<script>
if (window.testRunner) {
window.testRunner.waitUntilDone();
window.testRunner.dumpAsText();
}
onload = () => requestAnimationFrame(() =>
requestAnimationFrame(() => {
target.style.transform = "translateX(0)";
if (window.testRunner)
window.testRunner.notifyDone();
}));
</script>
......@@ -242,6 +242,21 @@ void CompositingRequirementsUpdater::Update(
absolute_descendant_bounding_box, compositing_reasons_stats);
}
#if DCHECK_IS_ON()
static void CheckSubtreeHasNoCompositing(PaintLayer* layer) {
if (!layer->StackingNode())
return;
PaintLayerStackingNodeIterator iterator(
*layer->StackingNode(),
kNegativeZOrderChildren | kNormalFlowChildren | kPositiveZOrderChildren);
while (PaintLayer* cur_layer = iterator.Next()) {
DCHECK(cur_layer->GetCompositingState() == kNotComposited);
DCHECK(!cur_layer->DirectCompositingReasons());
CheckSubtreeHasNoCompositing(cur_layer);
}
}
#endif
void CompositingRequirementsUpdater::UpdateRecursive(
PaintLayer* ancestor_layer,
PaintLayer* layer,
......@@ -490,6 +505,11 @@ void CompositingRequirementsUpdater::UpdateRecursive(
}
}
#if DCHECK_IS_ON()
if (skip_children)
CheckSubtreeHasNoCompositing(layer);
#endif
// Now that the subtree has been traversed, we can check for compositing
// reasons that depended on the state of the subtree.
......
......@@ -2377,7 +2377,7 @@ void PaintLayer::ClearNeedsCompositingLayerAssignment() {
}
void PaintLayer::SetNeedsCompositingRequirementsUpdate() {
for (PaintLayer* curr = Parent();
for (PaintLayer* curr = this;
curr && !curr->DescendantMayNeedCompositingRequirementsUpdate();
curr = curr->Parent()) {
curr->descendant_may_need_compositing_requirements_update_ = true;
......
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