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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 12 11:14:26 PDT 2011


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


Darin Adler <darin at apple.com> changed:

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




--- Comment #13 from Darin Adler <darin at apple.com>  2011-07-12 11:14:25 PST ---
(From update of attachment 100435)
View in context: https://bugs.webkit.org/attachment.cgi?id=100435&action=review

Since the entire purpose of this patch is renaming, and I am suggesting a different name, review-.

> Source/WebCore/html/HTMLInputElement.h:129
> +    // renderAsChecked is used by the rendering tree/CSS while checked() is used by JS to determine checked state
> +    virtual bool renderAsChecked() const;

I think it’s great to choose a name here that is distinct from the DOM function checked, but I am not a big fan of the term “render” here. I think there are clearer less-jargony terms we can use. The name I like best is shouldAppearChecked. Other possible names could be isVisiblyChecked or appearsChecked.

The only reason this function or isIndeterminate was a virtual function was the WML support. This should not be virtual any more. If it was really a virtual function then we’d have to rename the other implementations, but there are none. No reason to spend the extra runtime overhead of a virtual function dispatch.

> Source/WebCore/html/HTMLInputElement.h:130
>      virtual bool isIndeterminate() const { return indeterminate(); }

Not your responsibility in this patch, but this function needs to be removed. It only existed because of WML, and it’s now just a better-named, slow synonym for the DOM indeterminate function.

-- 
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