RESOLVED FIXED 54333
Expose checked field of HTMLInputElement to Chromium API
https://bugs.webkit.org/show_bug.cgi?id=54333
Summary Expose checked field of HTMLInputElement to Chromium API
Jay Soffian
Reported 2011-02-11 19:49:41 PST
Expose checked field of HTMLInputElement to Chromium API
Attachments
Patch (1.96 KB, patch)
2011-02-11 19:51 PST, Jay Soffian
no flags
Patch (1.97 KB, patch)
2011-02-14 10:24 PST, Jay Soffian
no flags
Jay Soffian
Comment 1 2011-02-11 19:51:37 PST
Darin Fisher (:fishd, Google)
Comment 2 2011-02-13 21:02:34 PST
Comment on attachment 82226 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=82226&action=review > w/Source/WebKit/chromium/public/WebInputElement.h:81 > + WEBKIT_API bool checked() const; How about renaming this to isChecked to be more consistent with how other, similar API methods are named? "checked" is really trying to ask a question, so it helps to word it like a question.
Jay Soffian
Comment 3 2011-02-14 07:25:51 PST
Every other WebInputElement method is named identically to the HTMLInputElement method it calls though to. This would be the first WebInputElement method that uses a different name. Isn't consistency more important? Also, there's this comment in HTMLInputElement.h: // isChecked is used by the rendering tree/CSS while checked() is used by JS to determine checked state
Darin Fisher (:fishd, Google)
Comment 4 2011-02-14 10:03:03 PST
(In reply to comment #3) > Every other WebInputElement method is named identically to the HTMLInputElement method it calls though to. This would be the first WebInputElement method that uses a different name. Isn't consistency more important? You're talking about an implementation detail. I'm arguing for making the publicly facing API consistent from the perspective of the guy who uses the API.
Jay Soffian
Comment 5 2011-02-14 10:16:19 PST
I will defer to your judgement, but in my experience abstractions leak and when that happens, it's less confusing for the same concepts at different layers to have the same name. Sending up new patch shortly.
Jay Soffian
Comment 6 2011-02-14 10:24:37 PST
Darin Fisher (:fishd, Google)
Comment 7 2011-02-14 11:16:08 PST
Comment on attachment 82330 [details] Patch R=me It sounds like the internal naming is unfortunate. "isChecked" and "checked" sound way too similar. I'd recommend finding a better name for one of those.
WebKit Commit Bot
Comment 8 2011-02-14 11:43:24 PST
The commit-queue encountered the following flaky tests while processing attachment 82330 [details]: fast/workers/storage/use-same-database-in-page-and-workers.html bug 50995 (author: dumi@chromium.org) The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 9 2011-02-14 11:46:03 PST
Comment on attachment 82330 [details] Patch Clearing flags on attachment: 82330 Committed r78494: <http://trac.webkit.org/changeset/78494>
WebKit Commit Bot
Comment 10 2011-02-14 11:46:07 PST
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 11 2011-02-14 12:13:18 PST
(In reply to comment #7) > It sounds like the internal naming is unfortunate. "isChecked" and "checked" sound way too similar. I'd recommend finding a better name for one of those. I think we ended up with these names because isChecked is a good name and checked is the name used in the HTML DOM.
Darin Fisher (:fishd, Google)
Comment 12 2011-02-15 09:52:29 PST
(In reply to comment #11) > (In reply to comment #7) > > It sounds like the internal naming is unfortunate. "isChecked" and "checked" sound way too similar. I'd recommend finding a better name for one of those. > > I think we ended up with these names because isChecked is a good name and checked is the name used in the HTML DOM. You don't find the names confusingly similar?
Darin Adler
Comment 13 2011-02-15 09:57:10 PST
(In reply to comment #12) > (In reply to comment #11) > > (In reply to comment #7) > > > It sounds like the internal naming is unfortunate. "isChecked" and "checked" sound way too similar. I'd recommend finding a better name for one of those. > > > > I think we ended up with these names because isChecked is a good name and checked is the name used in the HTML DOM. > > You don't find the names confusingly similar? I do. My intention was to explain how we got here, not defend where we are ;-) It’s bad to have two similar names with different behavior. They should definitely be named in a way that makes the difference clear.
Darin Fisher (:fishd, Google)
Comment 14 2011-02-15 10:24:23 PST
OK, I created a bug about the naming issue: see bug 54476.
Note You need to log in before you can comment on or make changes to this bug.