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.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +9 -0
  3. data/CONTRIBUTING.md +70 -8
  4. data/GETTINGSTARTED.md +65 -0
  5. data/LICENSE +1 -1
  6. data/README.md +12 -55
  7. data/Rakefile +1 -1
  8. data/a11y.rb +1 -3
  9. data/bbc-a11y.gemspec +0 -1
  10. data/features/check_standards/01_core_purpose.feature +39 -0
  11. data/features/check_standards/02_validation.feature +1 -0
  12. data/features/check_standards/03_progressive_enhancement.feature +3 -0
  13. data/features/check_standards/{language.feature → 04_indicating_language.feature} +2 -2
  14. data/features/check_standards/05_page_titles.feature +1 -0
  15. data/features/check_standards/{main_landmark.feature → 06_main_landmark.feature} +6 -6
  16. data/features/check_standards/07_headings.feature +222 -0
  17. data/features/check_standards/{minimum_text_size.feature → 08_minimum_text_size.feature} +22 -2
  18. data/features/check_standards/09_resizable_text.feature +2 -0
  19. data/features/check_standards/{tab_index.feature → 10_tab_index.feature} +7 -7
  20. data/features/check_standards/{title_attribute.feature → 11_title_attributes.feature} +13 -5
  21. data/features/check_standards/{focusable_controls.feature → 12_focusable_controls.feature} +4 -4
  22. data/features/check_standards/13_visible_on_focus.feature +1 -0
  23. data/features/check_standards/14_control_styles.feature +1 -0
  24. data/features/check_standards/15_focus_styles.feature +1 -0
  25. data/features/check_standards/16_colour_contrast.feature +1 -0
  26. data/features/check_standards/17_colour_and_meaning.feature +1 -0
  27. data/features/check_standards/{image_alt.feature → 18_image_alternatives.feature} +5 -5
  28. data/features/check_standards/{form_labels.feature → 19_form_labels.feature} +7 -7
  29. data/features/check_standards/{form_interactions.feature → 20_form_interactions.feature} +6 -6
  30. data/features/check_standards/21_tables.feature +1 -0
  31. data/features/cli/display_failing_result.feature +14 -1
  32. data/features/cli/display_result_summary.feature +15 -1
  33. data/features/cli/provide_muting_tips.feature +1 -1
  34. data/features/cli/skipping_standards.feature +1 -1
  35. data/features/mute_errors.feature +2 -2
  36. data/features/step_definitions/steps.rb +10 -9
  37. data/features/support/web_server.rb +0 -11
  38. data/features/support/web_server/blank.html +7 -0
  39. data/features/support/web_server/two_headings_failures.html +11 -0
  40. data/karma.conf.js +1 -1
  41. data/lib/bbc/a11y/cli.rb +33 -6
  42. data/lib/bbc/a11y/js/bundle.js +139 -89
  43. data/lib/bbc/a11y/js/standards.js +67 -20
  44. data/lib/bbc/a11y/js/standards/{anchorsMustHaveHrefs.js → focusableControls/anchorsMustHaveHrefs.js} +0 -0
  45. data/lib/bbc/a11y/js/standards/{formsMustHaveSubmitButtons.js → formInteractions/formsMustHaveSubmitButtons.js} +0 -0
  46. data/lib/bbc/a11y/js/standards/{fieldsMustHaveLabelsOrTitles.js → formLabels/fieldsMustHaveLabelsOrTitles.js} +0 -0
  47. data/lib/bbc/a11y/js/standards/headings/contentMustFollowHeadings.js +18 -0
  48. data/lib/bbc/a11y/js/standards/{exactlyOneMainHeading.js → headings/exactlyOneMainHeading.js} +1 -1
  49. data/lib/bbc/a11y/js/standards/{headingsMustBeInAscendingOrder.js → headings/headingsMustBeInAscendingOrder.js} +0 -0
  50. data/lib/bbc/a11y/js/standards/{imagesMustHaveAltAttributes.js → imageAlternatives/imagesMustHaveAltAttributes.js} +0 -0
  51. data/lib/bbc/a11y/js/standards/{htmlMustHaveLangAttribute.js → indicatingLanguage/htmlMustHaveLangAttribute.js} +0 -0
  52. data/lib/bbc/a11y/js/standards/{exactlyOneMainLandmark.js → mainLandmark/exactlyOneMainLandmark.js} +0 -0
  53. data/lib/bbc/a11y/js/standards/{minimumTextSize.js → minimumTextSize/textCannotBeTooSmall.js} +3 -3
  54. data/lib/bbc/a11y/js/standards/{elementsWithZeroTabIndexMustBeFields.js → tabIndex/elementsWithZeroTabIndexMustBeFields.js} +0 -0
  55. data/lib/bbc/a11y/js/standards/{titleAttributesOnlyOnInputs.js → titleAttributes/titleAttributesOnlyOnInputs.js} +1 -1
  56. data/lib/bbc/a11y/linter.rb +16 -4
  57. data/lib/bbc/a11y/runner.rb +0 -1
  58. data/lib/bbc/a11y/string_colours.rb +15 -0
  59. data/lib/bbc/a11y/version +1 -1
  60. data/package.json +3 -0
  61. data/spec/bbc/a11y/js/a11ySpec.js +15 -6
  62. data/spec/bbc/a11y/js/minimumTextSizeStandardSpec.js +25 -0
  63. data/spec/bbc/a11y/js/standardsSpec.js +6 -6
  64. data/spec/bbc/a11y/string_colours_spec.rb +13 -0
  65. metadata +68 -102
  66. data/circle.yml +0 -3
  67. data/examples/bbc-pages/Gemfile +0 -3
  68. data/examples/bbc-pages/Rakefile +0 -3
  69. data/examples/bbc-pages/a11y.rb +0 -2
  70. data/examples/local-web-app/Gemfile +0 -4
  71. data/examples/local-web-app/Rakefile +0 -3
  72. data/examples/local-web-app/a11y.rb +0 -52
  73. data/examples/local-web-app/config.ru +0 -1
  74. data/examples/local-web-app/public/missing_header.html +0 -13
  75. data/examples/local-web-app/public/perfect.html +0 -14
  76. data/examples/local-web-app/readme.md +0 -0
  77. data/features/check_standards/headings.feature +0 -153
  78. data/lib/bbc/a11y/js/standards/contentMustFollowHeadings.js +0 -15
  79. data/lib/bbc/a11y/standards.rb +0 -45
  80. data/lib/bbc/a11y/standards/anchor_hrefs.rb +0 -18
  81. data/lib/bbc/a11y/standards/content_follows_headings.rb +0 -22
  82. data/lib/bbc/a11y/standards/exactly_one_main_heading.rb +0 -25
  83. data/lib/bbc/a11y/standards/exactly_one_main_landmark.rb +0 -20
  84. data/lib/bbc/a11y/standards/form_labels.rb +0 -39
  85. data/lib/bbc/a11y/standards/form_submit_buttons.rb +0 -21
  86. data/lib/bbc/a11y/standards/heading_hierarchy.rb +0 -34
  87. data/lib/bbc/a11y/standards/image_alt.rb +0 -18
  88. data/lib/bbc/a11y/standards/language_attribute.rb +0 -19
  89. data/lib/bbc/a11y/standards/tab_index.rb +0 -22
  90. data/lib/bbc/a11y/standards/title_attribute.rb +0 -31
  91. data/standards/01_core-purpose.md +0 -24
  92. data/standards/02_validation.feature +0 -31
  93. data/standards/03_javascript.feature +0 -40
  94. data/standards/04_language.feature +0 -58
  95. data/standards/05_page_title.feature +0 -45
  96. data/standards/06_main_landmark.feature +0 -24
  97. data/standards/07_headings.feature +0 -65
  98. data/standards/08_title_attribute.feature +0 -71
  99. data/standards/09_tabindex.feature +0 -51
  100. data/standards/10_form_labels.feature +0 -88
  101. data/standards/11_visible-on-focus.md +0 -58
  102. data/standards/13_colour-contrast.md +0 -27
  103. data/standards/14_colour-meaning.md +0 -19
  104. data/standards/15_focusable-controls.md +0 -45
  105. data/standards/16_table.md +0 -109
  106. data/standards/17_control-styles.md +0 -78
  107. data/standards/18_focus-styles.md +0 -36
  108. data/standards/19_form-interactions.md +0 -33
  109. data/standards/20_image-alt.md +0 -34
  110. data/standards/21_min-font-sizes.md +0 -64
  111. data/standards/22_resize-zoom.md +0 -80
  112. data/standards/step_definitions/core_content_steps.rb +0 -3
  113. data/standards/step_definitions/form_steps.rb +0 -6
  114. data/standards/step_definitions/language_steps.rb +0 -21
  115. data/standards/step_definitions/page_steps.rb +0 -50
  116. data/standards/step_definitions/w3c_steps.rb +0 -7
  117. data/standards/support/capybara.rb +0 -53
  118. data/standards/support/skipper.rb +0 -5
  119. data/standards/support/world.rb +0 -3
  120. data/standards/support/world_extender.rb +0 -5
@@ -5,20 +5,61 @@ function Standards(standards, skipped) {
5
5
  this.skipped = skipped;
6
6
  }
7
7
 
8
- Standards.all = [
9
- require('./standards/anchorsMustHaveHrefs'),
10
- require('./standards/contentMustFollowHeadings'),
11
- require('./standards/elementsWithZeroTabIndexMustBeFields'),
12
- require('./standards/exactlyOneMainHeading'),
13
- require('./standards/exactlyOneMainLandmark'),
14
- require('./standards/fieldsMustHaveLabelsOrTitles'),
15
- require('./standards/formsMustHaveSubmitButtons'),
16
- require('./standards/headingsMustBeInAscendingOrder'),
17
- require('./standards/htmlMustHaveLangAttribute'),
18
- require('./standards/imagesMustHaveAltAttributes'),
19
- require('./standards/minimumTextSize'),
20
- require('./standards/titleAttributesOnlyOnInputs')
21
- ];
8
+ Standards.sections = {
9
+
10
+ focusableControls: [
11
+ require('./standards/focusableControls/anchorsMustHaveHrefs')
12
+ ],
13
+
14
+ formInteractions: [
15
+ require('./standards/formInteractions/formsMustHaveSubmitButtons')
16
+ ],
17
+
18
+ formLabels: [
19
+ require('./standards/formLabels/fieldsMustHaveLabelsOrTitles')
20
+ ],
21
+
22
+ headings: [
23
+ require('./standards/headings/contentMustFollowHeadings'),
24
+ require('./standards/headings/exactlyOneMainHeading'),
25
+ require('./standards/headings/headingsMustBeInAscendingOrder')
26
+ ],
27
+
28
+ imageAlternatives: [
29
+ require('./standards/imageAlternatives/imagesMustHaveAltAttributes'),
30
+ ],
31
+
32
+ indicatingLanguage: [
33
+ require('./standards/indicatingLanguage/htmlMustHaveLangAttribute')
34
+ ],
35
+
36
+ mainLandmark: [
37
+ require('./standards/mainLandmark/exactlyOneMainLandmark')
38
+ ],
39
+
40
+ minimumTextSize: [
41
+ require('./standards/minimumTextSize/textCannotBeTooSmall')
42
+ ],
43
+
44
+ tabIndex: [
45
+ require('./standards/tabIndex/elementsWithZeroTabIndexMustBeFields')
46
+ ],
47
+
48
+ titleAttributes: [
49
+ require('./standards/titleAttributes/titleAttributesOnlyOnInputs')
50
+ ]
51
+
52
+ }
53
+
54
+ Standards.all = [];
55
+
56
+ for (var section in Standards.sections) {
57
+ var sectionStandards = Standards.sections[section];
58
+ for (var i = 0; i < sectionStandards.length; ++i) {
59
+ sectionStandards[i].section = section;
60
+ Standards.all.push(sectionStandards[i]);
61
+ }
62
+ }
22
63
 
23
64
  Standards.prototype.validate = function(jquery) {
24
65
  var results = [];
@@ -28,7 +69,13 @@ Standards.prototype.validate = function(jquery) {
28
69
  }
29
70
  for (var i = 0; i < this.standards.length; ++i) {
30
71
  standard = this.standards[i];
31
- standardResult = { standard: this.standards[i].name, errors: [] };
72
+ standardResult = {
73
+ standard: {
74
+ section: this.standards[i].section,
75
+ name: this.standards[i].name
76
+ },
77
+ errors: []
78
+ };
32
79
  standard.validate(jquery, fail);
33
80
  results.push(standardResult);
34
81
  }
@@ -49,15 +96,15 @@ Standards.matching = function(criteria) {
49
96
  function standardsMatching(criteria) {
50
97
  var skips = criteria.skip || [];
51
98
  for (var i = 0; i < skips.length; ++i) {
52
- skips[i] = normalise(skips[i]);
99
+ skips[i] = normaliseStandardName(skips[i]);
53
100
  }
54
101
  var isOnly = typeof(criteria.only) == 'string';
55
- var only = isOnly ? normalise(criteria.only) : null;
102
+ var only = isOnly ? normaliseStandardName(criteria.only) : null;
56
103
  var matches = [];
57
104
  var skipped = [];
58
105
  for (var i = 0; i < Standards.all.length; ++i) {
59
106
  var standard = Standards.all[i];
60
- var name = normalise(standard.name);
107
+ var name = standard.section.toLowerCase() + normaliseStandardName(standard.name);
61
108
  if (isOnly) {
62
109
  if (only == name) {
63
110
  matches.push(standard);
@@ -73,8 +120,8 @@ function standardsMatching(criteria) {
73
120
  return { matches: matches, skipped: skipped };
74
121
  }
75
122
 
76
- function normalise(name) {
77
- return name.replace(/\s+/g, '').toLowerCase();
123
+ function normaliseStandardName(name) {
124
+ return name.replace(/\W+/g, '').toLowerCase();
78
125
  }
79
126
 
80
127
  module.exports = Standards;
@@ -0,0 +1,18 @@
1
+ var headingSelector = 'h1, h2, h3, h4, h5, h6, h7, h8';
2
+
3
+ module.exports = {
4
+ name: 'Content must follow headings',
5
+
6
+ validate: function($, fail) {
7
+ $(headingSelector).each(function(index, heading) {
8
+ var nextSibling = heading.nextSibling;
9
+ while (nextSibling) {
10
+ if ($(nextSibling).is(heading.tagName)) { break; }
11
+ if ($(nextSibling).text().trim().length > 0) { return; }
12
+ nextSibling = nextSibling.nextSibling ?
13
+ nextSibling.nextSibling : (nextSibling.parentNode && nextSibling.parentNode.nextSibling);
14
+ }
15
+ fail("No content follows:", heading);
16
+ });
17
+ }
18
+ }
@@ -2,7 +2,7 @@ module.exports = {
2
2
  name: 'Exactly one main heading',
3
3
 
4
4
  validate: function($, fail) {
5
- var mainHeadings = $('h1');
5
+ var mainHeadings = $('h1:visible');
6
6
  var count = mainHeadings.length;
7
7
  if (count == 0) {
8
8
  fail('Found 0 h1 elements.');
@@ -1,9 +1,9 @@
1
1
  module.exports = {
2
- name: 'Minimum text size',
2
+ name: 'Text cannot be too small',
3
3
 
4
4
  validate: function($, fail) {
5
- var textNodes = $('*:not(head, script, style)').contents().filter(function() {
6
- return this.nodeType === 3;
5
+ var textNodes = $('*:not(head, script, style):visible').contents().filter(function() {
6
+ return this.nodeType === 3 && this.textContent.trim().length > 0;
7
7
  });
8
8
 
9
9
  var parents = [];
@@ -2,7 +2,7 @@ module.exports = {
2
2
  name: 'Title attributes only on inputs',
3
3
 
4
4
  validate: function($, fail) {
5
- $("[title]:not(input, button, textarea, select)").each(function(index, element) {
5
+ $("[title]:not(input, button, textarea, select):visible").each(function(index, element) {
6
6
  fail('Non-input element has title attribute:', element);
7
7
  });
8
8
  }
@@ -1,5 +1,3 @@
1
- require 'bbc/a11y/standards'
2
-
3
1
  module BBC
4
2
  module A11y
5
3
 
@@ -38,8 +36,13 @@ module BBC
38
36
  end
39
37
 
40
38
  def self.from_json(json)
41
- errors = json["results"].map { |standard|
42
- standard["errors"].map { |error| error.join " " }
39
+ errors = json["results"].map { |standard_result|
40
+ standard_result["errors"].map { |error_message_array|
41
+ message = error_message_array.join ' '
42
+ LintError.new(standard_result["standard"]["section"],
43
+ standard_result["standard"]["name"],
44
+ message)
45
+ }
43
46
  }.flatten
44
47
  LintResult.new(errors, json["skipped"])
45
48
  end
@@ -47,5 +50,14 @@ module BBC
47
50
  attr_reader :errors, :skipped
48
51
  end
49
52
 
53
+ class LintError
54
+ def initialize(section, name, message)
55
+ @section = section
56
+ @name = name
57
+ @message = message
58
+ end
59
+
60
+ attr_reader :section, :name, :message
61
+ end
50
62
  end
51
63
  end
@@ -1,4 +1,3 @@
1
- require 'bbc/a11y/standards'
2
1
  require 'bbc/a11y/javascript'
3
2
  require 'phantomjs/poltergeist'
4
3
 
@@ -0,0 +1,15 @@
1
+ module BBC
2
+ module A11y
3
+ module StringColours
4
+ def red
5
+ "\e[31m#{self}\e[0m"
6
+ end
7
+
8
+ def green
9
+ "\e[32m#{self}\e[0m"
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ String.send(:include, BBC::A11y::StringColours)
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.2.0
@@ -5,6 +5,7 @@
5
5
  "main": "index.js",
6
6
  "directories": {},
7
7
  "scripts": {
8
+ "test": "karma start --single-run --browsers PhantomJS",
8
9
  "browserify": "browserify ./lib/bbc/a11y/js/a11y.js -o ./lib/bbc/a11y/js/bundle.js"
9
10
  },
10
11
  "repository": {
@@ -27,7 +28,9 @@
27
28
  "karma-chrome-launcher": "^0.2.2",
28
29
  "karma-mocha": "^0.2.1",
29
30
  "karma-mocha-reporter": "^1.1.3",
31
+ "karma-phantomjs-launcher": "^1.0.0",
30
32
  "mocha": "^2.3.4",
33
+ "phantomjs-prebuilt": "^2.1.4",
31
34
  "watchify": "^3.6.1"
32
35
  }
33
36
  }
@@ -14,21 +14,30 @@ describe('a11y', function() {
14
14
  });
15
15
  var expectedErrors = [
16
16
  {
17
- "standard":"Exactly one main heading",
17
+ "standard": {
18
+ "section": "headings",
19
+ "name": "Exactly one main heading"
20
+ },
18
21
  "errors":[
19
22
  ["Found 0 h1 elements."]
20
23
  ]
21
24
  },
22
25
  {
23
- "standard":"Exactly one main landmark",
26
+ "standard": {
27
+ "section": "indicatingLanguage",
28
+ "name": "Html must have lang attribute"
29
+ },
24
30
  "errors":[
25
- ['Found 0 elements with role="main".']
31
+ ["html tag has no lang attribute:","/html"]
26
32
  ]
27
33
  },
28
34
  {
29
- "standard":"Html must have lang attribute",
35
+ "standard": {
36
+ "section": "mainLandmark",
37
+ "name": "Exactly one main landmark"
38
+ },
30
39
  "errors":[
31
- ["html tag has no lang attribute:","/html"]
40
+ ['Found 0 elements with role="main".']
32
41
  ]
33
42
  }
34
43
  ];
@@ -36,7 +45,7 @@ describe('a11y', function() {
36
45
  });
37
46
 
38
47
  it('skips standards', function() {
39
- var validation = a11y.validate({ skip: ['Exactly one main landmark'] });
48
+ var validation = a11y.validate({ skip: ['Main landmark: Exactly one main landmark'] });
40
49
  expect(validation.skipped).to.eql(['Exactly one main landmark']);
41
50
  });
42
51
  });
@@ -0,0 +1,25 @@
1
+ var standard = require('../../../../lib/bbc/a11y/js/standards/minimumTextSize/textCannotBeTooSmall');
2
+ var $ = require('jquery');
3
+ var expect = require('chai').expect;
4
+
5
+ describe('minimum text size standard', function() {
6
+ it('ignores text nodes with parents with display: none', function() {
7
+ $('<div style="display:none; font-size: 1px">Text!</div>').appendTo('body');
8
+ var failures = [];
9
+ var fail = function(failure) {
10
+ failures.push(failure);
11
+ }
12
+ standard.validate($, fail);
13
+ expect(failures).to.eql([]);
14
+ });
15
+
16
+ it('ignores comment nodes', function() {
17
+ $('<div style="font-size: 1px"><!-- this is a comment --></div>').appendTo('body');
18
+ var failures = [];
19
+ var fail = function(failure) {
20
+ failures.push(failure);
21
+ }
22
+ standard.validate($, fail);
23
+ expect(failures).to.eql([]);
24
+ });
25
+ });
@@ -9,23 +9,23 @@ describe('standards', function() {
9
9
  });
10
10
  });
11
11
 
12
- describe('.matching(string)', function() {
12
+ describe('.matching("Focusable Controls: Anchors must have hrefs")', function() {
13
13
  it('finds standards matching the string', function() {
14
- var matches = standards.matching('anchors must have hrefs');
14
+ var matches = standards.matching('Focusable Controls: anchors must have hrefs');
15
15
  expect(matches.standards.length).to.equal(1);
16
16
  });
17
17
  });
18
18
 
19
- describe('.matching({ skip: ["anchors must have hrefs"] })', function() {
19
+ describe('.matching({ skip: ["Focusable Controls: Anchors must have hrefs"] })', function() {
20
20
  it('finds all standards except one', function() {
21
- var matches = standards.matching({ skip: ["anchors must have hrefs"] });
21
+ var matches = standards.matching({ skip: ["Focusable Controls: Anchors must have hrefs"] });
22
22
  expect(matches.standards.length).to.equal(standards.all.length - 1);
23
23
  });
24
24
  });
25
25
 
26
- describe('.matching({ only: "anchors must have hrefs" })', function() {
26
+ describe('.matching({ only: "Focusable controls: Anchors must have hrefs" })', function() {
27
27
  it('finds one standard', function() {
28
- var matches = standards.matching({ only: "anchors must have hrefs" });
28
+ var matches = standards.matching({ only: "Focusable controls: Anchors must have hrefs" });
29
29
  expect(matches.standards.length).to.equal(1);
30
30
  });
31
31
  });
@@ -0,0 +1,13 @@
1
+ require 'bbc/a11y/string_colours'
2
+
3
+ module BBC::A11y
4
+ describe StringColours do
5
+ it "makes strings red" do
6
+ expect("red".red).to eql("\e[31mred\e[0m")
7
+ end
8
+
9
+ it "makes strings green" do
10
+ expect("green".green).to eql("\e[32mgreen\e[0m")
11
+ end
12
+ end
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bbc-a11y
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Wynne
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-01-18 00:00:00.000000000 Z
13
+ date: 2016-04-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: capybara
@@ -54,20 +54,6 @@ dependencies:
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
- - !ruby/object:Gem::Dependency
58
- name: colorize
59
- requirement: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '0'
64
- type: :runtime
65
- prerelease: false
66
- version_requirements: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- version: '0'
71
57
  - !ruby/object:Gem::Dependency
72
58
  name: rspec
73
59
  requirement: !ruby/object:Gem::Requirement
@@ -148,7 +134,9 @@ extra_rdoc_files: []
148
134
  files:
149
135
  - ".rspec"
150
136
  - ".ruby-version"
137
+ - ".travis.yml"
151
138
  - CONTRIBUTING.md
139
+ - GETTINGSTARTED.md
152
140
  - Gemfile
153
141
  - LICENSE
154
142
  - README.md
@@ -156,28 +144,28 @@ files:
156
144
  - a11y.rb
157
145
  - bbc-a11y.gemspec
158
146
  - bin/a11y
159
- - circle.yml
160
- - examples/bbc-pages/Gemfile
161
- - examples/bbc-pages/Rakefile
162
- - examples/bbc-pages/a11y.rb
163
- - examples/local-web-app/Gemfile
164
- - examples/local-web-app/Rakefile
165
- - examples/local-web-app/a11y.rb
166
- - examples/local-web-app/config.ru
167
- - examples/local-web-app/public/missing_header.html
168
- - examples/local-web-app/public/perfect.html
169
- - examples/local-web-app/readme.md
170
147
  - features/README.md
171
- - features/check_standards/focusable_controls.feature
172
- - features/check_standards/form_interactions.feature
173
- - features/check_standards/form_labels.feature
174
- - features/check_standards/headings.feature
175
- - features/check_standards/image_alt.feature
176
- - features/check_standards/language.feature
177
- - features/check_standards/main_landmark.feature
178
- - features/check_standards/minimum_text_size.feature
179
- - features/check_standards/tab_index.feature
180
- - features/check_standards/title_attribute.feature
148
+ - features/check_standards/01_core_purpose.feature
149
+ - features/check_standards/02_validation.feature
150
+ - features/check_standards/03_progressive_enhancement.feature
151
+ - features/check_standards/04_indicating_language.feature
152
+ - features/check_standards/05_page_titles.feature
153
+ - features/check_standards/06_main_landmark.feature
154
+ - features/check_standards/07_headings.feature
155
+ - features/check_standards/08_minimum_text_size.feature
156
+ - features/check_standards/09_resizable_text.feature
157
+ - features/check_standards/10_tab_index.feature
158
+ - features/check_standards/11_title_attributes.feature
159
+ - features/check_standards/12_focusable_controls.feature
160
+ - features/check_standards/13_visible_on_focus.feature
161
+ - features/check_standards/14_control_styles.feature
162
+ - features/check_standards/15_focus_styles.feature
163
+ - features/check_standards/16_colour_contrast.feature
164
+ - features/check_standards/17_colour_and_meaning.feature
165
+ - features/check_standards/18_image_alternatives.feature
166
+ - features/check_standards/19_form_labels.feature
167
+ - features/check_standards/20_form_interactions.feature
168
+ - features/check_standards/21_tables.feature
181
169
  - features/cli/coloured_output.feature
182
170
  - features/cli/display_failing_result.feature
183
171
  - features/cli/display_result_summary.feature
@@ -194,8 +182,10 @@ files:
194
182
  - features/support/capybara.rb
195
183
  - features/support/env.rb
196
184
  - features/support/web_server.rb
185
+ - features/support/web_server/blank.html
197
186
  - features/support/web_server/missing_header.html
198
187
  - features/support/web_server/perfect.html
188
+ - features/support/web_server/two_headings_failures.html
199
189
  - karma.conf.js
200
190
  - lib/bbc/a11y/cli.rb
201
191
  - lib/bbc/a11y/configuration.rb
@@ -203,70 +193,31 @@ files:
203
193
  - lib/bbc/a11y/js/a11y.js
204
194
  - lib/bbc/a11y/js/bundle.js
205
195
  - lib/bbc/a11y/js/standards.js
206
- - lib/bbc/a11y/js/standards/anchorsMustHaveHrefs.js
207
- - lib/bbc/a11y/js/standards/contentMustFollowHeadings.js
208
- - lib/bbc/a11y/js/standards/elementsWithZeroTabIndexMustBeFields.js
209
- - lib/bbc/a11y/js/standards/exactlyOneMainHeading.js
210
- - lib/bbc/a11y/js/standards/exactlyOneMainLandmark.js
211
- - lib/bbc/a11y/js/standards/fieldsMustHaveLabelsOrTitles.js
212
- - lib/bbc/a11y/js/standards/formsMustHaveSubmitButtons.js
213
- - lib/bbc/a11y/js/standards/headingsMustBeInAscendingOrder.js
214
- - lib/bbc/a11y/js/standards/htmlMustHaveLangAttribute.js
215
- - lib/bbc/a11y/js/standards/imagesMustHaveAltAttributes.js
216
- - lib/bbc/a11y/js/standards/minimumTextSize.js
217
- - lib/bbc/a11y/js/standards/titleAttributesOnlyOnInputs.js
196
+ - lib/bbc/a11y/js/standards/focusableControls/anchorsMustHaveHrefs.js
197
+ - lib/bbc/a11y/js/standards/formInteractions/formsMustHaveSubmitButtons.js
198
+ - lib/bbc/a11y/js/standards/formLabels/fieldsMustHaveLabelsOrTitles.js
199
+ - lib/bbc/a11y/js/standards/headings/contentMustFollowHeadings.js
200
+ - lib/bbc/a11y/js/standards/headings/exactlyOneMainHeading.js
201
+ - lib/bbc/a11y/js/standards/headings/headingsMustBeInAscendingOrder.js
202
+ - lib/bbc/a11y/js/standards/imageAlternatives/imagesMustHaveAltAttributes.js
203
+ - lib/bbc/a11y/js/standards/indicatingLanguage/htmlMustHaveLangAttribute.js
204
+ - lib/bbc/a11y/js/standards/mainLandmark/exactlyOneMainLandmark.js
205
+ - lib/bbc/a11y/js/standards/minimumTextSize/textCannotBeTooSmall.js
206
+ - lib/bbc/a11y/js/standards/tabIndex/elementsWithZeroTabIndexMustBeFields.js
207
+ - lib/bbc/a11y/js/standards/titleAttributes/titleAttributesOnlyOnInputs.js
218
208
  - lib/bbc/a11y/js/xpath.js
219
209
  - lib/bbc/a11y/linter.rb
220
210
  - lib/bbc/a11y/runner.rb
221
- - lib/bbc/a11y/standards.rb
222
- - lib/bbc/a11y/standards/anchor_hrefs.rb
223
- - lib/bbc/a11y/standards/content_follows_headings.rb
224
- - lib/bbc/a11y/standards/exactly_one_main_heading.rb
225
- - lib/bbc/a11y/standards/exactly_one_main_landmark.rb
226
- - lib/bbc/a11y/standards/form_labels.rb
227
- - lib/bbc/a11y/standards/form_submit_buttons.rb
228
- - lib/bbc/a11y/standards/heading_hierarchy.rb
229
- - lib/bbc/a11y/standards/image_alt.rb
230
- - lib/bbc/a11y/standards/language_attribute.rb
231
- - lib/bbc/a11y/standards/tab_index.rb
232
- - lib/bbc/a11y/standards/title_attribute.rb
211
+ - lib/bbc/a11y/string_colours.rb
233
212
  - lib/bbc/a11y/version
234
213
  - package.json
235
214
  - spec/bbc/a11y/cli_spec.rb
236
215
  - spec/bbc/a11y/configuration_spec.rb
237
216
  - spec/bbc/a11y/js/a11ySpec.js
217
+ - spec/bbc/a11y/js/minimumTextSizeStandardSpec.js
238
218
  - spec/bbc/a11y/js/standardsSpec.js
239
219
  - spec/bbc/a11y/js/xpathSpec.js
240
- - standards/01_core-purpose.md
241
- - standards/02_validation.feature
242
- - standards/03_javascript.feature
243
- - standards/04_language.feature
244
- - standards/05_page_title.feature
245
- - standards/06_main_landmark.feature
246
- - standards/07_headings.feature
247
- - standards/08_title_attribute.feature
248
- - standards/09_tabindex.feature
249
- - standards/10_form_labels.feature
250
- - standards/11_visible-on-focus.md
251
- - standards/13_colour-contrast.md
252
- - standards/14_colour-meaning.md
253
- - standards/15_focusable-controls.md
254
- - standards/16_table.md
255
- - standards/17_control-styles.md
256
- - standards/18_focus-styles.md
257
- - standards/19_form-interactions.md
258
- - standards/20_image-alt.md
259
- - standards/21_min-font-sizes.md
260
- - standards/22_resize-zoom.md
261
- - standards/step_definitions/core_content_steps.rb
262
- - standards/step_definitions/form_steps.rb
263
- - standards/step_definitions/language_steps.rb
264
- - standards/step_definitions/page_steps.rb
265
- - standards/step_definitions/w3c_steps.rb
266
- - standards/support/capybara.rb
267
- - standards/support/skipper.rb
268
- - standards/support/world.rb
269
- - standards/support/world_extender.rb
220
+ - spec/bbc/a11y/string_colours_spec.rb
270
221
  homepage: https://cucumber.pro
271
222
  licenses:
272
223
  - MIT
@@ -291,19 +242,30 @@ rubyforge_project:
291
242
  rubygems_version: 2.4.5.1
292
243
  signing_key:
293
244
  specification_version: 4
294
- summary: bbc-a11y-0.1.2
245
+ summary: bbc-a11y-0.2.0
295
246
  test_files:
296
247
  - features/README.md
297
- - features/check_standards/focusable_controls.feature
298
- - features/check_standards/form_interactions.feature
299
- - features/check_standards/form_labels.feature
300
- - features/check_standards/headings.feature
301
- - features/check_standards/image_alt.feature
302
- - features/check_standards/language.feature
303
- - features/check_standards/main_landmark.feature
304
- - features/check_standards/minimum_text_size.feature
305
- - features/check_standards/tab_index.feature
306
- - features/check_standards/title_attribute.feature
248
+ - features/check_standards/01_core_purpose.feature
249
+ - features/check_standards/02_validation.feature
250
+ - features/check_standards/03_progressive_enhancement.feature
251
+ - features/check_standards/04_indicating_language.feature
252
+ - features/check_standards/05_page_titles.feature
253
+ - features/check_standards/06_main_landmark.feature
254
+ - features/check_standards/07_headings.feature
255
+ - features/check_standards/08_minimum_text_size.feature
256
+ - features/check_standards/09_resizable_text.feature
257
+ - features/check_standards/10_tab_index.feature
258
+ - features/check_standards/11_title_attributes.feature
259
+ - features/check_standards/12_focusable_controls.feature
260
+ - features/check_standards/13_visible_on_focus.feature
261
+ - features/check_standards/14_control_styles.feature
262
+ - features/check_standards/15_focus_styles.feature
263
+ - features/check_standards/16_colour_contrast.feature
264
+ - features/check_standards/17_colour_and_meaning.feature
265
+ - features/check_standards/18_image_alternatives.feature
266
+ - features/check_standards/19_form_labels.feature
267
+ - features/check_standards/20_form_interactions.feature
268
+ - features/check_standards/21_tables.feature
307
269
  - features/cli/coloured_output.feature
308
270
  - features/cli/display_failing_result.feature
309
271
  - features/cli/display_result_summary.feature
@@ -320,10 +282,14 @@ test_files:
320
282
  - features/support/capybara.rb
321
283
  - features/support/env.rb
322
284
  - features/support/web_server.rb
285
+ - features/support/web_server/blank.html
323
286
  - features/support/web_server/missing_header.html
324
287
  - features/support/web_server/perfect.html
288
+ - features/support/web_server/two_headings_failures.html
325
289
  - spec/bbc/a11y/cli_spec.rb
326
290
  - spec/bbc/a11y/configuration_spec.rb
327
291
  - spec/bbc/a11y/js/a11ySpec.js
292
+ - spec/bbc/a11y/js/minimumTextSizeStandardSpec.js
328
293
  - spec/bbc/a11y/js/standardsSpec.js
329
294
  - spec/bbc/a11y/js/xpathSpec.js
295
+ - spec/bbc/a11y/string_colours_spec.rb