RESOLVED FIXED 218538
[macOS] Toggling dark mode does not update the scrollbar appearance in overflow: scroll elements
https://bugs.webkit.org/show_bug.cgi?id=218538
Summary [macOS] Toggling dark mode does not update the scrollbar appearance in overfl...
Aditya Keerthi
Reported 2020-11-03 15:11:03 PST
The only way to update the scrollbar's appearance is by hovering over it.
Attachments
Patch (8.66 KB, patch)
2020-11-03 15:13 PST, Aditya Keerthi
no flags
Patch (12.69 KB, patch)
2020-11-04 18:24 PST, Aditya Keerthi
simon.fraser: review+
Patch for landing (12.81 KB, patch)
2020-11-05 07:26 PST, Aditya Keerthi
no flags
Patch for landing (12.81 KB, patch)
2020-11-05 08:19 PST, Aditya Keerthi
no flags
Aditya Keerthi
Comment 1 2020-11-03 15:11:37 PST
Aditya Keerthi
Comment 2 2020-11-03 15:13:58 PST
Simon Fraser (smfr)
Comment 3 2020-11-03 15:54:59 PST
Comment on attachment 413113 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=413113&action=review > Source/WebCore/platform/ScrollableArea.cpp:370 > m_scrollbarOverlayStyle = overlayStyle; > + updateScrollbarOverlayStyle(); Can you only call updateScrollbarOverlayStyle() if it changed?
Aditya Keerthi
Comment 4 2020-11-03 16:01:37 PST
(In reply to Simon Fraser (smfr) from comment #3) > Comment on attachment 413113 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=413113&action=review > > > Source/WebCore/platform/ScrollableArea.cpp:370 > > m_scrollbarOverlayStyle = overlayStyle; > > + updateScrollbarOverlayStyle(); > > Can you only call updateScrollbarOverlayStyle() if it changed? I think it should be fine to make that change here, but it would be unrelated to the solution. Note that I've made RenderLayer::styleChanged unconditionally call updateScrollbarOverlayStyle(). This is because the scrollbar's overlay style is always ScrollbarOverlayStyleDefault (regardless of dark/light mode) and we need to call into `[NSScrollerImp setNeedsDisplay:]` to trigger the appearance change.
Simon Fraser (smfr)
Comment 5 2020-11-03 16:16:33 PST
Comment on attachment 413113 [details] Patch r- because it invalidates scrollbars on every style change which will be a perf hit.
Aditya Keerthi
Comment 6 2020-11-04 18:24:58 PST
Simon Fraser (smfr)
Comment 7 2020-11-04 21:07:21 PST
Comment on attachment 413237 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=413237&action=review > Source/WebCore/platform/ScrollableArea.cpp:384 > if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) auto > Source/WebCore/platform/ScrollableArea.cpp:390 > if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) auto
Aditya Keerthi
Comment 8 2020-11-05 07:26:59 PST
Created attachment 413295 [details] Patch for landing
Aditya Keerthi
Comment 9 2020-11-05 08:19:41 PST
Created attachment 413301 [details] Patch for landing
EWS
Comment 10 2020-11-05 08:58:50 PST
Committed r269437: <https://trac.webkit.org/changeset/269437> All reviewed patches have been landed. Closing bug and clearing flags on attachment 413301 [details].
Note You need to log in before you can comment on or make changes to this bug.