A div containing floats and clear, fragmented into multiple columns, has unconstrained block-size
Categories
(Core :: Layout: Floats, defect, P3)
Tracking
()
People
(Reporter: TYLin, Assigned: TYLin)
References
(Regression)
Details
(Keywords: regression)
Attachments
(6 files, 1 obsolete file)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1574046 Part 2 - Move calling nsFloatManager::ClearContinues to BlockReflowInput::ClearFloats().
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
I follow this review comment to add an assertion in nsBlockReflowInput::nsBlockReflowInput
that mConsumedBSize
is not NS_UNCONSTRAINEDSIZE
, but this try run shows float-clear-001.html and a few other tests can trigger this assertion.
From the frame tree dump for float-clear-001.html, I can see that <div class="container">
, which has floats & clear, and being fragmented to multiple columns, has unconstrained block-size.
Seems like there might be a behavior regression in those tests from bug 1569701, then, so we should probably fix this in the same cycle.
Assignee | ||
Comment 2•5 years ago
•
|
||
The behavior change from bug 1569701 (bug 1569701 Part2 specifically) should be in effect only when column-span
is enabled. However, this bug can be observed on current release Firefox 68's devtool by inspecting <div class="container">
in float-clear-001.html, so this is not a recent regression at least.
From a quick debugging, I see that when reflowing the <div class="container">
, nsFloatManager::ClearFloats
returns nscoord_MAX
, and later the nscoord max value is set on BlockReflowInput::mBCoord
, which becomes the container's block-size when computing in nsBlockFrame::ComputeFinalSize
.
David, do you recall why we return nscoord_MAX
offhand? I have difficulty figuring out by reading bug 563584 patch 9 that added it.
One of the rules for placement of floats is that the top of a later float can't be higher than the top of an earlier float. So if we've pushed an earlier float to the next column, that means we can't try to fit any later floats in that column either. In some of those functions it handles that by telling the caller that a float won't fit at all -- but that's not the right thing if the caller wants to know what the right block height is to include floats. So probably either more information needs to be returned to the callers rather than just nscoord_MAX
, or arguments need to be added to some of the functions (or functions split up).
Comment 4•5 years ago
|
||
Bugbug thinks this bug is a regression, but please revert this change in case of error.
Assignee | ||
Comment 6•5 years ago
|
||
I can take a look at this later, but I don't have a plan to fix this in Firefox 70. I open float-clear-001.html in Firefox 39, and this bug was already there since we enabled float fragmentation in bug 1148104. I feel it doesn't worth tracking for current release.
Updated•5 years ago
|
Comment 7•5 years ago
|
||
Depends on D56416
Updated•5 years ago
|
Comment 8•5 years ago
|
||
I'm just wallpapering over one effect of this bug that blocks bug 1602430.
Updated•5 years ago
|
Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/44689b5ff306 Wallpaper the effect of this bug in nsBlockFrame::ComputeFinalSize. r=TYLin
Comment 10•5 years ago
|
||
bugherder |
Assignee | ||
Comment 11•4 years ago
|
||
According to the description in the tests, "The orange line should be
halfway down the third column", I think they meant to fill the column
sequentially when fragmenting the float elements.
Assignee | ||
Comment 12•4 years ago
|
||
All the callers in nsBlockFrame call BlockReflowInput::ClearFloats(), I
don't feel we need to pass the DONT_CLEAR_PUSHED_FLOATS down to
nsFloatManager. Besides, I'll remove the flag in a later patch.
Depends on D74536
Assignee | ||
Comment 13•4 years ago
|
||
This change doesn't change the behavior yet. It just changes all the
callers by having them catch the ClearFloatsResults.
Some of the callers will be revised in next patch by utilizing the
returned results. Some of the return values are not being used, and may
produce warnings, they will be suppressed in the next patch, too.
Depends on D74537
Assignee | ||
Comment 14•4 years ago
|
||
The rule I use when replacing the block-dir coordinates comparison
between the one passing to ClearFloats() and the one returned by
ClearFloats().
-
If they are equal, check the result has
BCoordNoChange
. -
If they are not equal, check the result has
BCoordAdvanced
or
FloatsPushedOrSplit
.
We want to do this conversion because in the next patch, I want to stop
ClearFloats() from returning nscoord_MAX, which is equivalent to
checking FloatsPushedOrSplit
.
Depends on D74538
Assignee | ||
Comment 15•4 years ago
|
||
This effectively makes ClearFloat() act like it always has
DONT_CLEAR_PUSHED_FLOATS. Thus, the flag is no longer needed.
We need to add an early return condition when the block cannot fit in
ReflowBlockFrame(). Because we now don't return nscoord_MAX when floats
are pushed or split, the availSpace.BSize(wm)
might equal to zero
rather than negative in this case. It's needed for
layout/reftests/pagination/float-clear-003.html and
layout/reftests/pagination/float-clear-003-print.html
Depends on D74539
Updated•4 years ago
|
Assignee | ||
Comment 16•4 years ago
|
||
Here a try run of my current patches.
Comment hidden (obsolete) |
Updated•4 years ago
|
Comment 18•4 years ago
|
||
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/aa23badb0824 Part 1 - Upstream float clear reftests to wpt, and add column-fill:auto counterparts. r=dbaron https://hg.mozilla.org/integration/autoland/rev/4140c68594e3 Part 2 - Move calling nsFloatManager::ClearContinues to BlockReflowInput::ClearFloats(). r=dbaron https://hg.mozilla.org/integration/autoland/rev/b217eaadc9d9 Part 3 - Make BlockReflowInput::ClearFloats() return ClearFloatsResults. r=dbaron https://hg.mozilla.org/integration/autoland/rev/2490a3ca2481 Part 4 - Use BlockReflowInput::ClearFloatsResult to replace coordinate comparison. r=dbaron https://hg.mozilla.org/integration/autoland/rev/e1232e2aeacf Part 5 - Prevent BlockReflowInput::ClearFloat from returning nscoord_MAX. r=dbaron
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/24179 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Comment 21•4 years ago
|
||
bugherder |
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Upstream PR merged by moz-wptsync-bot
Updated•3 years ago
|
Description
•