RESOLVED FIXED 46023
Deprecate the inputType function on HTMLInputElement
https://bugs.webkit.org/show_bug.cgi?id=46023
Summary Deprecate the inputType function on HTMLInputElement
Darin Adler
Reported 2010-09-17 18:08:50 PDT
Deprecate the inputType function on HTMLInputElement
Attachments
Patch (50.51 KB, patch)
2010-09-17 18:21 PDT, Darin Adler
kling: review+
Darin Adler
Comment 1 2010-09-17 18:21:23 PDT
Andreas Kling
Comment 2 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
Alexey Proskuryakov
Comment 3 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.
Andreas Kling
Comment 4 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().
Andreas Kling
Comment 5 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.)
Darin Adler
Comment 6 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?
Darin Adler
Comment 7 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.
Andreas Kling
Comment 8 2010-09-18 16:27:16 PDT
Comment on attachment 67988 [details] Patch You are right, this is straightforward. Thanks for explaining the reasons.
Darin Adler
Comment 9 2010-09-20 18:12:32 PDT
WebKit Review Bot
Comment 10 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
Philippe Normand
Comment 11 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
Note You need to log in before you can comment on or make changes to this bug.