[Webkit-unassigned] [Bug 45443] [GTK] Support for viewport meta tag

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 27 06:11:22 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=45443





--- Comment #43 from Gustavo Noronha (kov) <gns at gnome.org>  2010-10-27 06:11:21 PST ---
(From update of attachment 71716)
View in context: https://bugs.webkit.org/attachment.cgi?id=71716&action=review

I agree with Martin we should make those functions part of DRTSupport if possible, but I'm not against pushing them if it takes a while. Also, I'm not against having comments. Just make sure they have only one * at the first line, that way gtk-doc will skip them. We're almost there regarding API usability, but it still looks a bit backwards. Hopefully my comments will help a bit =)

> WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:613
> +void ChromeClient::dispatchViewportDataDidChange(const ViewportArguments& arguments) const
> +{
> +    WebKitViewportAttributes* viewportAttributes = webkit_web_view_get_viewport_attributes(m_webView);
> +    FloatRect rect = core(m_webView)->chrome()->pageRect();
> +    webkit_viewport_attributes_compute_internal(viewportAttributes, static_cast<gint>(rect.width()), static_cast<gint>(rect.height()));
> +
> +    g_signal_emit_by_name(m_webView, "viewport-attributes-changed", viewportAttributes); 

You should just call webkit_viewport_recompute here =).

> WebKit/gtk/webkit/webkitviewportattributes.cpp:261
> +    g_return_if_fail(WEBKIT_IS_VIEWPORT_ATTRIBUTES(viewportAttributes));
> +
> +    WebKitWebView* webView = kit(viewportAttributes->priv->page);
> +    FloatRect rect = viewportAttributes->priv->page->chrome()->pageRect();
> +    webkit_viewport_attributes_compute_internal(viewportAttributes, static_cast<gint>(rect.width()), static_cast<gint>(rect.height()));
> +
> +    g_signal_emit_by_name(webView, "viewport-attributes-changed", viewportAttributes); 

This seems to be the other way around than what is needed... You first need the information, to then make the calculation. What's the point of computing the attributes as if the available size was the pageRect first, and how do you use the available size provided afterwards?

Also, you should get the DPI and screen size here instead of at the time the object is created, otherwise it is not very useful to call this when screen stuff changes.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list