Bug 61791

Summary: [GTK] Provide custom DOM bindings methods to check if input/textareas have been edited
Product: WebKit Reporter: Xan Lopez <xan.lopez>
Component: WebKitGTKAssignee: Xan Lopez <xan.lopez>
Status: RESOLVED FIXED    
Severity: Normal CC: mrobinson, webkit.review.bot, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Xan Lopez 2011-05-31 10:28:41 PDT
This is useful to implement the usual "do not close this tab, there are unsubmitted forms" warning in browsers.
Comment 1 Xan Lopez 2011-05-31 10:35:41 PDT
Created attachment 95450 [details]
Patch
Comment 2 Xan Lopez 2011-05-31 10:36:33 PDT
Not much I can do about the style warning, the function has to be in C style since it's public API.
Comment 3 WebKit Review Bot 2011-05-31 10:37:38 PDT
Attachment 95450 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp:29:  webkit_dom_html_text_area_element_is_edited is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp:36:  webkit_dom_html_input_element_is_edited is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Total errors found: 2 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Martin Robinson 2011-05-31 10:45:41 PDT
Comment on attachment 95450 [details]
Patch

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

>> Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp:29
>> +gboolean webkit_dom_html_text_area_element_is_edited(WebKitDOMHTMLTextAreaElement* area)
> 
> webkit_dom_html_text_area_element_is_edited is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]

Why not webkit_dom_html_text_area_element_last_change_was_user_edit?
Comment 5 Martin Robinson 2011-05-31 10:46:13 PDT
(In reply to comment #4)
> (From update of attachment 95450 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=95450&action=review
> 
> >> Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp:29
> >> +gboolean webkit_dom_html_text_area_element_is_edited(WebKitDOMHTMLTextAreaElement* area)
> > 
> > webkit_dom_html_text_area_element_is_edited is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
> 
> Why not webkit_dom_html_text_area_element_last_change_was_user_edit?

Probably this name should be changed before landing, by the way. I think webkit_dom_html_text_area_element_is_edited inaccurately portrays what this method does.
Comment 6 Xan Lopez 2011-05-31 11:10:21 PDT
Comment on attachment 95450 [details]
Patch

Clearing flags on attachment: 95450

Committed r87741: <http://trac.webkit.org/changeset/87741>
Comment 7 Xan Lopez 2011-05-31 11:10:28 PDT
All reviewed patches have been landed.  Closing bug.