Fix invalid DCHECK in LayoutBox::GetCachedLayoutResult
Sometimes we may need to retrieve |NGLayoutResult| after its |WillBeDestroyed| is called. 1. |LayoutBox::WillBeDestroyed| marks its cached |NGLayoutResult| as |WillBeDestroyed|. 2. |LayoutObject::WillBeDestroyed| clears its children by |DestroyLeftoverChildren|. 3. One of its descendant calls |SetNeedsLayout|. 4. In determining the container chain to mark dirty, |GetCachedLayoutResult| is needed to know if |ObjectIsRelayoutBoundary|. There will be rooms to improve, such as: * |DestroyLeftoverChildren| after |WillBeDestroyed| of its subclasses look dangerous. |LayoutBlockFlow| calls |DestroyLeftoverChildren| probably to prevent this. * We can probalby stop marking objects that are |BeingDestroyed|, though knowing exactly where may not be easy. but these changes are likely risky. This patch simply allows retrieving |GetCachedLayoutResult| if |BeingDestroyed|. Bug: 1091188 Change-Id: I966e1c6e7844fed795eadeb775b520bbd239e56a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2230562 Auto-Submit: Koji Ishii <kojii@chromium.org> Reviewed-by:Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#775181}
Showing
Please register or sign in to comment