[LayoutNG] Fix shape exclusion tracking. #16802
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The DerivedGeometry class gets moved from exclusion-space to
exclusion-space as a fast way of determining layout opportunities (where
lines, etc get placed).
For speed we only allocate "NGShapeExclusions" if we've seen any shapes
within the formatting context.
This crash was due to an inconsistent state of the:
NGExclusionSpaceInternal::track_shape_exclusions_ flag.
"other" NGExclusionSpaceInternal
"this" NGExclusionSpaceInternal
Within the NGExclusionSpaceInternal::MoveAndUpdateDerivedGeometry method
we moved the derived geometry over to the "this" exclusion space.
However we didn't also move the track_shape_exclusions_ flag as a result
we'd try to add the 2nd shape exclusion, and a NPE was hit.
Bug: 962135, 962272, 962052
Change-Id: Id095bd2924f83ba6b2dbe90446d1f4613de09933
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610021
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659678}