Bug 224409 - initial horizontal scrollbar positions for RTL elements is wrong
Summary: initial horizontal scrollbar positions for RTL elements is wrong
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on:
Blocks: 224224
  Show dependency treegraph
 
Reported: 2021-04-10 18:38 PDT by Cameron McCormack (:heycam)
Modified: 2021-04-11 15:54 PDT (History)
12 users (show)

See Also:


Attachments
Patch (10.73 KB, patch)
2021-04-10 18:57 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack (:heycam) 2021-04-10 18:38:51 PDT
Scrollable elements that place their vertical scrollbar on the left (e.g. when they're `direction: rtl` or when the OS language is RTL and the relevant setting to always follow OS scrollbar side is used) have an incorrect scroll origin, which leads to creating a horizontal scrollbar with an incorrect initial offset.  This is because RenderLayerScrollableArea::computeScrollDimensions runs prior to the scrollbars being created.
Comment 1 Cameron McCormack (:heycam) 2021-04-10 18:57:04 PDT
Created attachment 425693 [details]
Patch
Comment 2 Darin Adler 2021-04-11 08:53:47 PDT
Comment on attachment 425693 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=425693&action=review

> Source/WebCore/rendering/RenderLayerScrollableArea.cpp:1032
> +        m_hBar->offsetDidChange();

This is unconditionally called, even if the code above sets the origin to the same value it’s already set to. Should there be a check?
Comment 3 Cameron McCormack (:heycam) 2021-04-11 14:50:28 PDT
(In reply to Darin Adler from comment #2)
> This is unconditionally called, even if the code above sets the origin to
> the same value it’s already set to. Should there be a check?

offsetDidChange() will do an almost equivalent check, when it recomputes its m_position based on the scroll offset, and avoid actually updating the thumb position.  So I figured it's not necessary.
Comment 4 EWS 2021-04-11 15:53:57 PDT
Committed r275811 (236382@main): <https://commits.webkit.org/236382@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425693 [details].
Comment 5 Radar WebKit Bug Importer 2021-04-11 15:54:25 PDT
<rdar://problem/76516885>