Closed Bug 1874093 Opened 2 years ago Closed 2 years ago

Page does not update when updating `scrollbar-gutter` from `stable both-edges` to `initial` on the root.

Categories

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

defect

Tracking

()

VERIFIED FIXED
123 Branch
Tracking Status
firefox123 --- verified

People

(Reporter: nchevobbe, Assigned: emilio)

References

Details

Attachments

(3 files)

Steps to reproduce

  1. Open attached document
  2. Click on scrollbar-gutter: initial button

Expected results

The yellow div and buttons should shift to the left as we're going from scrollbar-gutter: stable both-edges to scrollbar-gutter: initial

Actual results

The page does not update, until some changes are made to the page (in the attached document, clicking on the update button will set the yellow div innerText to "hello" again, which makes the shift happen; a simple reflow doesn't seem to be enough).

The scrollbar-gutter property works if the element is a scroll container. In the testcase, the scrollbar-gutter is set on <html> element, and in most of the cases, even if it has no overflow property, we make it a scroll container as if it has overflow:auto [1].

However, when we're detecting dynamic changes to scrollbar-gutter [2], we only consider the change is meaningful when the element also has overflow property that make the element a scroll container, and the code decides the change requires no action since <html> has overflow:visible. If <html> has overflow:auto property specified, it works as expected.

I'm not familiar with the details of root element's scroll frame setup and the overflow property propagation, so I don't have a solution without digging deeper.

Emilia, any ideas?

[1] https://searchfox.org/mozilla-central/rev/8188f3b1ee40b1408674197923e923d94f0c7260/layout/base/nsCSSFrameConstructor.cpp#2799-2809
[2] https://searchfox.org/mozilla-central/rev/8188f3b1ee40b1408674197923e923d94f0c7260/layout/style/nsStyleStruct.cpp#2356-2364

Flags: needinfo?(emilio)
Summary: Page does not update when updating `scrollbar-gutter` from `stable both-edges` to `initial` → Page does not update when updating `scrollbar-gutter` from `stable both-edges` to `initial` on the root.
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Flags: needinfo?(emilio)
See Also: → 1874091

No behavior change (maybe a bit cheaper in the "no style changed" case).

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9ef9a9d01379 Pass old style rather than specific structs to CalcDifference. r=TYLin https://hg.mozilla.org/integration/autoland/rev/8dcb680cf24d Fix invalidation of scrollbar-gutter on the root element if overflow isn't specified. r=TYLin,layout-reviewers
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/44015 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
Upstream PR merged by moz-wptsync-bot

I was able to reproduce the issue on Win10x64 using Firefox build 123.0a1(20240110213539) using steps from description.
Verified as fixed on Win10/Mac 12.6 using Firefox build 123.0b5, 124.0a1(20240202094312).

On Ubuntu 22.04 when pressing on 'scrollbar-gutter:initial' on latest versions( 123.0b5, 124.0a1) nothing happens. Is this expected? Thank you.

Flags: needinfo?(emilio)

Yes, overlay scrollbars means that there's no gutter.

Flags: needinfo?(emilio)

Mark as verified based on comment#9.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: