Bug 183510

Summary: [GTK] Do not use WebKitDOMHTMLFormElement as argument of signal WebKitWebPage::will-submit-form
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, bugs-noreply, ews-watchlist, gustavo, mcatanzaro
Priority: P2 Keywords: Gtk
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch mcatanzaro: review+

Description Carlos Garcia Campos 2018-03-09 03:50:11 PST
In 2.22 WebKitDOMHTMLFormElement will be deprecated in GTK+ port and won't still exist in WPE. The new JavaScript GLib API will be used to replace most of the DOM API, but a few classes will remain with a minimal API for things that can't be done with JavaScript. WebKitDOMElement will stay and will be added to WPE as well, so if we change the signal parameter to WebKitDOMElement we will be able to keep using WebKitWebPage::will-submit-form without any changes. WPE will gain this signal and the rest of the API that uses DOM. We need to do this before 2.20, since this is new API.
Comment 1 Carlos Garcia Campos 2018-03-09 03:53:16 PST
Created attachment 335416 [details]
Patch
Comment 2 EWS Watchlist 2018-03-09 03:55:39 PST
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 Michael Catanzaro 2018-03-09 06:35:41 PST
Comment on attachment 335416 [details]
Patch

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

> Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:594
> +     * @form: the #WebKitDOMElement to be submitted

the #WebKitDOMElement to be submitted, which will always correspond to an HTMLFormElement

> Tools/TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp:385
> +    GUniquePtr<char> formID(webkit_dom_element_get_id(formElement));

Oops. I wish it was not transfer full. :( But I guess the ID can change at any time.
Comment 4 Carlos Garcia Campos 2018-03-09 06:41:14 PST
Committed r229461: <https://trac.webkit.org/changeset/229461>