Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 92693c2591b2db3161960f6b03fbe74ad9cfe55e
https://github.com/WebKit/WebKit/commit/92693c2591b2db3161960f6b03fbe74ad9cfe55e
Author: Alan Baradlay <[email protected]>
Date: 2026-04-30 (Thu, 30 Apr 2026)
Changed paths:
A
LayoutTests/fast/scrolling/scrollbar-gutter-stable-rtl-viewport-expected.html
A LayoutTests/fast/scrolling/scrollbar-gutter-stable-rtl-viewport.html
M Source/WebCore/page/LocalFrameView.cpp
Log Message:
-----------
"scrollbar-gutter" on root element is misplaced in RTL layouts
https://bugs.webkit.org/show_bug.cgi?id=313161
Reviewed by Simon Fraser.
When a nested document (e.g. iframe) has dir=rtl and scrollbar-gutter: stable,
the gutter space (for space taking scrollbar) appears on the right side instead
of the left.
insetForLeftScrollbarSpace is called by ScrollView and compositing code to shift
content horizontally when scrollbar space should be on the left (RTL).
For the both-edges case it already used scrollbarGutterWidth(), which correctly
returns
the theme's scrollbar thickness when no actual scrollbar exists (via the early
return
in scrollbarGutterWidth (no-scrollbar + stable gutter branch). But the
RTL single-edge case called verticalScrollbar()->occupiedWidth(), returning 0
when no scrollbar exists.
In this iframe, the scrollbar is never created - scrollbar-gutter: stable
reserves the space purely through the theme thickness without an actual
scrollbar
widget. The fix uses scrollbarGutterWidth() for the RTL case too, matching the
both-edges case.
*
LayoutTests/fast/scrolling/scrollbar-gutter-stable-rtl-viewport-expected.html:
Added.
* LayoutTests/fast/scrolling/scrollbar-gutter-stable-rtl-viewport.html: Added.
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::insetForLeftScrollbarSpace const):
Canonical link: https://commits.webkit.org/312360@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications