Commit 3c9786f5 authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

[layoutng] Only clear the paint fragment if we get a successful layout

That way, we can keep around the old paint fragment while we wait for
a final new one.

This patch fixes a dcheck failure when enabling fragment caching.

R=kojii@chromium.org,eae@chromium.org

Bug: 635619
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I763446ab3411c828a636317421fd398f500be67f
Reviewed-on: https://chromium-review.googlesource.com/1012499Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551335}
parent 59f46ba7
......@@ -187,7 +187,8 @@ scoped_refptr<NGLayoutResult> NGBlockNode::Layout(
if (block_flow) {
block_flow->SetCachedLayoutResult(constraint_space, break_token,
layout_result);
block_flow->ClearPaintFragment();
if (layout_result->Status() == NGLayoutResult::kSuccess)
block_flow->ClearPaintFragment();
}
if (layout_result->Status() == NGLayoutResult::kSuccess &&
......
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