Bug 167335 - Implement scrollbar-gutter
Summary: Implement scrollbar-gutter
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Enhancement
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar, WPTImpact
Depends on: 257606 258743 266938 256891 256892 257204 257453 257605 257708 258207 258770 259014
Blocks:
  Show dependency treegraph
 
Reported: 2017-01-23 15:32 PST by Myles C. Maxfield
Modified: 2024-01-24 04:10 PST (History)
20 users (show)

See Also:


Attachments
Comparison of a modal dialog in a browser with scrollbar-gutter support and Safari Technology preview ithout scrollbar-gutter support causing a visual glitch (7.26 MB, video/quicktime)
2022-04-15 01:24 PDT, Jan Nicklas
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2017-01-23 15:32:05 PST
https://log.csswg.org/irc.w3.org/css/2017-01-13/#e761977

scrollbar-gutter = auto | stable | always
Comment 1 Radar WebKit Bug Importer 2017-01-23 15:32:40 PST
<rdar://problem/30153666>
Comment 2 Woody Lee 2021-09-28 20:53:11 PDT
Chrome 94 has supported scrollbar-gutter.
https://www.chromestatus.com/features/5746559209701376
Comment 3 Luke Warlow 2021-10-12 05:58:10 PDT
While I understand that Safari users generally have overlay scrollbars, which aren't currently relevant to the scrollbar-gutter property, it would be a nice addition to Safari (and other WebKit browsers) for the users who do have non-overlay scrollbars.

Worth noting the syntax has also changed to

auto | stable && both-edges?
Comment 4 Luke Warlow 2021-12-17 12:41:48 PST
Firefox 97 (probably) will support scrollbar-gutter. https://groups.google.com/a/mozilla.org/g/dev-platform/c/pAh2tDhBFOU/m/wQBctGKCCwAJ

Working in nightly.
Comment 5 Jan Nicklas 2022-04-15 01:24:20 PDT
Created attachment 457683 [details]
Comparison of a modal dialog in a browser with scrollbar-gutter support and Safari Technology preview ithout scrollbar-gutter support causing a visual glitch
Comment 6 Jan Nicklas 2022-04-15 01:25:16 PDT
Adding scrollbar-gutters for Safari would help us developers a lot.

A very common usecase which would benefit from scrollbar-gutters are modal dialogs & drawers. (e.g.: mobile burger menus, newsletter registration dialogs, ...)

Most of the time the requirement is to disable the body/window scrolling while a dialog or drawer is active. This can be done with overflow:hidden however this will always cause the entire page to jump/flicker as the width for the entire viewport changes.

I attached a video which shows this behaviour for Safari (jumping) vs Chrome (no jumping thanks to scrollbar-gutters)
Comment 7 cathiechen 2022-10-19 09:53:45 PDT
`scrollbar-gutter` also affects the cases in LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-030.html