[webkit-gtk] WebKit2 zoom API (II)

Carlos Garcia Campos cgarcia at igalia.com
Thu Feb 2 06:30:36 PST 2012

Finally the patch to set the zoom level landed, and other patches were
waiting until we agree on a solution. I have looked at some other
applications using WebKit1 API and most of them call
webkit_web_view_set_full_content_zoom() once to use text or page zoom.
That's why I proposed to use a setting. I've seen an app with both
methods, but it always calls webkit_web_view_set_full_content_zoom()
before setting the zoom-level so that when called for text, the page
factor is reset and when called for page, the text factor is reset. 

I still haven't heard of any use case where you want to set both scales
at the same time, all other ports don't allow it because it produces
unexpected odd results, so I still think we shouldn't support it.
However, I have a proposal to not block the API in this particular

 - Rename current set_zoom_level and get_zoom_level as
set_page_zoom_level and get_page_zoom_level
 - Add set_text_zoom_level and get_text_zoom_level
 - We save both values, but when one is set, the other one is reset
(like it happens with apps calling
webkit_web_view_set_full_content_zoom() all the time before setting the
soom level)
 - That way we have both methods in the aPI and we avoid the setting.
 - If we eventually find a use case where it makes sense to set both at
the same time we can just change the behaviour without having to change
the API (just the impl and the documentation)

Does it sound good?

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/20120202/a04c3d39/attachment.bin>

More information about the webkit-gtk mailing list