Commit 8489e6b6 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[PE] Fix crash in ScrollableAreaPainter::PaintOverflowControls()

Just a speculative fix.
Still don't know why a scrollable box doesn't have paint properties.

Bug: 849278
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I4add45ef22ae71d6cc0ec617b4405fb5fdf2145f
Reviewed-on: https://chromium-review.googlesource.com/1090037Reviewed-by: default avatarTien-Ren Chen <trchen@chromium.org>
Commit-Queue: Tien-Ren Chen <trchen@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565422}
parent 738c6fa6
......@@ -180,11 +180,15 @@ void ScrollableAreaPainter::PaintOverflowControls(
const auto& box = *GetScrollableArea().GetLayoutBox();
if (const auto* fragment = paint_info.FragmentToPaint(box)) {
const auto* properties = fragment->PaintProperties();
// TODO(crbug.com/849278): Remove either the DCHECK or the if condition
// when we figure out in what cases that the box doesn't have properties.
DCHECK(properties);
if (const auto* clip = properties->OverflowControlsClip()) {
scoped_paint_chunk_properties.emplace(
context.GetPaintController(), clip, box,
DisplayItem::kClipLayerOverflowControls);
if (properties) {
if (const auto* clip = properties->OverflowControlsClip()) {
scoped_paint_chunk_properties.emplace(
context.GetPaintController(), clip, box,
DisplayItem::kClipLayerOverflowControls);
}
}
}
} else {
......
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