[Webkit-unassigned] [Bug 98270] [GTK][WK2] Add API to retrieve a snapshot from a webview

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 18 03:50:43 PST 2013


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





--- Comment #23 from Claudio Saavedra <csaavedra at igalia.com>  2013-01-18 03:52:28 PST ---
I'm back working on this these days.

> 
> > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:2889
> > + * @rect: a #GdkRectangle with the region to take the snapshot of
> 
> I guess this is in document coordinates?

Yes, I'll add that to the docs.

> 
> > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:2896
> > + * Asynchronously retrieves a snapshot of the @web_view at @rect. If
> > + * @rect is empty, this function works exactly like
> 
> Maybe the empty special case could return a snapshot of the whole page, since we already have a convenient variant to get the visible area, this would make easier to get the whole page without having to query its size first.
> 

Yes, that's doable. However I am starting to think that this way the API is a bit confusing. I'll add a patch here anyway followign what you suggest and we can discuss whether we can make it a bit nicer.

> > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h:154
> > + * @WEBKIT_SNAPSHOT_OPTIONS_INCLUDE_SELECTION_HIGHLIGHTING: Whether to include in the
> > + * snapshot the highlight of the selected content.
> 
> Are you sure this is the selection and not the search results? I've tried the patch and I get the selection rendered in both cases.

Yes, I am sure. Actually it was due to a bug that I spotted now, but I tested this and it is indeed the selection.

> 
> > Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp:1131
> > +    cairo_surface_destroy(surface);
> 
> We need more tests, for example, we should tests the snapshot options, and check that the snapshot is different when there's something selected and the include selection option is used. There's code to compare pixbufs in search unit tests, comparing cairo surfaces should be easy too.

I'll check this after I post a new patch so that we can make a bit of progress in the review and API discussion while I add further tests.

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