[Webkit-unassigned] [Bug 54476] HTMLInputElement has two similarly named methods: "checked" and "isChecked"

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 11 09:40:33 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=54476


Darin Fisher (:fishd, Google) <fishd at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #100081|review?                     |review-
               Flag|                            |




--- Comment #9 from Darin Fisher (:fishd, Google) <fishd at chromium.org>  2011-07-11 09:40:32 PST ---
(From update of attachment 100081)
View in context: https://bugs.webkit.org/attachment.cgi?id=100081&action=review

> Source/WebCore/html/HTMLInputElement.h:129
> +    virtual bool isInputTypeChecked() const;

this name doesn't seem to improve things.  if i told you that an input element has
two properties, checked and input-type-checked, would you have any idea what the
difference is?

it seems like there are really two properties here: a checked property and a
can-render-as-checked property.  the problem here is that checked() returns the
first, and isChecked() returns the AND of both.

one solution is to expose both methods, and then fix callsites to check both
properties.  another idea is to come up with a good name for the AND case.

an uncreative approach:

  isCheckedAndCanRenderAsChecked

maybe a shorter name would be:

  shouldRenderAsChecked or even renderAsChecked

my vote is to go with renderAsChecked.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list