[webkit-gtk] Ignoring form submission doesn't work in 2.14

Carlos Alberto Lopez Perez clopez at igalia.com
Tue Jan 17 11:06:20 PST 2017

On 13/01/17 14:10, Vasiliy Faronov wrote:
> Hi,
> I have a Python program that uses WebKitGTK+ (via
> GObject-Introspection) to create a WebView, populate it with an HTML
> form, and handle submissions of that form.
> See: https://gist.github.com/vfaronov/f1c1faa969c58b5990d02f5d9890b180
> After my Python code has handled the submission, I want WebKit to stop
> its further processing: it must *not* navigate away to the form's
> target.
> To accomplish this, I keep references to the submission requests, as
> suggested by the docs for the submit-form signal [1]. This works for
> me with WebKitGTK+ 2.10 and 2.12.
> But with 2.14.2, the WebView "freezes" after my on_submit_form
> callback returns. That is, after clicking the "Submit" button, it
> stays visually pressed down, and I can no longer scroll the view or
> type in the input field. However, if I click the "Submit" button again
> in this "frozen" state, my callback is called again and produces the
> same output. And if I right-click in the WebView, the context menu
> still pops up.
> Of course, if I don't keep the reference -- that is, if I remove
> "refs.append(request)" -- then the WebView navigates away to the form
> target (about:blank), which is what I want to *prevent*.
> Any idea why my code breaks with 2.14? Maybe there's a better way to
> do what I want?
> Thank you.
> [1] https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#WebKitWebView-submit-form

It seems that the accelerated compositing mode (that we enabled by
default on 2.14.x) is triggering this issue (no idea why).

Try to export this environment variable before running you program:


With it, I'm not longer able to reproduce the freeze on the UI.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 883 bytes
Desc: OpenPGP digital signature
URL: <https://lists.webkit.org/pipermail/webkit-gtk/attachments/20170117/3ef4c98b/attachment.sig>

More information about the webkit-gtk mailing list