Closed Bug 1879770 Opened 8 months ago Closed 7 months ago

[css-grid] [css-overflow] Weird interaction between subgrid and scrollbar (or scrollbar-gutter)

Categories

(Core :: Layout: Scrolling and Overflow, defect)

defect

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: emilio, Assigned: TYLin)

References

Details

Attachments

(5 files)

STR:

ER:

  • Nothing, scrollbar-gutter keeps working.

AR:

  • The checkboxes somehow go under the scrollbar-gutter until you resize (?)

Ting-Yu, you've been lucking at both grid and scrollbar-gutter, maybe you can take a look?

Flags: needinfo?(aethanyc)
Attached image Screenshot

This bug doesn't require scrollbar-gutter, and is pre-existing with classic scrollbar. I reduced your testcase, and it can be reproduced with subgrid with overflow: scroll.

When a grid container resolves the track size, it calls SubgridComputeMarginBorderPadding [1] if the grid item is a subgrid. The method uses GetActualScrollbarSizes() [2] if the subgrid is a scroll container. However, this is wrong because the subgrid and its scrollbars are not reflowed yet, which is warned on the doc [3].

This bug is not reproducible with original attached testcese because we'll reflow the frame tree twice at [4]. Testcase 2 uses overflow:scroll to uncover this bug because we only reflow the entire frame tree once.

[1] https://searchfox.org/mozilla-central/rev/4fe00e0322377316390da6faa2d645cae53d08f4/layout/generic/nsGridContainerFrame.cpp#6575
[2] https://searchfox.org/mozilla-central/rev/4fe00e0322377316390da6faa2d645cae53d08f4/layout/generic/nsGridContainerFrame.cpp#3702-3703
[3] https://searchfox.org/mozilla-central/rev/4fe00e0322377316390da6faa2d645cae53d08f4/layout/generic/nsIScrollableFrame.h#120-121
[4] https://searchfox.org/mozilla-central/rev/4fe00e0322377316390da6faa2d645cae53d08f4/layout/generic/nsGfxScrollFrame.cpp#1048-1049,1081-1082

Flags: needinfo?(aethanyc)
Severity: -- → S3
Summary: [css-grid] [css-overflow] Weird interaction between (sub)grid and scrollbar-gutter. → [css-grid] [css-overflow] Weird interaction between subgrid and scrollbar (or scrollbar-gutter)
Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/8446073fb1d8 Part 1 - Mark IntrinsicScrollbarGutterSizeAtInlineEdges() const. r=emilio https://hg.mozilla.org/integration/autoland/rev/50bdb6f08609 Part 2 - Add a helper to query intrinsic scrollbar-gutter size for subgrid. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/44903 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
Upstream PR merged by moz-wptsync-bot
Duplicate of this bug: 1715178
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: