From c3b0c506c0f703a41f71686fc1ab16f68ecb2593 Mon Sep 17 00:00:00 2001
From: Domenic Denicola
Recall that an element's activation behavior runs for both
+ user-initiated activations and for synthetic activations (e.g., via el.click()). User agents might also have behaviors for a given control — not
+ specified here — that are triggered only by true user-initiated activations. A common choice is to
+ show the picker, if applicable, for the control. In contrast, the input
+ activation behavior only shows pickers for the special historical cases of the File Upload and Color states.
The legacy-pre-activation behavior for input elements are these
steps:
The input activation behavior for such an element element is:
+ +If element's relevant global object does not have transient + activation, then return.
Show the picker, if applicable, for element.
Constraint validation: While the user interface describes input that the user agent cannot convert to a valid lowercase simple color, the control is suffering from bad input.
@@ -48064,44 +48084,10 @@ ldh-str = < as defined in multiple attribute is not set on element, there - must be no more than one file selected; otherwise, any number may be selected. Files can be - from the filesystem or created on the fly, e.g., a picture taken from a camera connected to the - user's device. - -Wait for the user to have made their selection.
If the user dismissed the prompt without changing their selection, then queue an
- element task on the user interaction task source given element
- to fire an event named cancel at element, with the bubbles attribute initialized to true.
If element's relevant global object does not have transient + activation, then return.
Otherwise, update the file selection for element.
As with all user interface specifications, user agents have a good deal of
- freedom in how they interpret these requirements. The above text implies that a user either
- dismisses the prompt or changes their selection; exactly one of these will be true. But the
- mapping of these possibilities to specific user interface elements is not mandated by the
- standard. For example, a user agent might interpret clicking the "Cancel" button when files were
- previously selected as a change of selection to select zero files, thus firing input and change. Or it might
- interpret such a click as a dismissal that leaves the selection unchanged, thus firing cancel. Similarly, it's up to the user agent whether re-selecting
- the same files counts as were previously selected counts as a dismissal, or as a change of
- selection.
Show the picker, if applicable, for element.
If the element is mutable, the user agent should allow the @@ -49856,6 +49842,20 @@ You cannot submit this form when the field is incorrect.
Returns the datalist element indicated by the list attribute.
input.showPicker()Shows any applicable picker UI for input, so that the user can select a value. (If + no picker UI is implemented for the given control, then this method does nothing.)
+ +Throws a "NotAllowedError" DOMException if called
+ without transient user activation.
Throws a "SecurityError" DOMException if
+ input is inside a cross-origin iframe, unless input is in the
+ File Upload or Color states.
The showPicker() method steps are:
If this's relevant global object does not have transient
+ activation, then throw a "NotAllowedError"
+ DOMException.
If this's relevant settings object's origin is not same origin-domain
+ with this's relevant settings object's top-level origin,
+ and this's type attribute is not in the
+ File Upload state or Color state, then throw a
+ "SecurityError" DOMException.
File and Color inputs are exempted from this check for historical + reason: their input activation behavior also shows their pickers, and has never + been guarded by an origin check.
+Show the picker, if applicable, for this.
To show the picker, if applicable for an input element
+ element:
Assert: element's relevant global object has transient + activation.
If element is not mutable, then + return.
If element's type attribute is in the File Upload state, then run these steps in
+ parallel:
Optionally, wait until any prior execution of this algorithm has terminated.
Display a prompt to the user requesting that the user specify some files. If the multiple attribute is not set on element, there
+ must be no more than one file selected; otherwise, any number may be selected. Files can be
+ from the filesystem or created on the fly, e.g., a picture taken from a camera connected to the
+ user's device.
Wait for the user to have made their selection.
If the user dismissed the prompt without changing their selection, then queue an
+ element task on the user interaction task source given element
+ to fire an event named cancel at element, with the bubbles attribute initialized to true.
Otherwise, update the file selection for element.
As with all user interface specifications, user agents have a good deal of
+ freedom in how they interpret these requirements. The above text implies that a user either
+ dismisses the prompt or changes their selection; exactly one of these will be true. But the
+ mapping of these possibilities to specific user interface elements is not mandated by the
+ standard. For example, a user agent might interpret clicking the "Cancel" button when files were
+ previously selected as a change of selection to select zero files, thus firing input and change. Or it might
+ interpret such a click as a dismissal that leaves the selection unchanged, thus firing cancel. Similarly, it's up to the user agent whether re-selecting
+ the same files counts as were previously selected counts as a dismissal, or as a change of
+ selection.
Otherwise, the user agent should show any relevant user interface for selecting a value for + element, in the way it normally would when the user interacts with the control. (If + no such UI applies to element, then this step does nothing.)
+ +If such a user interface is shown, it must respect the requirements stated in the relevant
+ parts of the specification for how element behaves given its type attribute state. (For example, various sections describe
+ restrictions on the resulting value string.)
This step can have user-visible (but not script-visible) side effects, such as closing other + pickers that were previously shown by this algorithm.
+ +As of the time of this writing, typical browser implementations show such
+ picker UI for input elements whose type
+ attributes are in the Date, Month, Week,
+ Time, Local Date and Time, and Color states. (In addition to the special File Upload case specified above.) However, the intent of
+ this step is to trigger any picker UI implementation. So for example, if a user agent
+ implemented a password picker UI for the Password state, then this method would be expected to
+ show that picker UI when called on a password input.
If this's relevant global object does not have transient
- activation, then throw a "NotAllowedError"
- DOMException.
If this's relevant settings object's origin is not same origin-domain @@ -50149,6 +50145,10 @@ You cannot submit this form when the field is incorrect. been guarded by an origin check.
If this's relevant global object does not have transient
+ activation, then throw a "NotAllowedError"
+ DOMException.
Show the picker, if applicable, for this.
This step can have user-visible (but not script-visible) side effects, such as closing other - pickers that were previously shown by this algorithm.
+This step can have side effects, such as closing other pickers that were previously shown by
+ this algorithm. (If this closes a file selection picker, then per the above that will lead to
+ firing either input and change events, or a cancel
+ event.)
As of the time of this writing, typical browser implementations show such
picker UI for input elements whose type
From e8a4140394d94f013cf0fad5b8ee737c2af8b0b0 Mon Sep 17 00:00:00 2001
From: Domenic Denicola cancel
event.)
As of the time of this writing, typical browser implementations show such
- picker UI for input elements whose type
- attributes are in the Date, Month, Week,
- Time, Local Date and Time, and Color states. (In addition to the special File Upload case specified above.) However, the intent of
- this step is to trigger any picker UI implementation. So for example, if a user agent
- implemented a password picker UI for the Password state, then this method would be expected to
- show that picker UI when called on a password input.
As of the time of this writing, typical browser implementations show such picker UI for:
+ +input elements whose type
+ attributes are in the Date, Month, Week,
+ Time, Local Date and Time, and Color states;
input elements in various states that have a suggestions source element; and
input elements whose type attribute
+ is in the File Upload state (although those are
+ handled via the special case above, instead of by this step).
However, the intent of this step is to trigger any picker UI implementation. So + for example, if a user agent implemented a password picker UI for the Password state, then this method would be expected to + show that picker UI when called on a password input.
+If this's relevant settings object's origin is not same origin-domain
- with this's relevant settings object's top-level origin,
- and this's type attribute is not in the
- File Upload state or origin is not same origin with
+ this's relevant settings object's top-level origin, and
+ this's type attribute is not in the File Upload state or Color state, then throw a
"SecurityError" DOMException.