Title: [114877] trunk
Revision
114877
Author
tk...@chromium.org
Date
2012-04-23 01:00:08 -0700 (Mon, 23 Apr 2012)

Log Message

Add test function to get placeholder string
https://bugs.webkit.org/show_bug.cgi?id=84536

Reviewed by Ryosuke Niwa.

.:

* Source/autotools/symbols.filter:
Expose Node::textContent and HTMLTextFormControlElement::placeholderShouldBeVisible.

Source/WebCore:

Add window.internals.visiblePlaceholder(element), which returns a
placeholder string only when it's visible.

* WebCore.exp.in: Expose HTMLTextFormControlElement::placeholderShouldBeVisible().
* testing/Internals.cpp:
(WebCore::Internals::visiblePlaceholder): Added.
(WebCore::Internals::selectColorInColorChooser): Omit HTMLNames::.
* testing/Internals.h:
(Internals): Add visiblePlaceholder().
* testing/Internals.idl: ditto.

Source/WebKit2:

* win/WebKit2.def: Expose HTMLNames::inputTag,
HTMLTextFormControlElement::placeholderShouldBeVisible(), and
Node::textContent.
* win/WebKit2CFLite.def: ditto.

LayoutTests:

Make placeholder-stripped.html a dumpAsText test.

* fast/forms/placeholder-stripped-expected.html: Removed.
* fast/forms/placeholder-stripped-expected.txt: Added.
* fast/forms/placeholder-stripped.html:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/ChangeLog (114876 => 114877)


--- trunk/ChangeLog	2012-04-23 07:47:39 UTC (rev 114876)
+++ trunk/ChangeLog	2012-04-23 08:00:08 UTC (rev 114877)
@@ -1,3 +1,13 @@
+2012-04-23  Kent Tamura  <tk...@chromium.org>
+
+        Add test function to get placeholder string
+        https://bugs.webkit.org/show_bug.cgi?id=84536
+
+        Reviewed by Ryosuke Niwa.
+
+        * Source/autotools/symbols.filter:
+        Expose Node::textContent and HTMLTextFormControlElement::placeholderShouldBeVisible.
+
 2012-04-22  Sriram Neelakandan  <sriram.neelakan...@gmail.com>
 
         [Gtk] Added MOZ_X11 build flag for TARGET_X11

Modified: trunk/LayoutTests/ChangeLog (114876 => 114877)


--- trunk/LayoutTests/ChangeLog	2012-04-23 07:47:39 UTC (rev 114876)
+++ trunk/LayoutTests/ChangeLog	2012-04-23 08:00:08 UTC (rev 114877)
@@ -1,3 +1,16 @@
+2012-04-23  Kent Tamura  <tk...@chromium.org>
+
+        Add test function to get placeholder string
+        https://bugs.webkit.org/show_bug.cgi?id=84536
+
+        Reviewed by Ryosuke Niwa.
+
+        Make placeholder-stripped.html a dumpAsText test.
+
+        * fast/forms/placeholder-stripped-expected.html: Removed.
+        * fast/forms/placeholder-stripped-expected.txt: Added.
+        * fast/forms/placeholder-stripped.html:
+
 2012-04-23  Szilard Ledan  <szle...@inf.u-szeged.hu>
 
         Added a test for css surrogate pairs parser

Deleted: trunk/LayoutTests/fast/forms/placeholder-stripped-expected.html (114876 => 114877)


--- trunk/LayoutTests/fast/forms/placeholder-stripped-expected.html	2012-04-23 07:47:39 UTC (rev 114876)
+++ trunk/LayoutTests/fast/forms/placeholder-stripped-expected.html	2012-04-23 08:00:08 UTC (rev 114877)
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<p>CR and LF in placeholder values should be stripped. The first input element and the first textarea element should have a placeholder "first line second line", and the second input element and the second textarea element should have nothing.</p>
-
-<input placeholder="first line second line"><br>
-<input><br>
-<textarea placeholder="first line second line"></textarea><br>
-<textarea></textarea>
-</body>
-</html>

Added: trunk/LayoutTests/fast/forms/placeholder-stripped-expected.txt (0 => 114877)


--- trunk/LayoutTests/fast/forms/placeholder-stripped-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/placeholder-stripped-expected.txt	2012-04-23 08:00:08 UTC (rev 114877)
@@ -0,0 +1,13 @@
+CR and LF in placeholder values should be stripped.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS internals.visiblePlaceholder(input0) is "first line second line"
+PASS internals.visiblePlaceholder(input1) is ""
+PASS internals.visiblePlaceholder(textarea0) is "first line second line"
+PASS internals.visiblePlaceholder(textarea1) is ""
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/LayoutTests/fast/forms/placeholder-stripped.html (114876 => 114877)


--- trunk/LayoutTests/fast/forms/placeholder-stripped.html	2012-04-23 07:47:39 UTC (rev 114876)
+++ trunk/LayoutTests/fast/forms/placeholder-stripped.html	2012-04-23 08:00:08 UTC (rev 114877)
@@ -1,11 +1,30 @@
 <!DOCTYPE html>
 <html>
 <body>
-<p>CR and LF in placeholder values should be stripped. The first input element and the first textarea element should have a placeholder "first line second line", and the second input element and the second textarea element should have nothing.</p>
-
+<div id=container>
 <input placeholder="first line &#13;&#10;second line"><br>
 <input placeholder="&#13;"><br>
 <textarea placeholder="first line &#10;second line"></textarea><br>
 <textarea placeholder="&#10;"></textarea>
+</div>
+<script src=""
+<script>
+description('CR and LF in placeholder values should be stripped.');
+
+if (window.internals) {
+    var input0 = document.getElementsByTagName('input')[0];
+    var input1 = document.getElementsByTagName('input')[1];
+    var textarea0 = document.getElementsByTagName('textarea')[0];
+    var textarea1 = document.getElementsByTagName('textarea')[1];
+    shouldBeEqualToString('internals.visiblePlaceholder(input0)', 'first line second line');
+    shouldBeEqualToString('internals.visiblePlaceholder(input1)', '');
+    shouldBeEqualToString('internals.visiblePlaceholder(textarea0)', 'first line second line');
+    shouldBeEqualToString('internals.visiblePlaceholder(textarea1)', '');
+
+    document.body.removeChild(document.getElementById('container'));
+} else
+    debug('The first input element and the first textarea element should have a placeholder "first line second line", and the second input element and the second textarea element should have nothing.');
+</script>
+<script src=""
 </body>
 </html>

Modified: trunk/Source/WebCore/ChangeLog (114876 => 114877)


--- trunk/Source/WebCore/ChangeLog	2012-04-23 07:47:39 UTC (rev 114876)
+++ trunk/Source/WebCore/ChangeLog	2012-04-23 08:00:08 UTC (rev 114877)
@@ -1,3 +1,21 @@
+2012-04-23  Kent Tamura  <tk...@chromium.org>
+
+        Add test function to get placeholder string
+        https://bugs.webkit.org/show_bug.cgi?id=84536
+
+        Reviewed by Ryosuke Niwa.
+
+        Add window.internals.visiblePlaceholder(element), which returns a
+        placeholder string only when it's visible.
+
+        * WebCore.exp.in: Expose HTMLTextFormControlElement::placeholderShouldBeVisible().
+        * testing/Internals.cpp:
+        (WebCore::Internals::visiblePlaceholder): Added.
+        (WebCore::Internals::selectColorInColorChooser): Omit HTMLNames::.
+        * testing/Internals.h:
+        (Internals): Add visiblePlaceholder().
+        * testing/Internals.idl: ditto.
+
 2012-04-23  Szilard Ledan  <szle...@inf.u-szeged.hu>
 
         Incorrect handling of CSS escape sequences that encode surrogates

Modified: trunk/Source/WebCore/WebCore.exp.in (114876 => 114877)


--- trunk/Source/WebCore/WebCore.exp.in	2012-04-23 07:47:39 UTC (rev 114876)
+++ trunk/Source/WebCore/WebCore.exp.in	2012-04-23 08:00:08 UTC (rev 114877)
@@ -1377,6 +1377,7 @@
 __ZNK7WebCore23FrameLoaderStateMachine15firstLayoutDoneEv
 __ZNK7WebCore23FrameLoaderStateMachine23committingFirstRealLoadEv
 __ZNK7WebCore26HTMLTextFormControlElement21lastChangeWasUserEditEv
+__ZNK7WebCore26HTMLTextFormControlElement26placeholderShouldBeVisibleEv
 __ZNK7WebCore26NetscapePlugInStreamLoader6isDoneEv
 __ZNK7WebCore27AuthenticationChallengeBase15failureResponseEv
 __ZNK7WebCore27AuthenticationChallengeBase15protectionSpaceEv
@@ -1408,6 +1409,7 @@
 #endif
 __ZNK7WebCore4KURL8protocolEv
 __ZNK7WebCore4KURLcvP5NSURLEv
+__ZNK7WebCore4Node11textContentEb
 __ZNK7WebCore4Node14isDescendantOfEPKS0_
 __ZNK7WebCore4Node18getSubresourceURLsERN3WTF11ListHashSetINS_4KURLELm256ENS_8KURLHashEEE
 __ZNK7WebCore4Node20traversePreviousNodeEPKS0_

Modified: trunk/Source/WebCore/testing/Internals.cpp (114876 => 114877)


--- trunk/Source/WebCore/testing/Internals.cpp	2012-04-23 07:47:39 UTC (rev 114876)
+++ trunk/Source/WebCore/testing/Internals.cpp	2012-04-23 08:00:08 UTC (rev 114877)
@@ -87,6 +87,8 @@
 
 namespace WebCore {
 
+using namespace HTMLNames;
+
 static bool markerTypesFrom(const String& markerType, DocumentMarker::MarkerTypes& result)
 {
     if (markerType.isEmpty() || equalIgnoringCase(markerType, "all"))
@@ -388,10 +390,18 @@
     return element->shadowPseudoId().string();
 }
 
+String Internals::visiblePlaceholder(Element* element)
+{
+    HTMLTextFormControlElement* textControl = toTextFormControl(element);
+    if (textControl && textControl->placeholderShouldBeVisible())
+        return textControl->placeholderElement()->textContent();
+    return String();
+}
+
 #if ENABLE(INPUT_TYPE_COLOR)
 void Internals::selectColorInColorChooser(Element* element, const String& colorValue)
 {
-    if (!element->hasTagName(HTMLNames::inputTag))
+    if (!element->hasTagName(inputTag))
         return;
     HTMLInputElement* inputElement = element->toInputElement();
     if (!inputElement)

Modified: trunk/Source/WebCore/testing/Internals.h (114876 => 114877)


--- trunk/Source/WebCore/testing/Internals.h	2012-04-23 07:47:39 UTC (rev 114876)
+++ trunk/Source/WebCore/testing/Internals.h	2012-04-23 08:00:08 UTC (rev 114877)
@@ -92,6 +92,7 @@
     Node* nextNodeByWalker(Node*, ExceptionCode&);
     Node* previousNodeByWalker(Node*, ExceptionCode&);
 
+    String visiblePlaceholder(Element*);
 #if ENABLE(INPUT_TYPE_COLOR)
     void selectColorInColorChooser(Element*, const String& colorValue);
 #endif

Modified: trunk/Source/WebCore/testing/Internals.idl (114876 => 114877)


--- trunk/Source/WebCore/testing/Internals.idl	2012-04-23 07:47:39 UTC (rev 114876)
+++ trunk/Source/WebCore/testing/Internals.idl	2012-04-23 08:00:08 UTC (rev 114877)
@@ -64,6 +64,7 @@
 
         boolean attached(in Node node) raises(DOMException);
 
+        DOMString visiblePlaceholder(in Element element);
 #if defined(ENABLE_INPUT_TYPE_COLOR) && ENABLE_INPUT_TYPE_COLOR
         void selectColorInColorChooser(in Element element, in DOMString colorValue);
 #endif

Modified: trunk/Source/WebKit2/ChangeLog (114876 => 114877)


--- trunk/Source/WebKit2/ChangeLog	2012-04-23 07:47:39 UTC (rev 114876)
+++ trunk/Source/WebKit2/ChangeLog	2012-04-23 08:00:08 UTC (rev 114877)
@@ -1,3 +1,15 @@
+2012-04-23  Kent Tamura  <tk...@chromium.org>
+
+        Add test function to get placeholder string
+        https://bugs.webkit.org/show_bug.cgi?id=84536
+
+        Reviewed by Ryosuke Niwa.
+
+        * win/WebKit2.def: Expose HTMLNames::inputTag,
+        HTMLTextFormControlElement::placeholderShouldBeVisible(), and
+        Node::textContent.
+        * win/WebKit2CFLite.def: ditto.
+
 2012-04-22  Sriram Neelakandan  <sriram.neelakan...@gmail.com>
 
         [Gtk] Added MOZ_X11 build flag for TARGET_X11

Modified: trunk/Source/WebKit2/win/WebKit2.def (114876 => 114877)


--- trunk/Source/WebKit2/win/WebKit2.def	2012-04-23 07:47:39 UTC (rev 114876)
+++ trunk/Source/WebKit2/win/WebKit2.def	2012-04-23 08:00:08 UTC (rev 114877)
@@ -176,6 +176,7 @@
         ?getHighlight@InspectorController@WebCore@@QBEXPAUHighlight@2@@Z
         ?getLocationAndLengthFromRange@TextIterator@WebCore@@SA_NPAVElement@2@PBVRange@2@AAI2@Z
         ?hasShadowRoot@Element@WebCore@@QBE_NXZ
+        ?inputTag@HTMLNames@WebCore@@3VQualifiedName@2@B
         ?instrumentingAgentsForPage@InspectorInstrumentation@WebCore@@CAPAVInstrumentingAgents@2@PAVPage@2@@Z
         ?isCSSExclusionsEnabled@RuntimeEnabledFeatures@WebCore@@0_NA
         ?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z
@@ -195,6 +196,7 @@
         ?numberOfScopedHTMLStyleChildren@Node@WebCore@@QBEIXZ
         ?page@Document@WebCore@@QBEPAVPage@2@XZ
         ?paintControlTints@FrameView@WebCore@@AAEXXZ
+        ?placeholderShouldBeVisible@HTMLTextFormControlElement@WebCore@@QBE_NXZ
         ?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PAVElement@2@HH_N@Z
         ?removeAllShadowRoots@ShadowTree@WebCore@@QAEXXZ
         ?remove@String@WTF@@QAEXIH@Z
@@ -228,6 +230,7 @@
         ?substring@String@WTF@@QBE?AV12@II@Z
         ?suggestedValue@HTMLInputElement@WebCore@@QBEABVString@WTF@@XZ
         ?text@Range@WebCore@@QBE?AVString@WTF@@XZ
+        ?textContent@Node@WebCore@@QBE?AVString@WTF@@_N@Z
         ?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z
         ?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@Z
         ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVClientRect@1@@Z

Modified: trunk/Source/WebKit2/win/WebKit2CFLite.def (114876 => 114877)


--- trunk/Source/WebKit2/win/WebKit2CFLite.def	2012-04-23 07:47:39 UTC (rev 114876)
+++ trunk/Source/WebKit2/win/WebKit2CFLite.def	2012-04-23 08:00:08 UTC (rev 114877)
@@ -169,6 +169,7 @@
         ?getHighlight@InspectorController@WebCore@@QBEXPAUHighlight@2@@Z
         ?getLocationAndLengthFromRange@TextIterator@WebCore@@SA_NPAVElement@2@PBVRange@2@AAI2@Z
         ?hasShadowRoot@Element@WebCore@@QBE_NXZ
+        ?inputTag@HTMLNames@WebCore@@3VQualifiedName@2@B
         ?instrumentingAgentsForPage@InspectorInstrumentation@WebCore@@CAPAVInstrumentingAgents@2@PAVPage@2@@Z
         ?isCSSExclusionsEnabled@RuntimeEnabledFeatures@WebCore@@0_NA
         ?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z
@@ -188,6 +189,7 @@
         ?numberOfScopedHTMLStyleChildren@Node@WebCore@@QBEIXZ
         ?page@Document@WebCore@@QBEPAVPage@2@XZ
         ?paintControlTints@FrameView@WebCore@@AAEXXZ
+        ?placeholderShouldBeVisible@HTMLTextFormControlElement@WebCore@@QBE_NXZ
         ?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PAVElement@2@HH_N@Z
         ?removeAllShadowRoots@ShadowTree@WebCore@@QAEXXZ
         ?remove@String@WTF@@QAEXIH@Z
@@ -221,6 +223,7 @@
         ?substring@String@WTF@@QBE?AV12@II@Z
         ?suggestedValue@HTMLInputElement@WebCore@@QBEABVString@WTF@@XZ
         ?text@Range@WebCore@@QBE?AVString@WTF@@XZ
+        ?textContent@Node@WebCore@@QBE?AVString@WTF@@_N@Z
         ?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z
         ?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@Z
         ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVClientRect@1@@Z

Modified: trunk/Source/autotools/symbols.filter (114876 => 114877)


--- trunk/Source/autotools/symbols.filter	2012-04-23 07:47:39 UTC (rev 114876)
+++ trunk/Source/autotools/symbols.filter	2012-04-23 08:00:08 UTC (rev 114877)
@@ -85,6 +85,7 @@
 _ZN7WebCore9JSElement10putVirtualEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
 _ZN7WebCore9JSElement6s_infoE;
 _ZN7WebCore9toElementEN3JSC7JSValueE;
+_ZNK7WebCore4Node11textContentEb;
 _ZNK7WebCore4Node31numberOfScopedHTMLStyleChildrenEv;
 _ZNK7WebCore4Node9treeScopeEv;
 _ZNK7WebCore12RenderObject23absoluteBoundingBoxRectEb;
@@ -92,6 +93,7 @@
 _ZNK7WebCore17JSDOMGlobalObject22scriptExecutionContextEv;
 _ZNK7WebCore20CachedResourceLoader11isPreloadedERKN3WTF6StringE;
 _ZNK7WebCore26HTMLTextFormControlElement21lastChangeWasUserEditEv;
+_ZNK7WebCore26HTMLTextFormControlElement26placeholderShouldBeVisibleEv;
 _ZNK7WebCore5Frame8settingsEv;
 _ZNK7WebCore6JSNode21pushEventHandlerScopeEPN3JSC9ExecStateEPNS1_14ScopeChainNodeE;
 _ZNK7WebCore7Element10shadowTreeEv;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to