[webkit-changes] [WebKit/WebKit] 560abd: Fix incorrect custom pseudo-scrollbar sizes caused...

Ethan Wong noreply at github.com
Wed Jan 25 14:54:22 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 560abdc4b29416fc6052fa10fafd84f00c7a4244
      https://github.com/WebKit/WebKit/commit/560abdc4b29416fc6052fa10fafd84f00c7a4244
  Author: Ethan Wong <e1hanw0ng at gmail.com>
  Date:   2023-01-25 (Wed, 25 Jan 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/platform/mac/TestExpectations
    A LayoutTests/scrollbars/custom-scrollbar-scroller-style-change-expected.txt
    A LayoutTests/scrollbars/custom-scrollbar-scroller-style-change.html
    M Source/WebCore/platform/mac/ScrollbarsControllerMac.mm
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.mm

  Log Message:
  -----------
  Fix incorrect custom pseudo-scrollbar sizes caused by scroller style changes on Mac.
https://bugs.webkit.org/show_bug.cgi?id=249892

Reviewed by Simon Fraser.

Scroller style changes can cause custom pseudo-scrollbar sizes (set by
`width` or `height` property using `::-webkit-scrollbar`) to be
overridden by AppKit defaults. This could cause unexpected visual
appearances, especially when the scroller is thinner than the defaults.

This usually happens when the user enters or leaves the trackpad-only
setup (connecting or disconnecting the mouse for laptops would be a
typical case). Manually toggling the scroller appearance in the system
settings would be another way to reproduce this issue.

This patch resolves the above issue by explicitly checking for custom
scrollbars before replacing them with standard implementations when
processing scroller style updates.

* LayoutTests/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:
* LayoutTests/scrollbars/custom-scrollbar-scroller-style-change-expected.txt: Added.
* LayoutTests/scrollbars/custom-scrollbar-scroller-style-change.html: Added.
* Source/WebCore/platform/mac/ScrollbarsControllerMac.mm:
(WebCore::ScrollbarsControllerMac::updateScrollerStyle):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::setUsesOverlayScrollbars):
* Source/WebCore/testing/Internals.mm:
(WebCore::Internals::setUsesOverlayScrollbars):

Canonical link: https://commits.webkit.org/259389@main




More information about the webkit-changes mailing list