Summary: | Need an API to scale the page of macOS WKWebView | ||
---|---|---|---|
Product: | WebKit | Reporter: | Dan Saunders <dasau> |
Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW --- | ||
Severity: | Normal | CC: | andersca, sam, teodor.atroshenko |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Mac | ||
OS: | OS X 10.11 |
Description
Dan Saunders
2016-08-31 12:52:03 PDT
We found some private API that will work. Could these be made public? There is also some accessibility benefit to allow proper zooming of WKWebView without having to add the scrollbars (⌘+ in Safari). This private API is equivalent to ⌘+ in Safari. It seems low risk, and something that should be publicly available through an API. It is sufficient for our requirements, the only issue we found is text is the wrong size at very low zoom levels. [_webView _setPageZoomFactor:x]; This private API does exactly what we need, but there may be other reasons why it isn't exposed since it changes the layout mode. Text and other elements have the proper scale at low zoom levels: [_webView _setLayoutMode:_WKLayoutModeDynamicSizeComputedFromViewScale]; [_webView _setViewScale:x]; This is a significant issue now that iOS apps can be run on macOS on Apple Silicon. It is common for macOS apps to offer in-app font size control. Some users may prefer to keep the operating system font size one size, but increase font size in text-heavy apps (e.g., messenger, news, social networking apps). Our users are reporting problems with zoom in WKWebView-based apps. Contrary to Safari behavior, `webkitTextSizeAdjust` CSS property does not scale font size in WKWebView - all other elements of the layout are scaled, though. That limitation/issue would be fine if only this API was available and documented. Is there a Radar for this? |