bbc-a11y 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -0
- data/CONTRIBUTING.md +70 -8
- data/GETTINGSTARTED.md +65 -0
- data/LICENSE +1 -1
- data/README.md +12 -55
- data/Rakefile +1 -1
- data/a11y.rb +1 -3
- data/bbc-a11y.gemspec +0 -1
- data/features/check_standards/01_core_purpose.feature +39 -0
- data/features/check_standards/02_validation.feature +1 -0
- data/features/check_standards/03_progressive_enhancement.feature +3 -0
- data/features/check_standards/{language.feature → 04_indicating_language.feature} +2 -2
- data/features/check_standards/05_page_titles.feature +1 -0
- data/features/check_standards/{main_landmark.feature → 06_main_landmark.feature} +6 -6
- data/features/check_standards/07_headings.feature +222 -0
- data/features/check_standards/{minimum_text_size.feature → 08_minimum_text_size.feature} +22 -2
- data/features/check_standards/09_resizable_text.feature +2 -0
- data/features/check_standards/{tab_index.feature → 10_tab_index.feature} +7 -7
- data/features/check_standards/{title_attribute.feature → 11_title_attributes.feature} +13 -5
- data/features/check_standards/{focusable_controls.feature → 12_focusable_controls.feature} +4 -4
- data/features/check_standards/13_visible_on_focus.feature +1 -0
- data/features/check_standards/14_control_styles.feature +1 -0
- data/features/check_standards/15_focus_styles.feature +1 -0
- data/features/check_standards/16_colour_contrast.feature +1 -0
- data/features/check_standards/17_colour_and_meaning.feature +1 -0
- data/features/check_standards/{image_alt.feature → 18_image_alternatives.feature} +5 -5
- data/features/check_standards/{form_labels.feature → 19_form_labels.feature} +7 -7
- data/features/check_standards/{form_interactions.feature → 20_form_interactions.feature} +6 -6
- data/features/check_standards/21_tables.feature +1 -0
- data/features/cli/display_failing_result.feature +14 -1
- data/features/cli/display_result_summary.feature +15 -1
- data/features/cli/provide_muting_tips.feature +1 -1
- data/features/cli/skipping_standards.feature +1 -1
- data/features/mute_errors.feature +2 -2
- data/features/step_definitions/steps.rb +10 -9
- data/features/support/web_server.rb +0 -11
- data/features/support/web_server/blank.html +7 -0
- data/features/support/web_server/two_headings_failures.html +11 -0
- data/karma.conf.js +1 -1
- data/lib/bbc/a11y/cli.rb +33 -6
- data/lib/bbc/a11y/js/bundle.js +139 -89
- data/lib/bbc/a11y/js/standards.js +67 -20
- data/lib/bbc/a11y/js/standards/{anchorsMustHaveHrefs.js → focusableControls/anchorsMustHaveHrefs.js} +0 -0
- data/lib/bbc/a11y/js/standards/{formsMustHaveSubmitButtons.js → formInteractions/formsMustHaveSubmitButtons.js} +0 -0
- data/lib/bbc/a11y/js/standards/{fieldsMustHaveLabelsOrTitles.js → formLabels/fieldsMustHaveLabelsOrTitles.js} +0 -0
- data/lib/bbc/a11y/js/standards/headings/contentMustFollowHeadings.js +18 -0
- data/lib/bbc/a11y/js/standards/{exactlyOneMainHeading.js → headings/exactlyOneMainHeading.js} +1 -1
- data/lib/bbc/a11y/js/standards/{headingsMustBeInAscendingOrder.js → headings/headingsMustBeInAscendingOrder.js} +0 -0
- data/lib/bbc/a11y/js/standards/{imagesMustHaveAltAttributes.js → imageAlternatives/imagesMustHaveAltAttributes.js} +0 -0
- data/lib/bbc/a11y/js/standards/{htmlMustHaveLangAttribute.js → indicatingLanguage/htmlMustHaveLangAttribute.js} +0 -0
- data/lib/bbc/a11y/js/standards/{exactlyOneMainLandmark.js → mainLandmark/exactlyOneMainLandmark.js} +0 -0
- data/lib/bbc/a11y/js/standards/{minimumTextSize.js → minimumTextSize/textCannotBeTooSmall.js} +3 -3
- data/lib/bbc/a11y/js/standards/{elementsWithZeroTabIndexMustBeFields.js → tabIndex/elementsWithZeroTabIndexMustBeFields.js} +0 -0
- data/lib/bbc/a11y/js/standards/{titleAttributesOnlyOnInputs.js → titleAttributes/titleAttributesOnlyOnInputs.js} +1 -1
- data/lib/bbc/a11y/linter.rb +16 -4
- data/lib/bbc/a11y/runner.rb +0 -1
- data/lib/bbc/a11y/string_colours.rb +15 -0
- data/lib/bbc/a11y/version +1 -1
- data/package.json +3 -0
- data/spec/bbc/a11y/js/a11ySpec.js +15 -6
- data/spec/bbc/a11y/js/minimumTextSizeStandardSpec.js +25 -0
- data/spec/bbc/a11y/js/standardsSpec.js +6 -6
- data/spec/bbc/a11y/string_colours_spec.rb +13 -0
- metadata +68 -102
- data/circle.yml +0 -3
- data/examples/bbc-pages/Gemfile +0 -3
- data/examples/bbc-pages/Rakefile +0 -3
- data/examples/bbc-pages/a11y.rb +0 -2
- data/examples/local-web-app/Gemfile +0 -4
- data/examples/local-web-app/Rakefile +0 -3
- data/examples/local-web-app/a11y.rb +0 -52
- data/examples/local-web-app/config.ru +0 -1
- data/examples/local-web-app/public/missing_header.html +0 -13
- data/examples/local-web-app/public/perfect.html +0 -14
- data/examples/local-web-app/readme.md +0 -0
- data/features/check_standards/headings.feature +0 -153
- data/lib/bbc/a11y/js/standards/contentMustFollowHeadings.js +0 -15
- data/lib/bbc/a11y/standards.rb +0 -45
- data/lib/bbc/a11y/standards/anchor_hrefs.rb +0 -18
- data/lib/bbc/a11y/standards/content_follows_headings.rb +0 -22
- data/lib/bbc/a11y/standards/exactly_one_main_heading.rb +0 -25
- data/lib/bbc/a11y/standards/exactly_one_main_landmark.rb +0 -20
- data/lib/bbc/a11y/standards/form_labels.rb +0 -39
- data/lib/bbc/a11y/standards/form_submit_buttons.rb +0 -21
- data/lib/bbc/a11y/standards/heading_hierarchy.rb +0 -34
- data/lib/bbc/a11y/standards/image_alt.rb +0 -18
- data/lib/bbc/a11y/standards/language_attribute.rb +0 -19
- data/lib/bbc/a11y/standards/tab_index.rb +0 -22
- data/lib/bbc/a11y/standards/title_attribute.rb +0 -31
- data/standards/01_core-purpose.md +0 -24
- data/standards/02_validation.feature +0 -31
- data/standards/03_javascript.feature +0 -40
- data/standards/04_language.feature +0 -58
- data/standards/05_page_title.feature +0 -45
- data/standards/06_main_landmark.feature +0 -24
- data/standards/07_headings.feature +0 -65
- data/standards/08_title_attribute.feature +0 -71
- data/standards/09_tabindex.feature +0 -51
- data/standards/10_form_labels.feature +0 -88
- data/standards/11_visible-on-focus.md +0 -58
- data/standards/13_colour-contrast.md +0 -27
- data/standards/14_colour-meaning.md +0 -19
- data/standards/15_focusable-controls.md +0 -45
- data/standards/16_table.md +0 -109
- data/standards/17_control-styles.md +0 -78
- data/standards/18_focus-styles.md +0 -36
- data/standards/19_form-interactions.md +0 -33
- data/standards/20_image-alt.md +0 -34
- data/standards/21_min-font-sizes.md +0 -64
- data/standards/22_resize-zoom.md +0 -80
- data/standards/step_definitions/core_content_steps.rb +0 -3
- data/standards/step_definitions/form_steps.rb +0 -6
- data/standards/step_definitions/language_steps.rb +0 -21
- data/standards/step_definitions/page_steps.rb +0 -50
- data/standards/step_definitions/w3c_steps.rb +0 -7
- data/standards/support/capybara.rb +0 -53
- data/standards/support/skipper.rb +0 -5
- data/standards/support/world.rb +0 -3
- data/standards/support/world_extender.rb +0 -5
@@ -1,71 +0,0 @@
|
|
1
|
-
Feature: Correctly use `title` attributes
|
2
|
-
|
3
|
-
`title` attributes **must not** be used for critical information and **must not** repeat content that is already visible and associated with the same control or content.
|
4
|
-
|
5
|
-
Rationale
|
6
|
-
=========
|
7
|
-
|
8
|
-
`title` attributes are inaccessible to keyboard users without additional Assistive Technology. They are dependent on user settings in Screen Readers and similar Assistive Technology.
|
9
|
-
|
10
|
-
Additionally they suffer from discoverability problems: pointing device users are required to hover over page elements and pause before the title tooltip displays, usually with no indication that there is additional content to be displayed.
|
11
|
-
|
12
|
-
Repeating content in visible text and `title` attributes can lead to content clutter and repeated phrases.
|
13
|
-
|
14
|
-
Key recommendations are:
|
15
|
-
|
16
|
-
- Do not use the `title` attribute unless on a form input as title text is not well supported on links on mobile
|
17
|
-
- Do not use `title` attributes and explicit labels together on form fields
|
18
|
-
|
19
|
-
Techniques
|
20
|
-
==========
|
21
|
-
|
22
|
-
Pass:
|
23
|
-
|
24
|
-
<label for="name">Name</label>
|
25
|
-
<input type="text" id="name" name="name" />
|
26
|
-
<label for="email">Email</label>
|
27
|
-
|
28
|
-
<input type="text" id="email" name="email" />
|
29
|
-
|
30
|
-
<button type="button"><img src="/path/to/image/close.png" alt="Close" /></button>
|
31
|
-
|
32
|
-
Fail:
|
33
|
-
|
34
|
-
<input type="text" name="name" title="Name" />
|
35
|
-
<input type="text" name="email" title="Email" />
|
36
|
-
|
37
|
-
<label for="name">Name</label>
|
38
|
-
<input type="text" id="name" name="name" title="Name" />
|
39
|
-
|
40
|
-
<button type="button" title="Close"></button>
|
41
|
-
|
42
|
-
<a href="/news" title="News">News</a>
|
43
|
-
|
44
|
-
Tests
|
45
|
-
=====
|
46
|
-
|
47
|
-
| Procedure | Expected Result | Type |
|
48
|
-
| --------- | --------------- | ---- |
|
49
|
-
| Search source for all uses of the `title` attribute | Ensure no instances contain content that would be required by all users or content that is repeated in associated content | Manual |
|
50
|
-
| Search source for all uses of the `title` attribute | Ensure no instances contain content that is repeated within the element | Automated |
|
51
|
-
| Search source for all '<label>' elements and their associated form fields | Ensure that the associated form field does not have a title attribute | Automated |
|
52
|
-
|
53
|
-
--
|
54
|
-
|
55
|
-
Notes
|
56
|
-
=====
|
57
|
-
|
58
|
-
The first test is non-automatable, and may well have to be removed as it is too ambiguous.
|
59
|
-
|
60
|
-
Scenario: Check the elements with title attributes
|
61
|
-
|
62
|
-
Examples of failure:
|
63
|
-
|
64
|
-
<label for="name">Name</label>
|
65
|
-
<input type="text" id="name" name="name" title="Name" />
|
66
|
-
|
67
|
-
<a href="/news" title="News">News</a>
|
68
|
-
|
69
|
-
When I visit the page
|
70
|
-
Then there must be no elements with a title attribute whose content is repeated within the element
|
71
|
-
And any form fields with associated labels do not have a title attribute
|
@@ -1,51 +0,0 @@
|
|
1
|
-
Feature: Correctly use `tabindex` attributes
|
2
|
-
|
3
|
-
Positive `tabindex` attribute values **must not** be used to create a logical tab order.
|
4
|
-
|
5
|
-
`tabindex` values of `0` **must not** be used on elements that are not focusable by default.
|
6
|
-
|
7
|
-
Rationale
|
8
|
-
=========
|
9
|
-
|
10
|
-
Typical BBC pages are made up of several shared components (Global navigation, page content, share tools,
|
11
|
-
location service widgets, etc.) so no one piece of code has complete awareness of the content of the page
|
12
|
-
or when the content updates. Positive `tabindex` values results in unpredictable tab order that do not occur
|
13
|
-
if the natural order of content is relied upon.
|
14
|
-
|
15
|
-
Using `tabindex="0"` on an element adds it to the document tab order, however it does not change the element
|
16
|
-
type to allow it to be discovered by navigating by link or form element, nor does it bind click and key press
|
17
|
-
handlers to the element. There are no circumstances in which it is not better to use a natively focusable
|
18
|
-
control such as a `<a>` or `<button>`.
|
19
|
-
|
20
|
-
Techniques
|
21
|
-
==========
|
22
|
-
|
23
|
-
Pass:
|
24
|
-
|
25
|
-
<a href="/news">News</a>
|
26
|
-
|
27
|
-
<button type="submit">Search</button>
|
28
|
-
|
29
|
-
<div tabindex="-1"></div>
|
30
|
-
|
31
|
-
Fail:
|
32
|
-
|
33
|
-
<a href="/news" tabindex="1">
|
34
|
-
|
35
|
-
<button type="submit" tabindex="2">Search</button>
|
36
|
-
|
37
|
-
<div tabindex="3"></div>
|
38
|
-
|
39
|
-
<div tabindex="0"></div>
|
40
|
-
|
41
|
-
|
42
|
-
Scenario: Check all tabindex values
|
43
|
-
When I visit the page
|
44
|
-
Then there should be no elements with a tabindex attribte of 1 or greater
|
45
|
-
And there should be no elements with a tabindex attribute of 0 except for:
|
46
|
-
| a |
|
47
|
-
| button |
|
48
|
-
| input |
|
49
|
-
| select |
|
50
|
-
| textarea |
|
51
|
-
|
@@ -1,88 +0,0 @@
|
|
1
|
-
Feature: Correctly use form labels
|
2
|
-
|
3
|
-
Form fields that allow input (`select`, and `textarea` elements, and all
|
4
|
-
`input` element types other than image, submit, reset, button, or hidden)
|
5
|
-
**must** have an associated label, either in the form of a `<label>` element
|
6
|
-
or, for simple forms when no visible label is required, a `title` attribute.
|
7
|
-
|
8
|
-
Rationale
|
9
|
-
---------
|
10
|
-
|
11
|
-
Form labels are important for all users in order to understand what the form
|
12
|
-
field is however they are essential for speech output users who cannot easily
|
13
|
-
infer what the form element is by looking at the surrounding content.
|
14
|
-
|
15
|
-
While there are WAI-ARIA attributes that allow for labelling of forms it is
|
16
|
-
not supported in all versions of assistive technologies that BBC users could
|
17
|
-
reasonably expect to be able to use.
|
18
|
-
|
19
|
-
Techniques
|
20
|
-
----------
|
21
|
-
|
22
|
-
Pass:
|
23
|
-
|
24
|
-
```
|
25
|
-
<label for="search">Search the BBC</label>
|
26
|
-
<input type="text" id="search" name="q" />
|
27
|
-
|
28
|
-
<label for="search">
|
29
|
-
Search the BBC
|
30
|
-
<input type="text" name="q" />
|
31
|
-
</label>
|
32
|
-
|
33
|
-
<input type="text" name="q" title="Search the BBC" />
|
34
|
-
```
|
35
|
-
|
36
|
-
Fail:
|
37
|
-
|
38
|
-
```
|
39
|
-
<input type="text" name="name" title="Name" />
|
40
|
-
<input type="text" name="email" title="Email" />
|
41
|
-
|
42
|
-
<input type="text" name="q" value="Search the BBC" />
|
43
|
-
|
44
|
-
<input type="text" name="q" aria-label="Search the BBC" />
|
45
|
-
|
46
|
-
<input type="text" name="q" placeholder="Search the BBC" />
|
47
|
-
```
|
48
|
-
|
49
|
-
Tests
|
50
|
-
-----
|
51
|
-
..
|
52
|
-
| Procedure | Expected Result | Type |
|
53
|
-
| --------- | --------------- | ---- |
|
54
|
-
| Use WAVE Toolbar (or similar) to identify accessibility errors errors | There must be no 'ERROR: Form label missing' or 'ARIA label or description' messages | Tool |
|
55
|
-
| Check every `select`, and `textarea` elements, and all `input` element types other than image, submit, reset, button, or hidden | Every element must have either an associated `<label>` or a title attribute | Manual / Automated |
|
56
|
-
..
|
57
|
-
Notes
|
58
|
-
-----
|
59
|
-
..
|
60
|
-
Hopefully the second test can be automated. Associated labels are those that
|
61
|
-
wrap the element (`<label>Foo <input type="text" /></label>`) and those that
|
62
|
-
have a `for` attribute value that matches the `id` attribute of a field element
|
63
|
-
(`<label for="foo">Bar</label><input type="text" id="foo" />`). In the second
|
64
|
-
case the `<label>` can wrap the form element, but does not have to.
|
65
|
-
|
66
|
-
Scenario: Validate use of labels
|
67
|
-
When I visit the page
|
68
|
-
Then the following form elements must have a title attribute or associated label tag:
|
69
|
-
| select |
|
70
|
-
| textarea |
|
71
|
-
| input[type=checkbox] |
|
72
|
-
| input[type=color] |
|
73
|
-
| input[type=date] |
|
74
|
-
| input[type=datetime] |
|
75
|
-
| input[type=datetime-local] |
|
76
|
-
| input[type=email] |
|
77
|
-
| input[type=file] |
|
78
|
-
| input[type=month] |
|
79
|
-
| input[type=number] |
|
80
|
-
| input[type=password] |
|
81
|
-
| input[type=radio] |
|
82
|
-
| input[type=range] |
|
83
|
-
| input[type=search] |
|
84
|
-
| input[type=tel] |
|
85
|
-
| input[type=text] |
|
86
|
-
| input[type=time] |
|
87
|
-
| input[type=url] |
|
88
|
-
| input[type=week] |
|
@@ -1,58 +0,0 @@
|
|
1
|
-
# Visually hidden elements must be made visible on focus
|
2
|
-
|
3
|
-
Hidden elements in tab order **must** be made visible on focus.
|
4
|
-
|
5
|
-
## Rationale
|
6
|
-
|
7
|
-
While it sometimes beneficial to provide content to screen reader users only, not all keyboard users also use a screen reader. Having hidden content in tab order, such as `<a>` or `<button>` elements, that remain hidden when focussed causes confusion for keyboard users that do not also use a screen reader.
|
8
|
-
|
9
|
-
It is recommened to use a clipping technique instead of negative positioning because of problems this can cause in iOS7 Safari, but either approach is accessible.
|
10
|
-
|
11
|
-
## Techniques
|
12
|
-
|
13
|
-
Pass:
|
14
|
-
|
15
|
-
<style>
|
16
|
-
.hidden {
|
17
|
-
position: absolute; /* clip only relevant on absolutely positioned elements */
|
18
|
-
overflow: hidden;
|
19
|
-
height: 1px;
|
20
|
-
width: 1px;
|
21
|
-
clip: rect(1px 1px 1px 1px); /* For IE6, IE7 */
|
22
|
-
clip: rect(1px, 1px, 1px, 1px);
|
23
|
-
}
|
24
|
-
|
25
|
-
|
26
|
-
.hidden:focus {
|
27
|
-
height: auto;
|
28
|
-
width: auto;
|
29
|
-
clip: auto;
|
30
|
-
}
|
31
|
-
</style>
|
32
|
-
|
33
|
-
<a href="http://www.bbc.co.uk/" class="hidden">BBC</a>
|
34
|
-
|
35
|
-
Fail:
|
36
|
-
|
37
|
-
<style>
|
38
|
-
.hidden {
|
39
|
-
position: absolute;
|
40
|
-
top: -999em;
|
41
|
-
}
|
42
|
-
</style>
|
43
|
-
|
44
|
-
<div class="hidden">
|
45
|
-
<a href="http://www.bbc.co.uk/">BBC</a>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
## Tests
|
49
|
-
|
50
|
-
| Procedure | Expected Result | Type |
|
51
|
-
| --------- | --------------- | ---- |
|
52
|
-
| Tab through all elements in the document. Depending on browser / operating system you may need to activate tabbing through all controls (see [Enabling keyboard navigation in Mac OS X Web browsers](http://www.456bereastreet.com/archive/200906/enabling_keyboard_navigation_in_mac_os_x_web_browsers/) for OSX) | All elements in tab order must be visible when they receive focus | Manual |
|
53
|
-
|
54
|
-
--
|
55
|
-
|
56
|
-
## Notes
|
57
|
-
|
58
|
-
Matt: I don't see how this can be automated, but it would be great if I was wrong.
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# All content must meet minimum contrast standard
|
2
|
-
|
3
|
-
All colour combinations **must** pass the WCAG 2.0 AA-compliant colour contrast check in accordance with the [Snook colour contrast checker](http://snook.ca/technical/colour_contrast/colour.html).
|
4
|
-
|
5
|
-
This is a ratio of 4.5:1 for text 18pt or less in size, and 3:1 for text larger than 18pt or text that is bold and larger than 14pt.
|
6
|
-
|
7
|
-
Where it cannot be adapted, stylised text used in pre-existing broadcast logos and branding is exempt from this requirement.
|
8
|
-
|
9
|
-
## Rationale
|
10
|
-
|
11
|
-
If there is sufficient contrast between foreground and background colours, particularly between text and its background but also applicable to the keys of graphs and similar, then users with moderately low vision or with colour deficiencies that affect contrast to a minor degree are more likely to be able to access BBC content without requiring additional assistive technologies.
|
12
|
-
|
13
|
-
## Techniques
|
14
|
-
|
15
|
-
n/a
|
16
|
-
|
17
|
-
## Tests
|
18
|
-
|
19
|
-
| Procedure | Expected Result | Type |
|
20
|
-
| --------- | --------------- | ---- |
|
21
|
-
| Test every foreground and background colour combination against the [Snook colour contrast checker](http://snook.ca/technical/colour_contrast/colour.html) | Every combination must pass against the WCAG 2.0 AA standard | Manual / Tool |
|
22
|
-
|
23
|
-
--
|
24
|
-
|
25
|
-
## Notes
|
26
|
-
|
27
|
-
This (and every other test that requires checking a large number of elements and their properties) would be best run as part of the 'full' test set, and have a 'quick' test set for any standards that are quick to test.
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# Information must not be conveyed by colour alone
|
2
|
-
|
3
|
-
Information conveyed with colour **must** also be identifiable from context or markup.
|
4
|
-
|
5
|
-
## Rationale
|
6
|
-
|
7
|
-
Users who are blind, have low vision, or have colour blindness may not be able to differentiate content (lines on a chart) or states (selected tabs) if colour alone is used.
|
8
|
-
|
9
|
-
Alternatives must be provided for both sighted and non-sighted users, for example a table equivalent of a chart and lines differentiable with different styles (dashed, dotted, etc.).
|
10
|
-
|
11
|
-
## Techniques
|
12
|
-
|
13
|
-
n/a
|
14
|
-
|
15
|
-
## Tests
|
16
|
-
|
17
|
-
| Procedure | Expected Result | Type |
|
18
|
-
| --------- | --------------- | ---- |
|
19
|
-
| Locate every image or element that uses colour to convey meaning. Check visually and with a screen reader | For each use of colour to convey meaning there must be alternative visual and non-visual means of accessinging the same information | Manual / Tool |
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# Correctly use links and buttons
|
2
|
-
|
3
|
-
Controls for JavaScript enhanced interactions **must** be `<a>`, `<button>`, or `<input>[type=checkbox,color,date,datetime,datetime-local,email,file,month,number,password,radio,range,search,tel,text,time,url,week]` elements if that is the only mechanism for controlling them.
|
4
|
-
|
5
|
-
`<a>` elements used for controls **must** have an `href` attribute.
|
6
|
-
|
7
|
-
Controls that have no purpose without JavaScript **must not** be added to the page before the associated code is available capable of running.
|
8
|
-
|
9
|
-
## Rationale
|
10
|
-
|
11
|
-
When creating controls for user interaction with JavaScript enhanced features, for example a carousel with previous and next controls, the controls must be implemented with elements that provide natively focusable elements with click, keydown, and focus events so they are accessible to keyboard as well as pointing device users. If there is an alternative method of controlling the feature, for example a carousel that automatically displays new content when it receives content then controls that are only available to pointing device users can be used.
|
12
|
-
|
13
|
-
In general, use `<a>` elements when there is a URL associated with the interaction when JavaScript is not enabled, and `<button>` elements for interactions that don't have an associated URL.
|
14
|
-
|
15
|
-
`<a>` elements without a `href` attribute are not keyboard accessible, and therefore must not be used for controls.
|
16
|
-
|
17
|
-
When there is no core (non-JavaScript) interaction then the control must not be added to the document before the associated JavaScript is capable of running as this would lead to controls that apparently do nothing, potentially causing confusion to users.
|
18
|
-
|
19
|
-
## Techniques
|
20
|
-
|
21
|
-
Pass:
|
22
|
-
|
23
|
-
<button type="button">Open panel</button>
|
24
|
-
|
25
|
-
<ul>
|
26
|
-
<li><a href="#newstab">News</a></li>
|
27
|
-
<li><a href="#sporttab">Sport</a></li>
|
28
|
-
<li><a href="#entertainmenttab">Entertainment</a></li>
|
29
|
-
</ul>
|
30
|
-
|
31
|
-
Fail:
|
32
|
-
|
33
|
-
<a href="#">Open panel</a>
|
34
|
-
|
35
|
-
<ul>
|
36
|
-
<li><a>News</a></li>
|
37
|
-
<li><a>Sport</a></li>
|
38
|
-
<li><a>Entertainment</a></li>
|
39
|
-
</ul>
|
40
|
-
|
41
|
-
## Tests
|
42
|
-
|
43
|
-
| Procedure | Expected Result | Type |
|
44
|
-
| --------- | --------------- | ---- |
|
45
|
-
| Identify each control on the page | Navigate the page with a keyboard and ensure that each control is accessible | Manual |
|
data/standards/16_table.md
DELETED
@@ -1,109 +0,0 @@
|
|
1
|
-
# Correctly markup data tables
|
2
|
-
|
3
|
-
Data tables **must** be marked up in a way that enable browsers and assistive technologies to identify them as such.
|
4
|
-
|
5
|
-
## Rationale
|
6
|
-
|
7
|
-
Assistive technologies such as screen readers identify HTML tables as being either for data or for layout based on the markup used.
|
8
|
-
|
9
|
-
If a `<table>` is identified as a layout table then potentially useful structures may be ignored.
|
10
|
-
|
11
|
-
## Definitions
|
12
|
-
|
13
|
-
### Algorithm
|
14
|
-
|
15
|
-
The following algorithm is used to determine if a `<table>` has been marked up in a way that allows browsers and assistive technologies to identify it as a data table:
|
16
|
-
|
17
|
-
1. Table inside editable area is data table always since the table structure is crucial for table editing
|
18
|
-
2. Table having ARIA table related `role` is data table (like ARIA `grid` or `treegrid`)
|
19
|
-
3. Table having ARIA landmark `role` is data table
|
20
|
-
4. Table having `datatable="0"` attribute is layout table
|
21
|
-
5. Table created by CSS `display` style is layout table
|
22
|
-
6. Table having summary attribute or legitimate data table structures is data table; these structures are:
|
23
|
-
- `<caption>` element
|
24
|
-
- `<col>` or `<colgroup>` elements
|
25
|
-
- `<tfoot>` or `<thead>` elements
|
26
|
-
- `<th>` elements
|
27
|
-
- `header`, `scrope` or `abbr` attributes on table cell
|
28
|
-
- `abbr` element as a single child element of table cell
|
29
|
-
7. Table having nested table is layout table
|
30
|
-
8. Table having only one row or column is layout table
|
31
|
-
9. Table having many columns (>= 5) is data table
|
32
|
-
10. Table having borders around cells is data table
|
33
|
-
11. Table having differently colored rows is data table
|
34
|
-
12. Table having many rows (>= 20) is data table
|
35
|
-
13. Wide table (more than 95% of the document width) is layout table
|
36
|
-
14. Table having small amount of cells (<= 10) is layout table
|
37
|
-
15. Table containing `<embed>`, `<object>`, `<applet>` of iframe elements (typical advertisements elements) is layout table
|
38
|
-
16. Otherwise it's data table
|
39
|
-
|
40
|
-
Go through each check in turn, stopping when you reach a data table or layout table result.
|
41
|
-
|
42
|
-
## Techniques
|
43
|
-
|
44
|
-
Pass:
|
45
|
-
|
46
|
-
<table>
|
47
|
-
<caption>Champions League Group C summary table</caption>
|
48
|
-
<thead>
|
49
|
-
<tr>
|
50
|
-
<th scope="col">Team</th>
|
51
|
-
<th scope="col">Score</th>
|
52
|
-
</tr>
|
53
|
-
</thead>
|
54
|
-
<tbody>
|
55
|
-
<tr>
|
56
|
-
<td>Malaga</td>
|
57
|
-
<td>12</td>
|
58
|
-
</tr>
|
59
|
-
<tr>
|
60
|
-
<td>AC Milan</td>
|
61
|
-
<td>8</td>
|
62
|
-
</tr>
|
63
|
-
<tr>
|
64
|
-
<td>Zenit Saint Petersburg</td>
|
65
|
-
<td>7</td>
|
66
|
-
</tr>
|
67
|
-
<tr>
|
68
|
-
<td>Anderlecht</td>
|
69
|
-
<td>5</td>
|
70
|
-
</tr>
|
71
|
-
</tbody>
|
72
|
-
</table>
|
73
|
-
|
74
|
-
Fail:
|
75
|
-
|
76
|
-
<table>
|
77
|
-
<tr>
|
78
|
-
<td>Team</td>
|
79
|
-
<td>Score</td>
|
80
|
-
</tr>
|
81
|
-
<tr>
|
82
|
-
<td>Malaga</td>
|
83
|
-
<td>12</td>
|
84
|
-
</tr>
|
85
|
-
<tr>
|
86
|
-
<td>AC Milan</td>
|
87
|
-
<td>8</td>
|
88
|
-
</tr>
|
89
|
-
<tr>
|
90
|
-
<td>Zenit Saint Petersburg</td>
|
91
|
-
<td>7</td>
|
92
|
-
</tr>
|
93
|
-
<tr>
|
94
|
-
<td>Anderlecht</td>
|
95
|
-
<td>5</td>
|
96
|
-
</tr>
|
97
|
-
</table>
|
98
|
-
|
99
|
-
## Test
|
100
|
-
|
101
|
-
| Procedure | Expected Result | Type |
|
102
|
-
| --------- | --------------- | ---- |
|
103
|
-
| For each `<table>` element in the markup follow the defined algorithm | All data tables must be identifiable as a data table | Manual |
|
104
|
-
|
105
|
-
--
|
106
|
-
|
107
|
-
## Notes
|
108
|
-
|
109
|
-
Hopefully this is clear enough.
|