After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 684437 - Implement unsubmitted modified forms warning in WebKit2
Implement unsubmitted modified forms warning in WebKit2
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Backend
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: Xan Lopez
Epiphany Maintainers
Depends on:
Blocks: 678610 694091 694144
 
 
Reported: 2012-09-20 08:52 UTC by Carlos Garcia Campos
Modified: 2013-02-21 08:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (14.23 KB, patch)
2012-12-28 16:42 UTC, Carlos Garcia Campos
none Details | Review
Updated patch (15.27 KB, patch)
2013-01-11 09:59 UTC, Carlos Garcia Campos
reviewed Details | Review
Updated patch (15.30 KB, patch)
2013-02-18 10:10 UTC, Carlos Garcia Campos
accepted-commit_now Details | Review
Another update (15.48 KB, patch)
2013-02-18 11:08 UTC, Carlos Garcia Campos
committed Details | Review
Fix for the service name (3.22 KB, patch)
2013-02-19 16:16 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2012-09-20 08:52:33 UTC
We need to figure out a way to implement this, because DOM bindings are not available in WebKit2
Comment 1 Carlos Garcia Campos 2012-12-28 16:42:57 UTC
Created attachment 232334 [details] [review]
Patch

This requires a WebKit patch not landed yet, see:

https://bugs.webkit.org/show_bug.cgi?id=105631
Comment 2 Carlos Garcia Campos 2013-01-11 09:59:38 UTC
Created attachment 233212 [details] [review]
Updated patch

Patch updated to use the new api to set the web extensions dir.
Comment 3 Xan Lopez 2013-02-16 13:04:45 UTC
Review of attachment 233212 [details] [review]:

OK, quick review, although I know this needs to be updated once again. The only thing that worries me is the sync method, but there's already a FIXME about that.

::: embed/ephy-embed-single.c
@@ +656,3 @@
+                                                         NULL,
+                                                         NULL);
+  }

Let's do this in EphyEmbedShell, EphyEmbedSingle is on its way out.

::: embed/ephy-web-view.c
@@ +3497,3 @@
+  single = EPHY_EMBED_SINGLE (ephy_embed_shell_get_embed_single (ephy_embed_shell_get_default ()));
+
+  /* FIXME: This should be async */

Any reason we are not doing it in the first patch?

::: embed/web-extension/ephy-web-extension.h
@@ +20,3 @@
+#define EPHY_WEB_EXTENSION_OBJECT_PATH     "/org/gnome/Epiphany/WebExtension"
+#define EPHY_WEB_EXTENSION_FORMS_INTERFACE "org.gnome.Epiphany.WebExtension.Forms"
+

This is missing the usual guards against multiple definition.
Comment 4 Carlos Garcia Campos 2013-02-18 09:47:18 UTC
(In reply to comment #3)
> Review of attachment 233212 [details] [review]:
> 
> OK, quick review, although I know this needs to be updated once again.

Actually, I've just noticed that I had already updated the patch to use webkit_web_context_set_web_extensions_directory().

> The only
> thing that worries me is the sync method, but there's already a FIXME about
> that.
> 
> ::: embed/ephy-embed-single.c
> @@ +656,3 @@
> +                                                         NULL,
> +                                                         NULL);
> +  }
> 
> Let's do this in EphyEmbedShell, EphyEmbedSingle is on its way out.

Ok.

> ::: embed/ephy-web-view.c
> @@ +3497,3 @@
> +  single = EPHY_EMBED_SINGLE (ephy_embed_shell_get_embed_single
> (ephy_embed_shell_get_default ()));
> +
> +  /* FIXME: This should be async */
> 
> Any reason we are not doing it in the first patch?

Because the method is already sync and it contains wk1 and wk2 code, keping it sync we don't need to change the caller. My idea was to make it async when we remove the wk1 code. 

> ::: embed/web-extension/ephy-web-extension.h
> @@ +20,3 @@
> +#define EPHY_WEB_EXTENSION_OBJECT_PATH     "/org/gnome/Epiphany/WebExtension"
> +#define EPHY_WEB_EXTENSION_FORMS_INTERFACE
> "org.gnome.Epiphany.WebExtension.Forms"
> +
> 
> This is missing the usual guards against multiple definition.

Good catch!
Comment 5 Carlos Garcia Campos 2013-02-18 10:10:21 UTC
Created attachment 236570 [details] [review]
Updated patch
Comment 6 Xan Lopez 2013-02-18 10:31:12 UTC
Review of attachment 236570 [details] [review]:

Cool, let's do it. BTW you probably need to bump up the WebKit requirement too?
Comment 7 Manuel Rego Casasnovas 2013-02-18 10:39:31 UTC
I'm wondering what we're going to do regarding the D-Bus interfaces.

At this moment we're defining 1 interface "org.gnome.Epiphany.WebExtension.Forms" with 1 method "HasModifiedForms".

But for the web apps I think we'll need a new interface "org.gnome.Epiphany.WebExtension.WebApps" with a method "GetBestIcon" or something like that.

If we're going to have several interfaces priv->web_extension should be renamed to something like priv->web_extension_forms and rename ephy_embed_shell_get_web_extension_proxy to something like ephy_embed_shell_get_web_extension_forms_proxy.

The other option is that we just define a generic interface and use it for both forms, web apps and any other stuff we might need in the future.

What do you think?
Comment 8 Carlos Garcia Campos 2013-02-18 10:55:07 UTC
I think having a single interface for everything will make the whole thing a lot easier
Comment 9 Carlos Garcia Campos 2013-02-18 11:08:40 UTC
Created attachment 236575 [details] [review]
Another update

Patch updated to use a single generic interface and to bump wk requirements
Comment 10 Sergio Villar 2013-02-19 10:44:49 UTC
looks great
Comment 11 Xan Lopez 2013-02-19 11:42:19 UTC
Review of attachment 236575 [details] [review]:

Sure. I didn't mean to hold this off with my last comment, when I mark a patch as accepted-commit-now it is always fine to do further changes in git.
Comment 12 Carlos Garcia Campos 2013-02-19 12:00:20 UTC
Comment on attachment 236575 [details] [review]
Another update

Pushed.
Comment 13 Giovanni Campagna 2013-02-19 14:10:48 UTC
I just wanted to point out, given that nobody has yet, that are you're using a well-known name on the session bus, so this breaks hard with multiple web processes running (eg. epiphany in application mode).

You need to use a different naming scheme (for example add the epiphany PID to the name), or use a private channel instead of the session bus.
Comment 14 Carlos Garcia Campos 2013-02-19 14:25:43 UTC
You are right, it was a temporary solution that I thought it was going to be a problem only when supporting multiple web processes, but it's indeed a problem for web apps or private instances :-(
Comment 15 Carlos Garcia Campos 2013-02-19 16:16:30 UTC
Created attachment 236781 [details] [review]
Fix for the service name

This is the easy fix for the problem, in the future we might want to use private dbus connection instead of the session bus.
Comment 16 Xan Lopez 2013-02-21 00:07:54 UTC
Review of attachment 236781 [details] [review]:

Alright.