Skip to content

Commit e1177df

Browse files
Merge branch 'main' into patrickhlauke-issue4654
2 parents 92b68b1 + a3245dd commit e1177df

35 files changed

+336
-306
lines changed

11ty/CustomLiquid.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { type Options as SlugifyOptions, slugifyWithCounter } from "@sindresorhus/slugify";
12
import hljs from "highlight.js";
23
import { Liquid, type Template } from "liquidjs";
34
import type { LiquidOptions, RenderOptions } from "liquidjs/dist/liquid-options";
@@ -10,7 +11,6 @@ import type { GlobalData } from "eleventy.config";
1011

1112
import { biblioPattern, getBiblio, getXmlBiblio } from "./biblio";
1213
import { flattenDom, load, type CheerioAnyNode } from "./cheerio";
13-
import { generateId } from "./common";
1414
import { getAcknowledgementsForVersion, type TermsMap } from "./guidelines";
1515
import { resolveTechniqueIdFromHref, understandingToTechniqueLinkSelector } from "./techniques";
1616
import { techniqueToUnderstandingLinkSelector } from "./understanding";
@@ -640,6 +640,9 @@ export class CustomLiquid extends Liquid {
640640
} else $("section#references").remove();
641641
}
642642

643+
const slugify = slugifyWithCounter();
644+
const slugifyOptions: SlugifyOptions = { decamelize: false };
645+
643646
// Allow autogenerating missing top-level section IDs in understanding docs,
644647
// but don't pick up incorrectly-nested sections in some techniques pages (e.g. H91)
645648
const sectionSelector = scope.isUnderstanding ? "section" : "section[id]:not(.obsolete)";
@@ -650,7 +653,8 @@ export class CustomLiquid extends Liquid {
650653
// when we have sections and sidebar skeleton already reordered
651654
const $tocList = $(".sidebar nav ul");
652655
$h2Sections.each((_, el) => {
653-
if (!el.attribs.id) el.attribs.id = generateId($(el).find(sectionH2Selector).text());
656+
if (!el.attribs.id)
657+
el.attribs.id = slugify($(el).find(sectionH2Selector).text(), slugifyOptions);
654658
$("<a></a>")
655659
.attr("href", `#${el.attribs.id}`)
656660
.text(normalizeTocLabel($(el).find(sectionH2Selector).text()))
@@ -674,9 +678,14 @@ export class CustomLiquid extends Liquid {
674678
$(autoIdSectionSelectors.join(", "))
675679
.filter(`:has(${sectionHeadingSelector})`)
676680
.each((_, el) => {
677-
el.attribs.id = generateId($(el).find(sectionHeadingSelector).text());
681+
el.attribs.id = slugify($(el).find(sectionHeadingSelector).text(), slugifyOptions);
678682
});
679683

684+
// Also autogenerate IDs for any headings with no dedicated section nor explicit ID
685+
$(":is(h3, h4, h5):not(:first-child):not([id])").each((_, el) => {
686+
el.attribs.id = slugify($(el).text(), slugifyOptions);
687+
});
688+
680689
return stripHtmlComments($.html());
681690
}
682691
}

guidelines/act-mapping.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,9 @@
20102010
"title": "Audio and visuals of video element have transcript",
20112011
"permalink": "/standards-guidelines/act/rules/1a02b0/proposed/",
20122012
"successCriteria": [
2013-
"media-alternative-prerecorded"
2013+
"media-alternative-prerecorded",
2014+
"info-and-relationships",
2015+
"audio-only-and-video-only-prerecorded"
20142016
],
20152017
"wcagTechniques": [
20162018
"G69"
@@ -2035,6 +2037,12 @@
20352037
"failed": "not satisfied",
20362038
"passed": "further testing needed",
20372039
"inapplicable": "further testing needed"
2040+
},
2041+
"wcag20:1.3.1": {
2042+
"secondary": "This success criterion is **related** to this rule. This is because this criterion applies to a visible transcript."
2043+
},
2044+
"wcag20:1.2.1": {
2045+
"secondary": "This success criterion is **less strict** than this rule. This is because this criterion does not require a transcript when the audio-only or video-only is a media alternative for text and is clearly labeled as such. Some of the failed examples may satisfy this success criterion."
20382046
}
20392047
},
20402048
"input_aspects": [
@@ -4275,7 +4283,10 @@
42754283
{
42764284
"title": "Video element visual-only content has transcript",
42774285
"permalink": "/standards-guidelines/act/rules/ee13b5/proposed/",
4278-
"successCriteria": [],
4286+
"successCriteria": [
4287+
"info-and-relationships",
4288+
"audio-only-and-video-only-prerecorded"
4289+
],
42794290
"wcagTechniques": [
42804291
"G159"
42814292
],
@@ -4293,6 +4304,12 @@
42934304
"failed": "not satisfied",
42944305
"passed": "further testing needed",
42954306
"inapplicable": "further testing needed"
4307+
},
4308+
"wcag20:1.3.1": {
4309+
"secondary": "This success criterion is **related** to this rule. This is because this criterion applies to a visible transcript."
4310+
},
4311+
"wcag20:1.2.1": {
4312+
"secondary": "This success criterion is **less strict** than this rule. This is because this criterion does not require a transcript when the audio-only or video-only is a media alternative for text and is clearly labeled as such. Some of the failed examples may satisfy this success criterion."
42964313
}
42974314
},
42984315
"input_aspects": [

guidelines/terms/20/accessibility-supported.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181
<p class="note">The Accessibility Guidelines Working Group and the W3C do not specify which or how much support by assistive
8282
technologies there must be for a particular use of a web technology in order for it
83-
to be classified as accessibility supported. (See <a href="https://www.w3.org/WAI/WCAG21/Understanding/conformance#support-level">Level of Assistive Technology Support Needed for "Accessibility Support"</a>.)
83+
to be classified as accessibility supported. (See <a href="https://www.w3.org/WAI/WCAG22/Understanding/conformance#support-level">Level of Assistive Technology Support Needed for "Accessibility Support"</a>.)
8484
</p>
8585

8686
<p class="note">Web technologies can be used in ways that are not accessibility supported as long
@@ -100,7 +100,7 @@
100100

101101
<p class="note">One way for authors to locate uses of a technology that are accessibility supported
102102
would be to consult compilations of uses that are documented to be accessibility supported.
103-
(See <a href="https://www.w3.org/WAI/WCAG21/Understanding/conformance#documented-lists">Understanding Accessibility-Supported Web Technology Uses</a>.) Authors, companies, technology vendors, or others may document accessibility-supported
103+
(See <a href="https://www.w3.org/WAI/WCAG22/Understanding/conformance#documented-lists">Understanding Accessibility-Supported Web Technology Uses</a>.) Authors, companies, technology vendors, or others may document accessibility-supported
104104
ways of using web content technologies. However, all ways of using technologies in
105105
the documentation would need to meet the definition of accessibility-supported Web
106106
content technologies above.

guidelines/terms/20/conforming-alternate-version.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@
6464
the preferences is accessibility supported.
6565
</p>
6666

67-
<p>See <a href="https://www.w3.org/WAI/WCAG21/Understanding/conformance#conforming-alt-versions">Understanding Conforming Alternate Versions</a></p>
67+
<p>See <a href="https://www.w3.org/WAI/WCAG22/Understanding/conformance#conforming-alt-versions">Understanding Conforming Alternate Versions</a></p>
6868

6969
</dd>

guidelines/terms/20/text-alternative.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
text alternative for the chart indicates that a description follows.
1111
</p></aside>
1212

13-
<p class="note">Refer to <a href="https://www.w3.org/WAI/WCAG21/Understanding/conformance#text-alternatives">Understanding Text Alternatives</a> for more information.
13+
<p class="note">Refer to <a href="https://www.w3.org/WAI/WCAG22/Understanding/conformance#text-alternatives">Understanding Text Alternatives</a> for more information.
1414
</p>
1515

1616
</dd>

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"license": "W3C",
1919
"dependencies": {
2020
"@11ty/eleventy": "^3.1.2",
21+
"@sindresorhus/slugify": "^2.2.1",
2122
"axios": "^1.11.0",
2223
"cheerio": "^1.0.0",
2324
"glob": "^10.3.16",

techniques/aria/ARIA14.html

Lines changed: 83 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,96 @@
1-
<!DOCTYPE html><html lang="en"><head><title>Using aria-label to provide an invisible label where a visible label cannot be used</title><link rel="stylesheet" type="text/css" href="../../css/editors.css" class="remove"></head><body><h1>Using aria-label to provide an invisible label where a visible label cannot be used</h1><section class="meta"><p class="id">ID: ARIA14</p><p class="technology">Technology: aria</p><p class="type">Type: Technique</p></section><section id="applicability"><h2>When to Use</h2>
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Using aria-label to provide an accessible name where a visible label cannot be used</title>
5+
<link rel="stylesheet" type="text/css" href="../../css/editors.css" class="remove">
6+
</head>
7+
8+
<body>
9+
<h1>Using aria-label to provide an accessible name where a visible label cannot be used</h1>
10+
<section class="meta">
11+
<p class="id">ID: ARIA14</p>
12+
<p class="technology">Technology: aria</p>
13+
<p class="type">Type: Technique</p>
14+
</section>
15+
<section id="applicability">
16+
<h2>When to Use</h2>
217
<p>Technologies that support <a href="https://www.w3.org/TR/wai-aria/">Accessible Rich Internet Applications (WAI-ARIA)</a>. </p>
3-
</section><section id="description"><h2>Description</h2>
4-
<p>For sighted users, the context and visual appearance of an element can provide sufficient cues to determine the purpose. An example is the 'X' often used in the top right corner of pop-up <code>div</code>s (light boxes) to indicate the control for closing the div.
5-
</p>
6-
<p>In some situations, elements can be given the attribute <code>aria-label</code> to provide an accessible name for situations when there is no visible label due to a chosen design approach or layout but the context and visual appearance of the control make its purpose clear.</p>
18+
</section>
19+
<section id="description">
20+
<h2>Description</h2>
21+
<p>For sighted users, the context and visual appearance of an element can provide sufficient cues to determine the purpose. An example is the “&times;” often used in the top-right corner of dialogs to indicate the control for closing the dialog. While it might be visually clear that the button with the “&times;” symbol closes the dialog, users with assistive technologies rely on accessible names that clearly communicate the purpose of components, in this case “Close”.
22+
</p>
23+
<p>When no clear visible text label is available due to design decisions, the <a href="https://www.w3.org/TR/accname-1.2/#dfn-accessible-name">accessible name</a> can be set by using the <code>aria-label</code> attribute instead, provided that the element has an implicit or explicit <a href="https://www.w3.org/TR/wai-aria-1.2/#namefromauthor">role that supports naming</a>.</p>
24+
25+
<p>The <code>aria-label</code> attribute can also be used to provide an accessible name for custom controls that are not <a href="https://html.spec.whatwg.org/multipage/forms.html#category-label">labelable elements</a>, and cannot therefore use a <code>&lt;label&gt;</code> element with the <code>for</code> attribute.</p>
726

8-
<p>In other situations, elements can be given the attribute <code>aria-label</code> to provide an accessible name when the native HTML labeling element is not supported by the control - for example, when a <code>div</code> set to <code>contentEditable</code> is used instead of native form elements such as <code>input type="text"</code> or <code>textarea</code> in order to provide a richer text editing experience.</p>
27+
<p>For instance, <code>aria-label</code> or <code>aria-labelledby</code> are the most suitable way to provide an accessible name when a <code>&lt;div&gt;</code> element is made editable using the <code>contentEditable</code> attribute, instead of native form elements such as <code>&lt;input type="text"&gt;</code> or <code>&lt;textarea&gt;</code> in order to provide a richer text editing experience.</p>
928

10-
</section><section id="examples"><h2>Examples</h2>
29+
</section>
30+
<section id="examples">
31+
<h2>Examples</h2>
1132
<section class="example">
12-
<h3>A close button in a pop-up box</h3>
13-
14-
<p>On a page, a link displays a pop-up box (a <code>div</code>) with additional information. The 'close' element is implemented as a <code>button</code> containing merely the letter 'X'. The property <code>aria-label="close"</code> is used to provide an accessible name to the <code>button</code>.</p>
15-
<pre xml:space="preserve"><code class="language-html">&lt;div id="box"&gt;
16-
This is a pop-up box.
17-
&lt;button aria-label="Close"&gt;X&lt;/button&gt;
18-
&lt;/div&gt;</code></pre>
19-
<p class="working-example">Working example: <a href="../../working-examples/aria-label-invisible-label-box/">Close button example</a>.
20-
</p>
21-
33+
<h3>A close button in a dialog</h3>
34+
35+
<p>On a page, a button displays a dialog (a <code>&lt;div&gt;</code> element) with additional information. The close element is implemented as a <code>&lt;button&gt;</code> containing merely the symbol “&times;”. The property <code>aria-label="close"</code> is used to provide an accessible name to the button.</p>
36+
<pre xml:space="preserve"><code class="language-html">&lt;dialog id=&quot;dialog&quot;&gt;
37+
This is the content of the dialog.
38+
&lt;button aria-label=&quot;Close&quot;&gt;&times;&lt;/button&gt;
39+
&lt;/dialog&gt;</code></pre>
40+
<p class="working-example">Working example: <a href="../../working-examples/aria-label-accessible-name-dialog/">Close button example</a>.
41+
</p>
42+
2243
</section>
23-
<section class="example">
24-
<h3>A phone number with multiple fields</h3>
25-
26-
<pre xml:space="preserve"><code class="language-html">&lt;div role="group" aria-labelledby="groupLabel"&gt;
44+
<section class=" example">
45+
<h3>A phone number with multiple fields</h3>
46+
47+
<pre xml:space="preserve"><code class="language-html">&lt;div role="group" aria-labelledby="groupLabel"&gt;
2748
&lt;span id="groupLabel"&gt;Work Phone&lt;/span&gt;
2849
+&lt;input autocomplete="tel-country-code" type="number" aria-label="country code"&gt;
2950
&lt;input autocomplete="tel-area-code" type="number" aria-label="area code"&gt;
3051
&lt;input autocomplete="tel-local" type="number" aria-label="subscriber number"&gt;
3152
&lt;/div&gt;</code></pre>
32-
53+
3354
</section>
34-
</section><section id="tests"><h2>Tests</h2>
35-
<section class="procedure"><h3>Procedure</h3>
36-
<p>For elements that use <code>aria-label</code>:
37-
</p>
38-
<ol>
39-
<li>Check that the value of the <code>aria-label</code> attribute properly describes the purpose of an element where user input is required
40-
</li>
41-
</ol>
55+
</section>
56+
<section id="tests">
57+
<h2>Tests</h2>
58+
<section class="procedure">
59+
<h3>Procedure</h3>
60+
<p>For elements that use the <code>aria-label</code> attribute:
61+
</p>
62+
<ol>
63+
<li>Check that the value of the <code>aria-label</code> attribute properly describes the purpose of an element where user input is required
64+
</li>
65+
</ol>
4266
</section>
43-
<section class="results"><h3>Expected Results</h3>
44-
<ul>
45-
<li>#1 is true.</li>
46-
</ul>
67+
<section class="results">
68+
<h3>Expected Results</h3>
69+
<ul>
70+
<li>#1 is true.</li>
71+
</ul>
4772
</section>
48-
</section><section id="related"><h2>Related Techniques</h2><ul>
49-
<li><a href="../aria/ARIA6">ARIA6</a></li>
50-
<li><a href="../aria/ARIA16">ARIA16</a></li>
51-
</ul></section><section id="resources"><h2>Resources</h2>
52-
53-
<ul>
54-
<li>
55-
<a href="https://www.w3.org/WAI/ARIA/apg/">WAI-ARIA Authoring Practices Guide</a>
56-
</li>
57-
<li>
58-
<a href="https://www.w3.org/TR/html-aam/">HTML Accessibility API Mappings</a>
59-
</li>
60-
</ul>
61-
62-
</section>
63-
</body></html>
73+
</section>
74+
<section id="related">
75+
<h2>Related Techniques</h2>
76+
<ul>
77+
<li><a href="../aria/ARIA6">ARIA6</a></li>
78+
<li><a href="../aria/ARIA16">ARIA16</a></li>
79+
</ul>
80+
</section>
81+
<section id="resources">
82+
<h2>Resources</h2>
83+
84+
<ul>
85+
<li>
86+
<a href="https://www.w3.org/WAI/ARIA/apg/">WAI-ARIA Authoring Practices Guide</a>
87+
</li>
88+
<li>
89+
<a href="https://www.w3.org/TR/html-aam/">HTML Accessibility API Mappings</a>
90+
</li>
91+
</ul>
92+
93+
</section>
94+
</body>
95+
96+
</html>

techniques/aria/ARIA21.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h3>Using aria-invalid on required fields</h3>
5252
&lt;/div&gt;
5353
&lt;div&gt;
5454
&lt;label for="email"&gt;Email (required)&lt;/label&gt;
55-
&lt;input type="text" name="email" id="email"&gt;
55+
&lt;input type="email" name="email" id="email"&gt;
5656
&lt;/div&gt;
5757
&lt;div&gt;
5858
&lt;input type="submit" name="button" id="button" value="Submit"&gt;
@@ -69,7 +69,7 @@ <h3>Identifying errors in data format</h3>
6969
<pre xml:space="preserve"><code class="language-html">&lt;div class="control"&gt;
7070
&lt;div&gt;
7171
&lt;label for="email"&gt;Email address: [*]&lt;/label&gt;
72-
&lt;input type="text" name="email" id="email" class="error"
72+
&lt;input type="email" name="email" id="email" class="error"
7373
aria-invalid="true" aria-describedBy="err_1"&gt;
7474
&lt;/div&gt;
7575
&lt;span class="errtext" id="err_1"&gt;Error: Incorrect data&lt;/span&gt;
@@ -78,7 +78,7 @@ <h3>Identifying errors in data format</h3>
7878

7979
<pre xml:space="preserve"><code class="language-html">&lt;div class="control"&gt;
8080
&lt;div&gt;&lt;label for="email"&gt;Email address: [*]&lt;/label&gt;
81-
&lt;input type="text" name="email" id="email" class="error"
81+
&lt;input type="email" name="email" id="email" class="error"
8282
aria-invalid="true" aria-describedBy="err_2"&gt;
8383
&lt;/div&gt;
8484
&lt;span class="errtext" id="err_2"&gt;Error: Input data missing&lt;/span&gt;
@@ -139,4 +139,4 @@ <h3>Identifying errors in data format</h3>
139139
</ul>
140140

141141
</section>
142-
</body></html>
142+
</body></html>

0 commit comments

Comments
 (0)