From d20d68b0419128627b87dfd061321338335a56ea Mon Sep 17 00:00:00 2001
From: Alice Boxhall DOMTokenList
object whose associated element is the element in question and
whose associated attribute's local name is the name of the attribute in question.
If a reflecting IDL attribute has the type HTMLElement
,
+ or an interface that descends from HTMLElement
,
+ then it must be paired with another reflecting IDL attribute
+ that has the type DOMString
.
+ The relationship between these two attributes is as follows:
HTMLElement
+ should be named attrElement
,
+ where the paired DOMString
attribute is named
+ attr
.attr
attribute,
+ the IDL attribute must return the value of the content attribute as normal.attrElement
attribute,
+ it must run the following algorithm
+ (stopping at the first point where a value is returned):attr
+ is absent, then the IDL attribute attrElement
must return null.document.getElementById()
method
+ would find when called on the content attribute's element's node document
+ if it were passed as its argument the current value
+ of the corresponding content attribute.attr
attribute,
+ the content attribute must be set to the specified value.attrElement
attribute,
+ it must run the following algorithm:id
attribute,
+ and has the same tree as the element of the attribute being set,
+ and the given element is the first element in that tree
+ whose ID is the value
+ of that id
attribute,
+ then let id be the value of that id
attribute.
+ attr
content attribute to id.
+ If a reflecting IDL attribute has the type sequence<Element>
,
+ or sequence<T>
where T descends from Element
...
TODO
+ +If a reflecting IDL attribute has the type HTMLElement
,
- or an interface that descends from HTMLElement
,
- then it must be paired with another reflecting IDL attribute
- that has the type DOMString
.
- The relationship between these two attributes is as follows:
HTMLElement
, then:
+ HTMLElement
- should be named attrElement
,
- where the paired DOMString
attribute is named
- attr
.attr
attribute,
- the IDL attribute must return the value of the content attribute as normal.attrElement
attribute,
- it must run the following algorithm
- (stopping at the first point where a value is returned):attr
- is absent, then the IDL attribute attrElement
must return null.document.getElementById()
method
+ would find when called on the content attribute's element's node document
+ if it were passed id as its argument.document.getElementById()
method
- would find when called on the content attribute's element's node document
- if it were passed as its argument the current value
- of the corresponding content attribute.attr
attribute,
- the content attribute must be set to the specified value.attrElement
attribute,
- it must run the following algorithm:id
attribute,
- and has the same tree as the element of the attribute being set,
- and the given element is the first element in that tree
- whose ID is the value
- of that id
attribute,
- then let id be the value of that id
attribute.
- attr
content attribute to id.
- id
attribute,
+ and has the same tree as the element of the attribute being set,
+ and the given element is the first element in that tree
+ whose ID is the value
+ of that id
attribute,
+ then let id be the value of that id
attribute.Element.setAttribute()
),
+ the value for the IDL attribute is re-set to the value produced by the getting algorithm, above.If a reflecting IDL attribute has the type sequence<Element>
,
- or sequence<T>
where T descends from Element
...
sequence<T>
where T descends from Element
, then:
+ TODO
+document.getElementById()
method
+ would find when called on the content attribute's element's node document
+ if it were passed id as its argument.id
attribute,
+ or is not in the same tree as the element of the attribute being set,
+ or the given element is not the first element in that tree
+ whose ID is the value
+ of that id
attribute,
+ then continue to the next element in the sequence.
+
+ id
attribute.
+
+ Element.setAttribute()
),
+ the value for the IDL attribute is re-set to the value produced by the getting algorithm, above.DOMTokenList
object whose associated element is the element in question and
whose associated attribute's local name is the name of the attribute in question.
- If a reflecting IDL attribute has the type HTMLElement
,
- or an interface that descends from HTMLElement
, then:
+
If a reflecting IDL attribute attr has the type Element
,
+ or an interface that inherits from Element
, then:
This attribute defines an internal slot, [[attrAssociatedElement]], + on the attribute's element. The initial value for this slot is null.
On getting, it must run the following algorithm + (stopping at the first point where a value is returned):
If the value of [[attrAssociatedElement]] is not null, + then return that value, regardless of the value of the content attribute.
Otherwise, if the content attribute is absent, then return null.
Otherwise, let id be the current value of the content attribute.
document.getElementById()
method
- would find when called on the content attribute's element's node document
- if it were passed id as its argument.Let candidate be the first element within + the content attribute's elements node document's + descendants whose ID is + id.
If candidate is null, or if it is not type-compatible with the IDL attribute, + then return null.
Otherwise, return candidate.
On setting, it must run the following algorithm:
If the given value is null, or is not type-compatible with the IDL attribute, + or is not a descendant of either the attribute's element's root + or the attribute's element's shadow-including root:
+Set [[attrAssociatedElement]] to null.
Remove the content attribute.
Return.
Otherwise, set [[attrAssociatedElement]] to the given value.
id
attribute,
- and has the same tree as the element of the attribute being set,
- and the given element is the first element in that tree
- whose ID is the value
- of that id
attribute,
- then let id be the value of that id
attribute.Let id be the empty string.
If the given element has an id
attribute,
+ and is in a document tree with the same root
+ as the element of the attribute being set,
+ and the given element is the first element in that root's descendants
+ whose ID is the value
+ of that id
attribute,
+ then let id be the value of that id
attribute.
Set the content attribute to id.
Element.setAttribute()
),
- the value for the IDL attribute is re-set to the value produced by the getting algorithm, above.If the content attribute is set directly (such as via Element.setAttribute()
),
+ the value for the IDL attribute is reset to null.
If a reflecting IDL attribute has the type sequence<Element>
,
- or sequence<T>
where T descends from Element
, then:
+
If a reflecting IDL attribute attr has the type sequence<Element>
,
+ or sequence<T>
where T inherits from Element
, then:
This attribute defines an internal slot, [[attrAssociatedElements]], + on the attribute's element. The initial value for this slot is null.
On getting, it must run the following algorithm (stopping at the first point where a value is returned):
If the value of [[attrAssociatedElements]] is not null, + then return that value, regardless of the value of the content attribute.
If the content attribute is absent, then the IDL attribute must return null.
Otherwise, let elements be an empty list.
For each id in the set of space-separated tokens:
Let candidate be the first element within + the content attribute's elements node document's + descendants whose ID is + id.
document.getElementById()
method
- would find when called on the content attribute's element's node document
- if it were passed id as its argument.If candidate is null, + or if it is not type-compatible with the IDL attribute, + then continue to the next token.
Otherwise, append candidate to elements.
Return elements.
On setting, it must run the following algorithm:
If the given value is null:
+Set [[attrAssociatedElements]] to null.
Remove the content attribute.
Return.
Otherwise, let elements be an empty list, + and value be an empty string.
For each element in the sequence:
id
attribute,
- or is not in the same tree as the element of the attribute being set,
- or the given element is not the first element in that tree
- whose ID is the value
- of that id
attribute,
- then continue to the next element in the sequence.
+ If element is not type-compatible with the IDL attribute, + or is not a descendant of either the attribute's element's root + or the attribute's element's shadow-including root, + continue to the next element in the sequence.
If value is empty and elements is non-empty:
+Append element to elements.
Continue to the next element in the sequence.
Otherwise, append element to elements.
If the given element has no id
attribute,
+ or is not in a document tree with the same root
+ as the element of the attribute being set,
+ or the given element is not the first element in that tree
+ whose ID is the value
+ of that id
attribute, then:
Reset value to be the empty string.
Continue to the next element in the sequence.
id
attribute.
+ Otherwise, let id be the value of
+ the element's id
attribute.
If value is non-empty, append a space character to value.
Append id to value.
Set [[attrAssociatedElements]] to elements.
Set the content attribute to value.
Element.setAttribute()
),
- the value for the IDL attribute is re-set to the value produced by the getting algorithm, above.If the content attribute is set directly (such as via Element.setAttribute()
),
+ the value for the IDL attribute is reset to null.
If a reflecting IDL attribute attr has the type Element
,
or an interface that inherits from Element
, then:
This attribute defines an internal slot, [[attrAssociatedElement]], - on the attribute's element. The initial value for this slot is null.
This attribute defines an internal slot, [[attrAssociatedElement]], on the + attribute's element. The initial value for this slot is null.
On getting, it must run the following algorithm - (stopping at the first point where a value is returned):
-If the value of [[attrAssociatedElement]] is not null, - then return that value, regardless of the value of the content attribute.
On getting, it must run the following algorithm:
+If the value of [[attrAssociatedElement]] is not null, then return that + value, regardless of the value of the content attribute.
Otherwise, if the content attribute is absent, then return null.
Otherwise, if the content attribute is absent, then return null.
Otherwise, let id be the current value of the content attribute.
Otherwise, let id be the current value of the content attribute.
Let candidate be the first element within - the content attribute's elements node document's - descendants whose ID is - id.
Let candidate be the first element within the content attribute's element's + node document's descendants whose ID is + id.
If candidate is null, or if it is not type-compatible with the IDL attribute, - then return null.
If candidate is null, or if it is not type-compatible with the IDL attribute, + then return null.
Otherwise, return candidate.
On setting, it must run the following algorithm:
+Otherwise, return candidate.
On setting, it must run the following algorithm:
+If the given value is null, or is not type-compatible with the IDL attribute, or is not a + descendant of either the attribute's element's root or the attribute's element's + shadow-including root:
If the given value is null, or is not type-compatible with the IDL attribute, - or is not a descendant of either the attribute's element's root - or the attribute's element's shadow-including root:
-Set [[attrAssociatedElement]] to null.
Remove the content attribute.
Return.
Set [[attrAssociatedElement]] to null.
Remove the content + attribute.
Return.
Otherwise, set [[attrAssociatedElement]] to the given value.
Otherwise, set [[attrAssociatedElement]] to the given value.
Let id be the empty string.
Let id be the empty string.
If the given element has an id
attribute, and is in
+ a document tree with the same root as the element of the attribute being
+ set, and the given element is the first element in that root's descendants whose
+ ID is the value of that id
+ attribute, then let id be the value of that id
+ attribute.
If the given element has an id
attribute,
- and is in a document tree with the same root
- as the element of the attribute being set,
- and the given element is the first element in that root's descendants
- whose ID is the value
- of that id
attribute,
- then let id be the value of that id
attribute.
Set the content attribute to id.
Set the content attribute to id.
If the content attribute is set directly (such as via Element.setAttribute()
),
- the value for the IDL attribute is reset to null.
If the content attribute is set directly (such as via Element.setAttribute()
), the value for the IDL attribute is reset to null.
If a reflecting IDL attribute attr has the type sequence<Element>
,
- or sequence<T>
where T inherits from Element
, then:
+
If a reflecting IDL attribute attr has the type sequence<
, or Element
>sequence<T>
where
+ T inherits from Element
, then:
This attribute defines an internal slot, [[attrAssociatedElements]], - on the attribute's element. The initial value for this slot is null.
This attribute defines an internal slot, [[attrAssociatedElements]], on the + attribute's element. The initial value for this slot is null.
On getting, it must run the following algorithm (stopping at the first point where a value is returned):
-If the value of [[attrAssociatedElements]] is not null, - then return that value, regardless of the value of the content attribute.
On getting, it must run the following algorithm:
+If the value of [[attrAssociatedElements]] is not null, then return that + value, regardless of the value of the content attribute.
If the content attribute is absent, then the IDL attribute must return null.
If the content attribute is absent, then the IDL attribute must return null.
Otherwise, let elements be an empty list.
Otherwise, let elements be an empty list.
For each id in the set of space-separated tokens:
-Let candidate be the first element within - the content attribute's elements node document's - descendants whose ID is - id.
For each id in the set of space-separated tokens:
+Let candidate be the first element within the content attribute's elements + node document's descendants whose ID is + id.
If candidate is null, - or if it is not type-compatible with the IDL attribute, - then continue to the next token.
If candidate is null, or if it is not type-compatible with the IDL + attribute, then continue to the next token.
Otherwise, append candidate to elements.
Return elements.
Otherwise, append candidate to elements.
Return elements.
On setting, it must run the following algorithm:
+If the given value is null:
+Set [[attrAssociatedElements]] to null.
Remove the content + attribute.
Return.
On setting, it must run the following algorithm:
+Otherwise, let elements be an empty list, and value be an empty + string.
For each element in the sequence:
If the given value is null:
-Set [[attrAssociatedElements]] to null.
Remove the content attribute.
Return.
If element is not type-compatible with the IDL attribute, or is not a + descendant of either the attribute's element's root or the attribute's element's + shadow-including root, continue to the next element in the sequence.
If value is empty and elements is non-empty:
+Append element to elements.
Continue to the + next element in the sequence.
Otherwise, let elements be an empty list, - and value be an empty string.
Otherwise, append element to elements.
For each element in the sequence:
-If element is not type-compatible with the IDL attribute, - or is not a descendant of either the attribute's element's root - or the attribute's element's shadow-including root, - continue to the next element in the sequence.
If value is empty and elements is non-empty:
-Append element to elements.
Continue to the next element in the sequence.
Otherwise, append element to elements.
If the given element has no id
attribute,
- or is not in a document tree with the same root
- as the element of the attribute being set,
- or the given element is not the first element in that tree
- whose ID is the value
- of that id
attribute, then:
Reset value to be the empty string.
Continue to the next element in the sequence.
Otherwise, let id be the value of
- the element's id
attribute.
If value is non-empty, append a space character to value.
Append id to value.
If the given element has no id
attribute, or is not
+ in a document tree with the same root as the element of the
+ attribute being set, or the given element is not the first element in that tree
+ whose ID is the value of that id
attribute, then:
Reset value to be the empty string.
Continue to the next + element in the sequence.
Set [[attrAssociatedElements]] to elements.
Otherwise, let id be the value of the element's id
attribute.
Set the content attribute to value.
If value is non-empty, append a space character to value.
Append id to value.
Set [[attrAssociatedElements]] to elements.
Set the content attribute to value.
If the content attribute is set directly (such as via Element.setAttribute()
),
- the value for the IDL attribute is reset to null.
If the content attribute is set directly (such as via Element.setAttribute()
), the value for the IDL attribute is reset to null.
On getting, it must run the following algorithm:
+On getting:
If the value of [[attrAssociatedElement]] is not null, then return that value, regardless of the value of the content attribute.
Otherwise, return candidate.
On setting, it must run the following algorithm:
+On setting:
If the given value is null, or is not type-compatible with the IDL attribute, or is not a descendant of either the attribute's element's root or the attribute's element's shadow-including root:
Set [[attrAssociatedElement]] to null.
Remove the content - attribute.
Return.
Set [[attrAssociatedElement]] to null.
Remove the content attribute.
Return.
id
attribute.Set the content attribute to id.
Set the content attribute's value to id.
On getting, it must run the following algorithm:
+On getting:
If the value of [[attrAssociatedElements]] is not null, then return that value, regardless of the value of the content attribute.
If the content attribute is absent, then the IDL attribute must return null.
If the content attribute is absent, then return null.
Otherwise, let elements be an empty list.
For each id in the set of space-separated tokens:
+For each id in the set of space-separated + tokens:
+Let candidate be the first element within the content attribute's elements node document's descendants whose ID is id.
If candidate is null, or if it is not type-compatible with the IDL - attribute, then continue to the next token.
Otherwise, append candidate to elements.
Return elements.
On setting, it must run the following algorithm:
+On setting:
If the given value is null:
Set [[attrAssociatedElements]] to null.
Remove the content - attribute.
Return.
Set [[attrAssociatedElements]] to null.
Remove the content attribute.
Return.
For each element in the sequence:
+For each element in the given value:
If element is not type-compatible with the IDL attribute, or is not a - descendant of either the attribute's element's root or the attribute's element's - shadow-including root, continue to the next element in the sequence.
If element is not type-compatible with the IDL attribute's inner type, or + is not a descendant of either the attribute's element's root or the attribute's + element's shadow-including root, then continue.
If value is empty and elements is non-empty:
Append element to elements.
Continue to the - next element in the sequence.
Append element to elements.
Continue.
Otherwise, append element to elements.
Otherwise, append element to + elements.
If the given element has no id
attribute, or is not
@@ -7348,15 +7356,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
whose ID is the value of that id
attribute, then:
Reset value to be the empty string.
Continue to the next - element in the sequence.
Reset value to be the empty string.
Continue.
Otherwise, let id be the value of the element's id
attribute.
If value is non-empty, append a space character to value.
If value is non-empty, append U+0020 SPACE to value.
Append id to value.
Set [[attrAssociatedElements]] to elements.
Set the content attribute to value.
Set the content attribute's value to value.
DOMTokenList
object whose associated element is the element in question and
whose associated attribute's local name is the name of the attribute in question.
- If a reflecting IDL attribute attr has the type Element
,
- or an interface that inherits from Element
, then:
+
If a reflecting IDL attribute attr has the type
, or an interface that inherits from Element
?
, then:
Element
?
This attribute defines an internal slot, [[attrAssociatedElement]], on the attribute's element. The initial value for this slot is null.
If the content attribute is set directly (such as via Element.setAttribute()
), the value for the IDL attribute is reset to null.
The following attribute change + step is used to synchronize between the content attribute and the IDL attribute:
+If localName is associated attribute’s local name, and namespace + is null, reset [[attrAssociatedElement]] to null.
If a reflecting IDL attribute attr has the type sequence<
, or Element
>sequence<T>
where
- T inherits from Element
, then:
Element
>?, or sequence<T>?
where T inherits from
+ Element
, then:
This attribute defines an internal slot, [[attrAssociatedElements]], on the @@ -7296,10 +7304,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Otherwise, let elements be an empty list.
For each id in the set of space-separated - tokens:
+Let tokens be the content attribute's value, split on ASCII whitespace.
For each id in tokens:
Let candidate be the first element within the content attribute's elements node document's descendants whose ID is @@ -7376,8 +7385,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
If the content attribute is set directly (such as via Element.setAttribute()
), the value for the IDL attribute is reset to null.
The following attribute change + step is used to synchronize between the content attribute and the IDL attribute:
+If localName is associated attribute’s local name, and namespace + is null, reset [[attrAssociatedElements]] to null.
This attribute defines an internal slot, [[attrAssociatedElement]], on the attribute's element. The initial value for this slot is null.
On getting:
-If the value of [[attrAssociatedElement]] is not null, then return that - value, regardless of the value of the content attribute.
Otherwise, if the content attribute is absent, then return null.
Otherwise, let id be the current value of the content attribute.
Let candidate be the first element within the content attribute's element's - node document's descendants whose ID is - id.
If candidate is null, or if it is not type-compatible with the IDL attribute, - then return null.
Otherwise, return candidate.
On getting, return the value of [[attrAssociatedElement]].
On setting:
@@ -7264,12 +7246,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attributeLet id be the empty string.
If the given element has an id
attribute, and is in
- a document tree with the same root as the element of the attribute being
- set, and the given element is the first element in that root's descendants whose
- ID is the value of that id
- attribute, then let id be the value of that id
- attribute.
If the given element:
+has an id
attribute, and
has the same root as the element of the attribute being set, and
is the first element in the element's node tree whose ID is the value of that id
+ attribute,
then let id be the element's ID.
Set the content attribute's value to id.
The following attribute change - step is used to synchronize between the content attribute and the IDL attribute:
+ steps are used to synchronize between the content attribute and the IDL attribute:If localName is associated attribute’s local name, and namespace - is null, reset [[attrAssociatedElement]] to null.
If localName is not associated attribute’s local name, or + namespace is not null, return.
If value is null, then:
+Reset [[attrAssociatedElements]] to null.
Return.
Let candidate be the first element, in tree order, within the content + attribute's element's node tree whose ID is + value.
If candidate is null, or if it is not type-compatible with the IDL attribute, + then set [[attrAssociatedElement]] to null.
Otherwise, set [[attrAssociatedElement]] to candidate.
If a reflecting IDL attribute attr has the type sequence<
, or Element
>?sequence<T>?
where T inherits from
+ data-x="">FrozenArray<Element
>?, or FrozenArray<T>?
where T inherits from
Element
, then:
This attribute defines an internal slot, [[attrAssociatedElements]], on the attribute's element. The initial value for this slot is null.
On getting:
-If the value of [[attrAssociatedElements]] is not null, then return that - value, regardless of the value of the content attribute.
If the content attribute is absent, then return null.
Otherwise, let elements be an empty list.
Let tokens be the content attribute's value, split on ASCII whitespace.
For each id in tokens:
-Let candidate be the first element within the content attribute's elements - node document's descendants whose ID is - id.
If candidate is null, or if it is not type-compatible with the IDL - attribute, then continue.
Otherwise, append candidate to elements.
Return elements.
On getting, return the value of [[attrAssociatedElements]].
On setting:
@@ -7347,31 +7320,28 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute is not a descendant of either the attribute's element's root or the attribute's element's shadow-including root, then continue.If value is empty and elements is non-empty:
-Append element to elements.
Continue.
If value is empty and elements is non-empty, append element to elements and + continue.
Otherwise, append element to elements.
If the given element has no id
attribute, or is not
- in a document tree with the same root as the element of the
- attribute being set, or the given element is not the first element in that tree
- whose ID is the value of that id
attribute, then:
Reset value to be the empty string.
Continue.
If the given element:
+has no id
attribute, or
does not have the same root as the element of the attribute being set, + or
is not the first element in the element's node tree whose ID is the value of that id
+ attribute,
then reset value to be the empty string, and continue.
Otherwise, let id be the value of the element's id
attribute.
Otherwise, let id be the element's ID
.
If value is non-empty, append U+0020 SPACE to value.
The following attribute change - step is used to synchronize between the content attribute and the IDL attribute:
+ steps are used to synchronize between the content attribute and the IDL attribute:If localName is associated attribute’s local name, and namespace - is null, reset [[attrAssociatedElements]] to null.
If localName is not associated attribute’s local name, or + namespace is not null, return.
If value is null, then:
+Reset [[attrAssociatedElements]] to null.
Return.
Let elements be an empty list.
Let tokens be the content attribute's value, split on ASCII whitespace.
For each id in tokens:
+Let candidate be the first element, in tree order, within the content + attribute's elements node tree whose ID is + id.
If candidate is null, or if it is not type-compatible with the IDL + attribute, then continue.
Otherwise, append candidate to elements.
Set [[attrAssociatedElements]] to elements.
If a reflecting IDL attribute attr has the type
, or an interface that inherits from Element
?
, then:
+ data-x="">Element
?Element
?, or type T? where T is an interface
+ that inherits from
, then:
Element
This attribute defines an internal slot, [[attrAssociatedElement]], on the attribute's element. The initial value for this slot is null.
If the given value is null, or is not type-compatible with the IDL attribute, or is not a - descendant of either the attribute's element's root or the attribute's element's - shadow-including root:
+ descendant of either the attribute's element's root or, if the element's + root is a shadow root, the attribute's element's host's root:Set [[attrAssociatedElement]] to null.
Remove the content attribute.
id
attribute,then let id be the element's ID. +
then set id to the element's ID.
Set the content attribute's value to id.
If value is null, then:
Reset [[attrAssociatedElements]] to null.
Set [[attrAssociatedElements]] to null.
Return.
id
attribute,
- then reset value to be the empty string, and continue.
+then set value to be the empty string, and continue.
Otherwise, let id be the element's ID
.
If value is non-empty, append U+0020 SPACE to value.
If value is not the empty string, append U+0020 SPACE to + value.
Append id to value.
On setting:
If the given value is null, or is not type-compatible with the IDL attribute, or is not a - descendant of either the attribute's element's root or, if the element's - root is a shadow root, the attribute's element's host's root: +
If the given value is:
+null, or
not type-compatible with the IDL attribute, or
not a descendant of any of the attribute's element's shadow-including ancestors,
then:
Set [[attrAssociatedElement]] to null.
Remove the content attribute.
If localName is not associated attribute’s local name, or namespace is not null, return.
If the content attribute was set via reflection of the IDL attribute, return.
If value is null, then:
If localName is not associated attribute’s local name, or namespace is not null, return.
If the content attribute was set via reflection of the IDL attribute, return.
If value is null, then:
Element
?, or type T? where T is an interface
that inherits from Element
, then:
This attribute defines an internal slot, [[attrAssociatedElement]], on the - attribute's element. The initial value for this slot is null.
This attribute defines two internal slots on the attribute's element:
+[[attrAssociatedElement]], with an initial value of null;
[[attrSetViaReflection]], with an initial value of false.
On getting, return the value of [[attrAssociatedElement]].
On setting:
Set [[attrSetViaReflection]] to true.
If the given value is:
If localName is not associated attribute’s local name, or namespace is not null, return.
If the content attribute was set via reflection of the IDL attribute, return.
If [[attrSetViaReflection]] is true:
+Set [[attrSetViaReflection]] to false.
Return.
Set [[attrSetViaReflection]] to false.
If value is null, then:
@@ -7301,14 +7315,20 @@ a.setAttribute('href', 'https://example.com/'); // change the content attributeElement
, then:
This attribute defines an internal slot, [[attrAssociatedElements]], on the - attribute's element. The initial value for this slot is null.
This attribute defines two internal slots on the attribute's element:
+[[attrAssociatedElements]], with an initial value of null;
[[attrSetViaReflection]], with an initial value of false.
On getting, return the value of [[attrAssociatedElements]].
On setting:
Set [[attrSetViaReflection]] to true.
If the given value is null:
Otherwise, let elements be an empty list, and value be an empty +
Set [[attrSetViaReflection]] to false.
Let elements be an empty list, and value be an empty string.
If localName is not associated attribute’s local name, or namespace is not null, return.
If the content attribute was set via reflection of the IDL attribute, return.
If [[attrSetViaReflection]] is true:
+Set [[attrSetViaReflection]] to false.
Return.
If value is null, then:
From 8e27621e3b96be11cb111523827bc27f3f8fc362 Mon Sep 17 00:00:00 2001 From: Alice BoxhallIf value is null, then:
Set [[attrAssociatedElements]] to null.
Set [[attrAssociatedElement]] to null.
Return.
Element
?, or type T? where T is an interface
that inherits from Element
, then:
The attribute's element can be associated with a particular other element, referred to as + its attr-associated element.
Except where otherwise specified by the following rules, an element has no + attr-associated element.
This attribute defines an internal slot on element named + [[attrAssociatedElement]], with an initial value of null;
If the value of [[attrAssociatedElement]] is not null, the element's + attr-associated element is the value of + [[attrAssociatedElement]].
This attribute defines two internal slots on the attribute's element:
+If the value of [[attrAssociatedElement]] is null, and the value of the content + attribute is not null, then the element's attr-associated element is the + first element, in tree order, within the content attribute's element's node tree + which meets the following criteria:
[[attrAssociatedElement]], with an initial value of null;
[[attrSetViaReflection]], with an initial value of false.
the element's ID is the value of the content + attribute, and
the element is type-compatible with the IDL attribute.
If no element exists which meeds both criteria, then the element has no + attr-associated element.
On getting, return the value of [[attrAssociatedElement]].
On getting, the IDL attribute must return the element's attr-associated + element.
On setting:
Set [[attrSetViaReflection]] to true.
If the given value is:
null, or
not type-compatible with the IDL attribute, or
not a descendant of any of the attribute's element's shadow-including ancestors,
then set id to the element's ID. -
Set the content attribute's value to id.
Set the content attribute's value to id, skipping the attribute change steps.
If localName is not associated attribute’s local name, or namespace is not null, return.
If [[attrSetViaReflection]] is true:
-Set [[attrSetViaReflection]] to false.
Return.
Set [[attrSetViaReflection]] to false.
If value is null, then:
-Set [[attrAssociatedElement]] to null.
Return.
Let candidate be the first element, in tree order, within the content - attribute's element's node tree whose ID is - value.
If candidate is null, or if it is not type-compatible with the IDL attribute, - then set [[attrAssociatedElement]] to null.
Otherwise, set [[attrAssociatedElement]] to candidate.
Set [[attrAssociatedElement]] to null.
Element
, then:
- The attribute's element can be associated with a list of other elements, referred to as + its attr-associated elements.
Except where otherwise specified by the following rules, an element has no + attr-associated elements.
This attribute defines an internal slot on element named + [[attrAssociatedElements]], with an initial value of null.
If the value of [[attrAssociatedElements]] is not null, the element's + attr-associated elements list is the value of + [[attrAssociatedElements]].
This attribute defines two internal slots on the attribute's element:
+If the value of [[attrAssociatedElements]] is null, and the value of the content + attribute is not null, then the element's attr-associated element is + computed as follows:
[[attrAssociatedElements]], with an initial value of null;
[[attrSetViaReflection]], with an initial value of false.
Let elements be an empty list.
Let tokens be the content attribute's value, split on ASCII whitespace.
For each id in tokens:
+Let candidate be the first element, in tree order, within the content + attribute's elements node tree whose ID is + id.
If candidate is null, or if it is not type-compatible with the IDL + attribute, then continue.
Otherwise, append candidate to elements.
If elements is empty, then the element has no + attr-associated elements.
Otherwise, the element's attr-associated elements is + elements.
On getting, return the value of [[attrAssociatedElements]].
On getting, the IDL attribute must return the element's attr-associated + element, or null if it does not exist.
On setting:
Set [[attrSetViaReflection]] to true.
If the given value is null:
Set [[attrSetViaReflection]] to false.
Let elements be an empty list, and value be an empty string.
Set [[attrAssociatedElements]] to elements.
Set the content attribute's value to value.
Set the content attribute's value to value, skipping the attribute change steps.
If localName is not associated attribute’s local name, or namespace is not null, return.
If [[attrSetViaReflection]] is true:
-Set [[attrSetViaReflection]] to false.
Return.
If value is null, then:
-Reset [[attrAssociatedElements]] to null.
Return.
Let elements be an empty list.
Let tokens be the content attribute's value, split on ASCII whitespace.
For each id in tokens:
-Let candidate be the first element, in tree order, within the content - attribute's elements node tree whose ID is - id.
If candidate is null, or if it is not type-compatible with the IDL - attribute, then continue.
Otherwise, append candidate to elements.
Set [[attrAssociatedElements]] to elements.
Set [[attrAssociatedElements]] to null.
Element
?, or type T? where T is an interface
that inherits from Element
, then:
The attribute's element can be associated with a particular other element, referred to as - its attr-associated element.
This attribute defines an internal slot on element named + [[attrElement]], with an initial value of null;
Except where otherwise specified by the following rules, an element has no - attr-associated element.
The attribute's element can be associated with a particular other element, referred to as its + attr-associated element. To compute the attr-associated + element for a particular element:
-This attribute defines an internal slot on element named - [[attrAssociatedElement]], with an initial value of null;
If the value of [[attrElement]] is not null, then return the value of + [[attrElement]].
If the value of [[attrAssociatedElement]] is not null, the element's - attr-associated element is the value of - [[attrAssociatedElement]].
Otherwise, if the value of [[attrElement]] is null, and the value of the content + attribute is not null, let candidate be the first element, in tree order, within + the content attribute's element's node tree which meets the following + criteria:
-If the value of [[attrAssociatedElement]] is null, and the value of the content - attribute is not null, then the element's attr-associated element is the - first element, in tree order, within the content attribute's element's node tree - which meets the following criteria:
-the element's ID is the value of the content - attribute, and
the element is type-compatible with the IDL attribute.
If no element exists which meeds both criteria, then the element has no - attr-associated element.
+the element's ID is the value of the content + attribute, and
the element is type-compatible with the IDL attribute.
If candidate is not null, then return candidate.
Otherwise, the element has no attr-associated element +
On getting, the IDL attribute must return the element's attr-associated
@@ -7258,22 +7262,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
On setting: If the given value is: null, or not a descendant of any of the attribute's element's shadow-including ancestors, then: If the given value is not a descendant of any of the attribute's element's
+ shadow-including ancestors,
+ then: Set [[attrAssociatedElement]] to null. Set [[attrElement]] to null. Remove the content attribute. Return. Otherwise, set [[attrAssociatedElement]] to the given value. Let id be the empty string. If the given element: then set id to the element's ID.
- Set the content attribute's value to id, skipping the attribute change steps. Set the content attribute's value to id. Set [[attrElement]] to the given value.
-
-
-
If localName is not associated attribute’s local name, or namespace is not null, return.
Set [[attrAssociatedElement]] to null.
Set [[attrElement]] to null.
This attribute defines an internal slot on element named - [[attrAssociatedElements]], with an initial value of null.
If the value of [[attrAssociatedElements]] is not null, the element's +
If the value of [[attrElements]] is not null, the element's attr-associated elements list is the value of - [[attrAssociatedElements]].
If the value of [[attrAssociatedElements]] is null, and the value of the content +
If the value of [[attrElements]] is null, and the value of the content attribute is not null, then the element's attr-associated element is computed as follows:
If the given value is null:
Set [[attrAssociatedElements]] to null.
Set [[attrElements]] to null.
Remove the content attribute.
Return.
For each element in the given value:
If element is not type-compatible with the IDL attribute's inner type, or - is not a descendant of either the attribute's element's root or the attribute's - element's shadow-including root, then continue.
If element is not a descendant of any of the attribute's + element's shadow-including + ancestors, then continue.
+If value is empty and elements is non-empty, append element to elements and @@ -7399,8 +7401,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
then set value to be the empty string, and continue.
Otherwise, let id be the element's ID
.
Otherwise, let id be the element's ID.
If value is not the empty string, append U+0020 SPACE to value.
Set [[attrAssociatedElements]] to elements.
Set [[attrElements]] to elements.
Set the content attribute's value to value, skipping the attribute change steps.
If localName is not associated attribute’s local name, or namespace is not null, return.
Set [[attrAssociatedElements]] to null.
Set [[attrElements]] to null.
If a reflecting IDL attribute attr has the type
, or type T? where T is an interface
- that inherits from Element
?
, then:
+ data-x="">T?, where T is either Element
Element
or an
+ interface that inherits from Element
, then:
+
This attribute defines an internal slot on element named - [[attrElement]], with an initial value of null;
Elements of the type this IDL attribute appears on have an explicitly set + attr-element, which is an element or null. It is initially null.
The attribute's element can be associated with a particular other element, referred to as its - attr-associated element. To compute the attr-associated - element for a particular element:
+Elements of the type this IDL attribute appears on have an attr-associated + element. To compute the attr-associated element for such an + element element:
If the value of [[attrElement]] is not null, then return the value of - [[attrElement]].
If element's explicitly set attr-element is not null, + then return element's explicitly set attr-element.
Otherwise, if the value of [[attrElement]] is null, and the value of the content - attribute is not null, let candidate be the first element, in tree order, within - the content attribute's element's node tree which meets the following +
Otherwise, if the content attribute is present on element, then return the first + element candidate, in tree order, that meets the following criteria:
-the element's ID is the value of the content - attribute, and
the element is type-compatible with the IDL attribute.
If candidate is not null, then return candidate.
If no such element exists, then return null.
+Otherwise, the element has no attr-associated element +
Return null.
Other parts of this specification, or other specifications using attribute + reflection, are generally expected to consult the attr-associated + element. The explicitly set attr-element is an internal + implementation detail of the attr-associated element, and is not to be + used directly.
On getting, the IDL attribute must return the element's attr-associated
+ On getting, the IDL attribute must return this element's attr-associated
element. On setting: On setting, the IDL attribute must perform the following steps: If the given value is not a descendant of any of the attribute's element's
- shadow-including ancestors,
- then: If the given value is not a descendant of any of this element's shadow-including ancestors, then: Set [[attrElement]] to null. Remove the content attribute. Set this element's explicitly set attr-element to
+ null. Remove the content attribute from this element. Return. Let id be the empty string. If the given element: has an has the same root as the element of the attribute being set, and is the first element in the element's node tree whose If the given value: then set id to the element's ID.
+ then set id to the given value's ID. Set the content attribute's value to id. Set the content attribute's value for this element to id. Set [[attrElement]] to the given value. Set this element's explicitly set attr-element to the given
+ value. The following attribute change
steps are used to synchronize between the content attribute and the IDL attribute: If localName is not associated attribute’s local name, or
- namespace is not null, return. If localName is not the content attribute's local name, or
+ namespace is not null, then return. Set [[attrElement]] to null. Set element's explicitly set attr-element to
+ null.
-
-
id
attribute, and
+
id
attribute, andid
- attribute,
-
If a reflecting IDL attribute attr has the type FrozenArray<
, or Element
>?FrozenArray<T>?
where T inherits from
- Element
, then:
Element
or an interface that inherits from Element
, then:
The attribute's element can be associated with a list of other elements, referred to as - its attr-associated elements.
Elements of the type this IDL attribute appears on have explicitly set + attr-elements, which is either a list of elements or null. It is + initially null.
Except where otherwise specified by the following rules, an element has no - attr-associated elements.
Elements of the type this IDL attribute appears on have cached
+ attr-associated elements, which is a FrozenArray<
. It is initially null.Element
>?
This attribute defines an internal slot on element named - [[attrElements]], with an initial value of null.
Elements of the type this IDL attribute appears on have attr-associated elements. To compute the + attr-associated elements for such an element element:
-If the value of [[attrElements]] is not null, the element's - attr-associated elements list is the value of - [[attrElements]].
If element's explicitly set attr-elements is not + null, then return element's explicitly set + attr-elements.
If the value of [[attrElements]] is null, and the value of the content - attribute is not null, then the element's attr-associated element is - computed as follows: -
Let elements be an empty list.
Let elements be an empty list.
Let tokens be the content attribute's value, split on ASCII whitespace.
For each id in tokens:
-Let candidate be the first element, in tree order, within the content - attribute's elements node tree whose ID is - id.
Let candidate be the first element, in tree order, that meets the + following criteria:
+ +If candidate is null, or if it is not type-compatible with the IDL - attribute, then continue.
If no such element exists, then continue.
+Otherwise, append candidate to elements.
Append candidate to + elements.
If elements is empty, then the element has no - attr-associated elements.
If elements is empty, then set + elements to null.
Otherwise, the element's attr-associated elements is - elements.
Return elements.
Other parts of this specification, or other specifications using attribute + reflection, are generally expected to consult the attr-associated + elements. The explicitly set attr-elements are an internal + implementation detail of the attr-associated elements, and are not to be + used directly. Similarly, the cached attr-associated elements are an + internal implementation detail of the IDL attribute's getter.
-On getting, the IDL attribute must return the element's attr-associated - element, or null if it does not exist.
On getting, the IDL attribute must perform the following steps:
+ +Let elements be this element's attr-associated + elements.
If the contents of elements is equal to the contents of this element's + cached attr-associated elements, then return this element's + cached attr-associated elements.
Let elementsAsFrozenArray be elements, converted to a FrozenArray<T>?
.
Set this element's cached attr-associated elements to + elementsAsFrozenArray.
Return elementsAsFrozenArray.
This extra caching layer is necessary to preserve the invariant that element.reflectedElements === element.reflectedElements
.
On setting:
+On setting, the IDL attribute must perform the following steps:
If the given value is null:
Set [[attrElements]] to null.
Remove the content attribute.
Set this element's explicitly set attr-elements to + null.
Remove the content attribute from this element.
Return.
Let elements be an empty list, and value be an empty - string.
Let elements be an empty list.
Let value be an empty string.
For each element in the given value:
If element is not a descendant of any of the attribute's - element's shadow-including - ancestors, then continue.
+If element is not a descendant of any of this element's shadow-including ancestors, then + continue.
If value is empty and elements is non-empty, append element to elements and +
If value is empty and elements is non-empty, then append element to elements and continue.
Otherwise, append element to +
Append element to elements.
If the given element:
-has no id
attribute, or
does not have the same root as the element of the attribute being set, - or
is not the first element in the element's node tree whose If element:
+ +id
attribute, orid
- attribute,then set value to be the empty string, and continue.
+ +then set value to the empty string, and continue.
Otherwise, let id be the element's Let id be element's ID.
If value is not the empty string, append U+0020 SPACE to +
If value is not the empty string, then append U+0020 SPACE to value.
Append id to value.
Set [[attrElements]] to elements.
Set the content attribute's value for this element to value.
Set the content attribute's value to value, skipping the attribute change steps.
Set this element's explicitly set attr-elements to + elements.
The following attribute change steps are used to synchronize between the content attribute and the IDL attribute:
If localName is not associated attribute’s local name, or - namespace is not null, return.
If localName is not the content attribute's local name, or + namespace is not null, then return.
Set [[attrElements]] to null.
Set element's explicitly set attr-elements to + null.
If element's explicitly set attr-element is not null, - then return element's explicitly set attr-element.
If element's explicitly set attr-element is not null:
+If element's explicitly set attr-element is a + descendant of any of element's shadow-including ancestors, then return + element's explicitly set attr-element.
Otherwise, return null.
Otherwise, if the content attribute is present on element, then return the first @@ -7245,7 +7253,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
On setting, the IDL attribute must perform the following steps:
If the given value is not a descendant of any of this element's shadow-including ancestors, then:
- -Set this element's explicitly set attr-element to - null.
Remove the content attribute from this element.
Return.
Let id be the empty string.
If the given value:
@@ -7333,44 +7329,63 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute attr-associated elements for such an element element:If element's explicitly set attr-elements is not - null, then return element's explicitly set - attr-elements.
Let elements be an empty list.
Let elements be an empty list.
Let tokens be the content attribute's value, split on ASCII whitespace, if the content attribute is present on - element; otherwise let tokens be an empty list.
For each id in tokens:
-Let candidate be the first element, in tree order, that meets the - following criteria:
- -If no such element exists, then continue.
-If element's explicitly set attr-elements is not + null, then:
+For each attrElement in the element's + explicitly set attr-elements:
+If attrElement is not a descendant of any of element's shadow-including ancestors, then + continue.
Add attrElement to elements.
Otherwise:
+Let tokens be the content attribute's value, split on ASCII whitespace, if the content attribute is present on + element; otherwise let tokens be an empty list.
Append candidate to - elements.
For each id in tokens:
+Let candidate be the first element, in tree order, that meets the + following criteria:
+ +If no such element exists, then continue.
+Append candidate to + elements.
If elements is empty, then set - elements to null.
If elements is empty, then set + elements to null.
Return elements.
Return elements.
Other parts of this specification, or other specifications using attribute reflection, are generally expected to consult the attr-associated elements. The explicitly set attr-elements are an internal @@ -7419,19 +7434,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Let elements be an empty list.
Let value be an empty string.
For each element in the given value:
If element is not a descendant of any of this element's shadow-including ancestors, then - continue.
-If value is empty and elements is non-empty, then append element to elements and continue.
Elements of the type this IDL attribute appears on have cached
- attr-associated elements, which is a FrozenArray<
. It is initially null.Element
>?
Elements of the type this IDL attribute appears on have attr-associated elements. To compute the @@ -7390,8 +7386,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute reflection, are generally expected to consult the attr-associated elements. The explicitly set attr-elements are an internal implementation detail of the attr-associated elements, and are not to be - used directly. Similarly, the cached attr-associated elements are an - internal implementation detail of the IDL attribute's getter.
+ used directly.Let elements be this element's attr-associated elements.
If the contents of elements is equal to the contents of this element's - cached attr-associated elements, then return this element's - cached attr-associated elements.
Let elementsAsFrozenArray be elements, converted to a FrozenArray<T>?
.
Set this element's cached attr-associated elements to - elementsAsFrozenArray.
Return elementsAsFrozenArray.
This extra caching layer is necessary to preserve the invariant that element.reflectedElements === element.reflectedElements
.
Elements of the type this IDL attribute appears on have cached
+ attr-associated elements, which is a FrozenArray<
. It is initially null.Element
>?
Elements of the type this IDL attribute appears on have attr-associated elements. To compute the @@ -7386,7 +7390,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute reflection, are generally expected to consult the attr-associated elements. The explicitly set attr-elements are an internal implementation detail of the attr-associated elements, and are not to be - used directly.
+ used directly. Similarly, the cached attr-associated elements are an + internal implementation detail of the IDL attribute's getter.Let elements be this element's attr-associated elements.
If the contents of elements is equal to the contents of this element's + cached attr-associated elements, then return this element's + cached attr-associated elements.
Let elementsAsFrozenArray be elements, converted to a FrozenArray<T>?
.
Set this element's cached attr-associated elements to + elementsAsFrozenArray.
Return elementsAsFrozenArray.
This extra caching layer is necessary to preserve the invariant that element.reflectedElements === element.reflectedElements
.
Otherwise:
If the content attribute is not present on element, return null.
Let tokens be the content attribute's value, split on ASCII whitespace, if the content attribute is present on - element; otherwise let tokens be an empty list.
For each id in tokens:
@@ -7378,9 +7379,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attributeIf elements is empty, then set - elements to null.
Return elements.