⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243804 in webkit


Ignore:
Timestamp:
Apr 3, 2019, 9:40:16 AM (7 years ago)
Author:
Michael Catanzaro
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.
Location:
trunk
Files:
4 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243802 r243804  
     12019-04-03  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        Get rid of HTMLInputElement::setEditingValue
     4        https://bugs.webkit.org/show_bug.cgi?id=196402
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/forms/editing-value-expected.txt: Removed.
     9        * fast/forms/editing-value-null-renderer-expected.txt: Removed.
     10        * fast/forms/editing-value-null-renderer.html: Removed.
     11        * fast/forms/editing-value.html: Removed.
     12
    1132019-04-03  Shawn Roberts  <sroberts@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r243799 r243804  
     12019-04-03  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        Get rid of HTMLInputElement::setEditingValue
     4        https://bugs.webkit.org/show_bug.cgi?id=196402
     5
     6        Reviewed by Darin Adler.
     7
     8        HTMLInputElement::setEditingValue is only used for Epiphany password autofill. We did it
     9        this way because that's what Chrome uses for autofill, but Apple uses
     10        HTMLInputElement::setValueForUser. Let's switch to that instead, then we can get rid of
     11        setEditingValue.
     12
     13        This fixes logging into ting.com after username and password are autofilled by Epiphany.
     14        Before this change, the login would fail unless you first manually edit either the username
     15        or the password field.
     16
     17        * html/HTMLInputElement.cpp:
     18        (WebCore::HTMLInputElement::setEditingValue): Deleted.
     19        * html/HTMLInputElement.h:
     20        * testing/Internals.cpp:
     21        (WebCore::Internals::setEditingValue): Deleted.
     22        * testing/Internals.h:
     23        * testing/Internals.idl:
     24
    1252019-04-03  Pablo Saavedra  <psaavedra@igalia.com>
    226
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r243647 r243804  
    10351035}
    10361036
    1037 void HTMLInputElement::setEditingValue(const String& value)
    1038 {
    1039     if (!isTextField())
    1040         return;
    1041 
    1042     setInnerTextValue(value);
    1043     subtreeHasChanged();
    1044 
    1045     unsigned max = value.length();
    1046     if (focused())
    1047         setSelectionRange(max, max);
    1048     else
    1049         cacheSelectionInResponseToSetValue(max);
    1050 
    1051     dispatchInputEvent();
    1052 }
    1053 
    10541037ExceptionOr<void> HTMLInputElement::setValue(const String& value, TextFieldEventBehavior eventBehavior)
    10551038{
  • trunk/Source/WebCore/html/HTMLInputElement.h

    r240452 r243804  
    186186    String visibleValue() const;
    187187
    188     WEBCORE_EXPORT void setEditingValue(const String&);
    189 
    190188    WEBCORE_EXPORT double valueAsDate() const;
    191189    WEBCORE_EXPORT ExceptionOr<void> setValueAsDate(double);
  • trunk/Source/WebCore/testing/Internals.cpp

    r243674 r243804  
    18151815}
    18161816
    1817 void Internals::setEditingValue(HTMLInputElement& element, const String& value)
    1818 {
    1819     element.setEditingValue(value);
    1820 }
    1821 
    18221817void Internals::setAutofilled(HTMLInputElement& element, bool enabled)
    18231818{
  • trunk/Source/WebCore/testing/Internals.h

    r243674 r243804  
    256256    ExceptionOr<bool> wasLastChangeUserEdit(Element& textField);
    257257    bool elementShouldAutoComplete(HTMLInputElement&);
    258     void setEditingValue(HTMLInputElement&, const String&);
    259258    void setAutofilled(HTMLInputElement&, bool enabled);
    260259    enum class AutoFillButtonType { None, Contacts, Credentials, StrongPassword, CreditCard };
  • trunk/Source/WebCore/testing/Internals.idl

    r243674 r243804  
    275275    [MayThrowException] boolean wasLastChangeUserEdit(Element textField);
    276276    boolean elementShouldAutoComplete(HTMLInputElement inputElement);
    277     void setEditingValue(HTMLInputElement inputElement, DOMString value);
    278277    void setAutofilled(HTMLInputElement inputElement, boolean enabled);
    279278    void setShowAutoFillButton(HTMLInputElement inputElement, AutoFillButtonType autoFillButtonType);
  • trunk/Source/WebKit/ChangeLog

    r243800 r243804  
     12019-04-03  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        Get rid of HTMLInputElement::setEditingValue
     4        https://bugs.webkit.org/show_bug.cgi?id=196402
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp:
     9        (webkit_dom_element_html_input_element_set_editing_value):
     10        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
     11        (webkit_dom_html_input_element_set_editing_value):
     12
    1132019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
    214
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp

    r229973 r243804  
    149149 * @value: the text to set
    150150 *
    151  * Set editing value of an HTML input element. If @element is not an HTML input element this function does nothing.
     151 * Set the value of an HTML input element as if it had been edited by
     152 * the user, triggering a change event. If @element is not an HTML input
     153 * element this function does nothing.
    152154 *
    153155 * Since: 2.22
     
    161163        return;
    162164
    163     downcast<WebCore::HTMLInputElement>(*node).setEditingValue(String::fromUTF8(value));
     165    downcast<WebCore::HTMLInputElement>(*node).setValueForUser(String::fromUTF8(value));
    164166}
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp

    r234586 r243804  
    10081008  g_return_if_fail(value);
    10091009
    1010   WebKit::core(self)->setEditingValue(WTF::String::fromUTF8(value));
     1010  WebKit::core(self)->setValueForUser(WTF::String::fromUTF8(value));
    10111011}
    10121012G_GNUC_END_IGNORE_DEPRECATIONS;
Note: See TracChangeset for help on using the changeset viewer.