Bug 267575

Summary: Incorrect invalidation of ::-webkit-scrollbar-* on hover
Product: WebKit Reporter: Bramus <bramus>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: ahmad.saleem792, bfulgham, koivisto, lwarlow, simon.fraser, webkit-bug-importer, webkit, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Mac (Apple Silicon)   
OS: Unspecified   
Attachments:
Description Flags
Recording none

Bramus
Reported 2024-01-16 02:57:55 PST
Created attachment 469411 [details] Recording Demo: https://codepen.io/bramus/pen/dyrOGNg/657fde2205298e6c681bbf1ac1c76ab2 Recording: see attachment Take this CSS, which should change the background color the scrollbars when hovering the scroller: ```css .scroller::-webkit-scrollbar { max-width: 10px; max-height: 10px; } .scroller::-webkit-scrollbar-thumb { background: transparent; } .scroller::-webkit-scrollbar-track { background: transparent; } .scroller:hover::-webkit-scrollbar-thumb { background: hotpink; } .scroller:hover::-webkit-scrollbar-track { background: blue; } ``` This only happens when actively hovering the scrollbar itself, but not when hovering the scroller itself. As a workaround, authors now need to force a style invalidation by, for example, means of a Custom Property: ```css .scroller:hover { --safari-fix: ; /* Force a style invalidation on hover */ } ```
Attachments
Recording (2.57 MB, video/mp4)
2024-01-16 02:57 PST, Bramus
no flags
Ahmad Saleem
Comment 1 2024-01-16 16:54:36 PST
Steps to Reproduce (in Safari): 1) Untick 'Fix Safari Style Invalidation Bug' 2) Go to scrollbar area and hover Expected Result: Show 'scrollbar' area without doing 'hover' Actual Result: Show 'scrollbar' only on hover over scrollbar area and missing 'thumb' as well (pinky)
Radar WebKit Bug Importer
Comment 2 2024-01-23 02:58:15 PST
Note You need to log in before you can comment on or make changes to this bug.