Commit 94907aac authored by Xianzhu Wang's avatar Xianzhu Wang

Reland "[PE] Don't ignore clip change not across transform boundary"

This is a reland of 3b36628a

Fix crashes on release-without-DCHECK builds by adding check for
contex.tree_builder_context before dereferencing it.

Original change's description:
> [PE] Don't ignore clip change not across transform boundary
>
> If the clip change is caused by the object having transform, we should
> not ignore the clip change because it actually affects descendants.
>
> Bug: 790560
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
> Change-Id: Ifc05835e406eb265717128129c8095f3e52bb864
> Reviewed-on: https://chromium-review.googlesource.com/822919
> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
> Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#523653}

Bug: 790560
Change-Id: I2bc134f829aa38398cf87ad8fa89ac229634d6d0
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
TBR: chrishtr@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/822139Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523703}
parent cacd0b18
<!DOCTYPE html>
<div id="clip" style="width: 100px; height: 100px; outline: 10px solid black">
ABCDE
</div>
<!DOCTYPE html>
<style>
div {
isolation: isolate;
}
#clip {
transform: translateZ(0);
outline: 10px solid black;
overflow: hidden;
width: 100px;
height: 10px;
}
</style>
<div id="clip">
<div>
<div>ABCDE</div>
</div>
</div>
<script src="../../../resources/run-after-layout-and-paint.js"></script>
<script>
runAfterLayoutAndPaint(function() {
clip.style.height = '100px';
}, true);
</script>
......@@ -156,10 +156,6 @@ void PrePaintTreeWalk::InvalidatePaintLayerOptimizationsIfNeeded(
PaintLayer& paint_layer = *ToLayoutBoxModelObject(object).Layer();
// Ignore clips across transform boundaries.
if (object.StyleRef().HasTransform())
context.tree_builder_context->clip_changed = false;
if (!context.tree_builder_context->clip_changed)
return;
......@@ -231,6 +227,11 @@ void PrePaintTreeWalk::Walk(const LayoutObject& object,
PrePaintTreeWalkContext context(parent_context,
needs_tree_builder_context_update);
// Ignore clip changes from ancestor across transform boundaries.
if (context.tree_builder_context && object.StyleRef().HasTransform())
context.tree_builder_context->clip_changed = false;
WalkInternal(object, context);
for (const LayoutObject* child = object.SlowFirstChild(); child;
......
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