-
Notifications
You must be signed in to change notification settings - Fork 3k
Add name attribute for grouping details elements into an exclusive accordion #9400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
c88bbf7
8639043
cba81a3
51471c9
40c8996
5134538
8d04f03
9b76787
b7042fa
b945c9c
20490af
0c64396
65a26ed
e3ede80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59454,6 +59454,7 @@ dictionary <dfn dictionary>FormDataEventInit</dfn> : <span>EventInit</span> { | |
<dd>One <code>summary</code> element followed by <span>flow content</span>.</dd> | ||
<dt><span data-x="concept-element-attributes">Content attributes</span>:</dt> | ||
<dd><span>Global attributes</span></dd> | ||
<dd><code data-x="attr-details-name">name</code></dd> | ||
<dd><code data-x="attr-details-open">open</code></dd> | ||
<dt><span | ||
data-x="concept-element-accessibility-considerations">Accessibility considerations</span>:</dt> | ||
|
@@ -59465,6 +59466,7 @@ dictionary <dfn dictionary>FormDataEventInit</dfn> : <span>EventInit</span> { | |
interface <dfn interface>HTMLDetailsElement</dfn> : <span>HTMLElement</span> { | ||
[<span>HTMLConstructor</span>] constructor(); | ||
|
||
[<span>CEReactions</span>] attribute boolean <span data-x="dom-details-name">name</span>; | ||
[<span>CEReactions</span>] attribute boolean <span data-x="dom-details-open">open</span>; | ||
};</code></pre> | ||
</dd> | ||
|
@@ -59485,6 +59487,11 @@ interface <dfn interface>HTMLDetailsElement</dfn> : <span>HTMLElement</span> { | |
<p>The rest of the element's contents <span>represents</span> the additional information or | ||
controls.</p> | ||
|
||
<p>The <dfn element-attr for="details"><code data-x="attr-details-name">name</code></dfn> content | ||
attribute gives the name of the group of related <code>details</code> elements that the element is | ||
a member of. Opening one member of this group causes other members of the group to close. If the | ||
dbaron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
attribute is specified, its value must not be the empty string.</p> | ||
|
||
<p>The <dfn element-attr for="details"><code data-x="attr-details-open">open</code></dfn> content | ||
attribute is a <span>boolean attribute</span>. 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 | ||
|
@@ -59532,9 +59539,51 @@ interface <dfn interface>HTMLDetailsElement</dfn> : <span>HTMLElement</span> { | |
data-x="event-toggle">toggle</code> at the <code>details</code> element.</p></li> | ||
</ol> | ||
|
||
<p>The <dfn attribute for="HTMLDetailsElement"><code data-x="dom-details-open">open</code></dfn> | ||
IDL attribute must <span>reflect</span> the <code data-x="attr-details-open">open</code> content | ||
attribute.</p> | ||
<p>The <dfn><i>details name group</i></dfn> that contains a <code>details</code> element | ||
dbaron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
<var>a</var> also contains all the other <code>details</code> elements <var>b</var> that fulfill | ||
all of the following conditions:</p> | ||
|
||
dbaron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
<ul> | ||
|
||
<li>Both <var>a</var> and <var>b</var> are in the same <span>tree</span>, and the | ||
<span>root</span> of that tree is a <code>Document</code> or a <code>ShadowRoot</code>.</li> | ||
|
||
|
||
<li>They both have a <code data-x="attr-details-name">name</code> attribute, their <code | ||
data-x="attr-details-name">name</code> attributes are not empty, and the value of <var>a</var>'s | ||
<code data-x="attr-details-name">name</code> attribute equals the value of <var>b</var>'s <code | ||
data-x="attr-details-name">name</code> attribute.</li> | ||
|
||
</ul> | ||
|
||
<p>Whenever the <code data-x="attr-details-open">open</code> attribute is added to a | ||
<code>details</code> element that has a <code data-x="attr-details-name">name</code> attribute | ||
that is not empty, the user agent must run the following steps, which are known as the | ||
<dfn>details group closing steps</dfn>, for this <code>details</code> element:</p> | ||
dbaron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
<ol> | ||
<li> | ||
<p>Let <var>group members</var> be a list of elements, containing all elements in this | ||
<code>details</code> element's <i>details name group</i> except for this <code>details</code> | ||
element, in <span>tree order</span>.</p> | ||
|
||
|
||
<p class="note">This is done because mutation events could be run during this algorithm, and the | ||
mutation event listeners could change the members of the <i>details name group</i> or the | ||
dbaron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
<span>tree order</span>. | ||
</li> | ||
|
||
<li> | ||
<p>For each element <var>otherElement</var> in <var>group members</var>, in order:</p> | ||
dbaron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
dbaron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
<ol> | ||
dbaron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
<li><p>If the <code data-x="attr-details-open">open</code> attribute is set on | ||
<var>otherElement</var>, remove the <code data-x="attr-details-open">open</code> attribute on | ||
<var>otherElement</var>. | ||
</ol> | ||
</li> | ||
</ol> | ||
|
||
<p>The <dfn attribute for="HTMLDetailsElement"><code data-x="dom-details-name">name</code></dfn> | ||
and <dfn attribute for="HTMLDetailsElement"><code data-x="dom-details-open">open</code></dfn> | ||
IDL attributes must <span>reflect</span> the respective content attributes of the same name.</p> | ||
|
||
</div> | ||
dbaron marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
dbaron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
@@ -129304,6 +129353,7 @@ interface <dfn interface>External</dfn> { | |
<td><code>summary</code>*; | ||
<span data-x="Flow content">flow</span></td> | ||
<td><span data-x="global attributes">globals</span>; | ||
<code data-x="attr-details-name">name</code> | ||
domenic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
<code data-x="attr-details-open">open</code></td> | ||
<td><code>HTMLDetailsElement</code></td> | ||
</tr> | ||
|
@@ -131575,6 +131625,11 @@ interface <dfn interface>External</dfn> { | |
<span data-x="attr-fe-name">form-associated custom elements</span> | ||
<td> Name of the element to use for <span>form submission</span> and in the <code data-x="dom-form-elements">form.elements</code> API <!--or: Name of the element to use in the <code data-x="dom-form-elements">form.elements</code> API. --> | ||
<td> <a href="#attribute-text">Text</a>* | ||
<tr> | ||
<th> <code data-x="">name</code> | ||
<td> <code data-x="attr-details-name">details</code> | ||
<td> Name of group of mutually-exclusive details elements | ||
domenic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
<td> <a href="#attribute-text">Text</a>* | ||
<tr> | ||
<th> <code data-x="">name</code> | ||
<td> <code data-x="attr-form-name">form</code> | ||
|
Uh oh!
There was an error while loading. Please reload this page.