Bug 46023 - Deprecate the inputType function on HTMLInputElement
Summary: Deprecate the inputType function on HTMLInputElement
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks: 45872
  Show dependency treegraph
 
Reported: 2010-09-17 18:08 PDT by Darin Adler
Modified: 2010-09-21 03:10 PDT (History)
7 users (show)

See Also:


Attachments
Patch (50.51 KB, patch)
2010-09-17 18:21 PDT, Darin Adler
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2010-09-17 18:08:50 PDT
Deprecate the inputType function on HTMLInputElement
Comment 1 Darin Adler 2010-09-17 18:21:23 PDT
Created attachment 67988 [details]
Patch
Comment 2 Andreas Kling 2010-09-17 18:58:50 PDT
Comment on attachment 67988 [details]
Patch

> +        dprecatedNumberOfTypes for the same reason. Changed all code to use
Typo (dprecatedNumberOfTypes)

r=me
Comment 3 Alexey Proskuryakov 2010-09-17 22:24:26 PDT
Why?

The only explanation I could find was deep inside ChangeLog ("since it should not be used outside this class"), but even that seems mysterious.
Comment 4 Andreas Kling 2010-09-18 07:20:04 PDT
(In reply to comment #3)
> Why?

Darin may have more reasons, but personally I like it because it prevents the mistake of checking e.g "inputType() == TEXT" when you actually want isTextField().
Comment 5 Andreas Kling 2010-09-18 08:38:15 PDT
Comment on attachment 67988 [details]
Patch

Right, I was not aware of that ongoing refactoring effort, thanks Kent. I admit to jumping the gun on this review, as I was not aware of all the circumstances, resetting r? so someone else can have a look. (For the record, it still LGTM.)
Comment 6 Darin Adler 2010-09-18 16:10:24 PDT
This is a straightforward patch, and I think Andreas’s review should be sufficient, but as the author I guess I’m biased. So lets wait for someone else to review?
Comment 7 Darin Adler 2010-09-18 16:15:46 PDT
There are multiple reasons for this, and I could put some in the change log.

The primary reason is that we want to be free to add more input types without having to revise switch statements outside the class. And we’d like to change the class to be based on an input type object rather than an input type number. There is almost no code that depends on this numeric value and we can get that down to nothing pretty easily.

But yes, another reason is that people tend to special-case TEXT when it is not correct to do so. Generally speaking a list of types at a call site often can become wrong later when someone adds a new type.
Comment 8 Andreas Kling 2010-09-18 16:27:16 PDT
Comment on attachment 67988 [details]
Patch

You are right, this is straightforward. Thanks for explaining the reasons.
Comment 9 Darin Adler 2010-09-20 18:12:32 PDT
Committed r67903: <http://trac.webkit.org/changeset/67903>
Comment 10 WebKit Review Bot 2010-09-20 19:07:21 PDT
http://trac.webkit.org/changeset/67904 might have broken GTK Linux 64-bit Debug
The following changes are on the blame list:
http://trac.webkit.org/changeset/67904
http://trac.webkit.org/changeset/67903
Comment 11 Philippe Normand 2010-09-21 03:10:16 PDT
(In reply to comment #10)
> http://trac.webkit.org/changeset/67904 might have broken GTK Linux 64-bit Debug
> The following changes are on the blame list:
> http://trac.webkit.org/changeset/67904
> http://trac.webkit.org/changeset/67903

See bug 46169