-
Notifications
You must be signed in to change notification settings - Fork 1.6k
When moving past a left-hand scrollbar, don't jump way outside the content box #47344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
EWS run on previous version of this PR (hash 78ab849) |
…ntent box https://bugs.webkit.org/show_bug.cgi?id=279324 rdar://136040116 Reviewed by NOBODY (OOPS!). Merge (non-inline fix): https://source.chromium.org/chromium/chromium/src/+/d457f863f78941ed376b463ee39476b1a1852797 & https://chromium.googlesource.com/chromium/src.git/+/49858cc9147612da1e54a673147e8020c5d7b9f9 This patch fixes edge cases where scrollWidth can be messed up by left-hand scroller leading to be outside of content box in case of a scrollbar being wider than its containing block. * Source/WebCore/rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild): * Source/WebCore/rendering/RenderBox.cpp: (WebCore::RenderBox::verticalScrollbarWidthClampedToContentBox const): * Source/WebCore/rendering/RenderBox.h: * LayoutTests/fast/scrolling/content-box-smaller-than-scrollbar.html: * LayoutTests/fast/table/cell-percent-padding-expected.txt: * LayoutTests/fast/table/cell-percent-padding.html: * LayoutTests/fast/scrolling/content-box-smaller-than-scrollbar-expected.txt: * LayoutTests/platform/ios/TestExpectations: Add Platform Specific Expectation due to RTL scrollbars
78ab849
to
a28f91d
Compare
EWS run on current version of this PR (hash a28f91d) |
@@ -1213,7 +1213,7 @@ void RenderBlockFlow::determineLogicalLeftPositionForChild(RenderBox& child, App | |||
LayoutUnit startPosition = borderAndPaddingStart(); | |||
LayoutUnit initialStartPosition = startPosition; | |||
if ((shouldPlaceVerticalScrollbarOnLeft() || style().scrollbarGutter().bothEdges) && isHorizontalWritingMode()) | |||
startPosition += (writingMode().isLogicalLeftInlineStart() ? 1 : -1) * verticalScrollbarWidth(); | |||
startPosition += (writingMode().isLogicalLeftInlineStart() ? 1 : -1) * verticalScrollbarWidthClampedToContentBox(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto verticalScrollbarWidthClampedToContentBox = std::min(verticalScrollbarWidth(), std::max(0_lu, contentBoxLogicalWidth()))
would probably just work instead of introducing such specific function on RenderBox. -but even if we did introduce it , shouldn't it be on RenderBlockFlow
? (I am also wondering if there's a reason for not using contentBoxLogicalWidth
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alanbaradlay - I tried - it works but it fails:
auto verticalScrollbarWidthClampedToContentBox = std::min<LayoutUnit>(verticalScrollbarWidth(), std::max(0_lu, contentBoxLogicalWidth()));
It leads to failure:
FAIL RTL scrollable with block-level child assert_equals: expected 502 but got 504
a28f91d
a28f91d