Bug 67320 - Move text() and textWithHardLineBreaks() from RenderTextControl to HTMLTextFormControlElement
Summary: Move text() and textWithHardLineBreaks() from RenderTextControl to HTMLTextFo...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 66241
  Show dependency treegraph
 
Reported: 2011-08-31 14:30 PDT by Ryosuke Niwa
Modified: 2011-08-31 18:55 PDT (History)
9 users (show)

See Also:


Attachments
refactoring (17.53 KB, patch)
2011-08-31 15:03 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
fixed efl build (18.28 KB, patch)
2011-08-31 16:04 PDT, Ryosuke Niwa
darin: review+
webkit-ews: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2011-08-31 14:30:55 PDT
text() and textWithHardLineBreaks() don't depend anything in RenderText, and should be moved to HTMLTextFormControlElement.
Comment 1 Ryosuke Niwa 2011-08-31 15:03:37 PDT
Created attachment 105838 [details]
refactoring
Comment 2 Ryosuke Niwa 2011-08-31 15:06:38 PDT
Comment on attachment 105838 [details]
refactoring

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

> Source/WebCore/html/HTMLTextAreaElement.cpp:-175
> -    // FIXME: It's not acceptable to ignore the HardWrap setting when there is no renderer.
> -    // While we have no evidence this has ever been a practical problem, it would be best to fix it some day.

This comment is moved into valueWithHardLineBreaks.

> Source/WebCore/html/HTMLTextFormControlElement.cpp:524
> +        return value();

We call value() instead of emptyString() here (and 2 other places below).  These are only differences between HTMLTextFormControlElement::valueWithHardLineBreaks and RenderTextControl::textWithHardLineBreaks

> Source/WebCore/html/NumberInputType.cpp:321
> +    return element()->renderer() && !isAcceptableValue(element()->innerTextValue());

I bet these input type functions want to call value() instead of innerTextValue() but that can be done in a separate patch.
Comment 3 Gyuyoung Kim 2011-08-31 15:46:46 PDT
Comment on attachment 105838 [details]
refactoring

Attachment 105838 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/9563999
Comment 4 Early Warning System Bot 2011-08-31 15:51:09 PDT
Comment on attachment 105838 [details]
refactoring

Attachment 105838 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/9578085
Comment 5 Ryosuke Niwa 2011-08-31 16:04:00 PDT
Created attachment 105848 [details]
fixed efl build
Comment 6 Ryosuke Niwa 2011-08-31 16:14:34 PDT
Any reviewers?  This patch is blocking my work for the bug 66241.
Comment 7 Darin Adler 2011-08-31 16:27:26 PDT
Comment on attachment 105848 [details]
fixed efl build

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

r=me

> Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1956
> +        return toRenderTextControl(m_renderer)->textFormControlElement()->value();

Can textFormControlElement() ever be 0?
Comment 8 Ryosuke Niwa 2011-08-31 16:30:50 PDT
Comment on attachment 105848 [details]
fixed efl build

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

>> Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1956
>> +        return toRenderTextControl(m_renderer)->textFormControlElement()->value();
> 
> Can textFormControlElement() ever be 0?

Only if RenderObject::m_node is 0.  I guess I should check that.  Or that I just need to move this line below the nullity check below.
Comment 9 Ryosuke Niwa 2011-08-31 16:31:07 PDT
Thanks for the review!
Comment 10 Early Warning System Bot 2011-08-31 16:47:58 PDT
Comment on attachment 105848 [details]
fixed efl build

Attachment 105848 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/9572727
Comment 11 Ryosuke Niwa 2011-08-31 16:59:09 PDT
Committed r94252: <http://trac.webkit.org/changeset/94252>
Comment 12 Kent Tamura 2011-08-31 18:55:18 PDT
Comment on attachment 105838 [details]
refactoring

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

>> Source/WebCore/html/NumberInputType.cpp:321
>> +    return element()->renderer() && !isAcceptableValue(element()->innerTextValue());
> 
> I bet these input type functions want to call value() instead of innerTextValue() but that can be done in a separate patch.

It should be innerTextValue().
LayoutTests/fast/forms/input-number-unacceptable-style.html tests it.