Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b52f2b8abac2656e9e7e1c3ca3748e4f4650bded
      
https://github.com/WebKit/WebKit/commit/b52f2b8abac2656e9e7e1c3ca3748e4f4650bded
  Author: Aditya Keerthi <[email protected]>
  Date:   2024-04-01 (Mon, 01 Apr 2024)

  Changed paths:
    A 
LayoutTests/fast/forms/email-input-type-value-and-multiple-attributes-set-expected.html
    A 
LayoutTests/fast/forms/email-input-type-value-and-multiple-attributes-set.html
    M Source/WebCore/html/EmailInputType.cpp

  Log Message:
  -----------
  REGRESSION (273461@main): The value attribute is not displayed in an input 
field with type="email" and multiple attributes
https://bugs.webkit.org/show_bug.cgi?id=271043
rdar://125221858

Reviewed by Ryosuke Niwa.

273461@main deferred input element shadow tree construction outside of attribute
parsing. However, when combined with an earlier change to sanitize the value of
email inputs when the multiple attribute is set (263555@main), the deferral of
shadow tree construction results in the value not being displayed at all.

The root cause of the issue is the use of `setValueFromRenderer` introduced by
263555@main. The use of that method in `EmailInputType::attributeChanged` has
always been inappropriate, as it is specifically meant for user modifications.
However, in this case, the problem arises from the fact that 
`setValueFromRenderer`
calls `setFormControlValueMatchesRenderer(true)`. This results in the elision
of shadow tree construction in `TextFieldInputType::updateInnerTextValue`, as
`HTMLTextFormControlElement::setInnerTextValue` is only called if
`formControlValueMatchesRenderer()` returns false. Before 273461@main, this 
elision
was benign, as the shadow tree was constructed at attribute parse time.

Fix by using a more appropriate method to update the email input's value when
the multiple attribute is changed.

A new regression test is added. The coverage for the issue fixed by 263555@main
continues to be provided by the WPT: 
html/semantics/forms/the-input-element/email.html.

* 
LayoutTests/fast/forms/email-input-type-value-and-multiple-attributes-set-expected.html:
 Added.
* 
LayoutTests/fast/forms/email-input-type-value-and-multiple-attributes-set.html: 
Added.
* Source/WebCore/html/EmailInputType.cpp:
(WebCore::EmailInputType::attributeChanged):

Canonical link: https://commits.webkit.org/276895@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to