bbc-a11y 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +3 -7
  3. data/README.md +7 -3
  4. data/Rakefile +1 -2
  5. data/bin/a11y +2 -1
  6. data/features/README.md +4 -0
  7. data/features/exit_status.feature +14 -0
  8. data/features/specify_url_via_cli.feature +10 -0
  9. data/features/specify_url_via_config.feature +16 -0
  10. data/features/step_definitions/steps.rb +13 -0
  11. data/features/support/env.rb +5 -0
  12. data/features/support/web_server.rb +30 -0
  13. data/features/support/web_server/missing_header.html +13 -0
  14. data/features/support/web_server/perfect.html +14 -0
  15. data/lib/bbc/a11y.rb +1 -0
  16. data/lib/bbc/a11y/cli.rb +19 -5
  17. data/lib/bbc/a11y/configuration.rb +6 -1
  18. data/lib/bbc/a11y/cucumber_runner.rb +25 -5
  19. data/lib/bbc/a11y/cucumber_support.rb +9 -2
  20. data/lib/bbc/a11y/cucumber_support/disabled_w3c.rb +37 -0
  21. data/lib/bbc/a11y/cucumber_support/matchers.rb +21 -0
  22. data/lib/bbc/a11y/cucumber_support/page.rb +16 -6
  23. data/lib/bbc/a11y/version +1 -1
  24. data/spec/bbc/a11y/cli_spec.rb +27 -0
  25. data/spec/bbc/a11y/configuration_spec.rb +15 -3
  26. data/spec/bbc/a11y/cucumber_support/matchers_spec.rb +52 -0
  27. data/spec/bbc/a11y/cucumber_support/page_spec.rb +34 -10
  28. data/{features → standards}/01_core-purpose.md +0 -0
  29. data/{features → standards}/02_validation.feature +0 -0
  30. data/{features → standards}/03_javascript.feature +0 -0
  31. data/{features → standards}/04_language.feature +0 -0
  32. data/{features → standards}/05_page_title.feature +0 -0
  33. data/{features → standards}/06_main_landmark.feature +0 -0
  34. data/{features → standards}/07_headings.feature +0 -0
  35. data/{features → standards}/08_title_attribute.feature +0 -0
  36. data/{features → standards}/09_tabindex.feature +8 -1
  37. data/standards/10_form_labels.feature +88 -0
  38. data/{features → standards}/11_visible-on-focus.md +0 -0
  39. data/{features → standards}/13_colour-contrast.md +0 -0
  40. data/{features → standards}/14_colour-meaning.md +0 -0
  41. data/{features → standards}/15_focusable-controls.md +0 -0
  42. data/{features → standards}/16_table.md +0 -0
  43. data/{features → standards}/17_control-styles.md +0 -0
  44. data/{features → standards}/18_focus-styles.md +0 -0
  45. data/{features → standards}/19_form-interactions.md +0 -0
  46. data/{features → standards}/20_image-alt.md +0 -0
  47. data/{features → standards}/21_min-font-sizes.md +0 -0
  48. data/{features → standards}/22_resize-zoom.md +0 -0
  49. data/{features → standards}/step_definitions/core_content_steps.rb +0 -0
  50. data/standards/step_definitions/form_steps.rb +6 -0
  51. data/{features → standards}/step_definitions/language_steps.rb +0 -0
  52. data/{features → standards}/step_definitions/page_steps.rb +6 -2
  53. data/{features → standards}/step_definitions/w3c_steps.rb +0 -0
  54. data/{features → standards}/support/capybara.rb +0 -0
  55. data/{features → standards}/support/skipper.rb +0 -0
  56. data/{features → standards}/support/world.rb +0 -0
  57. data/{features → standards}/support/world_extender.rb +0 -0
  58. metadata +82 -86
  59. data/features/10_form-labels.md +0 -47
@@ -1,47 +0,0 @@
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.