Skip to content

Commit d440252

Browse files
author
Michael Cooper
committed
Add ACT rules
1 parent 45847b6 commit d440252

7 files changed

+157
-1
lines changed

act.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?xml version="1.0" encoding="UTF-8"?>

guidelines/act-mapping.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"act-rules": [{
3+
"title": "HTML page has title",
4+
"permalink": "/standards-guidelines/act/rules/html-page-has-title-2779a5/",
5+
"successCriteria": ["page-titled"],
6+
"wcagTechniques": ["G88", "H25"]
7+
}, {
8+
"title": "HTML page has `lang` attribute",
9+
"permalink": "/standards-guidelines/act/rules/html-page-lang-b5c3f8/",
10+
"successCriteria": ["language-of-page"],
11+
"wcagTechniques": ["H57"]
12+
}, {
13+
"title": "HTML page language is valid",
14+
"permalink": "/standards-guidelines/act/rules/html-page-lang-valid-bf051a/",
15+
"successCriteria": ["language-of-page"],
16+
"wcagTechniques": ["H57"]
17+
}, {
18+
"title": "HTML page lang and xml:lang attributes have matching values",
19+
"permalink": "/standards-guidelines/act/rules/html-page-lang-xml-lang-match-5b7ae0/",
20+
"successCriteria": ["language-of-page"],
21+
"wcagTechniques": ["H57"]
22+
}, {
23+
"title": "Image button has accessible name",
24+
"permalink": "/standards-guidelines/act/rules/image-button-accessible-name-59796f/",
25+
"successCriteria": ["non-text-content", "name-role-value"],
26+
"wcagTechniques": ["H36"]
27+
}]
28+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<title>Understanding ACT Rules</title>
5+
</head>
6+
<body>
7+
<h1>Understanding <abbr title="Accessibility Conformance Testing">ACT</abbr> Rules</h1>
8+
9+
<p>Accessibility Conformance Testing (ACT) Rules provide guidance for developers of automated testing tools and manual testing methodologies, to help ensure consistent interpretation of WCAG Success Criteria.</p>
10+
<p>W3C's <a href="https://www.w3.org/WAI/standards-guidelines/act/">List of ACT Rules for WCAG 2</a> is updated periodically. They are developed according to the <a href="https://www.w3.org/TR/act-rules-format/">Accessibility Conformance Testing (ACT) Rules Format 1.0</a> standard.</p>
11+
<p><a href="conformance">Understanding Conformance</a> provides related information, including on <a href="conformance#accessibility-support">understanding accessibility support</a>.</p>
12+
13+
<section>
14+
<h2>ACT Rules are Informative</h2>
15+
<p><em>ACT Rules are informative — that means they are not required for determining conformance. The basis for determining conformance to WCAG is the success criteria from the WCAG standard — not the ACT Rules.</em></p>
16+
<p>While W3C's <a href="https://www.w3.org/WAI/standards-guidelines/act/">List of ACT Rules for WCAG 2</a> are reviewed by the W3C Accessibility Guidelines Working Group (AGWG), they are not vetted to the same degree as the W3C Web Content Accessibility Guidelines (WCAG) standard (called <em>W3C Recommendation</em>). The WCAG standard is the normative reference on determining conformance.</p>
17+
</section>
18+
19+
<section>
20+
<h2>ACT Rules are Partial Checks</h2>
21+
<p>ACT Rules typically check specific aspects of WCAG success criteria. For example, that a table cell has a header rather than the entire WCAG 2.2 success criterion 1.3.1 "Info and Relationships", which applies to many more information structures on a web page. In fact, this example rule would not even check the validity of the table header, only if the header exists for a given table cell.</p>
22+
<p>ACT Rules are also technology-specific. For example, the aforementioned table header example would be specific to HTML, possibly enriched with WAI-ARIA roles and properties, but not to other formats with tables. WCAG 2.2 success criteria are designed to be technology-agnostic and applicable to all web technologies.</p>
23+
</section>
24+
25+
<section>
26+
<h2>ACT Rules Check for Failures</h2>
27+
<p>ACT Rules are designed to check failures in satisfying WCAG success criteria. That is, when content fails ACT Rules, it means that the content does not satisfy the corresponding success criteria. However, when content passes ACT Rules, it means that no corresponding failures were detected — it does not necessarily mean that the content satisfies all aspects of the corresponding success criteria.</p>
28+
<p>The reason for this is because WCAG success criteria typically cover several aspects and technologies, while ACT Rules only check specific aspects. Checking that content satisfies all aspects of WCAG success criteria typically requires further verification by human testers.</p>
29+
<p class="note"><a href="conformance#cc1">WCAG 2 Conformance Requirement 1</a> allows for "conforming alternate versions". That means that content may still conform to WCAG 2, even when content fails ACT Rules, thus does not satisfy the corresponding success criteria.</p>
30+
</section>
31+
32+
<!-- //
33+
<section>
34+
<h2>ACT Rule Implementations</h2>
35+
<p>Implementation of an ACT Rule can be any automated testing tool, manual testing methodology, or other procedure that provides the same expected results for the test cases defined by the ACT Rule. Specifically, when the expected result for a test case is:</p>
36+
<ul>
37+
<li><strong>Passed</strong>, the test result generated from the implementation is <strong>passed</strong>, <strong>cantTell</strong>, or <strong>inapplicable</strong></li>
38+
<li><strong>Failed</strong>, the test result generated from the implementation is <strong>failed</strong> or <strong>cantTell</strong></li>
39+
<li><strong>Inapplicable</strong>, the test result generated from the implementation is <strong>inapplicable</strong>, <strong>cantTell</strong>, or <strong>passed</strong></li>
40+
</ul>
41+
</section>
42+
//-->
43+
44+
<section>
45+
<h2>Structure of ACT Rules</h2>
46+
<p>ACT Rules conform to the <a href="https://www.w3.org/TR/act-rules-format/">Accessibility Conformance Testing (ACT) Rules Format 1.0</a> standard. They include the following parts:</p>
47+
<ul>
48+
<li><strong>Descriptive Title</strong> – title for the ACT Rule, which should describe the rule</li>
49+
<li><strong>Rule Identifier</strong> – identifier for the ACT Rule; the W3C rules use alphanumeric strings</li>
50+
<li><strong>Rule Type</strong> – there are two basic types of ACT Rules, depending on what is being tested:
51+
<ul>
52+
<li><strong>Atomic Rule</strong> – test one specific situation, which may be part of a composite rule</li>
53+
<li><strong>Composite Rule</strong> – combine outcome from multiple atomic rules to one outcome</li>
54+
</ul>
55+
</li>
56+
<li><strong>Accessibility Requirements Mapping</strong> – maps the ACT Rule to particular accessibility requirements; in this suite of rules we use Web Content Accessibility Guidelines (WCAG) 2 Success Criteria</li>
57+
<li><strong>Rule Input</strong> – describes the scope of input into ACT Rules, which is one of the following:
58+
<ul>
59+
<li><strong>Input Aspects</strong> – input into atomic rules, such as DOM Tree and CSS Styling etc.</li>
60+
<li><strong>Input Rules</strong> – input into the composite rules, which are the atomic rules in scope</li>
61+
</ul>
62+
</li>
63+
<li><strong>Applicability</strong> – description of the specific parts of the content, for which the rule applies</li>
64+
<li><strong>Expectations</strong> – description of the expected characteristics of the applicable rule content</li>
65+
<li><strong>Assumptions</strong> – assumptions made, such as specific interpretations of the requirements</li>
66+
<li><strong>Accessibility Support</strong> – known limitations regarding browsers and assistive technology</li>
67+
<li><strong>Test Cases</strong> – sample code demonstrating passed, failed, and inapplicable rule conditions</li>
68+
<li><strong>Change Log</strong> – history of changes for the ACT Rules, to support backward compatibility</li>
69+
<li><strong>Glossary</strong> – list of key terms defined by the ACT Rule or used by the specific ACT Rule</li>
70+
<li><strong>Issues List (Optional)</strong> – list of known issues or bugs for the particular ACT Rule, if any</li>
71+
<li><strong>Background (Optional)</strong> – relevant background, such as additional documentation, if any</li>
72+
<li><strong>Acknowledgements (Optional)</strong> – such as rule writers, reviewers, and other contributors</li>
73+
</ul>
74+
</section>
75+
</body>
76+
</html>

xslt/base.xslt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:wcag="https://www.w3.org/WAI/GL/"
66
xmlns="http://www.w3.org/1999/xhtml"
77
exclude-result-prefixes="#all"
8-
version="2.0">
8+
version="3.0">
99

1010
<xsl:param name="guidelines.version"/>
1111

@@ -19,6 +19,9 @@
1919
<xsl:param name="versions.file">../guidelines/versions.xml</xsl:param>
2020
<xsl:variable name="versions.doc" select="document($versions.file)"/>
2121

22+
<xsl:param name="act.file">../guidelines/act-mapping.json</xsl:param>
23+
<xsl:variable name="act.doc" select="json-to-xml(unparsed-text($act.file))"/>
24+
2225
<xsl:function name="wcag:isheading" as="xs:boolean">
2326
<xsl:param name="el"/>
2427
<xsl:choose>

xslt/generate-structure-xml.xslt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
<name>Understanding Techniques for WCAG Success Criteria</name>
3434
<file href="understanding-techniques"/>
3535
</understanding>
36+
<understanding>
37+
<name>Understanding ACT Rules</name>
38+
<file href="understanding-act-rules"/>
39+
</understanding>
3640
<xsl:apply-templates select="//html:section[@class='principle']"/>
3741
<understanding>
3842
<name>Understanding Conformance</name>

xslt/generate-techniques.xslt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
xmlns:xs="http://www.w3.org/2001/XMLSchema"
44
xmlns:html="http://www.w3.org/1999/xhtml"
55
xmlns:wcag="https://www.w3.org/WAI/GL/"
6+
xmlns:func="http://www.w3.org/2005/xpath-functions"
67
xmlns="http://www.w3.org/1999/xhtml"
78
exclude-result-prefixes="#all"
89
version="2.0">
@@ -55,6 +56,9 @@
5556
<xsl:if test="wcag:section-meaningfully-exists('resources', //html:section[@id = 'resources'])"><li><a href="#resources">Related Resources</a></li></xsl:if>
5657
<xsl:if test="wcag:section-meaningfully-exists('related', //html:section[@id = 'related'])"><li><a href="#related">Related Techniques</a></li></xsl:if>
5758
<li><a href="#tests">Tests</a></li>
59+
<xsl:if test="$act.doc//func:array[@key = 'wcagTechniques'][func:string = $meta/@id]">
60+
<li><a href="#testing-rules">Testing Rules</a></li>
61+
</xsl:if>
5862
</ul>
5963
</nav>
6064
</xsl:template>
@@ -180,6 +184,7 @@
180184
<xsl:call-template name="resources"/>
181185
<xsl:call-template name="related"/>
182186
<xsl:call-template name="tests"/>
187+
<xsl:call-template name="act"/>
183188
</main>
184189
</body>
185190
</html>
@@ -379,6 +384,22 @@
379384
</xsl:choose>
380385
</xsl:template>
381386

387+
<xsl:template name="act">
388+
<xsl:param name="meta" tunnel="yes"/>
389+
390+
<xsl:if test="$act.doc//func:array[@key = 'wcagTechniques'][func:string = $meta/@id]">
391+
<section id="testing-rules">
392+
<h2>Testing Rules</h2>
393+
<p>The following are testing rules for certain aspects of this Technique. It is not necessary to use these particular rules to check for conformance with WCAG, but they are defined and approved test methods. For information on using Accessibility Conformance Testing (ACT) Rules, see <a href="{$loc.understanding}understanding/understanding-act-rules.html">Understanding ACT Rules for WCAG Success Criteria</a>.</p>
394+
<ul>
395+
<xsl:for-each select="$act.doc//func:array[@key = 'wcagTechniques']/func:string[. = $meta/@id]">
396+
<li><a href="{ancestor::func:map/func:string[@key = 'permalink']}"><xsl:value-of select="ancestor::func:map/func:string[@key = 'title']"/></a></li>
397+
</xsl:for-each>
398+
</ul>
399+
</section>
400+
</xsl:if>
401+
</xsl:template>
402+
382403
<xsl:template match="html:section[@class='test']">
383404
<xsl:copy>
384405
<xsl:apply-templates select="@*"/>

xslt/generate-understanding.xslt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
xmlns:xs="http://www.w3.org/2001/XMLSchema"
44
xmlns:html="http://www.w3.org/1999/xhtml"
55
xmlns:wcag="https://www.w3.org/WAI/GL/"
6+
xmlns:func="http://www.w3.org/2005/xpath-functions"
67
xmlns="http://www.w3.org/1999/xhtml"
78
exclude-result-prefixes="#all"
89
version="2.0">
@@ -117,6 +118,9 @@
117118
<xsl:if test="wcag:section-meaningfully-exists('examples', //html:section[@id = 'examples'])"><li><a href="#examples">Examples</a></li></xsl:if>
118119
<xsl:if test="wcag:section-meaningfully-exists('resources', //html:section[@id = 'resources'])"><li><a href="#resources">Related Resources</a></li></xsl:if>
119120
<li><a href="#techniques">Techniques</a></li>
121+
<xsl:if test="$act.doc//func:array[@key = 'successCriteria'][func:string = $meta/@id]">
122+
<li><a href="#testing-rules">Testing Rules</a></li>
123+
</xsl:if>
120124
</xsl:if>
121125
<xsl:if test="name($meta) = 'guideline'">
122126
<li><a href="#intent">Intent</a></li>
@@ -204,12 +208,30 @@
204208
</xsl:if>
205209
</xsl:template>
206210

211+
<xsl:template name="act">
212+
<xsl:param name="meta" tunnel="yes"/>
213+
214+
<xsl:if test="$act.doc//func:array[@key = 'successCriteria'][func:string = $meta/@id]">
215+
<section id="testing-rules">
216+
<h2>Testing Rules</h2>
217+
<p>The following are testing rules for certain aspects of this Success Criterion. It is not necessary to use these particular rules to check for conformance with WCAG, but they are defined and approved test methods. For information on using Accessibility Conformance Testing (ACT) Rules, see <a href="understanding-act-rules.html">Understanding ACT Rules for WCAG Success Criteria</a>.</p>
218+
<ul>
219+
<xsl:for-each select="$act.doc//func:array[@key = 'successCriteria']/func:string[. = $meta/@id]">
220+
<li><a href="{ancestor::func:map/func:string[@key = 'permalink']}"><xsl:value-of select="ancestor::func:map/func:string[@key = 'title']"/></a></li>
221+
</xsl:for-each>
222+
</ul>
223+
</section>
224+
</xsl:if>
225+
</xsl:template>
226+
207227
<xsl:template match="term" mode="key-terms">
208228
<dt id="{id}"><xsl:value-of select="name[1]"/></dt>
209229
<dd><xsl:apply-templates select="definition"/></dd>
210230
</xsl:template>
211231

212232
<xsl:template match="guidelines">
233+
<!--<xsl:result-document href="wcag-act-rules.xml"><xsl:apply-templates select="$act.doc/*"/></xsl:result-document>-->
234+
213235
<xsl:apply-templates select="//understanding | //guideline | //success-criterion"/>
214236
</xsl:template>
215237

@@ -260,6 +282,7 @@
260282
<xsl:apply-templates select="//html:section[@id = 'examples']"/>
261283
<xsl:apply-templates select="//html:section[@id = 'resources']"/>
262284
<xsl:apply-templates select="//html:section[@id = 'techniques']"/>
285+
<xsl:call-template name="act"/>
263286
<xsl:if test="name($meta) = 'guideline'">
264287
<xsl:apply-templates select="//html:section[@id = 'advisory']" mode="gladvisory"/>
265288
<xsl:call-template name="gl-sc"/>

0 commit comments

Comments
 (0)