[LayoutNG] Don't remove lines from the fragment builder.
Reverting the fragment builder to an earlier state simply isn't supported. We used to remove line boxes from the fragment builder after having laid out too many lines. But this doesn't necessarily revert the builder to the exact state that it had prior to adding those lines. Case in point is when we discover and add out-of-flow positioned descendants among the lines that later on get deleted (see the test). We don't delete the out-of-flow descendants, so we'd end up with two identical fragments for the out-of-flow positioned box, one in the fragmentainer that it should occur, and also one in the preceding fragmentainer, where we laid out too many lines and then deleted them. We sometimes need to lay out more lines than we can fit in a fragmentainer, to figure out where to break in order to honor the widows requirement. The new approach is to do a full relayout of the container and stop at the correct line. This CL introduces a new type NGEarlyBreak, which is currently a glorified int, but it will soon be extended to also support 'avoid' values for the break-before and break-after properties. Bug: 829028 Change-Id: I2d1bc5d51dc43360cbff17401d39d65613dea4c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1819249Reviewed-by:Koji Ishii <kojii@chromium.org> Reviewed-by:
Emil A Eklund <eae@chromium.org> Reviewed-by:
Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/master@{#699280}
Showing
Please register or sign in to comment