-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
Fixes #2246. This also fixes the value that the open attribute is set to to be the empty string, instead of "open", matching existing implementations. Tests at web-platform-tests/wpt#4539 show that both implementers of <details> follow these same semantics, despite there having been no spec previously. The only exception is that Blink included a being-rendered check, but that was removed; see https://bugs.chromium.org/p/chromium/issues/detail?id=681711. There's still some discussion ongoing as to whether we should change the content models to disallow interactive descendants of <summary> elements, happening in #2272.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55325,10 +55325,17 @@ interface <dfn>HTMLDetailsElement</dfn> : <span>HTMLElement</span> { | |
information should be shown.</p> | ||
|
||
<p>The user agent should allow the user to request that the additional information be shown or | ||
hidden. To honor a request for the details to be shown, the user agent must set the <code | ||
data-x="attr-details-open">open</code> attribute on the element to the value <code | ||
data-x="">open</code>. To honor a request for the information to be hidden, the user agent must | ||
remove the <code data-x="attr-details-open">open</code> attribute from the element.</p> | ||
hidden. To honor a request for the details to be shown, the user agent must <span | ||
data-x="concept-element-attributes-set-value">set</span> the <code | ||
data-x="attr-details-open">open</code> attribute on the element to the empty string. To honor a | ||
request for the information to be hidden, the user agent must <span | ||
data-x="concept-element-attributes-remove">remove</span> the <code | ||
data-x="attr-details-open">open</code> attribute from the element.</p> | ||
|
||
<p class="note">This ability to request that additional information be shown or hidden may simply | ||
be the <span>activation behavior</span> of the appropriate <code>summary</code> element, in the | ||
case such an element exists. However, if no such element exists, user agents should still provide | ||
this ability through some other user interface affordance.</p> | ||
|
||
<p>Whenever the <code data-x="attr-details-open">open</code> attribute is added to or removed from | ||
a <code>details</code> element, the user agent must <span>queue a task</span> that runs the | ||
|
@@ -55446,6 +55453,33 @@ interface <dfn>HTMLDetailsElement</dfn> : <span>HTMLElement</span> { | |
rest of the contents of the <code>summary</code> element's parent <code>details</code> | ||
element<span w-nodev>, if any</span>.</p> | ||
|
||
<div w-nodev> | ||
|
||
<p>The <span>activation behavior</span> of <code>summary</code> elements is to run the following | ||
steps:</p> | ||
|
||
<ol> | ||
<li><p>If this <code>summary</code> element has no parent node, then abort these steps.</p></li> | ||
|
||
<li><p>Let <var>parent</var> be this <code>summary</code> element's parent node.</p> | ||
|
||
<li><p>If <var>parent</var> is not a <code>details</code> element, then abort these steps.</p> | ||
|
||
<li><p>If <var>parent</var>'s first child <code>summary</code> element is not this | ||
<code>summary</code> element, then abort these steps.</p></li> | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
annevk
Member
|
||
<li> | ||
<p>If the <code data-x="attr-details-open">open</code> attribute is present on | ||
<var>parent</var>, then <span data-x="concept-element-attributes-remove">remove</span> it. | ||
Otherwise, <span data-x="concept-element-attributes-set-value">set</span> <var>parent</var>'s | ||
<code data-x="attr-details-open">open</code> attribute to the empty string.</p> | ||
|
||
<p class="note">This will then run the <span>details notification task steps</span>.</p> | ||
</li> | ||
</ol> | ||
|
||
</div> | ||
|
||
|
||
|
||
<h4 id="the-menu-element">The <dfn id="menus"><code>menu</code></dfn> element</h4> | ||
|
@@ -72262,6 +72296,9 @@ END:VCARD</pre> | |
|
||
<li><code>menuitem</code> elements</li> | ||
|
||
<li><code>summary</code> elements that are the first child <code>summary</code> element of a | ||
<code>details</code> element</li> | ||
|
||
<li>Elements with a <code data-x="attr-draggable">draggable</code> attribute set, if that would | ||
enable the user agent to allow the user to begin a drag operations for those elements without | ||
the use of a pointing device</li> | ||
|
This step doesn't match implementations - see w3c/html#764 (comment)