NEW 213603
iOS pageZoom API confusing usage
https://bugs.webkit.org/show_bug.cgi?id=213603
Summary iOS pageZoom API confusing usage
Robbie Gibson
Reported 2020-06-25 07:48:13 PDT
Created attachment 402732 [details] Screenshots comparing pageZoom WKWebView and Safari zoom On iPhone, the pageZoom numbers seem backwards and have very different behavior when compared to the Safari Zoom feature. When the pageZoom increases from 1 -> 1.5, the size of the text on the page gets smaller. The page also becomes wider, so that content flows out of the viewport. When pageZoom goes from 1 -> 0.5, the text actually becomes bigger. Is this the intended behavior of the property? I've attached screenshots of comparisons between the pageZoom property and the Safari Zoom feature at different zoom levels.
Attachments
Screenshots comparing pageZoom WKWebView and Safari zoom (6.28 MB, application/pdf)
2020-06-25 07:48 PDT, Robbie Gibson
no flags
Wenson Hsieh
Comment 1 2020-06-25 09:41:37 PDT
Safari's -/+ feature actually uses the SPI `_viewScale`, which actually changes the viewport's minimum layout size used when laying out the page (and then rescales the page to fit the true device width). This technique is intended to preserve page layout at different zoom levels. It looks like the `pageZoom` API plumbs through `Frame::setPageZoomFactor`, which seems to behave more like CSS zoom.
Radar WebKit Bug Importer
Comment 2 2020-06-25 18:04:44 PDT
Robbie Gibson
Comment 3 2020-06-26 02:14:57 PDT
Ok, thanks for the clarification. I get different behavior on iPhone when using the new property vs setting the zoom property on the <body>. Notably, the text doesn't change size when using the new property, and the end result is that pages that have been zoomed in look smaller. If what we want is a feature to zoom in like cmd++/cmd+- on desktop or Safari's +/-, is there a better way to achieve this? Would it be possible to expose the SPI that Safari is using for general use?
Robbie Gibson
Comment 4 2020-07-27 05:56:57 PDT
The WWDC video Discover WKWebView Enhancements mentions that the new -pageZoom property is the same property that drives cmd++/cmd+- on Safari. Is this maybe referring to desktop Safari? (The video does also mentions that it functions similar to CSS zoom.)
Note You need to log in before you can comment on or make changes to this bug.