From f8e7dd45f8f3142f5bf7e5e6e0435e82694c3106 Mon Sep 17 00:00:00 2001
From: Domenic Denicola
If a reflecting IDL attribute is a USVString
attribute
- whose content attribute is defined to contain a URL, then on getting, if the
- content attribute is absent, the IDL attribute must return the empty string. Otherwise, the IDL
- attribute must parse the value of the content attribute relative
- to the element's node document and if that is successful, return the resulting
- URL string. If parsing fails, then the value of the content attribute must be returned
- instead, converted to a USVString
. On setting, the content attribute must be set to the
- specified new value.
If a reflecting IDL attribute is a DOMString
attribute
- whose content attribute is an enumerated attribute, and the IDL attribute is
- limited to only known values, then, on getting, the IDL attribute must return the
- keyword value associated with the state the attribute is in, if any, or the empty string if the
- attribute is in a state that has no associated keyword value or if the attribute is not in a
- defined state (e.g. the attribute is missing and there is no missing value default). If there are multiple keyword values for the state, then
- return the conforming one. If there are multiple conforming keyword values, then one will be
- designated the canonical keyword; choose that one. On setting, the content attribute
- must be set to the specified new value.
If a reflecting IDL attribute is a nullable DOMString
- attribute whose content attribute is an enumerated attribute, then, on getting, if
- the corresponding content attribute is in its missing value default state then the IDL
- attribute must return null, otherwise, the IDL attribute must return the keyword value associated
- with the state the attribute is in. If there are multiple keyword values for the state, then
- return the conforming one. If there are multiple conforming keyword values, then one will be
- designated the canonical keyword; choose that one. On setting, if the new value is
- null, the content attribute must be removed, and otherwise, the content attribute must be set to
- the specified new value.
If a reflecting IDL attribute is a DOMString
or USVString
attribute but doesn't fall into any of the above
- categories, then the getting and setting must be done in a transparent, case-preserving manner.
If a reflecting IDL attribute has the type DOMString
:
The getter steps are:
+ +If the content attribute is an enumerated attribute, and the IDL attribute is + limited to only known values:
+ +If the content attribute is not in any state (e.g. the attribute is missing and there + is no missing value default), or the content attribute + is in a state with no associated keyword value, then return the empty string.
If there is a single keyword value associated with the state of the content + attribute, then return it.
If there is a canonical keyword for the state of the content attribute, + then return it.
Assert: there is only one conforming keyword value associated with the state of the + content attribute.
Return the single conforming keyword value associated with the state of the content + attribute.
Otherwise:
+ +Return the content attribute's value.
The setter steps are to set the content attribute's value to the given value.
If a reflecting IDL attribute has the type DOMString?
:
The getter steps are:
+ +Assert: the content attribute is an enumerated attribute:
Assert: the content attribute is in some state.
If the content attribute is in its missing value + default state, then return null.
If there is a single keyword value associated with the state of the content attribute, + then return it.
Assert: there is a canonical keyword for the state of the content + attribute.
Return the canonical keyword for the state of the content + attribute.
The setter steps are:
+ +If the given value is null, then remove the content attribute.
Otherwise, set the content attribute's value to the given value.
If a reflecting IDL attribute has the type USVString
:
The getter steps are:
+ +If the content attribute is defined to contain a URL:
+ +If the content attribute is absent, then return the empty string.
Parse the value of the content attribute relative + to the element's node document.
If that is successful, then return the resulting URL string.
Otherwise, return the value of the content attribute, converted to a USVString
.
Otherwise:
+ +Return the value of the content attribute, converted to a USVString
.
The setter steps are to set the content attribute's value to the given value.
If a reflecting IDL attribute is a Some attributes are defined as taking one of a finite set of keywords. Such attributes are
- called enumerated attributes. The keywords are each
- defined to map to a particular state (several keywords might map to the same state, in
- which case some of the keywords are synonyms of each other; additionally, some of the keywords can
- be said to be non-conforming, and are only in the specification for historical reasons). In
- addition, two default states can be given. The first is the invalid value default, the
- second is the missing value default. If an enumerated attribute is specified, the attribute's value must be an ASCII
- case-insensitive match for one of the given keywords that are not said to be
- non-conforming, with no leading or trailing whitespace. When the attribute is specified, if its value is an ASCII case-insensitive match
- for one of the given keywords then that keyword's state is the state that the attribute
- represents. If the attribute value matches none of the given keywords, but the attribute has an
- invalid value default, then the attribute represents that
- state. Otherwise, there is no default, and invalid values mean that there is no state
- represented. When the attribute is not specified, if there is a missing value default state
- defined, then that is the state represented by the (missing) attribute. Otherwise, the absence of
- the attribute means that there is no state represented. Some attributes, called enumerated attributes, take
+ on a finite set of states. The state for such an attribute is derived by combining the
+ attribute's value, a set of keyword/state mappings given in the specification of each attribute,
+ and two possible special states that can also be given in the specification of the attribute.
+ These special states are the invalid value default and the missing
+ value default. Multiple keywords can map to the same state. The empty string can be a valid keyword. To determine the state of an attribute, use the following steps: If the attribute is not specified: If the attribute has a missing value default
+ defined, then return that missing value
+ default. Otherwise, return no state. If the attribute's value is an ASCII case-insensitive match for one of the
+ keywords defined for the attribute, then return the state represented by that keyword. If the attribute has an invalid value default
+ defined, then return that invalid value default. Return no state. For authoring conformance purposes, if an enumerated attribute is specified, the attribute's
+ value must be an ASCII case-insensitive match for one of the given keywords that are
+ not said to be non-conforming, with no leading or trailing whitespace. For reflection purposes, states which have any keywords mapping
+ to them are said to have a canonical keyword. This is determined as follows: If there is only one keyword mapping to the given state, then it is that keyword. If there is only one conforming keyword mapping to the given state, then it is
+ that conforming keyword. Otherwise, the canonical keyword for the state will be explicitly given in the
+ specification for the attribute.boolean
attribute, then on
getting the IDL attribute must return true if the content attribute is set, and false if it is
From 9a660de57b6606ffdb98db406aac7d02d8bedfe0 Mon Sep 17 00:00:00 2001
From: Domenic Denicola Keywords and enumerated attributes
-
+
+
+
+
+
+
+
+
Numbers
@@ -7441,16 +7469,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
is no missing value default), or the content attribute
is in a state with no associated keyword value, then return the empty string.
If there is a single keyword value associated with the state of the content - attribute, then return it.
If there is a canonical keyword for the state of the content attribute, - then return it.
Assert: there is only one conforming keyword value associated with the state of the - content attribute.
Return the single conforming keyword value associated with the state of the content +
Return the canonical keyword for the state of the content attribute.
The getter steps are:
Assert: the content attribute is an enumerated attribute:
Assert: the content attribute is an enumerated attribute.
Assert: the content attribute is in some state.
If the content attribute is in its missing value default state, then return null.
If there is a single keyword value associated with the state of the content attribute, - then return it.
Assert: there is a canonical keyword for the state of the content - attribute.
Return the canonical keyword for the state of the content attribute.
Some constructs are disallowed because historically they have been the cause of a lot of @@ -4608,8 +4608,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
If the attribute has a missing value default - defined, then return that missing value - default.
Otherwise, return no state.
If the attribute's value is an ASCII case-insensitive match for one of the keywords defined for the attribute, then return the state represented by that keyword.
If the attribute has an invalid value default - defined, then return that invalid value default.
If the attribute has an invalid value default state + defined, then return that invalid value default + state.
Return no state.
For authoring conformance purposes, if an enumerated attribute is specified, the attribute's - value must be an ASCII case-insensitive match for one of the given keywords that are - not said to be non-conforming, with no leading or trailing whitespace.
+ value must be an ASCII case-insensitive match for one of the conforming keywords for + that attribute, with no leading or trailing whitespace.For reflection purposes, states which have any keywords mapping to them are said to have a canonical keyword. This is determined as follows:
From be10a81827d3ca85d0b7700f3c4a66ea8787b346 Mon Sep 17 00:00:00 2001 From: Domenic DenicolaIDL attributes of type DOMString
or DOMString?
that reflect enumerated content attributes can be limited to only known values.
+ Per the processing models below, those will cause the getters for such IDL attributes to only
+ return keywords for those enumerated attributes, or the empty string or null.
If a reflecting IDL attribute has the type DOMString
:
If the content attribute is an enumerated attribute, and the IDL attribute is - limited to only known values:
+ limited to only known values:If the content attribute is not in any state (e.g. the attribute is missing and there @@ -7498,6 +7504,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Assert: the content attribute is an enumerated attribute.
Assert: the IDL attribute is limited to only known values.
Assert: the content attribute is in some state.
If the content attribute is in its missing value
From cf744a48b3342fe9e771a2bc16ee6f792e04b92b Mon Sep 17 00:00:00 2001
From: Domenic Denicola Multiple keywords can map to the same state. The empty string can be a valid keyword. The empty string can be a valid keyword. Note that the missing value default applies only when the attribute is missing, not when
+ it is present with an empty string value. To determine the state of an attribute, use the following steps: Assert: the content attribute is in some state. If the content attribute is in its missing value
- default state, then return null. If the content attribute is in a state with no associated keyword value, then return
+ null. Return the canonical keyword for the state of the content
attribute.
Some constructs are disallowed because historically they have been the cause of a lot of