[webkit-changes] [WebKit/WebKit] a4eb84: <button> and <select> elements with "readonly" att...

EWS noreply at github.com
Thu Jan 5 09:39:11 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a4eb84de0c697f529d942d00816cab7a703788ea
      https://github.com/WebKit/WebKit/commit/a4eb84de0c697f529d942d00816cab7a703788ea
  Author: Alexey Shvayka <ashvayka at apple.com>
  Date:   2023-01-05 (Thu, 05 Jan 2023)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-willvalidate-readonly-attribute-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-willvalidate-readonly-attribute.html
    A LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/select-willvalidate-readonly-attribute-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/select-willvalidate-readonly-attribute.html
    M Source/WebCore/html/HTMLFormControlElement.cpp
    M Source/WebCore/html/HTMLFormControlElement.h
    M Source/WebCore/html/HTMLTextFormControlElement.h

  Log Message:
  -----------
  <button> and <select> elements with "readonly" attribute shouldn't be barred from constraint validation
https://bugs.webkit.org/show_bug.cgi?id=250037

Reviewed by Aditya Keerthi.

Per spec, only <input> [1], <textarea> [2], and form-associated custom elements [3] are barred from
constraint validation if "readonly" attribute is present.

This change makes "readonly" attribute check conditional based on readOnlyBarsFromConstraintValidation().
We can't use supportsReadonly() instead as it reports `false` for certain <input> types, violating the spec [1].

Aligns WebKit with Gecko and the spec.

Tests: imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-willvalidate-readonly-attribute.html
       imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/select-willvalidate-readonly-attribute.html

[1] https://html.spec.whatwg.org/multipage/input.html#the-readonly-attribute:barred-from-constraint-validation
[2] https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element:barred-from-constraint-validation
[3] https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-core-concepts:barred-from-constraint-validation

* LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-willvalidate-readonly-attribute-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-willvalidate-readonly-attribute.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/select-willvalidate-readonly-attribute-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/select-willvalidate-readonly-attribute.html: Added.
* Source/WebCore/html/HTMLFormControlElement.h
* Source/WebCore/html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::computeWillValidate const):
* Source/WebCore/html/HTMLTextFormControlElement.h:

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




More information about the webkit-changes mailing list