Bug 231470 - WKWebView scroll indicator color doesn't match expected when web view is non-opaque
Summary: WKWebView scroll indicator color doesn't match expected when web view is non-...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Scrolling (show other bugs)
Version: WebKit Local Build
Hardware: iPhone / iPad All
: P2 Trivial
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-08 21:39 PDT by me
Modified: 2021-10-15 21:40 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description me 2021-10-08 21:39:04 PDT
When a WKWebView on iOS has isOpaque set to NO, the scrollViewBackgroundColor method in WKWebViewIOS.mm short-circuits and always returns transparentBlack. This causes the scroll indicator to always use the black style (set in _updateScrollViewBackground), regardless of the page's background color.

This is easily reproducible by enabling dark mode in the simulator, running MobileMiniBrowser, and visiting a page that has a black background. The scroll indicators are not visible, because they have the black style.

In my (very) limited testing, just removing the !webView.opaque if statement results in the expected behavior in the above example, but I'm not sure if this change has other implications.
Comment 1 Radar WebKit Bug Importer 2021-10-15 21:40:14 PDT
<rdar://problem/84327005>