GNOME Bugzilla – Bug 668260
Epiphany warns of unsubmitted changes in forms even if you delete all the text
Last modified: 2015-09-30 16:21:58 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.
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.
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?
(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.
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.
(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!
Attachment 312054 [details] pushed as 36ef168 - Don't warn about unsubmitted changes unless the form has text