[webkit-dev] Device and page scaling

Alexandre Elias aelias at chromium.org
Wed May 30 13:51:50 PDT 2012

On Tue, May 29, 2012 at 11:17 PM, Simon Fraser <simon.fraser at apple.com>wrote:
> On iOS, zooming is mostly done outside of WebKit. The viewport tag affects
> page scale in the same way that user zooming does. iOS has its own zoom
> factor plumbed into WebCore, but ideally would share pageScaleFactor. On
> iOS, zooming used to not affect "client" coordinates
> (getBoundingClientRects, event clientX/clientY etc), but gradually iOS has
> migrated to a model were client coords are relative to the "porthole"
> viewport (which is not the same as the CSS viewport). Panning on iOS
> happens outside of WebKit, and is not equivalent to FrameView scrolling,
> but some notion of the page offset is plumbed through to update scrollTop,
> and for scroll events etc.

Interesting to hear that iOS does not yet use pageScaleFactor.  Chrome for
Android uses it heavily -- for gesture zooming, viewport tag and even
deviceScaleFactor are applied using it (though we may reconsider the
deviceScaleFactor part, since it means the viewport tag values don't
correspond directly to pageScaleFactor values).

However, we haven't been happy with how pageScaleFactor is
applied asymmetrically depending on whether a layer is the root layer or
not.  On the root layer, the content bounds (and therefore scroll offset)
are premultiplied by pageScaleFactor, allowing pixel-precise scroll
offsets; however on all sublayers, the content bounds/scroll offsets stay
locked into CSS coordinates.  This leads to quite a few bugs, forked code,
and general confusion.

Do you know if iOS is more consistent here?  If so, we could change
pageScaleFactor to reflect iOS behavior, and allow them to converge on
pageScaleFactor as well as fix some problems for Android.

> This is a tricky area to get right, especially since different ports have
> their own notions of zooming, panning etc. It's going to be a challenge to
> get all ports sharing code here.
> Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120530/ef42a371/attachment.html>

More information about the webkit-dev mailing list