You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handle BR clear=all correctly in block fragmentation.
BR clearance is special in that it's applied *after* the content (the
line), while regular CSS clearance is about adding spacing *before*
something. If clearance from a BR element crosses fragmentainer
boundaries, do two things:
1. If the line has content before the BR clear element, add an
additional line break before it, so that we can fit everything on the
line before the BR in the correct fragmentainer. In addition to looking
good, the line may contain floats, and we cannot push those ahead of us,
as we'd get no progress that way!
2. Abort layout of a line with an isolated BR clear element, if it needs
to be pushed to a subsequent fragmentainer, and ignore any orphans and
widows requests in this case (we're creating a line that doesn't really
exist, spec-wise). Layout is aborted with
NGLayoutResult::kOutOfFragmentainerSpace.
We were already handling kOutOfFragmentainerSpace layout abortions for
new-FC children, as this was already supported for nested multicol
containers. Now that we also support it for same-FC children (such as
lines), we need to update the code to not assume that layout was
successful. Handle block fragmentation a bit earlier (so that we'll
return before attempting to access the resulting fragment), and add
checks for successful layout where needed.
It might be possible to add real support for trailing clearance to the
block fragmentation engine, but it just seemed like an unreasonably
large effort (especially maintenance-wise) for such a corner-case.
This fixes the following tests in external/wpt/css/CSS2/floats-clear/
(not part of the virtual/layout_ng_block_frag/ testsuite) when
LayoutNGBlockFragmentation is enabled:
floats-clear-multicol-000.html
floats-clear-multicol-001.html
floats-clear-multicol-balancing-000.html
floats-clear-multicol-balancing-001.html
Bug: 829028
Change-Id: If3ebb307cac4afd388e5edfc2ac576510afe283e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168884
Commit-Queue: Morten Stenshorne <[email protected]>
Reviewed-by: Ian Kilpatrick <[email protected]>
Reviewed-by: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#923551}
0 commit comments