Bug 42807 - Small refactoring for input value sanitization
Summary: Small refactoring for input value sanitization
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: 2010-07-22 00:14 PDT by Kent Tamura
Modified: 2010-07-22 01:21 PDT (History)
2 users (show)

See Also:


Attachments
Patch (6.47 KB, patch)
2010-07-22 00:24 PDT, Kent Tamura
no flags Details | Formatted Diff | Diff
Patch 2 (6.49 KB, patch)
2010-07-22 01:03 PDT, 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 2010-07-22 00:14:43 PDT
Small refactoring for input value sanitization
Comment 1 Kent Tamura 2010-07-22 00:24:59 PDT
Created attachment 62266 [details]
Patch
Comment 2 Darin Adler 2010-07-22 00:37:04 PDT
Comment on attachment 62266 [details]
Patch

> +        (WebCore::InputElement::sanitizeValueCommon):
> +          Renamed from sanitizeValue(), and call replaceEOLAndLimitLength()
> +          instead of sanitizeUserInputValue().

Is there any better name for this that doesn't involve the word "common"? How would you describe what this function does?
Comment 3 Kent Tamura 2010-07-22 00:46:33 PDT
(In reply to comment #2)
> (From update of attachment 62266 [details])
> > +        (WebCore::InputElement::sanitizeValueCommon):
> > +          Renamed from sanitizeValue(), and call replaceEOLAndLimitLength()
> > +          instead of sanitizeUserInputValue().
> 
> Is there any better name for this that doesn't involve the word "common"? How would you describe what this function does?

Actually I didn't think "common" was the best name and didn't have other good ideas.
A short description for this function would be:
   This is a sanitization function which is needed for almost all types of <input>.

Do you have any idea?
Comment 4 Darin Adler 2010-07-22 00:49:09 PDT
(In reply to comment #3)
> A short description for this function would be:
>    This is a sanitization function which is needed for almost all types of <input>.
> 
> Do you have any idea?

I might.

What are the exceptions to "almost all" in that sentence?
Comment 5 Kent Tamura 2010-07-22 00:57:30 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > A short description for this function would be:
> >    This is a sanitization function which is needed for almost all types of <input>.
> > 
> > Do you have any idea?
> 
> I might.
> 
> What are the exceptions to "almost all" in that sentence?

Well, "almost all" means HTMLInputElement::isTextField() for now.  So the name should sanitizeValueforTextField()?
Comment 6 Darin Adler 2010-07-22 00:58:44 PDT
(In reply to comment #5)
> Well, "almost all" means HTMLInputElement::isTextField() for now.  So the name should sanitizeValueforTextField()?

Yes. As you say, for now.
Comment 7 Kent Tamura 2010-07-22 01:03:54 PDT
Created attachment 62271 [details]
Patch 2
Comment 8 Kent Tamura 2010-07-22 01:21:02 PDT
Comment on attachment 62271 [details]
Patch 2

Clearing flags on attachment: 62271

Committed r63879: <http://trac.webkit.org/changeset/63879>
Comment 9 Kent Tamura 2010-07-22 01:21:10 PDT
All reviewed patches have been landed.  Closing bug.