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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 27 18:04:15 PDT 2010


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





--- Comment #45 from Joone Hur <joone at kldp.org>  2010-10-27 18:04:13 PST ---
(In reply to comment #43)
> (From update of attachment 71716 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=71716&action=review

> > 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?

The available size means the visible area of a web page, so I call the pageRect to get the visible area because it returns the webview size.  In addition, the available size is used to calculate the initial and minimum scale value through WebCore::computeViewportAttributes with the given desktopWidth, deviceWidth/height, and DeviceDPI.

> 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.
I assumed that the DPI and screen size are constant values, but we need to get the screen(device) size again as well as the available size when the screen is rotated.

Thanks, Martin and Kov, I will update the patch soon.

-- 
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