Bug 156835

Summary: [GTK] WebKitWebView should claim the contents size as its natural size
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, bugs-noreply, commit-queue, gustavo, mcatanzaro, mcrha, mrobinson
Priority: P2 Keywords: Gtk
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch zan: review+

Description Carlos Garcia Campos 2016-04-21 01:14:31 PDT
And keep claiming 0 as its minimum size since it's scrollable.
Comment 1 Carlos Garcia Campos 2016-04-21 01:18:38 PDT
Created attachment 276902 [details]
Patch
Comment 2 WebKit Commit Bot 2016-04-21 01:20:19 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Zan Dobersek 2016-04-21 03:39:51 PDT
Comment on attachment 276902 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=276902&action=review

> Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:1536
> +    if (priv->contentsSize == contentsSize)
> +        return;
> +    priv->contentsSize = contentsSize;

The early check-and-return doesn't help much IMO, since the assignment is the only change of state here, and there's no work or event propagated further if the same size is assigned.
Comment 4 Carlos Garcia Campos 2016-04-21 03:45:59 PDT
(In reply to comment #3)
> Comment on attachment 276902 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=276902&action=review
> 
> > Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:1536
> > +    if (priv->contentsSize == contentsSize)
> > +        return;
> > +    priv->contentsSize = contentsSize;
> 
> The early check-and-return doesn't help much IMO, since the assignment is
> the only change of state here, and there's no work or event propagated
> further if the same size is assigned.

Yes, that's the case of this patch, but this is a actually a split of two patches. The other one adds new API to tell the web view to fit its size to the contents, so here I schedule a resize, but only when the contents size have actually changed.
Comment 5 Carlos Garcia Campos 2016-04-21 03:53:47 PDT
Committed r199811: <http://trac.webkit.org/changeset/199811>