Bug 63519 - Refactor RenderTextControl::text().
Summary: Refactor RenderTextControl::text().
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: 2011-06-28 01:10 PDT by Kent Tamura
Modified: 2011-06-28 16:47 PDT (History)
2 users (show)

See Also:


Attachments
Patch (6.48 KB, patch)
2011-06-28 01:15 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 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.