Repository navigation
Throw on showPicker() when the <input> is not mutable - #7769
Conversation
565dce6 to
a6cdc8f
Compare
emilio
left a comment
There was a problem hiding this comment.
So... I just realized that the spec already accounts for mutability, here: https://html.spec.whatwg.org/#show-the-picker,-if-applicable
So I guess the issue I filed is a Chromium bug. However I think I prefer throwing rather than silently doing nothing for this case, tbh.
Also, I just realized while going through the tests and spec that we do not enforce that the element is rendered, i.e., that you can call input.showPicker() on a detached element, and per spec that should show a picker (somewhere? some pickers do need positioning information).
I think we should consider also throwing on non-rendered elements, what do you think?
|
Oh, huh. I guess we considered that. Indeed I feel like louder failure is probably better. In this case I should delete the extra check from "show the picker, if applicable". As for whether it's in the DOM or not, I think in #6909 (comment) we considered this and decided it was OK to show pickers for elements not in the DOM, since that generally works for existing elements. (Especially on mobile.) |
|
Hmm, so |
|
FYI I've started a Chromium CL at https://chromium-review.googlesource.com/c/chromium/src/+/3563070/ |
This CL makes sure showPicker() throws InvalidStateError DOMException when the HTML input element is either disabled or readonly. Spec: whatwg/html#7769 Bug: 939561 Change-Id: I3c3ad9be897beb17ac110092574331e3af80633c
This CL makes sure showPicker() throws InvalidStateError DOMException when the HTML input element is either disabled or readonly. Spec: whatwg/html#7769 Bug: 939561 Change-Id: I3c3ad9be897beb17ac110092574331e3af80633c
This CL makes sure showPicker() throws InvalidStateError DOMException when the HTML input element is either disabled or readonly. Spec: whatwg/html#7769 Bug: 939561 Change-Id: I3c3ad9be897beb17ac110092574331e3af80633c
This CL makes sure showPicker() throws InvalidStateError DOMException when the HTML input element is either disabled or readonly. Spec: whatwg/html#7769 Bug: 939561 Change-Id: I3c3ad9be897beb17ac110092574331e3af80633c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3563070 Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Fr <[email protected]> Cr-Commit-Position: refs/heads/main@{#991363}
This CL makes sure showPicker() throws InvalidStateError DOMException when the HTML input element is either disabled or readonly. Spec: whatwg/html#7769 Bug: 939561 Change-Id: I3c3ad9be897beb17ac110092574331e3af80633c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3563070 Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Fr <[email protected]> Cr-Commit-Position: refs/heads/main@{#991363}
This CL makes sure showPicker() throws InvalidStateError DOMException when the HTML input element is either disabled or readonly. Spec: whatwg/html#7769 Bug: 939561 Change-Id: I3c3ad9be897beb17ac110092574331e3af80633c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3563070 Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Fr <[email protected]> Cr-Commit-Position: refs/heads/main@{#991363}
|
Chromium has been updated: https://chromiumdash.appspot.com/commit/ee9a0b48b84c1ad754ef263ac8d9288140694c4f |
I went a different direction. Now "show the picker, if applicable" early-returns on some various error conditions. These are useful for callers like the input activation behavior. But showPicker() checks those same conditions, and throws explicit exceptions. |
annevk
left a comment
There was a problem hiding this comment.
Maybe mention that this includes an editorial change in the commit message as that was a bit confusing at first.
…s not mutable, a=testonly Automatic update from web-platform-tests Throw on showPicker() when the <input> is not mutable This CL makes sure showPicker() throws InvalidStateError DOMException when the HTML input element is either disabled or readonly. Spec: whatwg/html#7769 Bug: 939561 Change-Id: I3c3ad9be897beb17ac110092574331e3af80633c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3563070 Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Fr <[email protected]> Cr-Commit-Position: refs/heads/main@{#991363} -- wpt-commits: 1f6399f790ee4b6af88cdcd4eaab32319dc1f260 wpt-pr: 33465
…s not mutable, a=testonly Automatic update from web-platform-tests Throw on showPicker() when the <input> is not mutable This CL makes sure showPicker() throws InvalidStateError DOMException when the HTML input element is either disabled or readonly. Spec: whatwg/html#7769 Bug: 939561 Change-Id: I3c3ad9be897beb17ac110092574331e3af80633c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3563070 Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Fr <[email protected]> Cr-Commit-Position: refs/heads/main@{#991363} -- wpt-commits: 1f6399f790ee4b6af88cdcd4eaab32319dc1f260 wpt-pr: 33465
This CL makes sure showPicker() throws InvalidStateError DOMException when the HTML input element is either disabled or readonly. Spec: whatwg/html#7769 Bug: 939561 Change-Id: I3c3ad9be897beb17ac110092574331e3af80633c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3563070 Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Fr <[email protected]> Cr-Commit-Position: refs/heads/main@{#991363}
…s not mutable, a=testonly Automatic update from web-platform-tests Throw on showPicker() when the <input> is not mutable This CL makes sure showPicker() throws InvalidStateError DOMException when the HTML input element is either disabled or readonly. Spec: whatwg/html#7769 Bug: 939561 Change-Id: I3c3ad9be897beb17ac110092574331e3af80633c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3563070 Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Fr <[email protected]> Cr-Commit-Position: refs/heads/main@{#991363} -- wpt-commits: 1f6399f790ee4b6af88cdcd4eaab32319dc1f260 wpt-pr: 33465
Closes #7767.
(See WHATWG Working Mode: Changes for more details.)
@emilio, could you review this? Also maybe you are thinking of writing the tests? :)
/input.html ( diff )