Bug 63519

Summary: Refactor RenderTextControl::text().
Product: WebKit Reporter: Kent Tamura <tkent>
Component: FormsAssignee: Kent Tamura <tkent>
Status: RESOLVED FIXED    
Severity: Minor CC: morrita, webkit.review.bot
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description Kent Tamura 2011-06-28 01:10:40 PDT
Refactor RenderTextControl::text().
Comment 1 Kent Tamura 2011-06-28 01:15:03 PDT
Created attachment 98878 [details]
Patch
Comment 2 Hajime Morrita 2011-06-28 01:25:44 PDT
Comment on attachment 98878 [details]
Patch

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

> Source/WebCore/rendering/RenderTextControl.cpp:337
> +static String finishText(StringBuilder& result)

Another possible idea would be introducing a small class
which wraps or subclasses StringBuilder, and make it build these two types of text.
This kind of out-parameter looks kind of horrible for me. 
What do you think?
Comment 3 Kent Tamura 2011-06-28 01:31:59 PDT
Comment on attachment 98878 [details]
Patch

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

>> Source/WebCore/rendering/RenderTextControl.cpp:337
>> +static String finishText(StringBuilder& result)
> 
> Another possible idea would be introducing a small class
> which wraps or subclasses StringBuilder, and make it build these two types of text.
> This kind of out-parameter looks kind of horrible for me. 
> What do you think?

I feel it's overkill in this case.
Comment 4 Hajime Morrita 2011-06-28 01:40:39 PDT
Comment on attachment 98878 [details]
Patch

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

>>> Source/WebCore/rendering/RenderTextControl.cpp:337
>>> +static String finishText(StringBuilder& result)
>> 
>> Another possible idea would be introducing a small class
>> which wraps or subclasses StringBuilder, and make it build these two types of text.
>> This kind of out-parameter looks kind of horrible for me. 
>> What do you think?
> 
> I feel it's overkill in this case.

Okay, let's just land this.
Comment 5 WebKit Review Bot 2011-06-28 02:31:11 PDT
Comment on attachment 98878 [details]
Patch

Clearing flags on attachment: 98878

Committed r89913: <http://trac.webkit.org/changeset/89913>
Comment 6 WebKit Review Bot 2011-06-28 02:31:16 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Alexey Proskuryakov 2011-06-28 16:06:16 PDT
It would be really good to have a goal of refactoring mentioned in ChangeLog. What were you trying to achieve?
Comment 8 Kent Tamura 2011-06-28 16:47:40 PDT
(In reply to comment #7)
> It would be really good to have a goal of refactoring mentioned in ChangeLog. What were you trying to achieve?

Thank you for pointing it out.

The trigger of the change was I found text() was called twice in setInnerText(). It was obviously unnecessary.  Changes for text() and finishText() are just code cleanup.
I should have written such information to ChangeLog.