Title: [243804] trunk
Revision
243804
Author
[email protected]
Date
2019-04-03 09:40:16 -0700 (Wed, 03 Apr 2019)

Log Message

Get rid of HTMLInputElement::setEditingValue
https://bugs.webkit.org/show_bug.cgi?id=196402

Reviewed by Darin Adler.

Source/WebCore:

HTMLInputElement::setEditingValue is only used for Epiphany password autofill. We did it
this way because that's what Chrome uses for autofill, but Apple uses
HTMLInputElement::setValueForUser. Let's switch to that instead, then we can get rid of
setEditingValue.

This fixes logging into ting.com after username and password are autofilled by Epiphany.
Before this change, the login would fail unless you first manually edit either the username
or the password field.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setEditingValue): Deleted.
* html/HTMLInputElement.h:
* testing/Internals.cpp:
(WebCore::Internals::setEditingValue): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_html_input_element_set_editing_value):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
(webkit_dom_html_input_element_set_editing_value):

LayoutTests:

* fast/forms/editing-value-expected.txt: Removed.
* fast/forms/editing-value-null-renderer-expected.txt: Removed.
* fast/forms/editing-value-null-renderer.html: Removed.
* fast/forms/editing-value.html: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (243803 => 243804)


--- trunk/LayoutTests/ChangeLog	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/LayoutTests/ChangeLog	2019-04-03 16:40:16 UTC (rev 243804)
@@ -1,3 +1,15 @@
+2019-04-03  Michael Catanzaro  <[email protected]>
+
+        Get rid of HTMLInputElement::setEditingValue
+        https://bugs.webkit.org/show_bug.cgi?id=196402
+
+        Reviewed by Darin Adler.
+
+        * fast/forms/editing-value-expected.txt: Removed.
+        * fast/forms/editing-value-null-renderer-expected.txt: Removed.
+        * fast/forms/editing-value-null-renderer.html: Removed.
+        * fast/forms/editing-value.html: Removed.
+
 2019-04-03  Shawn Roberts  <[email protected]>
 
         The following layout tests are flaky failures

Deleted: trunk/LayoutTests/fast/forms/editing-value-expected.txt (243803 => 243804)


--- trunk/LayoutTests/fast/forms/editing-value-expected.txt	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/LayoutTests/fast/forms/editing-value-expected.txt	2019-04-03 16:40:16 UTC (rev 243804)
@@ -1,13 +0,0 @@
-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
-

Deleted: trunk/LayoutTests/fast/forms/editing-value-null-renderer-expected.txt (243803 => 243804)


--- trunk/LayoutTests/fast/forms/editing-value-null-renderer-expected.txt	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/LayoutTests/fast/forms/editing-value-null-renderer-expected.txt	2019-04-03 16:40:16 UTC (rev 243804)
@@ -1,12 +0,0 @@
-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 successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/fast/forms/editing-value-null-renderer.html (243803 => 243804)


--- trunk/LayoutTests/fast/forms/editing-value-null-renderer.html	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/LayoutTests/fast/forms/editing-value-null-renderer.html	2019-04-03 16:40:16 UTC (rev 243804)
@@ -1,37 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src=""
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<input type="email" id="test" placeholder="FAIL: placeholder should disappear" style="display: none">
-
-<script>
-description('This tests setting the editing value of an input.');
-
-var input = document.getElementById('test');
-input._onchange_ = function() {
-    testFailed("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=""
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/forms/editing-value.html (243803 => 243804)


--- trunk/LayoutTests/fast/forms/editing-value.html	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/LayoutTests/fast/forms/editing-value.html	2019-04-03 16:40:16 UTC (rev 243804)
@@ -1,37 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src=""
-</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=""
-</body>
-</html>

Modified: trunk/Source/WebCore/ChangeLog (243803 => 243804)


--- trunk/Source/WebCore/ChangeLog	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/Source/WebCore/ChangeLog	2019-04-03 16:40:16 UTC (rev 243804)
@@ -1,3 +1,27 @@
+2019-04-03  Michael Catanzaro  <[email protected]>
+
+        Get rid of HTMLInputElement::setEditingValue
+        https://bugs.webkit.org/show_bug.cgi?id=196402
+
+        Reviewed by Darin Adler.
+
+        HTMLInputElement::setEditingValue is only used for Epiphany password autofill. We did it
+        this way because that's what Chrome uses for autofill, but Apple uses
+        HTMLInputElement::setValueForUser. Let's switch to that instead, then we can get rid of
+        setEditingValue.
+
+        This fixes logging into ting.com after username and password are autofilled by Epiphany.
+        Before this change, the login would fail unless you first manually edit either the username
+        or the password field.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setEditingValue): Deleted.
+        * html/HTMLInputElement.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::setEditingValue): Deleted.
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2019-04-03  Pablo Saavedra  <[email protected]>
 
         Missing includes that were previously provided via UnifiedSources

Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (243803 => 243804)


--- trunk/Source/WebCore/html/HTMLInputElement.cpp	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp	2019-04-03 16:40:16 UTC (rev 243804)
@@ -1034,23 +1034,6 @@
     setValue(value, DispatchChangeEvent);
 }
 
-void HTMLInputElement::setEditingValue(const String& value)
-{
-    if (!isTextField())
-        return;
-
-    setInnerTextValue(value);
-    subtreeHasChanged();
-
-    unsigned max = value.length();
-    if (focused())
-        setSelectionRange(max, max);
-    else
-        cacheSelectionInResponseToSetValue(max);
-
-    dispatchInputEvent();
-}
-
 ExceptionOr<void> HTMLInputElement::setValue(const String& value, TextFieldEventBehavior eventBehavior)
 {
     if (isFileUpload() && !value.isEmpty())

Modified: trunk/Source/WebCore/html/HTMLInputElement.h (243803 => 243804)


--- trunk/Source/WebCore/html/HTMLInputElement.h	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/Source/WebCore/html/HTMLInputElement.h	2019-04-03 16:40:16 UTC (rev 243804)
@@ -185,8 +185,6 @@
     // The value which is drawn by a renderer.
     String visibleValue() const;
 
-    WEBCORE_EXPORT void setEditingValue(const String&);
-
     WEBCORE_EXPORT double valueAsDate() const;
     WEBCORE_EXPORT ExceptionOr<void> setValueAsDate(double);
 

Modified: trunk/Source/WebCore/testing/Internals.cpp (243803 => 243804)


--- trunk/Source/WebCore/testing/Internals.cpp	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/Source/WebCore/testing/Internals.cpp	2019-04-03 16:40:16 UTC (rev 243804)
@@ -1814,11 +1814,6 @@
     return element.shouldAutocomplete();
 }
 
-void Internals::setEditingValue(HTMLInputElement& element, const String& value)
-{
-    element.setEditingValue(value);
-}
-
 void Internals::setAutofilled(HTMLInputElement& element, bool enabled)
 {
     element.setAutoFilled(enabled);

Modified: trunk/Source/WebCore/testing/Internals.h (243803 => 243804)


--- trunk/Source/WebCore/testing/Internals.h	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/Source/WebCore/testing/Internals.h	2019-04-03 16:40:16 UTC (rev 243804)
@@ -255,7 +255,6 @@
 
     ExceptionOr<bool> wasLastChangeUserEdit(Element& textField);
     bool elementShouldAutoComplete(HTMLInputElement&);
-    void setEditingValue(HTMLInputElement&, const String&);
     void setAutofilled(HTMLInputElement&, bool enabled);
     enum class AutoFillButtonType { None, Contacts, Credentials, StrongPassword, CreditCard };
     void setShowAutoFillButton(HTMLInputElement&, AutoFillButtonType);

Modified: trunk/Source/WebCore/testing/Internals.idl (243803 => 243804)


--- trunk/Source/WebCore/testing/Internals.idl	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/Source/WebCore/testing/Internals.idl	2019-04-03 16:40:16 UTC (rev 243804)
@@ -274,7 +274,6 @@
 
     [MayThrowException] boolean wasLastChangeUserEdit(Element textField);
     boolean elementShouldAutoComplete(HTMLInputElement inputElement);
-    void setEditingValue(HTMLInputElement inputElement, DOMString value);
     void setAutofilled(HTMLInputElement inputElement, boolean enabled);
     void setShowAutoFillButton(HTMLInputElement inputElement, AutoFillButtonType autoFillButtonType);
     AutoFillButtonType autoFillButtonType(HTMLInputElement inputElement);

Modified: trunk/Source/WebKit/ChangeLog (243803 => 243804)


--- trunk/Source/WebKit/ChangeLog	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/Source/WebKit/ChangeLog	2019-04-03 16:40:16 UTC (rev 243804)
@@ -1,3 +1,15 @@
+2019-04-03  Michael Catanzaro  <[email protected]>
+
+        Get rid of HTMLInputElement::setEditingValue
+        https://bugs.webkit.org/show_bug.cgi?id=196402
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp:
+        (webkit_dom_element_html_input_element_set_editing_value):
+        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
+        (webkit_dom_html_input_element_set_editing_value):
+
 2019-04-03  Wenson Hsieh  <[email protected]>
 
         Add a WebKit internal feature flag to always enable modern compatibility mode by default

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp (243803 => 243804)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp	2019-04-03 16:40:16 UTC (rev 243804)
@@ -148,7 +148,9 @@
  * @element: a #WebKitDOMElement
  * @value: the text to set
  *
- * Set editing value of an HTML input element. If @element is not an HTML input element this function does nothing.
+ * Set the value of an HTML input element as if it had been edited by
+ * the user, triggering a change event. If @element is not an HTML input
+ * element this function does nothing.
  *
  * Since: 2.22
  */
@@ -160,5 +162,5 @@
     if (!is<WebCore::HTMLInputElement>(node))
         return;
 
-    downcast<WebCore::HTMLInputElement>(*node).setEditingValue(String::fromUTF8(value));
+    downcast<WebCore::HTMLInputElement>(*node).setValueForUser(String::fromUTF8(value));
 }

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp (243803 => 243804)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp	2019-04-03 16:39:58 UTC (rev 243803)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp	2019-04-03 16:40:16 UTC (rev 243804)
@@ -1007,6 +1007,6 @@
   g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self));
   g_return_if_fail(value);
 
-  WebKit::core(self)->setEditingValue(WTF::String::fromUTF8(value));
+  WebKit::core(self)->setValueForUser(WTF::String::fromUTF8(value));
 }
 G_GNUC_END_IGNORE_DEPRECATIONS;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to