fune/testing/web-platform/tests/css/css-break/float-in-inline-widows-orphans-crash.html
Morten Stenshorne 7cc5ad6939 Bug 1855384 [wpt PR 42189] - Never break before a float resumed after a break., a=testonly
Automatic update from web-platform-tests
Never break before a float resumed after a break.

Always process all incoming inline break tokens that establish a
parallel flow for a fragmented float or overflowed block-in-inline.

The orphans implementation works so that if we run out of space in a
fragmentainer, we'll still keep on laying out a few more lines, to
figure out if we should break further up (rather than exactly where we
run out of space), in order to honor widows. We count the number of
lines laid out. The fix is to make sure that inline break tokens that
just contain a resumed float or block-in-inline (in a parallel flow)
leave this counter alone. Otherwise we risk breaking before even getting
around to resuming the block node inside, which means that it wouldn't
be added to the fragment tree at all.

Add DCHECKs after layout of a block to make sure that we don't break at
a location where we'll be unable to resume correctly. This also includes
DCHECKing block break tokens, not just inline break tokens. There are no
known issues for block layout ending up in this state, but it would be
equally bad if it happens.

This also fixes a correctness issue that was introduced by CL:4874801.
Counting resumed floats as line boxes for orphans / widows consideration
caused us to break prematurely in some cases. If this premature break is
before an actual line box, we get a correctness issue (breaking too
soon). If this premature break is before a resumed float, the fragment
tree would be in a bad state, which could lead to crashes.

Add a test for both a crash and the correctness issue.

Bug: 1486252
Change-Id: I764c12e01540f7ceb437fb4aca787c9424ddfa48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4891832
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1201849}

--

wpt-commits: af15aec4a7076fbd08c08c989a27d690faa5a4d5
wpt-pr: 42189
2023-09-28 14:59:25 +00:00

10 lines
602 B
HTML

<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1486252">
<div style="columns:10em; orphans:2; widows:2; height:20px; column-fill:auto; line-height:20px; background:yellow;">
<div style="float:left; width:100%; height:30px; background:cyan;"></div>
<br>
<div style="float:left; contain:size; width:1px; height:10px; background:hotpink;"></div>
<div style="float:left; width:10px; height:10px; background:blue;"></div>
allworkandnoplaymakesjackadullstableboy
</div>