Commit bb10fad7 authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Fix crash when number of columns changes.

Bug: 763654
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ida1979f9418c95c3b38db423f3bf777186cbb86a
Reviewed-on: https://chromium-review.googlesource.com/660407Reviewed-by: default avatarTien-Ren Chen <trchen@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501154}
parent fc13d598
<!doctype HTML>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<style>
#target {
columns: 1px;
font: 14px/0 Ahem
</style>
<div id="target"></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<script>
test(function() {
target.innerText += "test";
}, "Should not crash");
</script>
......@@ -1319,10 +1319,7 @@ void PaintPropertyTreeBuilder::UpdateForObjectLocationAndSize(
// frame rect, so force a property update if it changes. TODO(pdr): We
// only need to update properties if there are relative lengths.
box.StyleRef().HasTransform() || box.StyleRef().HasPerspective() ||
box_generates_property_nodes_for_mask_and_clip_path
// Fragmentation sizes, positions and counts depend on the size of a
// fragmented box.
|| (box.Layer() && box.Layer()->EnclosingPaginationLayer()))
box_generates_property_nodes_for_mask_and_clip_path)
box.GetMutableForPainting().SetNeedsPaintPropertyUpdate();
}
......@@ -1416,6 +1413,12 @@ void PaintPropertyTreeBuilder::UpdateFragments(
PaintLayer* enclosing_pagination_layer =
paint_layer->EnclosingPaginationLayer();
// Always force-update properties for fragmented content.
// TODO(chrishtr): find ways to optimize this in the future.
// It may suffice to compare previous and current visual overflow,
// but we do not currenly cache that on the LayoutObject or PaintLayer.
object.GetMutableForPainting().SetNeedsPaintPropertyUpdate();
LayoutPoint offset_within_paginated_layer;
paint_layer->ConvertToLayerCoords(enclosing_pagination_layer,
offset_within_paginated_layer);
......
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