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 668260 - Epiphany warns of unsubmitted changes in forms even if you delete all the text
Epiphany warns of unsubmitted changes in forms even if you delete all the text
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-19 12:03 UTC by Xan Lopez
Modified: 2015-09-30 16:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't warn about unsubmitted changes unless the form has text (1.56 KB, patch)
2015-09-23 00:51 UTC, Michael Catanzaro
none Details | Review
Don't warn about unsubmitted changes unless the form has text (1.53 KB, patch)
2015-09-24 13:38 UTC, Michael Catanzaro
committed Details | Review

Description Xan Lopez 2012-01-19 12:03:13 UTC
Steps to reproduce:

- Write something in a form.
- Delete all of it.
- Try to close the tab/window.

You'll be warned about unsubmitted changes, but you probably should not.
Comment 1 Michael Catanzaro 2015-09-23 00:51:22 UTC
Created attachment 311918 [details] [review]
Don't warn about unsubmitted changes unless the form has text

You could delete all the text; the form is still modified, but we
shouldn't warn about it, since you have no data to lose.
Comment 2 Carlos Garcia Campos 2015-09-24 09:33:37 UTC
Review of attachment 311918 [details] [review]:

::: lib/ephy-web-dom-utils.c
@@ +69,3 @@
+          text = webkit_dom_html_text_area_element_get_value (WEBKIT_DOM_HTML_TEXT_AREA_ELEMENT (element));
+          if (text && *text)
+            has_data = TRUE;

has_data = text && *text ? That way you don't need the initialization on declaration either.

@@ +78,2 @@
       if (WEBKIT_DOM_IS_HTML_INPUT_ELEMENT (element))
         if (webkit_dom_html_input_element_is_edited (WEBKIT_DOM_HTML_INPUT_ELEMENT (element))) {

Shouldn't we do the same for input elements?
Comment 3 Michael Catanzaro 2015-09-24 13:34:11 UTC
(In reply to Carlos Garcia Campos from comment #2)
> Review of attachment 311918 [details] [review] [review]:
> 
> ::: lib/ephy-web-dom-utils.c
> @@ +69,3 @@
> +          text = webkit_dom_html_text_area_element_get_value
> (WEBKIT_DOM_HTML_TEXT_AREA_ELEMENT (element));
> +          if (text && *text)
> +            has_data = TRUE;
> 
> has_data = text && *text ? That way you don't need the initialization on
> declaration either.

OK.

> @@ +78,2 @@
>        if (WEBKIT_DOM_IS_HTML_INPUT_ELEMENT (element))
>          if (webkit_dom_html_input_element_is_edited
> (WEBKIT_DOM_HTML_INPUT_ELEMENT (element))) {
> 
> Shouldn't we do the same for input elements?

No, because we only warn about input elements with more than 50 characters.
Comment 4 Michael Catanzaro 2015-09-24 13:38:22 UTC
Created attachment 312054 [details] [review]
Don't warn about unsubmitted changes unless the form has text

You could delete all the text; the form is still modified, but we
shouldn't warn about it, since you have no data to lose.
Comment 5 Carlos Garcia Campos 2015-09-24 13:53:29 UTC
(In reply to Michael Catanzaro from comment #3)
> (In reply to Carlos Garcia Campos from comment #2)
> > Review of attachment 311918 [details] [review] [review] [review]:
> > 
> > ::: lib/ephy-web-dom-utils.c
> > @@ +69,3 @@
> > +          text = webkit_dom_html_text_area_element_get_value
> > (WEBKIT_DOM_HTML_TEXT_AREA_ELEMENT (element));
> > +          if (text && *text)
> > +            has_data = TRUE;
> > 
> > has_data = text && *text ? That way you don't need the initialization on
> > declaration either.
> 
> OK.
> 
> > @@ +78,2 @@
> >        if (WEBKIT_DOM_IS_HTML_INPUT_ELEMENT (element))
> >          if (webkit_dom_html_input_element_is_edited
> > (WEBKIT_DOM_HTML_INPUT_ELEMENT (element))) {
> > 
> > Shouldn't we do the same for input elements?
> 
> No, because we only warn about input elements with more than 50 characters.

Ah, right!
Comment 6 Michael Catanzaro 2015-09-30 16:21:55 UTC
Attachment 312054 [details] pushed as 36ef168 - Don't warn about unsubmitted changes unless the form has text