Bug 38344 - Remove custom bindings for HTMLInputElement
Summary: Remove custom bindings for HTMLInputElement
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Adam Barth
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-29 13:52 PDT by Adam Barth
Modified: 2010-09-02 16:01 PDT (History)
6 users (show)

See Also:


Attachments
Patch (25.06 KB, patch)
2010-04-29 13:54 PDT, Adam Barth
no flags Details | Formatted Diff | Diff
work in progress (10.09 KB, patch)
2010-05-14 22:06 PDT, Adam Barth
no flags Details | Formatted Diff | Diff
Patch (12.39 KB, patch)
2010-05-14 23:23 PDT, Adam Barth
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Barth 2010-04-29 13:52:04 PDT
Remove custom bindings for HTMLInputElement
Comment 1 Adam Barth 2010-04-29 13:54:50 PDT
Created attachment 54732 [details]
Patch
Comment 2 WebKit Review Bot 2010-04-29 13:58:10 PDT
Attachment 54732 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1
WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:440:  Extra space before ( in function call  [whitespace/parens] [4]
WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:456:  Extra space before ( in function call  [whitespace/parens] [4]
WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:481:  Extra space before ( in function call  [whitespace/parens] [4]
WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:591:  Extra space before )  [whitespace/parens] [2]
WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:597:  Extra space before )  [whitespace/parens] [2]
WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h:164:  Extra space before ( in function call  [whitespace/parens] [4]
WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h:167:  Extra space before ( in function call  [whitespace/parens] [4]
WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h:173:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 8 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Yaar Schnitman 2010-04-29 14:34:36 PDT
That's better.
Comment 4 Eric Seidel (no email) 2010-04-30 11:52:30 PDT
Comment on attachment 54732 [details]
Patch

I think HTMLInputElement.h needs a comment as to why we're adding these.  But I think this looks OK.

Should we be be making selectionStart, etc. virtual and overriding them in HTMLIntputElement as private members?  Should we change the baseclass to take an ExceptionCode and only throw it for HTMLInputElement?

I think this is OK as is, but I worry that folks could easily use the wrong one.
Comment 5 Darin Adler 2010-04-30 13:13:18 PDT
Comment on attachment 54732 [details]
Patch

Throwing an exception when previously we would silently do nothing could easily be a backward compatibility problem for the Objective-C bindings.

> +int HTMLInputElement::selectionStart(ExceptionCode& ec)
> +{
> +    if (!canHaveSelection()) {
> +        ec = TYPE_MISMATCH_ERR;
> +        return -1;
> +    }

I think this gives a different exception than before. Probably the new one is correct and the old was incorrect, but since it's a behavior change I'd like to see tests showing the behavior.
Comment 6 Adam Barth 2010-05-02 19:28:11 PDT
We should be able to have the ObjC bindings call the non-ec version of the method.  I'm not sure why that didn't work.
Comment 7 Eric Seidel (no email) 2010-05-02 19:33:07 PDT
Attachment 54732 [details] was posted by a committer and has review+, assigning to Adam Barth for commit.
Comment 8 Adam Barth 2010-05-14 16:34:21 PDT
Committed r59502: <http://trac.webkit.org/changeset/59502>
Comment 9 Adam Barth 2010-05-14 16:51:33 PDT
I landed the TestObj.idl changes in http://trac.webkit.org/changeset/59502.  I'm going to post a new patch that addresses Darin's feedback shortly.
Comment 10 Adam Barth 2010-05-14 22:06:51 PDT
Created attachment 56139 [details]
work in progress
Comment 11 Adam Barth 2010-05-14 23:23:49 PDT
Created attachment 56141 [details]
Patch
Comment 12 Darin Adler 2010-05-16 12:12:41 PDT
Comment on attachment 56141 [details]
Patch

Good to avoid custom bindings.

Awkward to have these two versions of these basic functions side by side. The only other place I can think of where we have that is the Range class. Note the different way these functions are declared in that class compared to what we have in this patch. I think I like the Range style slightly better.

> +    // The methods that take ExceptionCodes check canHaveSelection().

Methods is not a C++ term, and I normally avoid using it to mean member function in WebKit code. I would say "The following functions" or "These functions" rather than "The methods".
Comment 13 Eric Seidel (no email) 2010-09-02 13:47:12 PDT
I'm confused why this is open?