Bug 42807

Summary: Small refactoring for input value sanitization
Product: WebKit Reporter: Kent Tamura <tkent>
Component: FormsAssignee: Kent Tamura <tkent>
Status: RESOLVED FIXED    
Severity: Minor CC: darin, joepeck
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch 2 none

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.