Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Once content is added to a builder, break as normally.
If the RequiresContentBeforeBreaking flag was set when initializing the fragment builder, it was never set to false again. This was generally unproblematic, since it only affected last-resort break opportunities, which generally only occur at the beginning of a fragment (e.g. between a container and its first child). However, in flex layout there may be a last-resort break opportunity before any flex item that's flush with its flex line, because that is seen as having no container separation. Therefore, reset the RequiresContentBeforeBreaking flag once a child has been added to the builder. That in itself is a simple fix, in NGBoxFragmentBuilder::AddChild(). The rest of this CL is about keeping this mechanism working for out-of-flow positioned elements. We now need to check the RequiresContentBeforeBreaking state exactly when the out-of-flow positioned element is found in the box tree, not when it's being laid out. Doing it later, in NGOutOfFlowLayoutPart, is now too late, since the flag may have been reset in the meantime, which would prevent us from forcing OOFs to stay in the current fragmentainer when they should. So store it directly in NGLogicalOutOfFlowPositionedNode when creating it. Since these objects bubble up the parent chain as physical fragments, NGPhysicalOutOfFlowPositionedNode also needs to store this. Storing it in NGContainingBlock is no longer necessary, on the other hand. css/css-break/tall-content-inside-constrained-block-006.tentative.html is a test for this. Bug: 1500947 Change-Id: I3b60239b0bdac82477748b3e0a99daf074d7246d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5029777 Reviewed-by: Alison Maher <[email protected]> Commit-Queue: Morten Stenshorne <[email protected]> Cr-Commit-Position: refs/heads/main@{#1224475}
- Loading branch information