From e861f774ab38e53124d3fb9f31ec079344b99dce Mon Sep 17 00:00:00 2001
From: Domenic Denicola ElementInternals
object's
- setValidity()
method. The user agent should use the
+ setValidity()
method. The user agent should use the
custom validity error message when alerting the user to the problem with the
control.
select
elements and controls in radio button
groups, as specified in their sections.
- When the setValidity()
method sets
+
When the setValidity()
method sets
valueMissing
flag to true for a
form-associated custom element.
When the setValidity()
method sets
+
When the setValidity()
method sets
typeMismatch
flag to true for a
form-associated custom element.
When a control has a value that doesn't satisfy the
pattern
attribute.
When the setValidity()
method sets
+
When the setValidity()
method sets
patternMismatch
flag to true for a
form-associated custom element.
input
maxlength
, textarea
maxlength
).
- When the setValidity()
method sets
+
When the setValidity()
method sets
tooLong
flag to true for a
form-associated custom element.
input
minlength
, textarea
minlength
).
- When the setValidity()
method sets
+
When the setValidity()
method sets
tooShort
flag to true for a
form-associated custom element.
When a control has a value that is not the empty
string and is too low for the min
attribute.
When the setValidity()
method sets
+
When the setValidity()
method sets
rangeUnderflow
flag to true for a
form-associated custom element.
When a control has a value that is not the empty
string and is too high for the max
attribute.
When the setValidity()
method sets
+
When the setValidity()
method sets
rangeOverflow
flag to true for a
form-associated custom element.
When a control has a value that doesn't fit the
rules given by the step
attribute.
When the setValidity()
method sets
+
When the setValidity()
method sets
stepMismatch
flag to true for a
form-associated custom element.
When a control has incomplete input and the user agent does not think the user ought to be able to submit the form in its current state.
-When the setValidity()
method sets
+
When the setValidity()
method sets
badInput
flag to true for a form-associated custom element.
When a control's custom validity error message (as set by the element's
setCustomValidity()
method or
- ElementInternals
's setValidity()
method) is
+ ElementInternals
's setValidity()
method) is
not the empty string.
Just adding static formAssociated
property with true makes an
- autonomous custom element a form-associated custom element.
+
Adding a static formAssociated
property, with a true value, makes an
+ autonomous custom element a form-associated custom element. The
ElementInternals
interface helps you to implement functions and properties common
- in form control elements.
class MyCheckbox extends HTMLElement {
static get formAssociated() { return true; }
@@ -67886,12 +67886,12 @@ interface ElementInternals {
// Form-associated custom elements
- void setFormValue((File or USVString or FormData)? value,
+ void setFormValue((File or USVString or FormData)? value,
optional (File or USVString or FormData)? state);
readonly attribute HTMLFormElement? form;
- void setValidity(ValidityStateFlags flags,
+ void setValidity(ValidityStateFlags flags,
optional DOMString message,
optional HTMLElement anchor);
readonly attribute boolean willValidate;
@@ -67917,7 +67917,7 @@ dictionary ValidityStateFlags {
};
setFormValue
(value)setFormValue
(value)Sets both the state and submission value of internals's @@ -67926,7 +67926,7 @@ dictionary ValidityStateFlags {
If value is null, the element won't participate in form submission.
setFormValue
(value,
+ setFormValue
(value,
state)Sets the submission value of @@ -67940,7 +67940,7 @@ dictionary ValidityStateFlags {
Returns the form owner of internals's target element.
setValidity
(flags,
+ setValidity
(flags,
message [, anchor ])Marks internals's target element as
suffering from the constraints indicated by the flags argument, and sets the element's
@@ -67950,7 +67950,7 @@ dictionary ValidityStateFlags {
interactively or reportValidity()
is
called.
setValidity
({})setValidity
({})Marks internals's target element as satisfying its constraints.
File
, or a
list of entries.
- The setFormValue()
method is used by the custom element
- author to set the element's submission value and state, thus communicating these to the user agent.
The setFormValue()
method is used by
+ the custom element author to set the element's submission
+ value and state, thus communicating these to the user
+ agent.
When the user agent believes it is a good idea to restore a form-associated custom element's state, for example after navigation or @@ -68084,7 +68085,7 @@ dictionary ValidityStateFlags {
The The Each form-associated custom element has a
validation anchor element. It is null initially. The The setFormValue(value,
+
setFormValue(value,
state)
method of the ElementInternals
interface must
run the following steps:setValidity(flags,
+
setValidity(flags,
message, anchor)
method of the ElementInternals
interface must run the following steps: