Closed Bug 1711803 Opened 5 months ago Closed 5 months ago

Subgrid's scrollbar size shouldn't affect its grid area and children's position

Categories

(Core :: Layout: Grid, defect)

defect

Tracking

()

RESOLVED INVALID

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

Attachments

(1 file, 1 obsolete file)

This is a variant of bug 1709491.

In SubgridComputeMarginBorderPadding, we add the scrollbar sizes to subgrid->mMarginBorderPadding, so the subgrid's grid area can be different depending on whether the scrollbars are presented, or the scrollbars are the overlay scrollbars.
https://searchfox.org/mozilla-central/rev/98a9257ca2847fad9a19631ac76199474516b31e/layout/generic/nsGridContainerFrame.cpp#3446-3447

I think we should remove the two lines. Because if the subgrid has children that overflow, the overflow property on subgrid shouldn't affect subgrid children's position.

To figure out whether the scrollbar can affect the subgrid's grid area, I take a step back and write a test for ordinary grid containers. All the browsers agree that the scrollbars do occupy the grid container's content area if the grid area is implicit. However, if the grid area is explicit, the scrollbar doesn't occupy the content space.

So the question is: is subgrid's area implicit or explicit? From the subgrid section in the spec:

a. ... The grid lines thus shared between the subgrid and its parent form the subgrid’s explicit grid, and its track sizes are governed by the parent grid.

f. The subgrid does not have any implicit grid tracks in the subgridded dimension(s). ...

It seems to me that the subgrid's grid area is explicit and its size is defined by the parent grid container. So my proposed patch probably makes sense.

Mats, does above sound reasonable to you?

Flags: needinfo?(mats)
No longer blocks: 1527539

After reading Florian's comment https://github.com/w3c/csswg-drafts/issues/6350#issuecomment-855493239, I can see my proposed patch makes classic scrollbar act like overlay scrollbar on subgrid, which doesn't make sense. Our current behavior is desired. I'm closing this as INVALID.

Status: NEW → RESOLVED
Closed: 5 months ago
Flags: needinfo?(mats)
Resolution: --- → INVALID
Attachment #9222531 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.