bbc-a11y 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +1 -0
  3. data/CONTRIBUTING.md +19 -0
  4. data/Gemfile +2 -0
  5. data/LICENSE +21 -0
  6. data/README.md +54 -0
  7. data/Rakefile +12 -0
  8. data/bbc-a11y.gemspec +32 -0
  9. data/bin/a11y +5 -0
  10. data/example/.a11y.rb +64 -0
  11. data/example/Gemfile +4 -0
  12. data/example/Rakefile +3 -0
  13. data/example/config.ru +1 -0
  14. data/example/public/missing_header.html +13 -0
  15. data/example/public/perfect.html +14 -0
  16. data/example/readme.md +0 -0
  17. data/features/01_core-purpose.md +24 -0
  18. data/features/02_validation.feature +31 -0
  19. data/features/03_javascript.feature +40 -0
  20. data/features/04_language.feature +58 -0
  21. data/features/05_page_title.feature +45 -0
  22. data/features/06_main_landmark.feature +24 -0
  23. data/features/07_headings.feature +65 -0
  24. data/features/08_title_attribute.feature +71 -0
  25. data/features/09_tabindex.feature +38 -0
  26. data/features/10_form-labels.md +47 -0
  27. data/features/11_visible-on-focus.md +58 -0
  28. data/features/13_colour-contrast.md +27 -0
  29. data/features/14_colour-meaning.md +19 -0
  30. data/features/15_focusable-controls.md +45 -0
  31. data/features/16_table.md +109 -0
  32. data/features/17_control-styles.md +78 -0
  33. data/features/18_focus-styles.md +36 -0
  34. data/features/19_form-interactions.md +33 -0
  35. data/features/20_image-alt.md +34 -0
  36. data/features/21_min-font-sizes.md +64 -0
  37. data/features/22_resize-zoom.md +80 -0
  38. data/features/step_definitions/core_content_steps.rb +3 -0
  39. data/features/step_definitions/language_steps.rb +21 -0
  40. data/features/step_definitions/page_steps.rb +46 -0
  41. data/features/step_definitions/w3c_steps.rb +7 -0
  42. data/features/support/capybara.rb +38 -0
  43. data/features/support/skipper.rb +5 -0
  44. data/features/support/world.rb +3 -0
  45. data/features/support/world_extender.rb +5 -0
  46. data/lib/bbc/a11y/cli.rb +49 -0
  47. data/lib/bbc/a11y/configuration.rb +83 -0
  48. data/lib/bbc/a11y/cucumber_runner.rb +133 -0
  49. data/lib/bbc/a11y/cucumber_support/heading_hierarchy.rb +92 -0
  50. data/lib/bbc/a11y/cucumber_support/language_detector.rb +26 -0
  51. data/lib/bbc/a11y/cucumber_support/page.rb +81 -0
  52. data/lib/bbc/a11y/cucumber_support/per_page_checks.rb +28 -0
  53. data/lib/bbc/a11y/cucumber_support/w3c.rb +36 -0
  54. data/lib/bbc/a11y/cucumber_support.rb +49 -0
  55. data/lib/bbc/a11y/version +1 -0
  56. data/lib/bbc/a11y.rb +4 -0
  57. data/spec/bbc/a11y/cucumber_support/heading_hierarchy_spec.rb +123 -0
  58. data/spec/bbc/a11y/cucumber_support/page_spec.rb +130 -0
  59. metadata +274 -0
@@ -0,0 +1,38 @@
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, location service widgets, etc.) so no one piece of code has complete awareness of the content of the page or when the content updates. Positive `tabindex` values results in unpredictable tab order that do not occur if the natural order of content is relied upon.
11
+
12
+ Using `tabindex="0"` on an element adds it to the document tab order, however it does not change the element type to allow it to be discovered by navigating by link or form element, nor does it bind click and key press handlers to the element. There are no circumstances in which it is not better to use a natively focusable control such as a `<a>` or `<button>`.
13
+
14
+ Techniques
15
+ ==========
16
+
17
+ Pass:
18
+
19
+ <a href="/news">News</a>
20
+
21
+ <button type="submit">Search</button>
22
+
23
+ <div tabindex="-1"></div>
24
+
25
+ Fail:
26
+
27
+ <a href="/news" tabindex="1">
28
+
29
+ <button type="submit" tabindex="2">Search</button>
30
+
31
+ <div tabindex="3"></div>
32
+
33
+ <div tabindex="0"></div>
34
+
35
+
36
+ Scenario: Check all tabindex values
37
+ When I visit the page
38
+ Then there should be no elements with a tabindex attribte of 0 or greater
@@ -0,0 +1,47 @@
1
+ # Correctly use form labels
2
+
3
+ Form fields that allow input (`select`, and `textarea` elements, and all `input` element types other than image, submit, reset, button, or hidden) **must** have an associated label, either in the form of a `<label>` element or, for simple forms when no visible label is required, a `title` attribute.
4
+
5
+ ## Rationale
6
+
7
+ Form labels are important for all users in order to understand what the form field is however they are essential for speech output users who cannot easily infer what the form element is by looking at the surrounding content.
8
+
9
+ While there are WAI-ARIA attributes that allow for labelling of forms it is not supported in all versions of assistive technologies that BBC users could reasonably expect to be able to use.
10
+
11
+ ## Techniques
12
+
13
+ Pass:
14
+
15
+ <label for="search">Search the BBC</label>
16
+ <input type="text" id="search" name="q" />
17
+
18
+ <label for="search">
19
+ Search the BBC
20
+ <input type="text" name="q" />
21
+ </label>
22
+
23
+ <input type="text" name="q" title="Search the BBC" />
24
+
25
+ Fail:
26
+
27
+ <input type="text" name="name" title="Name" />
28
+ <input type="text" name="email" title="Email" />
29
+
30
+ <input type="text" name="q" value="Search the BBC" />
31
+
32
+ <input type="text" name="q" aria-label="Search the BBC" />
33
+
34
+ <input type="text" name="q" placeholder="Search the BBC" />
35
+
36
+ ## Tests
37
+
38
+ | Procedure | Expected Result | Type |
39
+ | --------- | --------------- | ---- |
40
+ | 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 |
41
+ | 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 |
42
+
43
+ --
44
+
45
+ ## Notes
46
+
47
+ Hopefully the second test can be automated. Associated labels are those that wrap the element (`<label>Foo <input type="text" /></label>`) and those that have a `for` attribute value that matches the `id` attribute of a field element (`<label for="foo">Bar</label><input type="text" id="foo" />`). In the second case the `<label>` can wrap the form element, but does not have to.
@@ -0,0 +1,58 @@
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.
@@ -0,0 +1,27 @@
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.
@@ -0,0 +1,19 @@
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 |
@@ -0,0 +1,45 @@
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 |
@@ -0,0 +1,109 @@
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.
@@ -0,0 +1,78 @@
1
+ # Links must be self-evident
2
+
3
+ Links that are part of general editorial content **must** be identifiable by there visual style and be distinguishable from the surrounding content.
4
+
5
+ Text links **must** have a mouse-over state change.
6
+
7
+ ## Rationale
8
+
9
+ To aid discoverability all links must be made self-evident with their visual style.
10
+
11
+ Appropriate styles are:
12
+
13
+ - underlined
14
+ - a different colour, meeting contrast standards, to the surrounding text
15
+
16
+ When hovered over links should have a change in style as confirmation that they are links.
17
+
18
+ Appropriate styles are:
19
+
20
+ - adding an underline to previously not underlined content
21
+ - a change in colour, with a sufficiently different contrast to meet the contrast standard compared with the default state colour
22
+
23
+ ## Techniques
24
+
25
+ Pass:
26
+
27
+ <style>
28
+ body {
29
+ background: #fff;
30
+ color: #000;
31
+ }
32
+
33
+ a {
34
+ color: #005580;
35
+ text-decoration: none;
36
+ }
37
+
38
+ a:focus,
39
+ a:hover {
40
+ background:
41
+ text-decoration: underline;
42
+ }
43
+ </style>
44
+
45
+ <a href="http://www.bbc.co.uk/">BBC</a>
46
+
47
+ Fail:
48
+
49
+ <style>
50
+ body {
51
+ background: #fff;
52
+ color: #000;
53
+ }
54
+
55
+ a {
56
+ color: #000;
57
+ text-decoration: none;
58
+ }
59
+ </style>
60
+
61
+ <a href="http://www.bbc.co.uk/">BBC</a>
62
+
63
+ ## Tests
64
+
65
+ | Procedure | Expected Result | Type |
66
+ | --------- | --------------- | ---- |
67
+ | For every `<a>` element check the visual style | All `<a>` elements must be visually distinguishable from the surrounding content | Manual |
68
+ | For every `<a>` element check the visual style of the `:hover` state | All `<a>` elements must have a visually distinguishable style between `:link` and `:hover` states | Manual |
69
+
70
+ --
71
+
72
+ ## Notes
73
+
74
+ Might be difficult to automate the first test. It might be possible (but expensive) to check every link on a page against the style of its parent element, comparing colour, underlines, weight, and other styles but at best I feel this could only be an error if there are no style changes.
75
+
76
+ The second test is testing two states of the same element so might not be quite as difficult (providing you have access to the :hover styles) but it's still hard to have a high degree of confidence in the outcome.
77
+
78
+ Perhaps we need to have a warning rather than an error for these tests.
@@ -0,0 +1,36 @@
1
+ # Focusable elements must have a clear visual indication when they receive focus
2
+
3
+ All focusable elements **must** have a clearly identifiable visual style when they have focus
4
+
5
+ ## Rationale
6
+
7
+ Sighted keyboard users do not have the explicit association between pointer and content that pointing device users have, so it is important that they are aware at all times what element currently has focus and which element keyboard interactions will operate on.
8
+
9
+ The currently focussed element should therefore have a visual style that makes it clearly distinguishable from the surrounding content.
10
+
11
+ ## Techniques
12
+
13
+ Pass:
14
+
15
+ <style>
16
+ a {
17
+ text-decoration: none;
18
+ }
19
+ a:focus {
20
+ text-decoration: underline;
21
+ }
22
+ </style>
23
+
24
+ Fail:
25
+
26
+ <style>
27
+ a {
28
+ outline: none;
29
+ }
30
+ </style>
31
+
32
+ ## Test
33
+
34
+ | Procedure | Expected Result | Type |
35
+ | --------- | --------------- | ---- |
36
+ | For every `<a>`, `<button>`, or other focusable element check the visual style of the `:focus` state | All `<a>`, `<button>`, and other focusable elements must have a visually distinguishable style between their regular and `:focus` states | Manual |
@@ -0,0 +1,33 @@
1
+ # Forms must have a submit button and forms must not update the location of the page on change, focus, or blur events
2
+
3
+ All `<form>` elements that take user input (i.e. do not consist only of `input[type=hidden]` elements to store state) **must** have a submit button in the form of a `<input>[type=submit,image]` or `<button>[type=submit]` element.
4
+
5
+ Changes to the page **must** location must only take place on explicit user action i.e. when a submit button is activated. They must not take place when change (particularly for `select` elements), focus, or blur events are fired.
6
+
7
+ ## Rationale
8
+
9
+ All forms should have a submit button to provide a clear call to action. This is particularly important to users with cognitive disabilities, but is also beneficial to low vision users as an indication of the end of the form.
10
+
11
+ ## Techniques
12
+
13
+ Pass:
14
+
15
+ <form action="/search">
16
+ <label for="q">Search term:</label>
17
+ <input type="text" name="q" id="q">
18
+ <input type="submit" value="Search">
19
+ </form>
20
+
21
+ Fail:
22
+
23
+ <form action="/search">
24
+ <label for="q">Search term:</label>
25
+ <input type="text" name="q" id="q">
26
+ </form>
27
+
28
+ ## Tests
29
+
30
+ | Procedure | Expected Result | Type |
31
+ | --------- | --------------- | ---- |
32
+ | Identify every `<form>` or collection of form elements | Each `<form>` or collection of form elements must have a submit button | Manual |
33
+ | Test each `<form>` or collection of form elements | Page location must not change on change, focus, or blur events | Manual |
@@ -0,0 +1,34 @@
1
+ # Image alternative content
2
+
3
+ All images **must** have an alt attribute.
4
+
5
+ All editorial significant images **must** have a non-null alt attribute value, or a text alternative in the preceding or following content.
6
+
7
+ ## Rationale
8
+
9
+ Assistive technologies such as screen readers will provide a text alternative for images that do not have alt attributes based on the image file name. For images that do not have editorial significance or are described in the surrounding text content it is appropriate to use a null (alt="") value for the image alt attribute to avoid this.
10
+
11
+ All editorially significantly images must have a text alternative either as the value of the alt attribute or in the immediately surrounding text content.
12
+
13
+ ## Techniques
14
+
15
+ Pass:
16
+
17
+ <img src="bbc-logo.png" alt="BBC">
18
+
19
+ <h1>Story headline</h1>
20
+ <img src="story-image.png" alt="">
21
+
22
+ Fail:
23
+
24
+ <img src="bbc-logo.png">
25
+
26
+ <h1>Story headline</h1>
27
+ <img src="story-image.png" alt="Story headline">
28
+
29
+ ## Tests
30
+
31
+ | Procedure | Expected Result | Type |
32
+ | --------- | --------------- | ---- |
33
+ | Identify each image on the page | Every image must have an alt attribute | Manual |
34
+ | Identify each editorially significant image on the page | Every editorially significant image must have a text alternative either as the value of the alt attribute or in the immediately surrounding text content. | Manual |
@@ -0,0 +1,64 @@
1
+ # Minimum text size
2
+
3
+ At default browser level all text **must** have a minimum calculated size of 11px and all core content **must** have a minimum calculated size of 13px.
4
+
5
+ ## Rationale
6
+
7
+ Having a minimum text size will reduce the number of users who need to make use of browser based text resize or page zoom. This is a particular issue with an ageing audience, many of whom will not consider themselves as having low vision and there will not have access to assistive technology or be familiar with browser tools to resize content.
8
+
9
+ ## Definitions
10
+
11
+ ### Core content
12
+
13
+ The content that is required to fulfil the core purpose of the document or feature.
14
+
15
+ ## Techniques
16
+
17
+ Pass:
18
+
19
+ <style>
20
+ body {
21
+ font-size: 62.5%; /* Set default size of 1em to 10px */
22
+ }
23
+
24
+ .news-article p {
25
+ font-size: 1.3em; /* Primary content size set to 13px */
26
+ }
27
+
28
+ .news-supplimentary-links {
29
+ font-size: 1.2em; /* Secondary content size set to 12px */
30
+ }
31
+ </style>
32
+
33
+ Fail:
34
+
35
+ <style>
36
+ body {
37
+ font-size: 62.5%; /* Set default size of 1em to 10px */
38
+ }
39
+
40
+ .news-article p {
41
+ font-size: 1.2em; /* Primary content size set to 12px */
42
+ }
43
+
44
+ .news-supplimentary-links {
45
+ font-size: 1em; /* Secondary content size set to 10px */
46
+ }
47
+ </style>
48
+
49
+ ## Test
50
+
51
+ | Procedure | Expected Result | Type |
52
+ | --------- | --------------- | ---- |
53
+ | For every piece of text of different sizes check the computed text size | All content must have a minimum size of 11px | Manual, automatable |
54
+ | For every piece of core content text of different sizes check the computed text size | All core content must have a minimum size of 13px | Manual |
55
+
56
+ --
57
+
58
+ ## Notes
59
+
60
+ The core content problem again so we can only realistically automate testing against the 11px minimum.
61
+
62
+ It could be an expensive operation to get the computed style for every text node in a document, and it is tests like this that made me think about having grades of tests based on how quickly they are likely to run. You don't need to run this test every time a CSS change is made, but it is worth running before committing.
63
+
64
+ It is likely that entire parts of the page will be considered 'core', for example everything in the page `<main>` element, so would it be possible to write this in such a way as to make it easy for individualy products to add their custom rules to test for the 13px minimum within certain elements?
@@ -0,0 +1,80 @@
1
+ # Content must be resizable to 200
2
+
3
+ Text **must** be styled with units that are resizable in all browsers.
4
+
5
+ Content **must** be visible and usable with text resized to 200% of normal.
6
+
7
+ Content **must** be visible and usable with page zoomed to 200% of normal.
8
+
9
+ Where available on a platform zoom **must** be suported.
10
+
11
+ ## Rationale
12
+
13
+ Standard browser features for resizing text or page zoom can make content accessible to many low vision users without the need for additional assistive technologies such as screen magnifiers or screen readers.
14
+
15
+ Text resizing and page zoom cater to different needs, and therefore both should be supported.
16
+
17
+ Internet Explorer does not resize text that have been styled in `px` units, therefore `em`, `%` or similar units should be used.
18
+
19
+ Browsers on iOS, Android, and other mobile platforms also support zoom with pinch-in and pinch-out gestures. In most cases it is just a matter of not disabling this, but there are some cases when it is appropriate to implement content specific interactions, such as with zoomable maps, which should mimic the same pinch-in and pinch-out gestures.
20
+
21
+ ## Definitions
22
+
23
+ ### Visible
24
+
25
+ Content is not clipped and does not overlap other content, and has sufficient spacing to make it readable.
26
+
27
+ ### Usable
28
+
29
+ Links, forms, and other controls are not overlapped with other elements making them un-clickable.
30
+
31
+ ## Techniques
32
+
33
+ Pass:
34
+
35
+ <style>
36
+ body {
37
+ font-size: 1.3em;
38
+ }
39
+ </style>
40
+
41
+ <meta name="viewport" content="user-scalable=YES">
42
+
43
+ <meta name="viewport" content="width=device-width;
44
+ initial-scale=1.0; maximum-scale=2.0;
45
+ user-scalable=1;">
46
+
47
+ Fail:
48
+
49
+ <style>
50
+ body {
51
+ font-size: 13px;
52
+ }
53
+ </style>
54
+
55
+ <style>
56
+ body {
57
+ overflow: hidden;
58
+ }
59
+ </style>
60
+
61
+ <meta name="viewport" content="user-scalable=no" />
62
+
63
+ <meta name="viewport" content="width=device-width;
64
+ initial-scale=1.0; maximum-scale=1.0;
65
+ user-scalable=1;">
66
+
67
+ ## Test
68
+
69
+ | Procedure | Expected Result | Type |
70
+ | --------- | --------------- | ---- |
71
+ | In a browser that supports page zoom, increase the zoom level to 200% | All content must be visible and usable | Manual |
72
+ | In a browser that supports text resize, increase text resize to 200% | All content must be visible and usable | Manual |
73
+ | In Internet Explorer, increase text resize | All text content should increase in size | Manual |
74
+ | On platforms that support it, use pinch-in and pinch-out to zoom content | All content should increase and descrease in size | Manual |
75
+
76
+ --
77
+
78
+ ## Notes
79
+
80
+ The first two tests will have to be manual I think, but is it possible to make automate the 'px' test?