0-height frame is generated on testing/web-platform/tests/css/css-scroll-snap/multicol-001.html
Categories
(Core :: Layout: Columns, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox152 | --- | fixed |
People
(Reporter: hiro, Assigned: hiro)
References
(Blocks 5 open bugs)
Details
Attachments
(8 files)
|
296 bytes,
text/html
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
1.25 KB,
text/html
|
Details | |
|
1.17 KB,
text/html
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
#target element in multicol-001.html is split into 3 frames;
Block(div id=target)(3)@7f48ba7d81a8 parent=7f48ba7d8720 next-in-flow=7f48ba7d87e8 (x=0, y=100, w= 100, h=0) [content=7f48b a404670][cs=7f48ba7e77a8] <
Block(div id=target)(3)@7f48ba7d87e8 parent=7f48ba7d8900 prev-in-flow=7f48ba7d81a8 next-in-flow=7f 48ba7d89c8 (x=0, y=0, w= 100, h=100) [content=7f48ba404670][cs=7f48ba7e77a8] <
Block(div id=target)(3)@7f48ba7d89c8 parent=7f48ba7d8ae0 next=7f48ba7d8270 prev-in-flow=7f48ba7d87 e8 (x=0, y=0, w=100, h=2 0) [content=7f48ba404670][cs=7f48ba7e77a8] <
I was told by dholbert the first frame x=0, y=100, w=100, h=0), i.e. generating zero height frame is a multicol/fragmentation bug.
This is the root cause of multicol-001.html failure (bug 2014322).
| Assignee | ||
Comment 1•5 months ago
|
||
Looks like multicol-002.html has the same issue;
Block(div id=target)(3)@77e85a1e15d8 parent=77e85a1e1c40 next-in-flow=77e85a1e1d08 ( x=0, y=100, w=100, h=0) [content=77e85 9004820][cs=77e85a1e8be8] <
Block(div id=target)(3)@77e85a1e1d08 parent=77e85a1e1e20 prev-in-flow=77e85a1e15d8 n ext-in-flow=77e85a1e1ee8 (x=0, y=0, w= 100, h=100) [content=77e859004820][cs=77e85a1e8be8] <
Comment 2•5 months ago
|
||
Here's a testcase, reduced from multicol-001.html, which has a red outline to let you visualize the 0-height frame.
EXPECTED RESULTS:
Only the right column should have a red outline.
ACTUAL RESULTS:
There's also a red outline around a 0-height area at the bottom of the left column.
Updated•5 months ago
|
Comment 3•5 months ago
|
||
The zero height #target doesn't look right. nsBlockFrame::ReflowDirtyLines() is the function I'd investigate first, to see how we behave when the block frame doesn't have enough available block-size for lines.
Hiro, is this the only bug blocking css/css-scroll-snap/multicol-[001|002].html? If so, would you like me to investigate this soon?
| Assignee | ||
Comment 4•5 months ago
|
||
Those ones that I've found so far, but they will be a part of interop-2026. So I'd like you to investigate in 10 months or so if it's the case:)
Comment 5•5 months ago
|
||
Thanks for letting me know. NI myself as a reminder.
| Assignee | ||
Comment 6•5 months ago
|
||
Thank you! I've told Frank that if you are busy on other tasks, I am happy to jump in.
| Assignee | ||
Comment 7•4 months ago
|
||
I had poked this bug for two days, what I've learned so far is before reflowing we add line boxes in the first column for each children which might be fragmented. So for example in the case of multicol-001.html 3 line boxes exist in the block frame which is corresponding to the first column, and then while reflowing the second kid #target element, the second line is laid out in the first column as 0-height frame, and generates a continuation frame, pushes the frame (and it's line box) to the next column.
So what I am guessing now is, we can't avoid the initial line box generation in the first column, rather we can push the line itself to the second column, we have similar code here and here.
FWIW, note that I've locally tweaked the second similar code part, it works for this specific bug, but it breaks a bunch of multi-col wpts.
| Assignee | ||
Comment 8•4 months ago
|
||
Ting-Yu told me that tweaking this part is a wrong approach and he gave kindly me a patch what he thought. And he also told that with his patch class-c-breakpoint-after-float-001.html fails.
So I've poked the class-c-breakpoint-after-float-001.html, and I realized there are other test failures such as out-of-flow-in-multicolumn-029.html. Then I realized a common pattern in those failures is a placeholder whose height is 0. Now I believe placeholders for clearance or out-of-flow items need 0-height frame there.
One more important note; With Ting-Yu's patch some grid reftests such as grid-fragmentation-006.html also fail.
I've poked the grid reftest too, what I've found so far are;
- grid-fragmentation-006.html is not affected by the patch
- rather grid-fragmentation-006-ref.html is affected by the patch
- the result of grid-fragmentation-006-ref.html with the patch looks closer to chrome's result
You can see the these test failures on this try run.
| Assignee | ||
Comment 9•4 months ago
|
||
Also note that fixing this bug makes offset-top-block-in-inline.html, since this hotpink element is incorrectly laid out as 0-height frame in the first column so that the Element.offSetTop is calculated based on the wrong Y offset, just like y=100 in the dump list in comment 0.
| Assignee | ||
Comment 10•4 months ago
|
||
When a block is reflowed with zero available block-size in a fragmentainer,
it produces a zero-height fragment with Incomplete status. PlaceBlock now
rejects such fragments so the block is pushed to the next fragmentainer
instead of leaving a useless zero-height fragment.
Genuinely zero-height blocks are unaffected: they have Complete status, so
the new check does not trigger.
| Assignee | ||
Comment 11•4 months ago
|
||
I uploaded the Ting-Yu's patch. Oddly phabricator didn't respect the author name in the patch. :/
Anyways, I think remaining tasks are
- Added a new check whether it's a placeholder or not and if it is, do not reject 0-height frame
- Clarify whether the reason of the grid test failures is an issue in our grid implementation or it's actually an issue in the patch
| Assignee | ||
Comment 12•4 months ago
|
||
Attaching file is a simplified version of grid-fragmentation-006-ref.html to see the difference introduced by the path.
If you open the file on the current Firefox you will see grayed space at the the top of the second column, and if you click "add/remove border-top-style: 0px" button, you will not see the grayed space in the second column.
The patch shows the grayed space regardless of the border style, that's actually the difference happens on grid-fragmentation-006-ref.html.
I believe the patched result is correct, as you can see there's another button "add/remove columns:3", if you click the button you will always see the space regardless of the border style.
Also note that It matches Chrome's result.
| Assignee | ||
Comment 13•4 months ago
|
||
So now there's another question; is the result of grid-fragmentation-006.html correct?
Attaching file is a simplified version of grid-fragmentation-006.html. If you open the file on the current nightly or even on builds with D283622, you will see 3 columns, and the first column is entirely blank.
If you open the file on Chrome you will only 2 columns.
So now I am pretty sure that this test case is another variant of this bug, 0-height frame generation issue; In fact there's 0-height GridContainer in the first column;
GridContainer(div)(1)@73e70a1cc328 parent=73e70a1cc260 next-in-flow=73e70a1cc610 (x=0, y=0, w=32 5.333, h=0) [content=73e70a0045e0][cs=73e70a188018] <
The reason why 0-height GridContainer remains there is that D283622 does just reject 0-height block frames, it doesn't help 0-height GridContainer. So if we fixed the 0-height GridContainer case altogether, then I expect those grid tests will not fail.
| Assignee | ||
Comment 14•4 months ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #13)
The reason why 0-height GridContainer remains there is that D283622 does just reject 0-height block frames, it doesn't help 0-height GridContainer. So if we fixed the 0-height GridContainer case altogether, then I expect those grid tests will not fail.
Well, we also need to revise each reference cases since in the reference case we forcibly create 3 columns by adding a some amount of height element.
| Assignee | ||
Comment 15•4 months ago
|
||
I debugged the case in comment 13. The GridContainer actually runs through the code where D283622 tweaked. But in the GridContainer frame case, this aForceFit flag is true so that it doesn't run into the if branch.
And in my naiive thinking about the aForceFit is that it looks correct to me that the flag is true for the GridContainer for the first column.
A remaining question is why the GridContainer size ends up being 0-height.
Comment 16•4 months ago
|
||
Hiro, thank you for looking into this bug. I'm clearing my needinfo.
Updated•3 months ago
|
| Assignee | ||
Comment 17•3 months ago
|
||
The previous check rejected any zero-height incomplete fragment
unconditionally, which was too aggressive and broke two cases:
-
A block that is a containing block for absolutely-positioned children must
keep its zero-height fragment as the coordinate origin for those OOF boxes.
This is now guarded by HasAbsolutelyPositionedChildren().
(e.g. out-of-flow-in-multicolumn-029.html) -
class-c-breakpoint-after-float-001.html: A block with a clear:both child
inside a multicol column can end up with the child pushed by clearance to
exactly the column boundary, leaving it 0px of available space. The child
produces a zero-height incomplete fragment, but its parent still has a
non-zero-height fragment covering the clearance gap. Rejecting the child's
fragment caused the parent's fragment to collapse, losing the class C break
opportunity and the green background over the float area.More generally, any gap before the child in the parent's fragment (from
clearance, a non-collapsing margin, float avoidance, or preceding siblings)
means the parent fragment is non-zero regardless of this child. The child's
zero-height fragment is only truly useless when it is the very first content
in the fragmentainer with nothing before it.
The refined condition therefore only rejects when fragmentBStart equals
mSpace.BStart(), i.e. the child lands at the very beginning of the available
space. The variable fragmentBStart is introduced to name this quantity
clearly and to avoid recomputing mBCoord - backupContainingBlockAdvance.
| Assignee | ||
Comment 18•3 months ago
|
||
I think D292681 has fixed all test failures.
Comment 19•2 months ago
|
||
Comment 20•2 months ago
|
||
Comment 21•2 months ago
|
||
Backed out for causing wr failures @multi-line-row-flex-fragmentation-093.html.
| Assignee | ||
Comment 22•2 months ago
|
||
a link to reftests-analyzer on a failure.
For some reasons orange/yellow/purple boxes' color are slightly different, something like:
Image 1: #c080c0 rgb(192,128,192)
Image 2: #bf7fbf rgb(191,127,191)
I've confirmed that D283622 changed the color. I am going to add fuzzy annotation here in this bug will file a follow-up bug.
Comment 23•2 months ago
|
||
Comment 24•2 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/b55428c5d7f6
https://hg.mozilla.org/mozilla-central/rev/f2f4591e81aa
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/59485 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Comment 27•2 months ago
|
||
Updated•2 months ago
|
Comment 28•2 months ago
|
||
Backed out as requested by Hiro on element.
https://hg.mozilla.org/integration/autoland/rev/3185a8f35b52
Comment 29•2 months ago
|
||
Backout merged to central: https://hg.mozilla.org/mozilla-central/rev/5d4479056614
| Assignee | ||
Comment 30•1 month ago
|
||
Test cases involving break-before: always in
grid-fragmentation-020-ref.html are not properly tested because of bug 2020239.
| Assignee | ||
Comment 31•1 month ago
|
||
Test cases involving Class C breaks triggered by break-inside:avoid in
grid-fragmentation-006.html are split into a separate -avoid-break file
so they can be addressed separately in bug 2038550.
| Assignee | ||
Comment 32•1 month ago
|
||
Some of the reference files used by these grid reftests are affected
by D283622, causing the reftests to fail once that patch is applied.
The new rendering of the references appears correct, which means the
reftests had been relying on incorrect rendering results and need to
be revised. This will be addressed in bug 2038553.
Updated•1 month ago
|
Comment 33•1 month ago
|
||
Comment 34•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/d3eb3bf61078
https://hg.mozilla.org/mozilla-central/rev/ae92c4ca808c
https://hg.mozilla.org/mozilla-central/rev/472e9479771f
https://hg.mozilla.org/mozilla-central/rev/08367f7651ad
https://hg.mozilla.org/mozilla-central/rev/1d89d8b5f69f
Updated•1 month ago
|
Description
•