Bug 76039 - Rename HTMLInputElement::setDefaultName to setInitialName
Summary: Rename HTMLInputElement::setDefaultName to setInitialName
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Minor
Assignee: Kent Tamura
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-11 01:13 PST by Kent Tamura
Modified: 2012-01-11 14:36 PST (History)
2 users (show)

See Also:


Attachments
Patch (6.02 KB, patch)
2012-01-11 01:46 PST, Kent Tamura
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Tamura 2012-01-11 01:13:34 PST
https://bugs.webkit.org/show_bug.cgi?id=45719#c22
> In a mostly unrelated note, when looking at this I noticed a peculiarly-named public function, setDefaultName, that is called only by the HTMLIsIndexElement constructor. We should probably make that function protected. And further, it’s only safe to call that function if the object is not a checkbox, so we might want to assert that. And it’s only correct to call it on an object that doesn’t already have a name, so we might want to assert that m_name is null. And finally, this doesn’t actually work correctly if a name is added and then subsequently removed from the isindex element. That’s probably unimportant because of how rare it is to use the isindex element at all, but annoying that it’s incorrect. That’s the reason the function name is so bad: It doesn’t actually set a default name, just sets an initial name.
Comment 1 Kent Tamura 2012-01-11 01:26:55 PST
> this doesn’t actually work correctly if a name is added and then subsequently removed from the isindex element.

I confirmed the current behavior of WebKit is compatible with IE9, Firefox, and Opera. As you wrote, setDefaultName() really sets just an initial name.
Comment 2 Kent Tamura 2012-01-11 01:46:17 PST
Created attachment 121994 [details]
Patch
Comment 3 Darin Adler 2012-01-11 10:15:18 PST
Comment on attachment 121994 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=121994&action=review

> Source/WebCore/html/HTMLInputElement.cpp:1305
> +    ASSERT(hasTagName(isindexTag));

To me it seems like this assert goes a little overboard, but only a tiny bit, so I say, lets keep it.
Comment 4 WebKit Review Bot 2012-01-11 14:36:10 PST
Comment on attachment 121994 [details]
Patch

Clearing flags on attachment: 121994

Committed r104747: <http://trac.webkit.org/changeset/104747>
Comment 5 WebKit Review Bot 2012-01-11 14:36:15 PST
All reviewed patches have been landed.  Closing bug.