Skip to content

Commit aa374be

Browse files
authored
Tweak how accesskey on legend works
Fixes #3950. Tests: web-platform-tests/wpt#12800 * Don't special-case focusable legend, like Edge/Chrome/Safari * Fix grammar * Fix wording * Use lists to make it less ambiguous * and * Address domenic's comments * Add an example * Source formatting nits
1 parent 1ca520a commit aa374be

File tree

1 file changed

+35
-14
lines changed

1 file changed

+35
-14
lines changed

source

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56825,7 +56825,7 @@ interface <dfn>HTMLDetailsElement</dfn> : <span>HTMLElement</span> {
5682556825
<p>The <span data-x="command-facet-Label">Label</span> of the command is the string given by the
5682656826
element's <code>textContent</code> IDL attribute.</p>
5682756827

56828-
<p>The <span data-x="command-facet-AccessKey">AccessKey</span> of the command is the element's
56828+
<p>The <span data-x="command-facet-AccessKey">Access Key</span> of the command is the element's
5682956829
<span>assigned access key</span>, if any.</p>
5683056830

5683156831
<p>The <span data-x="command-facet-HiddenState">Hidden State</span> of the command is true (hidden)
@@ -56891,7 +56891,7 @@ interface <dfn>HTMLDetailsElement</dfn> : <span>HTMLElement</span> {
5689156891

5689256892
</ul>
5689356893

56894-
<p>The <span data-x="command-facet-AccessKey">AccessKey</span> of the command is the element's
56894+
<p>The <span data-x="command-facet-AccessKey">Access Key</span> of the command is the element's
5689556895
<span>assigned access key</span>, if any.</p>
5689656896

5689756897
<p>The <span data-x="command-facet-HiddenState">Hidden State</span> of the command is true (hidden)
@@ -56917,7 +56917,7 @@ interface <dfn>HTMLDetailsElement</dfn> : <span>HTMLElement</span> {
5691756917
with <span data-x="strip and collapse ASCII whitespace">ASCII whitespace stripped and
5691856918
collapsed</span>.</p>
5691956919

56920-
<p>The <span data-x="command-facet-AccessKey">AccessKey</span> of the command is the element's
56920+
<p>The <span data-x="command-facet-AccessKey">Access Key</span> of the command is the element's
5692156921
<span>assigned access key</span>, if any.</p>
5692256922

5692356923
<p>The <span data-x="command-facet-HiddenState">Hidden State</span> of the command is true (hidden)
@@ -56939,25 +56939,46 @@ interface <dfn>HTMLDetailsElement</dfn> : <span>HTMLElement</span> {
5693956939
<h5><dfn data-x="legend-command">Using the <code data-x="attr-accesskey">accesskey</code> attribute
5694056940
on a <code>legend</code> element to define a command</dfn></h5>
5694156941

56942-
<p>A <code>legend</code> element that has an <span>assigned access key</span> and is a child of a
56943-
<code>fieldset</code> element that has a descendant that is not a descendant of the
56944-
<code>legend</code> element and is neither a <code>label</code> element nor a <code>legend</code>
56945-
element but that <span data-x="concept-command">defines a command</span>, itself <span
56946-
data-x="concept-command">defines a command</span>.</p>
56942+
<p>A <code>legend</code> element <span data-x="concept-command">defines a command</span> if all of
56943+
the following are true:</p>
56944+
56945+
<ul>
56946+
<li><p>It has an <span>assigned access key</span>.</p></li>
56947+
56948+
<li><p>It is a child of a <code>fieldset</code> element.</p></li>
56949+
56950+
<li><p>Its parent has a descendant that <span data-x="concept-command">defines a command</span>
56951+
that is neither a <code>label</code> element nor a <code>legend</code> element. This element,
56952+
if it exists, is <dfn>the <code>legend</code> element's <code>accesskey</code>
56953+
delegatee</dfn>.</p></li>
56954+
</ul>
5694756955

5694856956
<p>The <span data-x="command-facet-Label">Label</span> of the command is the string given by the
5694956957
element's <code>textContent</code> IDL attribute.</p>
5695056958

56951-
<p>The <span data-x="command-facet-AccessKey">AccessKey</span> of the command is the element's
56959+
<p>The <span data-x="command-facet-AccessKey">Access Key</span> of the command is the element's
5695256960
<span>assigned access key</span>.</p>
5695356961

5695456962
<p>The <span data-x="command-facet-HiddenState">Hidden State</span>, <span
5695556963
data-x="command-facet-DisabledState">Disabled State</span>, and <span
5695656964
data-x="command-facet-Action">Action</span> facets of the command are the same as the respective
56957-
facets of the first element in <span>tree order</span> that is a descendant of the parent of the
56958-
<code>legend</code> element that <span data-x="concept-command">defines a command</span> but is not
56959-
a descendant of the <code>legend</code> element and is neither a <code>label</code> nor a
56960-
<code>legend</code> element.</p>
56965+
facets of <span>the <code>legend</code> element's <code>accesskey</code> delegatee</span>.</p>
56966+
56967+
<div class="example">
56968+
<p>In this example, the <code>legend</code> element specifies an <code
56969+
data-x="attr-accesskey">accesskey</code>, which, when activated, will delegate to the
56970+
<code>input</code> element inside the <code>legend</code> element.</p>
56971+
56972+
<pre><code class="html" data-x="">&lt;fieldset>
56973+
&lt;legend accesskey=p>
56974+
&lt;label>I want &lt;input name=pizza type=number step=1 value=1 min=0>
56975+
pizza(s) with these toppings&lt;/label>
56976+
&lt;/legend>
56977+
&lt;label>&lt;input name=pizza-cheese type=checkbox checked> Cheese&lt;/label>
56978+
&lt;label>&lt;input name=pizza-ham type=checkbox checked> Ham&lt;/label>
56979+
&lt;label>&lt;input name=pizza-pineapple type=checkbox> Pineapple&lt;/label>
56980+
&lt;/fieldset></code></pre>
56981+
</div>
5696156982

5696256983

5696356984
<h5><dfn data-x="accesskey-command">Using the <code data-x="attr-accesskey">accesskey</code>
@@ -56979,7 +57000,7 @@ interface <dfn>HTMLDetailsElement</dfn> : <span>HTMLElement</span> {
5697957000
the <span data-x="command-facet-Label">Label</span> is the <code>textContent</code> of the element
5698057001
itself.</p>
5698157002

56982-
<p>The <span data-x="command-facet-AccessKey">AccessKey</span> of the command is the element's
57003+
<p>The <span data-x="command-facet-AccessKey">Access Key</span> of the command is the element's
5698357004
<span>assigned access key</span>.</p>
5698457005

5698557006
<p>The <span data-x="command-facet-HiddenState">Hidden State</span> of the command is true (hidden)

0 commit comments

Comments
 (0)