[webkit-gtk] WebKit2 zoom API

Carlos Garcia Campos cgarcia at igalia.com
Thu Dec 29 00:54:52 PST 2011

El jue, 29-12-2011 a las 00:31 -0800, Martin Robinson escribió:
> On Thu, Dec 29, 2011 at 12:11 AM, Carlos Garcia Campos
> <cgarcia at igalia.com> wrote:
> > so, if we decide to add zoom_in/out methods we would end up with 4
> > methods more, text_zoom_in/out and page_zoom_in/out. I find it very
> > confusing, users expose only one zoom control in their UIs and they
> > decide whether it affects only the text or not, but I can't think of any
> > use case where it's needed to change both at the same time or even
> > expose two zoom controls (one for text and one for the page).
> Perhaps I am mistaken, but after reading the API it seems that some
> types of documents do not support text zoom (thus the
> WKPageSupportsTextZoom method).

This is just for images and custom representation (like PDF or PS
documents in ports that support them). In that case, if zoomsTextOnly is
YES the image or document is not scaled. 

>  Matching the full C API here allows a
> client to prefer text zooms, but resort to full content zoom when the
> document does not support it.

Firefox has a zoom text only option too (exposed in the UI), when
enabled, images are not scaled.

>  Zoom type as a property on
> WebKitSettings prevents properly handling this case, unecessarily
> limits the API in relation to what WebCore can do and, in my opinion,
> doesn't make it any more clear. The API consumer would still need to
> understand the difference between full page zoom and text only zoom.

I don't think so, if we use a good default value only the consumer who
want to zoom text only needs to understand it. That's why I looked at
different apps to see how they use the zoom API. And it seems to me that
apps using zoom text only don't want images to b scaled at all. 

> I would prefer an approach that doesn't expose text-only zoom at all,
> rather than exposing it in a slightly broken way.

why is it broken?

>  I don't mean to hold
> up your work here, but I think the C API is designed this way for a
> reason.

Yes, because WebCore does, but AFAIK all ports expose just one zoom API.

> --Martin

Carlos Garcia Campos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20111229/fecb3c2e/attachment.bin>

More information about the webkit-gtk mailing list