WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
240302
input.showPicker() should throw when input is readonly/disabled
https://bugs.webkit.org/show_bug.cgi?id=240302
Summary
input.showPicker() should throw when input is readonly/disabled
Tim Nguyen (:ntim)
Reported
2022-05-11 04:38:32 PDT
See: html/semantics/forms/the-input-element/show-picker-disabled-readonly.html
Attachments
Patch
(10.05 KB, patch)
2022-05-12 04:58 PDT
,
zsun
no flags
Details
Formatted Diff
Diff
Patch
(10.13 KB, patch)
2022-05-12 07:13 PDT
,
zsun
no flags
Details
Formatted Diff
Diff
Patch
(10.13 KB, patch)
2022-05-12 07:13 PDT
,
zsun
no flags
Details
Formatted Diff
Diff
Patch
(10.09 KB, patch)
2022-05-12 07:49 PDT
,
zsun
no flags
Details
Formatted Diff
Diff
[fast-cq] Patch
(18.09 KB, patch)
2022-05-13 06:19 PDT
,
zsun
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2022-05-11 04:38:39 PDT
<
rdar://problem/93090068
>
Tim Nguyen (:ntim)
Comment 2
2022-05-11 13:51:40 PDT
https://chromium-review.googlesource.com/c/chromium/src/+/3563070/6/third_party/blink/renderer/core/html/forms/html_input_element.cc
zsun
Comment 3
2022-05-12 04:58:43 PDT
Created
attachment 459223
[details]
Patch
zsun
Comment 4
2022-05-12 04:59:44 PDT
The patch needs rebase once the patch for
bug 240301
is landed.
EWS Watchlist
Comment 5
2022-05-12 05:02:38 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see
https://trac.webkit.org/wiki/WPTExportProcess
Tim Nguyen (:ntim)
Comment 6
2022-05-12 05:59:09 PDT
Comment hidden (obsolete)
Comment on
attachment 459223
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=459223&action=review
> LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/show-picker-disabled-readonly-expected.txt:40 > +FAIL input[type=file] showPicker() doesn't throw when readonly assert_throws_dom: function "() => { input.showPicker(); }" threw object "InvalidStateError: Input showPicker cannot be used on immutable controls." that is not a DOMException NotAllowedError: property "code" is equal to 11, expected 0 > +FAIL input[type=hidden] showPicker() doesn't throw when readonly assert_throws_dom: function "() => { input.showPicker(); }" threw object "InvalidStateError: Input showPicker cannot be used on immutable controls." that is not a DOMException NotAllowedError: property "code" is equal to 11, expected 0 > +FAIL input[type=image] showPicker() doesn't throw when readonly assert_throws_dom: function "() => { input.showPicker(); }" threw object "InvalidStateError: Input showPicker cannot be used on immutable controls." that is not a DOMException NotAllowedError: property "code" is equal to 11, expected 0 > +PASS input[type=month] showPicker() throws when readonly > +PASS input[type=number] showPicker() throws when readonly > +PASS input[type=password] showPicker() throws when readonly > +FAIL input[type=radio] showPicker() doesn't throw when readonly assert_throws_dom: function "() => { input.showPicker(); }" threw object "InvalidStateError: Input showPicker cannot be used on immutable controls." that is not a DOMException NotAllowedError: property "code" is equal to 11, expected 0 > +FAIL input[type=range] showPicker() doesn't throw when readonly assert_throws_dom: function "() => { input.showPicker(); }" threw object "InvalidStateError: Input showPicker cannot be used on immutable controls." that is not a DOMException NotAllowedError: property "code" is equal to 11, expected 0 > +FAIL input[type=reset] showPicker() doesn't throw when readonly assert_throws_dom: function "() => { input.showPicker(); }" threw object "InvalidStateError: Input showPicker cannot be used on immutable controls." that is not a DOMException NotAllowedError: property "code" is equal to 11, expected 0 > +PASS input[type=search] showPicker() throws when readonly > +FAIL input[type=submit] showPicker() doesn't throw when readonly assert_throws_dom: function "() => { input.showPicker(); }" threw object "InvalidStateError: Input showPicker cannot be used on immutable controls." that is not a DOMException NotAllowedError: property "code" is equal to 11, expected 0
The different fails here are a regression (see:
https://wpt.fyi/results/html/semantics/forms/the-input-element/show-picker-disabled-readonly.html?label=experimental&label=master&aligned
) Seems like the test expects a different error for readonly, based on the input type. Firefox's implementation might be relevant here:
https://phabricator.services.mozilla.com/D142754#change-NirQH5Dh8sEo
, since it's the only one implementing this correctly. Seems like the spec is consistent with Firefox as well:
https://html.spec.whatwg.org/multipage/input.html#dom-input-showpicker
Tim Nguyen (:ntim)
Comment 7
2022-05-12 06:45:49 PDT
I found the more exact bit that describes on which elements the readonly attribute applies:
https://html.spec.whatwg.org/multipage/input.html#do-not-apply
Tim Nguyen (:ntim)
Comment 8
2022-05-12 06:55:05 PDT
Comment on
attachment 459223
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=459223&action=review
r=me with the commit message fixed.
> Source/WebCore/ChangeLog:8 > + input.showPicker() should throw when input is readonly/disabled on supported types > +
https://bugs.webkit.org/show_bug.cgi?id=240302
> + > + Reviewed by NOBODY (OOPS!). > + > + When input is readonly or disabled on supported types, input.showPicker() should throw InvalidStateError.
Can you remove the "on supported types" bits? I filed
bug 240343
to fix the readonly supported types.
Tim Nguyen (:ntim)
Comment 9
2022-05-12 06:56:11 PDT
Comment on
attachment 459223
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=459223&action=review
> Source/WebCore/html/HTMLInputElement.cpp:1255 > + return Exception { InvalidStateError, "Input showPicker cannot be used on immutable controls."_s };
showPicker() to be consistent with other messages.
zsun
Comment 10
2022-05-12 07:13:01 PDT
Created
attachment 459230
[details]
Patch
zsun
Comment 11
2022-05-12 07:13:56 PDT
Created
attachment 459231
[details]
Patch
Tim Nguyen (:ntim)
Comment 12
2022-05-12 07:44:39 PDT
Comment on
attachment 459231
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=459231&action=review
> Source/WebCore/ChangeLog:3 > + input.showPicker() should throw when input is readonly/disabled on supported types
The title needs updating too, both in LayoutTests/imported/w3c/ChangeLog and Source/WebCore/ChangeLog
zsun
Comment 13
2022-05-12 07:49:22 PDT
Created
attachment 459233
[details]
Patch
Tim Nguyen (:ntim)
Comment 14
2022-05-12 09:28:03 PDT
Looks like WPT expectations need to be updated with the new message
zsun
Comment 15
2022-05-13 06:19:18 PDT
Created
attachment 459297
[details]
[fast-cq] Patch
EWS
Comment 16
2022-05-13 10:26:25 PDT
Committed
r294163
(
250532@main
): <
https://commits.webkit.org/250532@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 459297
[details]
.
zsun
Comment 17
2022-06-06 12:00:43 PDT
***
Bug 239302
has been marked as a duplicate of this bug. ***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug