Open Bug 1527539 Opened 10 months ago Updated 4 months ago

[css-grid][css-flexbox] item margins should be included in overflow?

Categories

(Core :: Layout: Grid, enhancement, P3)

enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: mats, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(3 files, 2 obsolete files)

Attached file Testcase #1 (obsolete) —

I haven't check the specs yet, but our rendering differs to Chrome
in both the grid and flexbox cases...

Daniel, can you take a look at the flexbox case?

Flags: needinfo?(dholbert)
Attached file Testcase #1

(slightly clearer version)

Attachment #9043504 - Attachment is obsolete: true

Oh, nice... :(

https://drafts.csswg.org/css-overflow-3/#scrollable
"The UA may additionally include the margin areas of boxes for which it is the containing block.
The conditions under which such margin areas are included is undefined in this level.
ISSUE 6. This needs further testing and investigation; is therefore deferred in this draft."

Flags: needinfo?(dholbert)

I'm guessing that the rendering in Chrome makes sense to authors,
since it's compatible with block layout at least for this trivial
example. I guess we'll have to reverse-engineer what they are
doing if we want to be compatible... Sigh.

Attached file Testcase #2 (obsolete) —

Slightly more complex test for grid/flex layout.
It looks like Chrome is using the margin-boxes of children when calculating the overflow.

Does anyone have an opinion about the spec issue (cited in comment 3)?
Otherwise, I'm leaning towards proposing to the CSSWG that we resolve
in favor of using margin-boxes.

Some background about this: we intentionally included margins in bug 665597
and then reverted that partially in bug 724352 and eventually backed it out
in bug 750293 due to regressions. The part that did survive lives in
nsBlockFrame::ComputeFinalSize in the form of 'blockEndEdgeOfChildren'
which we propagate to ConsiderBlockEndEdgeOfChildren for inclusion into
the overflow area. So it appears that we only include the block-end margin,
but maybe only in some cases? - I haven't looked at the details yet...
I'll try to file a spec issue to sort this out unless there is one already.

bug 1487927 is about the block-end margin rendering difference on columns.

Attached file Testcase #2
Attachment #9043510 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.