Bug 156835 - [GTK] WebKitWebView should claim the contents size as its natural size
Summary: [GTK] WebKitWebView should claim the contents size as its natural size
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2016-04-21 01:14 PDT by Carlos Garcia Campos
Modified: 2016-04-21 03:53 PDT (History)
7 users (show)

See Also:


Attachments
Patch (8.35 KB, patch)
2016-04-21 01:18 PDT, Carlos Garcia Campos
zan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>