Fix for https://bugs.webkit.org/show_bug.cgi?id=53740
authoradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 18:18:30 +0000 (18:18 +0000)
committeradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 18:18:30 +0000 (18:18 +0000)
commit912bef6a4619b4d6bce1ee1803cdd5853180753f
treedafad5dfa0dbd0a5f8c8b9f8321faba60410db56
parent82aefa839c04d8fca12a4c8637890e6474b08426
Fix for https://bugs.webkit.org/show_bug.cgi?id=53740
<rdar://problem/8503629> Allow platforms to specify if the placeholder should be visible when text controls are focused

Reviewed by Dan Bernstein.

Tests:
fast/forms/textarea-placeholder-visibility-1.html
fast/forms/textarea-placeholder-visibility-2.html
fast/forms/input-placeholder-visibility-1.html
fast/forms/input-placeholder-visibility-2.html
fast/forms/input-placeholder-visibility-3.html

* html/HTMLFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
Add a check for shouldShowPlaceholderWhenFocused.
* html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::updateValue):
Whenever the value is updated, we should also update placeholder visibility.
* rendering/RenderTheme.h: (WebCore::RenderTheme::shouldShowPlaceholderWhenFocused):
Make the default the same as the existing behavior.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::shouldShowPlaceholderWhenFocused):
Show placeholder when appropriate.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
45 files changed:
LayoutTests/fast/forms/input-placeholder-focus-twice.html [deleted file]
LayoutTests/fast/forms/input-placeholder-visibility-1.html [new file with mode: 0644]
LayoutTests/fast/forms/input-placeholder-visibility-2.html [new file with mode: 0644]
LayoutTests/fast/forms/input-placeholder-visibility-3.html [new file with mode: 0644]
LayoutTests/fast/forms/textarea-placeholder-visibility-1.html [new file with mode: 0644]
LayoutTests/fast/forms/textarea-placeholder-visibility-2.html [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/input-placeholder-visibility-1-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/input-placeholder-visibility-1-expected.png [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/input-placeholder-visibility-1-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/input-placeholder-visibility-2-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/input-placeholder-visibility-2-expected.png [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/input-placeholder-visibility-2-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/input-placeholder-visibility-3-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/input-placeholder-visibility-3-expected.png [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/input-placeholder-visibility-3-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/textarea-placeholder-visibility-1-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/textarea-placeholder-visibility-1-expected.png [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/textarea-placeholder-visibility-1-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/textarea-placeholder-visibility-2-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/textarea-placeholder-visibility-2-expected.png [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/fast/forms/textarea-placeholder-visibility-2-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/input-placeholder-focus-twice-expected.checksum [deleted file]
LayoutTests/platform/mac/fast/forms/input-placeholder-focus-twice-expected.png [deleted file]
LayoutTests/platform/mac/fast/forms/input-placeholder-focus-twice-expected.txt [deleted file]
LayoutTests/platform/mac/fast/forms/input-placeholder-visibility-1-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/input-placeholder-visibility-1-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/input-placeholder-visibility-1-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/input-placeholder-visibility-2-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/input-placeholder-visibility-2-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/input-placeholder-visibility-2-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/input-placeholder-visibility-3-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/input-placeholder-visibility-3-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/input-placeholder-visibility-3-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/textarea-placeholder-visibility-1-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/textarea-placeholder-visibility-1-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/textarea-placeholder-visibility-1-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/textarea-placeholder-visibility-2-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/textarea-placeholder-visibility-2-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/textarea-placeholder-visibility-2-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeMac.h
Source/WebCore/rendering/RenderThemeMac.mm