https://bugs.webkit.org/show_bug.cgi?id=85353
Reviewed by Kent Tamura.
.:
* Source/autotools/symbols.filter: Added HTMLInputElement::setEditingValue
Source/WebCore:
Test: fast/forms/editing-value.html
We need this to implement the datalist UI for <input type=email multiple>.
HTMLInputElement.value gives you the sanitized value so the whitespace between values are trimmed.
We need to append the selected suggestion to the end without modifying the rest of the text.
* WebCore.exp.in: Added HTMLInputElement::setEditingValue
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setEditingValue):
(WebCore):
* html/HTMLInputElement.h:
(HTMLInputElement):
* testing/Internals.cpp:
(WebCore::Internals::setEditingValue):
(WebCore):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:
Source/WebKit/chromium:
* public/WebInputElement.h:
(WebInputElement):
* src/WebInputElement.cpp:
(WebKit::WebInputElement::editingValue):
(WebKit):
(WebKit::WebInputElement::setEditingValue):
Source/WebKit2:
* win/WebKit2.def: Added HTMLInputElement::setEditingValue
* win/WebKit2CFLite.def: Added HTMLInputElement::setEditingValue
LayoutTests:
* fast/forms/editing-value-expected.txt: Added.
* fast/forms/editing-value.html: Added. Tests that setting the editing value takes care of the style and placeholder, and that it fires an input event.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117263
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-05-16 Keishi Hattori <keishi@webkit.org>
+
+ [chromium] Add WebKit API to access inner text value of input element
+ https://bugs.webkit.org/show_bug.cgi?id=85353
+
+ Reviewed by Kent Tamura.
+
+ * Source/autotools/symbols.filter: Added HTMLInputElement::setEditingValue
+
2012-05-15 Kihong Kwon <kihong.kwon@samsung.com>
[EFL] Enable Fullscreen API
+2012-05-16 Keishi Hattori <keishi@webkit.org>
+
+ [chromium] Add WebKit API to access inner text value of input element
+ https://bugs.webkit.org/show_bug.cgi?id=85353
+
+ Reviewed by Kent Tamura.
+
+ * fast/forms/editing-value-expected.txt: Added.
+ * fast/forms/editing-value.html: Added. Tests that setting the editing value takes care of the style and placeholder, and that it fires an input event.
+
2012-05-16 Ádám Kallai <kadam@inf.u-szeged.hu>
[Qt] Gardening. Skip failing test after 117246.
--- /dev/null
+This tests setting the editing value of an input.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS oninput event was fired.
+PASS input.value is "foo"
+PASS document.querySelector(":invalid") is input
+PASS onchange event was fired.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<input type="email" id="test" placeholder="FAIL: placeholder should disappear">
+
+<script>
+description('This tests setting the editing value of an input.');
+
+var input = document.getElementById('test');
+input.onchange = function() {
+ testPassed("onchange event was fired.");
+};
+input.oninput = function() {
+ testPassed("oninput event was fired.");
+};
+
+input.focus();
+if (window.internals) {
+ internals.setEditingValue(input, " foo ");
+} else {
+ debug('This test requires window.internals object.');
+}
+shouldBe('input.value', '"foo"');
+shouldBe('document.querySelector(":invalid")', 'input');
+input.blur();
+
+</script>
+
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
+2012-05-16 Keishi Hattori <keishi@webkit.org>
+
+ [chromium] Add WebKit API to access inner text value of input element
+ https://bugs.webkit.org/show_bug.cgi?id=85353
+
+ Reviewed by Kent Tamura.
+
+ Test: fast/forms/editing-value.html
+
+ We need this to implement the datalist UI for <input type=email multiple>.
+ HTMLInputElement.value gives you the sanitized value so the whitespace between values are trimmed.
+ We need to append the selected suggestion to the end without modifying the rest of the text.
+
+ * WebCore.exp.in: Added HTMLInputElement::setEditingValue
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::setEditingValue):
+ (WebCore):
+ * html/HTMLInputElement.h:
+ (HTMLInputElement):
+ * testing/Internals.cpp:
+ (WebCore::Internals::setEditingValue):
+ (WebCore):
+ * testing/Internals.h:
+ (Internals):
+ * testing/Internals.idl:
+
2012-05-16 Jason Liu <jason.liu@torchmobile.com.cn>
[BlackBerry] Cookies should be checked during parsing to improve performance.
__ZN7WebCore16HTMLInputElement13setAutofilledEb
__ZN7WebCore16HTMLInputElement15setValueForUserERKN3WTF6StringE
__ZN7WebCore16HTMLInputElement17setSuggestedValueERKN3WTF6StringE
+__ZN7WebCore16HTMLInputElement15setEditingValueERKN3WTF6StringE
__ZN7WebCore16IconDatabaseBase28synchronousIconURLForPageURLERKN3WTF6StringE
__ZN7WebCore16IconDatabaseBase4openERKN3WTF6StringES4_
__ZN7WebCore16LegacyWebArchive19createFromSelectionEPNS_5FrameE
updateInnerTextValue();
}
+void HTMLInputElement::setEditingValue(const String& value)
+{
+ if (!renderer() || !isTextField())
+ return;
+ setInnerTextValue(value);
+ subtreeHasChanged();
+
+ unsigned max = value.length();
+ if (focused())
+ setSelectionRange(max, max);
+ else
+ cacheSelectionInResponseToSetValue(max);
+
+ dispatchInputEvent();
+}
+
void HTMLInputElement::setValue(const String& value, TextFieldEventBehavior eventBehavior)
{
if (!m_inputType->canSetValue(value))
const String& suggestedValue() const;
void setSuggestedValue(const String&);
+ void setEditingValue(const String&);
+
double valueAsDate() const;
void setValueAsDate(double, ExceptionCode&);
inputElement->setSuggestedValue(value);
}
+void Internals::setEditingValue(Element* element, const String& value, ExceptionCode& ec)
+{
+ if (!element) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+
+ HTMLInputElement* inputElement = element->toInputElement();
+ if (!inputElement) {
+ ec = INVALID_NODE_TYPE_ERR;
+ return;
+ }
+
+ inputElement->setEditingValue(value);
+}
+
void Internals::scrollElementToRect(Element* element, long x, long y, long w, long h, ExceptionCode& ec)
{
if (!element || !element->document() || !element->document()->view()) {
bool wasLastChangeUserEdit(Element* textField, ExceptionCode&);
String suggestedValue(Element* inputElement, ExceptionCode&);
void setSuggestedValue(Element* inputElement, const String&, ExceptionCode&);
+ void setEditingValue(Element* inputElement, const String&, ExceptionCode&);
void scrollElementToRect(Element*, long x, long y, long w, long h, ExceptionCode&);
void paintControlTints(Document*, ExceptionCode&);
boolean wasLastChangeUserEdit(in Element textField) raises (DOMException);
DOMString suggestedValue(in Element inputElement) raises (DOMException);
void setSuggestedValue(in Element inputElement, in DOMString value) raises (DOMException);
+ void setEditingValue(in Element inputElement, in DOMString value) raises (DOMException);
void paintControlTints(in Document document) raises (DOMException);
+2012-05-16 Keishi Hattori <keishi@webkit.org>
+
+ [chromium] Add WebKit API to access inner text value of input element
+ https://bugs.webkit.org/show_bug.cgi?id=85353
+
+ Reviewed by Kent Tamura.
+
+ * public/WebInputElement.h:
+ (WebInputElement):
+ * src/WebInputElement.cpp:
+ (WebKit::WebInputElement::editingValue):
+ (WebKit):
+ (WebKit::WebInputElement::setEditingValue):
+
2012-05-16 Hans Wennborg <hans@chromium.org>
Speech JavaScript API: pass WebSecurityOrigin to embedder
WEBKIT_EXPORT int size() const;
WEBKIT_EXPORT void setValue(const WebString&, bool sendChangeEvent = false);
WEBKIT_EXPORT WebString value() const;
+ // This returns the non-sanitized, exact value inside the text field.
+ WEBKIT_EXPORT WebString editingValue() const;
+ // Sets the value inside the text field without being sanitized.
+ // Can't be used if a renderer doesn't exist or on a non text field type.
+ // Caret will be moved to the end.
+ WEBKIT_EXPORT void setEditingValue(const WebString&);
WEBKIT_EXPORT void setSuggestedValue(const WebString&);
WEBKIT_EXPORT WebString suggestedValue() const;
WEBKIT_EXPORT void setPlaceholder(const WebString&);
return constUnwrap<HTMLInputElement>()->value();
}
+WebString WebInputElement::editingValue() const
+{
+ return constUnwrap<HTMLInputElement>()->innerTextValue();
+}
+
+void WebInputElement::setEditingValue(const WebString& value)
+{
+ unwrap<HTMLInputElement>()->setEditingValue(value);
+}
+
void WebInputElement::setSuggestedValue(const WebString& value)
{
unwrap<HTMLInputElement>()->setSuggestedValue(value);
+2012-05-16 Keishi Hattori <keishi@webkit.org>
+
+ [chromium] Add WebKit API to access inner text value of input element
+ https://bugs.webkit.org/show_bug.cgi?id=85353
+
+ Reviewed by Kent Tamura.
+
+ * win/WebKit2.def: Added HTMLInputElement::setEditingValue
+ * win/WebKit2CFLite.def: Added HTMLInputElement::setEditingValue
+
2012-05-16 Zalan Bujtas <zbujtas@gmail.com>
[Qt][WK2] Move WebFrameNetworkingContext to WebKit namespace.
?setSerifFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
?setStandardFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
?setSuggestedValue@HTMLInputElement@WebCore@@QAEXABVString@WTF@@@Z
+ ?setEditingValue@HTMLInputElement@WebCore@@QAEXABVString@WTF@@@Z
?settings@Document@WebCore@@QBEPAVSettings@2@XZ
?settings@Frame@WebCore@@QBEPAVSettings@2@XZ
?setFixedElementsLayoutRelativeToFrame@Settings@WebCore@@QAEX_N@Z
?setSerifFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
?setStandardFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
?setSuggestedValue@HTMLInputElement@WebCore@@QAEXABVString@WTF@@@Z
+ ?setEditingValue@HTMLInputElement@WebCore@@QAEXABVString@WTF@@@Z
?settings@Document@WebCore@@QBEPAVSettings@2@XZ
?settings@Frame@WebCore@@QBEPAVSettings@2@XZ
?setFixedElementsLayoutRelativeToFrame@Settings@WebCore@@QAEX_N@Z
_ZN7WebCore14ClientRectListD1Ev;
_ZN7WebCore15setDOMExceptionEPN3JSC9ExecStateEi;
_ZN7WebCore16HTMLInputElement17setSuggestedValueERKN3WTF6StringE;
+_ZN7WebCore16HTMLInputElement15setEditingValueERKN3WTF6StringE;
_ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_10StringHashENS3_10HashTraitsIS6_EENSB_IS9_EEEES6_;
_ZN7WebCore16scriptNameToCodeERKN3WTF6StringE;
_ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9ClassInfoE;