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

Add workaround to avoid crashing when calling LocalBorderBoxProperties

In the presence of rare bugs, it is apparently possible to have a
graphics layer but no LocalBorderBoxProperties.

Bug: 1137883

Change-Id: I17d65c6ca04d15254efe9b2d13e3de905b59567e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2474918
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817565}
parent 62664fac
......@@ -44,12 +44,6 @@ void CompositingLayerPropertyUpdater::Update(const LayoutObject& object) {
object.GetDocument().Printing() ||
!object.CanBeCompositedForDirectReasons());
// TODO(chrishtr): this should never happen, but does in practice and
// we haven't been able to find all of the cases where it happens yet.
// Once we find more of them, try to remove this.
if (!fragment_data.HasLocalBorderBoxProperties())
return;
PhysicalOffset layout_snapped_paint_offset =
fragment_data.PaintOffset() - paint_layer->SubpixelAccumulation();
IntPoint snapped_paint_offset = RoundedIntPoint(layout_snapped_paint_offset);
......
......@@ -150,6 +150,12 @@ class CORE_EXPORT FragmentData {
// ancestor transform space.
PropertyTreeStateOrAlias LocalBorderBoxProperties() const {
DCHECK(HasLocalBorderBoxProperties());
// TODO(chrishtr): this should never happen, but does in practice and
// we haven't been able to find all of the cases where it happens yet.
// See crbug.com/1137883. Once we find more of them, remove this.
if (!rare_data_ || !rare_data_->local_border_box_properties)
return PropertyTreeState::Root();
return rare_data_->local_border_box_properties->GetPropertyTreeState();
}
bool HasLocalBorderBoxProperties() const {
......
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