diff --git a/source b/source index 73646634775..3265de433b5 100644 --- a/source +++ b/source @@ -10697,6 +10697,14 @@ partial interface Document {
This is only populated for "about:"-schemed
Documents.
Each Document has a fire
+ mutation events flag, which is a boolean, initially true.
This is intended to suppress firing of DOM Mutation Events in cases when they + would normally fire. The specification describing mutation events is not actively maintained so + it does not look at this flag, but implementations are expected to act as though it did. + UIEVENTS
+DocumentOrShadowRoot interfaceDOM defines the Content attributes:
@@ -59937,6 +59947,31 @@ interface HTMLDetailsElement : HTMLElement {
nameopen
The rest of the element's contents represents the additional information or controls.
+The name content
+ attribute gives the name of the group of related details elements that the element is
+ a member of. Opening one member of this group causes other members of the group to close. If the
+ attribute is specified, its value must not be the empty string.
A document must not contain more than one details element in the same
+ details name group that has the open
+ attribute present. Authors must not use script to add details elements to a document
+ in a way that would cause a details name group to have more than one
+ details element with the open attribute
+ present.
The group of elements that is created by a common name attribute is exclusive, meaning that at most one of the
+ details elements can be open at once. While this exclusivity is enforced by user
+ agents, the resulting enforcement immediately changes the open attributes in the markup. This requirement on authors
+ forbids such misleading markup.
Documents that use the name attribute to group multiple
+ related details elements should keep those related elements together in a containing
+ element (such as a section element).
Keeping related elements together can be important for accessibility.
+The open content
attribute is a boolean attribute. If present, it indicates that both the summary and
the additional information is to be shown to the user. If the attribute is absent, only the
@@ -59963,25 +59998,68 @@ interface HTMLDetailsElement : HTMLElement {
exists, user agents can still provide this ability through some other user interface
affordance.
The details name group that contains a details element a
+ also contains all the other details elements b that fulfill all of the
+ following conditions:
name attribute, their name attributes are not the empty string, and the value of
+ a's name attribute equals the value of
+ b's name attribute.Every details element has a details toggle task tracker, which is a
toggle task tracker or null, initially null.
Whenever the open attribute is added to or removed from
- a details element, the user agent must run the following steps, which are known as
- the details notification task steps, for this details element:
When the open attribute is toggled several
- times in succession, the resulting tasks essentially get coalesced so that only one event is
- fired.
The following attribute change
+ steps, given element, localName, oldValue,
+ value, and namespace, are used for all details elements:
If the open attribute is added, queue a
- details toggle event task given the details element, "closed", and "open".
If namespace is not null, then return.
If localName is name, then ensure
+ details exclusivity by closing the given element if needed given
+ element.
Otherwise, queue a details toggle event task given the details
- element, "open", and "closed".
If localName is open, then:
+
If one of oldValue or value is null and the other is not null,
+ run the following steps, which are known as the details notification task steps, for
+ this details element:
When the open attribute is toggled
+ several times in succession, the resulting tasks essentially get coalesced so that only one
+ event is fired.
If oldValue is null, queue a details toggle event task given
+ the details element, "closed", and "open".
Otherwise, queue a details toggle event task given the
+ details element, "open", and "closed".
If oldValue is null and value is not null, then ensure + details exclusivity by closing other elements if needed given + element.
The details HTML element insertion
+ steps, given insertedNode, are:
Ensure details exclusivity by closing the given element if needed given + insertedNode.
To queue a details toggle event task given a details element
@@ -60023,9 +60101,105 @@ interface HTMLDetailsElement : HTMLElement {
to oldState.
The open
- IDL attribute must reflect the open content
- attribute.
To ensure details exclusivity by closing other elements if needed given a
+ details element element:
Assert: element has an open attribute.
If element does not have a name
+ attribute, or its name attribute is the empty string,
+ then return.
Let document be element's node document.
Let oldFlag be the value of document's fire mutation events flag.
Set document's fire + mutation events flag to false.
Let groupMembers be a list of elements, containing all elements in + element's details name group except for element, in tree + order.
For each element otherElement of + groupMembers:
+If the open attribute is set on
+ otherElement, then:
Assert: otherElement is the only element in
+ groupMembers that has the open attribute
+ set.
Remove the open attribute on otherElement.
Break.
Set document's fire + mutation events flag to oldFlag.
To ensure details exclusivity by closing the given element if needed given a
+ details element element:
If element does not have an open
+ attribute, then return.
If element does not have a name
+ attribute, or its name attribute is the empty string,
+ then return.
Let document be element's node document.
Let oldFlag be the value of document's fire mutation events flag.
Set document's fire + mutation events flag to false.
Let groupMembers be a list of elements, containing all elements in + element's details name group except for element, in tree + order.
For each element otherElement of + groupMembers:
+ +If the open attribute is set on
+ otherElement, then:
Remove the open attribute on element.
Break.
Set document's fire + mutation events flag to oldFlag.
The name
+ and open
+ IDL attributes must reflect the respective content attributes of the same name.
The following example shows the name attribute of the
+ details element being used to create an exclusive accordion, a set of
+ details elements where a user action to open one details element causes
+ any open details to close.
<section class="characteristics">
+ <details name="frame-characteristics">
+ <summary>Material</summary>
+ The picture frame is made of solid oak wood.
+ </details>
+ <details name="frame-characteristics">
+ <summary>Size</summary>
+ The picture frame fits a photo 40cm tall and 30cm wide.
+ The frame is 45cm tall, 35cm wide, and 2cm thick.
+ </details>
+ <details name="frame-characteristics">
+ <summary>Color</summary>
+ The picture frame is available in its natural wood
+ color, or with black stain.
+ </details>
+</section>
+ The following example shows what happens when the open
+ attribute is set on a details element that is part of a set of elements using the
+ name attribute to create an exclusive accordion.
Given the initial markup:
+ +<section class="characteristics">
+ <details name="frame-characteristics" id="d1" open>...</details>
+ <details name="frame-characteristics" id="d2">...</details>
+ <details name="frame-characteristics" id="d3">...</details>
+</section>
+
+ and the script:
+ +document.getElementById("d2").setAttribute("open", "");
+
+ then the resulting tree after the script executes will be equivalent to the markup:
+ +<section class="characteristics">
+ <details name="frame-characteristics" id="d1">...</details>
+ <details name="frame-characteristics" id="d2" open>...</details>
+ <details name="frame-characteristics" id="d3">...</details>
+</section>
+
+ because setting the open attribute on d2 removes it from d1.
The same happens when the user activates the summary element inside of d2.
Because the open attribute is added and removed
@@ -108868,8 +109098,17 @@ document.body.appendChild(frame)
erase all event listeners and handlers given document's relevant
global object.
Replace all with null within - document, without firing any mutation events.
If document is fully active, then:
@@ -134232,6 +134471,7 @@ interface External {summary*;
flowname;
openHTMLDetailsElementform.elements API
name
+ details
+ details elements
+ name
form