Add text-overflow support that allows placeholder and value text to show an ellipsis...
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 22:56:14 +0000 (22:56 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 22:56:14 +0000 (22:56 +0000)
commit740cb28ff307e8231cf6b9924d57ab9055fd4158
tree9d86916d59dabe1c5cb7e4b259dec7090404fa53
parentb1fd633665ba3bf77e693141552486cf2f72dd6b
Add text-overflow support that allows placeholder and value text to show an ellipsis when not focused
https://bugs.webkit.org/show_bug.cgi?id=76118
<rdar://problem/9271742>

Reviewed by Dan Bernstein.

Source/WebCore:

Tests: fast/css/text-overflow-input-focus-placeholder-expected.html
       fast/css/text-overflow-input-focus-placeholder.html
       fast/css/text-overflow-input-focus-value-expected.html
       fast/css/text-overflow-input-focus-value.html
       fast/css/text-overflow-input.html

* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::styleDidChange): When the style of the text control
changes, we update the text overflow property of the placeholder.
(WebCore::RenderTextControlSingleLine::createInnerTextStyle): When the style of the text control
changes, we update the text overflow property of the inner text block.
(WebCore::RenderTextControlSingleLine::textShouldBeTruncated): The text of the value and placeholder should
only contain the ellipsis if the input's text-overflow property is set to ellipsis, and the input is not focused.
* rendering/RenderTextControlSingleLine.h:

LayoutTests:

* fast/css/text-overflow-input-focus-placeholder-expected.html: Added.
* fast/css/text-overflow-input-focus-placeholder.html: Added.
* fast/css/text-overflow-input-focus-value-expected.html: Added.
* fast/css/text-overflow-input-focus-value.html: Added.
* fast/css/text-overflow-input.html: Added.

New baselines:
* platform/mac/fast/css/text-overflow-input-expected.png: Added.
* platform/mac/fast/css/text-overflow-input-expected.txt: Added.

Needs baselines:
* platform/chromium/test_expectations.txt:
* platform/gtk/test_expectations.txt:
* platform/qt/test_expectations.txt:
* platform/win/test_expectations.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/text-overflow-input-focus-placeholder-expected.html [new file with mode: 0644]
LayoutTests/fast/css/text-overflow-input-focus-placeholder.html [new file with mode: 0644]
LayoutTests/fast/css/text-overflow-input-focus-value-expected.html [new file with mode: 0644]
LayoutTests/fast/css/text-overflow-input-focus-value.html [new file with mode: 0644]
LayoutTests/fast/css/text-overflow-input.html [new file with mode: 0644]
LayoutTests/platform/chromium/test_expectations.txt
LayoutTests/platform/gtk/test_expectations.txt
LayoutTests/platform/mac/fast/css/text-overflow-input-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/text-overflow-input-expected.txt [new file with mode: 0644]
LayoutTests/platform/qt/test_expectations.txt
LayoutTests/platform/win/test_expectations.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTextControlSingleLine.cpp
Source/WebCore/rendering/RenderTextControlSingleLine.h