Changeset 286413 in webkit


Ignore:
Timestamp:
Dec 1, 2021 10:05:10 PM (8 months ago)
Author:
Chris Dumez
Message:

validity.valueMissing should not rely on element's disabled state for inputs of type radio/file/checkbox
https://bugs.webkit.org/show_bug.cgi?id=233735

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that more checks are passing.

  • web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt:
  • web-platform-tests/html/semantics/forms/constraints/radio-valueMissing-expected.txt:

Source/WebCore:

validity.valueMissing should not rely on element's disabled state for inputs of type radio/file/checkbox:

This was causing us to fail a few WPT tests that are passing in both Blink and Gecko.

  • html/BaseDateAndTimeInputType.cpp:

(WebCore::BaseDateAndTimeInputType::valueMissing const):

  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::valueMissing const):

  • html/TextFieldInputType.cpp:

(WebCore::TextFieldInputType::valueMissing const):

LayoutTests:

Rebaseline WPT tests now that more checks are passing.

  • platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt:
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r286409 r286413  
     12021-12-01  Chris Dumez  <cdumez@apple.com>
     2
     3        validity.valueMissing should not rely on element's disabled state for inputs of type radio/file/checkbox
     4        https://bugs.webkit.org/show_bug.cgi?id=233735
     5
     6        Reviewed by Darin Adler.
     7
     8        Rebaseline WPT tests now that more checks are passing.
     9
     10        * platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt:
     11
    1122021-12-01  Arcady Goldmints-Orlov  <agoldmints@igalia.com>
    213
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r286365 r286413  
     12021-12-01  Chris Dumez  <cdumez@apple.com>
     2
     3        validity.valueMissing should not rely on element's disabled state for inputs of type radio/file/checkbox
     4        https://bugs.webkit.org/show_bug.cgi?id=233735
     5
     6        Reviewed by Darin Adler.
     7
     8        Rebaseline WPT tests now that more checks are passing.
     9
     10        * web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt:
     11        * web-platform-tests/html/semantics/forms/constraints/radio-valueMissing-expected.txt:
     12
    1132021-12-01  Antti Koivisto  <antti@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt

    r267646 r286413  
    3636PASS [INPUT in CHECKBOX status] The required attribute is not set
    3737PASS [INPUT in CHECKBOX status] The checked attribute is true
    38 FAIL [INPUT in CHECKBOX status] The checked attribute is false assert_true: The validity.valueMissing should be true, when control is disabled. expected true got false
     38PASS [INPUT in CHECKBOX status] The checked attribute is false
    3939PASS [INPUT in RADIO status] The required attribute is not set
    4040PASS [INPUT in RADIO status] The checked attribute is true
     
    4242PASS [INPUT in RADIO status] The checked attribute is false and the name attribute is empty
    4343PASS [INPUT in FILE status] The required attribute is not set
    44 FAIL [INPUT in FILE status] The Files attribute is null assert_true: The validity.valueMissing should be true, when control is disabled. expected true got false
     44PASS [INPUT in FILE status] The Files attribute is null
    4545PASS [select]  The required attribute is not set
    4646PASS [select]  Selected the option with value equals to 1
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/constraints/radio-valueMissing-expected.txt

    r267646 r286413  
    44PASS One of the radios is required and checked
    55PASS One of the radios is required and another one is checked
    6 FAIL One of the radios is required and disabled, but none checked assert_true: The radio10.validity.valueMissing should be true expected true got false
     6PASS One of the radios is required and disabled, but none checked
    77PASS One of the radios is required, checked and disabled
    88
  • trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt

    r267658 r286413  
    8282PASS [INPUT in CHECKBOX status] The required attribute is not set
    8383PASS [INPUT in CHECKBOX status] The checked attribute is true
    84 FAIL [INPUT in CHECKBOX status] The checked attribute is false assert_true: The validity.valueMissing should be true, when control is disabled. expected true got false
     84PASS [INPUT in CHECKBOX status] The checked attribute is false
    8585PASS [INPUT in RADIO status] The required attribute is not set
    8686PASS [INPUT in RADIO status] The checked attribute is true
     
    8888PASS [INPUT in RADIO status] The checked attribute is false and the name attribute is empty
    8989PASS [INPUT in FILE status] The required attribute is not set
    90 FAIL [INPUT in FILE status] The Files attribute is null assert_true: The validity.valueMissing should be true, when control is disabled. expected true got false
     90PASS [INPUT in FILE status] The Files attribute is null
    9191PASS [select]  The required attribute is not set
    9292PASS [select]  Selected the option with value equals to 1
  • trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt

    r267658 r286413  
    8282PASS [INPUT in CHECKBOX status] The required attribute is not set
    8383PASS [INPUT in CHECKBOX status] The checked attribute is true
    84 FAIL [INPUT in CHECKBOX status] The checked attribute is false assert_true: The validity.valueMissing should be true, when control is disabled. expected true got false
     84PASS [INPUT in CHECKBOX status] The checked attribute is false
    8585PASS [INPUT in RADIO status] The required attribute is not set
    8686PASS [INPUT in RADIO status] The checked attribute is true
     
    8888PASS [INPUT in RADIO status] The checked attribute is false and the name attribute is empty
    8989PASS [INPUT in FILE status] The required attribute is not set
    90 FAIL [INPUT in FILE status] The Files attribute is null assert_true: The validity.valueMissing should be true, when control is disabled. expected true got false
     90PASS [INPUT in FILE status] The Files attribute is null
    9191PASS [select]  The required attribute is not set
    9292PASS [select]  Selected the option with value equals to 1
  • trunk/Source/WebCore/ChangeLog

    r286411 r286413  
     12021-12-01  Chris Dumez  <cdumez@apple.com>
     2
     3        validity.valueMissing should not rely on element's disabled state for inputs of type radio/file/checkbox
     4        https://bugs.webkit.org/show_bug.cgi?id=233735
     5
     6        Reviewed by Darin Adler.
     7
     8        validity.valueMissing should not rely on element's disabled state for inputs of type radio/file/checkbox:
     9        - https://html.spec.whatwg.org/multipage/input.html#radio-button-state-(type=radio):suffering-from-being-missing
     10        - https://html.spec.whatwg.org/multipage/input.html#file-upload-state-(type=file):suffering-from-being-missing
     11        - https://html.spec.whatwg.org/multipage/input.html#checkbox-state-(type=checkbox):suffering-from-being-missing
     12
     13        This was causing us to fail a few WPT tests that are passing in both Blink and Gecko.
     14
     15        * html/BaseDateAndTimeInputType.cpp:
     16        (WebCore::BaseDateAndTimeInputType::valueMissing const):
     17        * html/HTMLInputElement.cpp:
     18        (WebCore::HTMLInputElement::valueMissing const):
     19        * html/TextFieldInputType.cpp:
     20        (WebCore::TextFieldInputType::valueMissing const):
     21
    1222021-12-01  Simon Fraser  <simon.fraser@apple.com>
    223
  • trunk/Source/WebCore/html/BaseDateAndTimeInputType.cpp

    r283757 r286413  
    243243{
    244244    ASSERT(element());
    245     return element()->isRequired() && value.isEmpty();
     245    return !element()->isDisabledOrReadOnly() && element()->isRequired() && value.isEmpty();
    246246}
    247247
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r286316 r286413  
    302302bool HTMLInputElement::valueMissing() const
    303303{
    304     return willValidate() && m_inputType->valueMissing(value());
     304    return m_inputType->valueMissing(value());
    305305}
    306306
  • trunk/Source/WebCore/html/TextFieldInputType.cpp

    r283851 r286413  
    121121{
    122122    ASSERT(element());
    123     return element()->isRequired() && value.isEmpty();
     123    return !element()->isDisabledOrReadOnly() && element()->isRequired() && value.isEmpty();
    124124}
    125125
Note: See TracChangeset for help on using the changeset viewer.