diff --git a/source b/source index 81cbb67d3b0..ffd929187ce 100644 --- a/source +++ b/source @@ -2714,6 +2714,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
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 T?
, where T is either Element
or an
+ interface that inherits from Element
, then:
+
+
Elements of the type this IDL attribute appears on have an explicitly set + attr-element, which is a weak reference to an element or null. It is initially + null.
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 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 + element candidate, in tree order, that meets the following + criteria:
+ +If no such element exists, then return null.
+Return null.
Other parts of this specification, or other specifications using attribute + reflection, are expected to consult an element's attr-associated + element. An element's explicitly set attr-element is an internal + implementation detail of its attr-associated element and is not to be + used directly.
+The getter steps are to return this's attr-associated + element.
The setter steps are:
+If the given value is null, then:
+ +Set this's explicitly set attr-element to + null.
Remove the content attribute from this.
Return.
Let id be the empty string.
If the given value:
+ +id
attribute, andid
+ attribute,then set id to the given value's ID.
+Set the content attribute's value for this to id.
Set this's explicitly set attr-element to a weak + reference to the given value.
The following attribute change + steps, given element, localName, oldValue, + value, and namespace, are used to synchronize between the content + attribute and the IDL attribute:
+If localName is not the content attribute's local name, or + namespace is not null, then return.
Set element's explicitly set attr-element to + null.
If a reflecting IDL attribute attr has the type FrozenArray<T>?
, where T is either
+ Element
or an interface that inherits from Element
, then:
Elements of the type this IDL attribute appears on have explicitly set + attr-elements, which is either a list of weak references to elements + or null. It is initially null.
Elements of the type this IDL attribute appears on have cached
+ attr-associated elements, which is a FrozenArray<T>?
. It is initially 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:
+ +Let elements be an empty list.
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.
Append attrElement to elements.
Otherwise:
+If the content attribute is not present on element, return null.
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, that meets the + following criteria:
+ +If no such element exists, then continue.
+Append candidate to + elements.
Return elements.
Other parts of this specification, or other specifications using attribute + reflection, are expected to consult an element's attr-associated + elements. An element's explicitly set attr-elements is an internal + implementation detail of its attr-associated elements and is not to be + used directly. Similarly, the element's cached attr-associated elements + is an internal implementation detail of the IDL attribute's getter.
+The getter steps are:
+ +Let elements be this's attr-associated + elements.
If the contents of elements is equal to the contents of this's + cached attr-associated elements, then return this's + cached attr-associated elements.
Let elementsAsFrozenArray be elements, converted to a FrozenArray<T>?
.
Set this's cached attr-associated elements to + elementsAsFrozenArray.
Return elementsAsFrozenArray.
This extra caching layer is necessary to preserve the invariant that element.reflectedElements === element.reflectedElements
.
The setter steps are:
+If the given value is null:
+ +Set this's explicitly set attr-elements to + null.
Remove the content attribute from this.
Return.
Let value be an empty string.
For each element in the given value:
+ +If value is empty and elements is non-empty, then:
+ +Append a weak reference to element + to elements.
Continue.
Append a weak reference to element to + elements.
If element:
+ +id
attribute, orid
+ attribute,then set value to the empty string, and continue.
+Let id be element's ID.
If value is not the empty string, then append U+0020 SPACE to + value.
Append id to value.
Set the content attribute's value for this to value.
Set this's explicitly set attr-elements to + elements.
The following attribute change + steps, given element, localName, oldValue, + value, and namespace, are used to synchronize between the content + attribute and the IDL attribute:
+ +If localName is not the content attribute's local name, or + namespace is not null, then return.
Set element's explicitly set attr-elements to + null.
canvas
element.
Set the placeholder canvas
- element of offscreenCanvas to be a weak reference to this canvas
+ element of offscreenCanvas to a weak reference to this canvas
element.
Set this canvas
element's context