[webkit-changes] [WebKit/WebKit] ea06eb: Resetting the value of an input file to null shoul...
Ahmad Saleem
noreply at github.com
Wed Feb 22 11:49:02 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ea06eb38955ae78f014ff6868b728cf6179c0b56
https://github.com/WebKit/WebKit/commit/ea06eb38955ae78f014ff6868b728cf6179c0b56
Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
Date: 2023-02-22 (Wed, 22 Feb 2023)
Changed paths:
A LayoutTests/fast/forms/file/file-input-empty-validation-expected.txt
A LayoutTests/fast/forms/file/file-input-empty-validation.html
A LayoutTests/fast/forms/file/file-input-reset-validation-expected.txt
A LayoutTests/fast/forms/file/file-input-reset-validation.html
M LayoutTests/platform/gtk/TestExpectations
M LayoutTests/platform/ios/TestExpectations
M LayoutTests/platform/mac-wk2/TestExpectations
M Source/WebCore/html/FileInputType.cpp
M Source/WebCore/html/HTMLInputElement.cpp
Log Message:
-----------
Resetting the value of an input file to null should make it invalid
https://bugs.webkit.org/show_bug.cgi?id=242063
rdar://problem/96446732
Reviewed by Ryosuke Niwa.
This patch is to align WebKit with Gecko / Firefox and Blink / Chromium.
Partial Merge - https://src.chromium.org/viewvc/blink?view=revision&revision=165942 &
https://src.chromium.org/viewvc/blink?view=revision&revision=166115
This patches add "updateValidity" check when the input form is reset and return early,
if the value is not changed. This is to ensure that "required" marked form control element
does not end up being incorrectly labelled as valid.
* Source/WebCore/html/FileInputType.cpp:
(FileInputType::setValue): Refer to bool "valueChanged" and return early and also updateValidity
* Source/WebCore/html/HTMLInputElement.cpp:
(HTMLInputElement::reset): Add "updateValidity" check
* LayoutTests/fast/forms/file/file-input-empty-validation.html: Add Test Case
* LayoutTests/fast/forms/file/file-input-empty-validation-expected.txt: Add Test Case Expectation
* LayoutTests/fast/forms/file/file-input-reset-validation.html: Add Test Case
* LayoutTests/fast/forms/file/file-input-reset-validation-expected.txt: Add Test Case Expectation
* LayoutTests/platform/gtk/TestExpectations: Add Platform Expectation due to lack of drag and drop support
* LayoutTests/platform/ios/TestExpectations: Ditto
* LayoutTests/platform/mac-wk2/TestExpectations: Add Platform Expectations due to missing testing support in WebKit2
Canonical link: https://commits.webkit.org/260688@main
More information about the webkit-changes
mailing list