access_lint 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6579431c0684abb58da168d3cbe881145d47e58f
4
- data.tar.gz: eedd24b50168a7fd491c9c309f840f179c4b968b
3
+ metadata.gz: 3066707dce7e7cbf2c227440546870979fe40a41
4
+ data.tar.gz: d765d5b1051be86ad7fc4802313344d893e81e79
5
5
  SHA512:
6
- metadata.gz: 9f4302997abb396f02f6a77da9765d7709676572ce4e14727ae2a8997ac7cea5c7602f3fc6325f5326724f498522bef2e51da9ec8b662c0fbb125cea4ae43685
7
- data.tar.gz: eb216d33d1f81d6fe5cd891ef72910e60168c5bc88ef1a2d5be7fd3258618c9189206d8b84bef0d5430a3b2da9187289b59f35eb3ee8d2bc4eda648998c03716
6
+ metadata.gz: 93e23d5c054aadcb06001734fe14524dfa1ec72cd886a6cb47c94bb9654afa2ff867630d7ddca9b81e139eb38ed74b35a03a1aaeb2b00e77da1460470ccf8f6c
7
+ data.tar.gz: e313c019417517a4604c40e81b42350300bdfdc8d95f282ba84bdb2233e1ab0d371a7de61ce8ca38fb971cf2081f412a89401aefc2d1f77c49fb5b673fa8ea3b
@@ -1,3 +1,3 @@
1
1
  module AccessLint
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -1,17 +1,3 @@
1
- Copyright 2013 Google Inc. All Rights Reserved.
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
14
-
15
1
  # Accessibility Developer Tools
16
2
 
17
3
  This is a library of accessibility-related testing and utility code.
@@ -23,6 +9,42 @@ There is also a collection of accessibility-related utility code, including but
23
9
  * retrieving and validating ARIA attributes and states
24
10
  * accessible name calculation using the algorithm at [http://www.w3.org/TR/wai-aria/roles#textalternativecomputation](http://www.w3.org/TR/wai-aria/roles#textalternativecomputation)
25
11
 
12
+ # Getting the code
13
+
14
+ To include just the javascript rules, require the following file:
15
+
16
+ https://raw.github.com/GoogleChrome/accessibility-developer-tools/stable/dist/js/axs_testing.js
17
+
18
+ `git 1.6.5` or later:
19
+
20
+ % git clone --recursive https://github.com/GoogleChrome/accessibility-developer-tools.git
21
+
22
+ Before `git 1.6.5`:
23
+
24
+ % git clone https://github.com/GoogleChrome/accessibility-developer-tools.git
25
+ % cd accessibility-developer-tools
26
+ % git submodule init; git submodule update
27
+
28
+ # Building
29
+
30
+ You will need `node` and `grunt-cli` to build.
31
+
32
+ 1. (Once only) Install [Node.js](http://nodejs.org/) and `npm` - useful instructions here: [https://gist.github.com/isaacs/579814](https://gist.github.com/isaacs/579814)
33
+
34
+ Make sure you have Node.js v 0.8 or higher.
35
+
36
+ 2. (Once only) Use `npm` to install `grunt-cli`
37
+
38
+ % npm install -g grunt-cli # May need to be run as root
39
+
40
+ 3. (Every time you make a fresh checkout) Install dependencies (including `grunt`) for this project (run from project root)
41
+
42
+ % npm install
43
+
44
+ 4. Build using `grunt` (run from project root)
45
+
46
+ % grunt
47
+
26
48
  # Using the Audit API
27
49
 
28
50
  ## Including the library
@@ -46,6 +68,14 @@ Once you have included `axs_testing.js`, you can call call `axs.Audit.run()`. Th
46
68
  rule // The rule which this result is for.
47
69
  }
48
70
 
71
+ ### Command Line Runner
72
+
73
+ The Accessibility Developer Tools project includes a command line runner for the audit. To use the runner, [install phantomjs](http://phantomjs.org/download.html) then run the following command from the project root directory.
74
+
75
+ $ phantomjs tools/runner/audit.js <url-or-filepath>
76
+
77
+ The runner will load the specified file or URL in a headless browser, inject axs_testing.js, run the audit and output the report text.
78
+
49
79
  ## Using the results
50
80
 
51
81
  ### Interpreting the result
@@ -125,3 +155,19 @@ You can set a `scope` on the `AuditConfiguration` object like this:
125
155
  var configuration = new axs.AuditConfiguration();
126
156
  configuration.scope = document.querySelector('main'); // or however you wish to choose your scope element
127
157
  axs.Audit.run(configuration);
158
+
159
+ ## License
160
+
161
+ Copyright 2013 Google Inc. All Rights Reserved.
162
+
163
+ Licensed under the Apache License, Version 2.0 (the "License");
164
+ you may not use this file except in compliance with the License.
165
+ You may obtain a copy of the License at
166
+
167
+ [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
168
+
169
+ Unless required by applicable law or agreed to in writing, software
170
+ distributed under the License is distributed on an "AS IS" BASIS,
171
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
172
+ See the License for the specific language governing permissions and
173
+ limitations under the License.
@@ -13,11 +13,11 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  *
16
- * Generated from http://github.com/GoogleChrome/accessibility-developer-tools/tree/33515adf3dcd6e17d48f8a9dde27c60865545b70
16
+ * Generated from http://github.com/GoogleChrome/accessibility-developer-tools/tree/80f7c9ac87569c23429a7b07de1af980679c9a34
17
17
  *
18
18
  * See project README for build steps.
19
19
  */
20
-
20
+
21
21
  // AUTO-GENERATED CONTENT BELOW: DO NOT EDIT! See above for details.
22
22
 
23
23
  var COMPILED = !0, goog = goog || {};
@@ -414,20 +414,20 @@ axs.browserUtils.matchSelector = function(a, b) {
414
414
  return a.webkitMatchesSelector ? a.webkitMatchesSelector(b) : a.mozMatchesSelector ? a.mozMatchesSelector(b) : !1
415
415
  };
416
416
  axs.constants = {};
417
- axs.constants.ARIA_ROLES = {alert:{namefrom:["author"], parent:["region"]}, alertdialog:{namefrom:["author"], namerequired:!0, parent:["alert", "dialog"]}, application:{namefrom:["author"], namerequired:!0, parent:["landmark"]}, article:{namefrom:["author"], parent:["document", "region"]}, banner:{namefrom:["author"], parent:["landmark"]}, button:{childpresentational:!0, namefrom:["contents", "author"], namerequired:!0, parent:["command"], properties:["aria-expanded", "aria-pressed"]}, checkbox:{namefrom:["contents",
418
- "author"], namerequired:!0, parent:["input"], requiredProperties:["aria-checked"], properties:["aria-checked"]}, columnheader:{namefrom:["contents", "author"], namerequired:!0, parent:["gridcell", "sectionhead", "widget"], properties:["aria-sort"]}, combobox:{mustcontain:["listbox", "textbox"], namefrom:["author"], namerequired:!0, parent:["select"], requiredProperties:["aria-expanded"], properties:["aria-expanded", "aria-autocomplete", "aria-required"]}, command:{"abstract":!0, namefrom:["author"],
419
- parent:["widget"]}, complementary:{namefrom:["author"], parent:["landmark"]}, composite:{"abstract":!0, childpresentational:!1, namefrom:["author"], parent:["widget"], properties:["aria-activedescendant"]}, contentinfo:{namefrom:["author"], parent:["landmark"]}, definition:{namefrom:["author"], parent:["section"]}, dialog:{namefrom:["author"], namerequired:!0, parent:["window"]}, directory:{namefrom:["contents", "author"], parent:["list"]}, document:{namefrom:[" author"], namerequired:!0, parent:["structure"],
420
- properties:["aria-expanded"]}, form:{namefrom:["author"], parent:["landmark"]}, grid:{mustcontain:["row", "rowgroup"], namefrom:["author"], namerequired:!0, parent:["composite", "region"], properties:["aria-level", "aria-multiselectable", "aria-readonly"]}, gridcell:{namefrom:["contents", "author"], namerequired:!0, parent:["section", "widget"], properties:["aria-readonly", "aria-required", "aria-selected"]}, group:{namefrom:[" author"], parent:["section"], properties:["aria-activedescendant"]},
421
- heading:{namerequired:!0, parent:["sectionhead"], properties:["aria-level"]}, img:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["section"]}, input:{"abstract":!0, namefrom:["author"], parent:["widget"]}, landmark:{"abstract":!0, namefrom:["contents", "author"], namerequired:!1, parent:["region"]}, link:{namefrom:["contents", "author"], namerequired:!0, parent:["command"], properties:["aria-expanded"]}, list:{mustcontain:["group", "listitem"], namefrom:["author"], parent:["region"]},
422
- listbox:{mustcontain:["option"], namefrom:["author"], namerequired:!0, parent:["list", "select"], properties:["aria-multiselectable", "aria-required"]}, listitem:{namefrom:["contents", "author"], namerequired:!0, parent:["section"], properties:["aria-level", "aria-posinset", "aria-setsize"]}, log:{namefrom:[" author"], namerequired:!0, parent:["region"]}, main:{namefrom:["author"], parent:["landmark"]}, marquee:{namerequired:!0, parent:["section"]}, math:{childpresentational:!0, namefrom:["author"],
423
- parent:["section"]}, menu:{mustcontain:["group", "menuitemradio", "menuitem", "menuitemcheckbox"], namefrom:["author"], namerequired:!0, parent:["list", "select"]}, menubar:{namefrom:["author"], parent:["menu"]}, menuitem:{namefrom:["contents", "author"], namerequired:!0, parent:["command"]}, menuitemcheckbox:{namefrom:["contents", "author"], namerequired:!0, parent:["checkbox", "menuitem"]}, menuitemradio:{namefrom:["contents", "author"], namerequired:!0, parent:["menuitemcheckbox", "radio"]}, navigation:{namefrom:["author"],
424
- parent:["landmark"]}, note:{namefrom:["author"], parent:["section"]}, option:{namefrom:["contents", "author"], namerequired:!0, parent:["input"], properties:["aria-checked", "aria-posinset", "aria-selected", "aria-setsize"]}, presentation:{parent:["structure"]}, progressbar:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["range"]}, radio:{namefrom:["contents", "author"], namerequired:!0, parent:["checkbox", "option"]}, radiogroup:{mustcontain:["radio"], namefrom:["author"],
425
- namerequired:!0, parent:["select"], properties:["aria-required"]}, range:{"abstract":!0, namefrom:["author"], parent:["widget"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext"]}, region:{namefrom:[" author"], parent:["section"]}, roletype:{"abstract":!0, properties:"aria-atomic aria-busy aria-controls aria-describedby aria-disabled aria-dropeffect aria-flowto aria-grabbed aria-haspopup aria-hidden aria-invalid aria-label aria-labelledby aria-live aria-owns aria-relevant".split(" ")},
426
- row:{mustcontain:["columnheader", "gridcell", "rowheader"], namefrom:["contents", "author"], parent:["group", "widget"], properties:["aria-level", "aria-selected"]}, rowgroup:{mustcontain:["row"], namefrom:["contents", "author"], parent:["group"]}, rowheader:{namefrom:["contents", "author"], namerequired:!0, parent:["gridcell", "sectionhead", "widget"], properties:["aria-sort"]}, search:{namefrom:["author"], parent:["landmark"]}, section:{"abstract":!0, namefrom:["contents", "author"], parent:["structure"],
427
- properties:["aria-expanded"]}, sectionhead:{"abstract":!0, namefrom:["contents", "author"], parent:["structure"], properties:["aria-expanded"]}, select:{"abstract":!0, namefrom:["author"], parent:["composite", "group", "input"]}, separator:{childpresentational:!0, namefrom:["author"], parent:["structure"], properties:["aria-expanded", "aria-orientation"]}, scrollbar:{childpresentational:!0, namefrom:["author"], namerequired:!1, parent:["input", "range"], requiredProperties:["aria-controls", "aria-orientation",
428
- "aria-valuemax", "aria-valuemin", "aria-valuenow"], properties:["aria-controls", "aria-orientation", "aria-valuemax", "aria-valuemin", "aria-valuenow"]}, slider:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["input", "range"], requiredProperties:["aria-valuemax", "aria-valuemin", "aria-valuenow"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-orientation"]}, spinbutton:{namefrom:["author"], namerequired:!0, parent:["input", "range"], requiredProperties:["aria-valuemax",
429
- "aria-valuemin", "aria-valuenow"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-required"]}, status:{parent:["region"]}, structure:{"abstract":!0, parent:["roletype"]}, tab:{namefrom:["contents", "author"], parent:["sectionhead", "widget"], properties:["aria-selected"]}, tablist:{mustcontain:["tab"], namefrom:["author"], parent:["composite", "directory"], properties:["aria-level"]}, tabpanel:{namefrom:["author"], namerequired:!0, parent:["region"]}, textbox:{namefrom:["author"],
430
- namerequired:!0, parent:["input"], properties:["aria-activedescendant", "aria-autocomplete", "aria-multiline", "aria-readonly", "aria-required"]}, timer:{namefrom:["author"], namerequired:!0, parent:["status"]}, toolbar:{namefrom:["author"], parent:["group"]}, tooltip:{namerequired:!0, parent:["section"]}, tree:{mustcontain:["group", "treeitem"], namefrom:["author"], namerequired:!0, parent:["select"], properties:["aria-multiselectable", "aria-required"]}, treegrid:{mustcontain:["row"], namefrom:["author"],
417
+ axs.constants.ARIA_ROLES = {alert:{namefrom:["author"], parent:["region"]}, alertdialog:{namefrom:["author"], namerequired:!0, parent:["alert", "dialog"]}, application:{namefrom:["author"], namerequired:!0, parent:["landmark"]}, article:{namefrom:["author"], parent:["document", "region"]}, banner:{namefrom:["author"], parent:["landmark"]}, button:{childpresentational:!0, namefrom:["contents", "author"], namerequired:!0, parent:["command"], properties:["aria-expanded", "aria-pressed"]}, checkbox:{namefrom:["contents",
418
+ "author"], namerequired:!0, parent:["input"], requiredProperties:["aria-checked"], properties:["aria-checked"]}, columnheader:{namefrom:["contents", "author"], namerequired:!0, parent:["gridcell", "sectionhead", "widget"], properties:["aria-sort"]}, combobox:{mustcontain:["listbox", "textbox"], namefrom:["author"], namerequired:!0, parent:["select"], requiredProperties:["aria-expanded"], properties:["aria-expanded", "aria-autocomplete", "aria-required"]}, command:{"abstract":!0, namefrom:["author"],
419
+ parent:["widget"]}, complementary:{namefrom:["author"], parent:["landmark"]}, composite:{"abstract":!0, childpresentational:!1, namefrom:["author"], parent:["widget"], properties:["aria-activedescendant"]}, contentinfo:{namefrom:["author"], parent:["landmark"]}, definition:{namefrom:["author"], parent:["section"]}, dialog:{namefrom:["author"], namerequired:!0, parent:["window"]}, directory:{namefrom:["contents", "author"], parent:["list"]}, document:{namefrom:[" author"], namerequired:!0, parent:["structure"],
420
+ properties:["aria-expanded"]}, form:{namefrom:["author"], parent:["landmark"]}, grid:{mustcontain:["row", "rowgroup"], namefrom:["author"], namerequired:!0, parent:["composite", "region"], properties:["aria-level", "aria-multiselectable", "aria-readonly"]}, gridcell:{namefrom:["contents", "author"], namerequired:!0, parent:["section", "widget"], properties:["aria-readonly", "aria-required", "aria-selected"]}, group:{namefrom:[" author"], parent:["section"], properties:["aria-activedescendant"]},
421
+ heading:{namerequired:!0, parent:["sectionhead"], properties:["aria-level"]}, img:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["section"]}, input:{"abstract":!0, namefrom:["author"], parent:["widget"]}, landmark:{"abstract":!0, namefrom:["contents", "author"], namerequired:!1, parent:["region"]}, link:{namefrom:["contents", "author"], namerequired:!0, parent:["command"], properties:["aria-expanded"]}, list:{mustcontain:["group", "listitem"], namefrom:["author"], parent:["region"]},
422
+ listbox:{mustcontain:["option"], namefrom:["author"], namerequired:!0, parent:["list", "select"], properties:["aria-multiselectable", "aria-required"]}, listitem:{namefrom:["contents", "author"], namerequired:!0, parent:["section"], properties:["aria-level", "aria-posinset", "aria-setsize"]}, log:{namefrom:[" author"], namerequired:!0, parent:["region"]}, main:{namefrom:["author"], parent:["landmark"]}, marquee:{namerequired:!0, parent:["section"]}, math:{childpresentational:!0, namefrom:["author"],
423
+ parent:["section"]}, menu:{mustcontain:["group", "menuitemradio", "menuitem", "menuitemcheckbox"], namefrom:["author"], namerequired:!0, parent:["list", "select"]}, menubar:{namefrom:["author"], parent:["menu"]}, menuitem:{namefrom:["contents", "author"], namerequired:!0, parent:["command"]}, menuitemcheckbox:{namefrom:["contents", "author"], namerequired:!0, parent:["checkbox", "menuitem"]}, menuitemradio:{namefrom:["contents", "author"], namerequired:!0, parent:["menuitemcheckbox", "radio"]}, navigation:{namefrom:["author"],
424
+ parent:["landmark"]}, note:{namefrom:["author"], parent:["section"]}, option:{namefrom:["contents", "author"], namerequired:!0, parent:["input"], properties:["aria-checked", "aria-posinset", "aria-selected", "aria-setsize"]}, presentation:{parent:["structure"]}, progressbar:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["range"]}, radio:{namefrom:["contents", "author"], namerequired:!0, parent:["checkbox", "option"]}, radiogroup:{mustcontain:["radio"], namefrom:["author"],
425
+ namerequired:!0, parent:["select"], properties:["aria-required"]}, range:{"abstract":!0, namefrom:["author"], parent:["widget"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext"]}, region:{namefrom:[" author"], parent:["section"]}, roletype:{"abstract":!0, properties:"aria-atomic aria-busy aria-controls aria-describedby aria-disabled aria-dropeffect aria-flowto aria-grabbed aria-haspopup aria-hidden aria-invalid aria-label aria-labelledby aria-live aria-owns aria-relevant".split(" ")},
426
+ row:{mustcontain:["columnheader", "gridcell", "rowheader"], namefrom:["contents", "author"], parent:["group", "widget"], properties:["aria-level", "aria-selected"]}, rowgroup:{mustcontain:["row"], namefrom:["contents", "author"], parent:["group"]}, rowheader:{namefrom:["contents", "author"], namerequired:!0, parent:["gridcell", "sectionhead", "widget"], properties:["aria-sort"]}, search:{namefrom:["author"], parent:["landmark"]}, section:{"abstract":!0, namefrom:["contents", "author"], parent:["structure"],
427
+ properties:["aria-expanded"]}, sectionhead:{"abstract":!0, namefrom:["contents", "author"], parent:["structure"], properties:["aria-expanded"]}, select:{"abstract":!0, namefrom:["author"], parent:["composite", "group", "input"]}, separator:{childpresentational:!0, namefrom:["author"], parent:["structure"], properties:["aria-expanded", "aria-orientation"]}, scrollbar:{childpresentational:!0, namefrom:["author"], namerequired:!1, parent:["input", "range"], requiredProperties:["aria-controls", "aria-orientation",
428
+ "aria-valuemax", "aria-valuemin", "aria-valuenow"], properties:["aria-controls", "aria-orientation", "aria-valuemax", "aria-valuemin", "aria-valuenow"]}, slider:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["input", "range"], requiredProperties:["aria-valuemax", "aria-valuemin", "aria-valuenow"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-orientation"]}, spinbutton:{namefrom:["author"], namerequired:!0, parent:["input", "range"], requiredProperties:["aria-valuemax",
429
+ "aria-valuemin", "aria-valuenow"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-required"]}, status:{parent:["region"]}, structure:{"abstract":!0, parent:["roletype"]}, tab:{namefrom:["contents", "author"], parent:["sectionhead", "widget"], properties:["aria-selected"]}, tablist:{mustcontain:["tab"], namefrom:["author"], parent:["composite", "directory"], properties:["aria-level"]}, tabpanel:{namefrom:["author"], namerequired:!0, parent:["region"]}, textbox:{namefrom:["author"],
430
+ namerequired:!0, parent:["input"], properties:["aria-activedescendant", "aria-autocomplete", "aria-multiline", "aria-readonly", "aria-required"]}, timer:{namefrom:["author"], namerequired:!0, parent:["status"]}, toolbar:{namefrom:["author"], parent:["group"]}, tooltip:{namerequired:!0, parent:["section"]}, tree:{mustcontain:["group", "treeitem"], namefrom:["author"], namerequired:!0, parent:["select"], properties:["aria-multiselectable", "aria-required"]}, treegrid:{mustcontain:["row"], namefrom:["author"],
431
431
  namerequired:!0, parent:["grid", "tree"]}, treeitem:{namefrom:["contents", "author"], namerequired:!0, parent:["listitem", "option"]}, widget:{"abstract":!0, parent:["roletype"]}, window:{"abstract":!0, namefrom:[" author"], parent:["roletype"], properties:["aria-expanded"]}};
432
432
  axs.constants.WIDGET_ROLES = {};
433
433
  axs.constants.addAllParentRolesToSet_ = function(a, b) {
@@ -464,22 +464,22 @@ for(var roleName in axs.constants.ARIA_ROLES) {
464
464
  role.allParentRolesSet = parentRolesSet;
465
465
  "widget" in parentRolesSet && (axs.constants.WIDGET_ROLES[roleName] = role)
466
466
  }
467
- axs.constants.ARIA_PROPERTIES = {activedescendant:{type:"property", valueType:"idref"}, atomic:{defaultValue:"false", type:"property", valueType:"boolean"}, autocomplete:{defaultValue:"none", type:"property", valueType:"token", values:["inline", "list", "both", "none"]}, busy:{defaultValue:"false", type:"state", valueType:"boolean"}, checked:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "mixed", "undefined"]}, controls:{type:"property", valueType:"idref_list"},
468
- describedby:{type:"property", valueType:"idref_list"}, disabled:{defaultValue:"false", type:"state", valueType:"boolean"}, dropeffect:{defaultValue:"none", type:"property", valueType:"token_list", values:"copy move link execute popup none".split(" ")}, expanded:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "undefined"]}, flowto:{type:"property", valueType:"idref_list"}, grabbed:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false",
469
- "undefined"]}, haspopup:{defaultValue:"false", type:"property", valueType:"boolean"}, hidden:{defaultValue:"false", type:"state", valueType:"boolean"}, invalid:{defaultValue:"false", type:"state", valueType:"token", values:["grammar", "false", "spelling", "true"]}, label:{type:"property", valueType:"string"}, labelledby:{type:"property", valueType:"idref_list"}, level:{type:"property", valueType:"integer"}, live:{defaultValue:"off", type:"property", valueType:"token", values:["off", "polite", "assertive"]},
470
- multiline:{defaultValue:"false", type:"property", valueType:"boolean"}, multiselectable:{defaultValue:"false", type:"property", valueType:"boolean"}, orientation:{defaultValue:"vertical", type:"property", valueType:"token", values:["horizontal", "vertical"]}, owns:{type:"property", valueType:"idref_list"}, posinset:{type:"property", valueType:"integer"}, pressed:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "mixed", "undefined"]}, readonly:{defaultValue:"false",
471
- type:"property", valueType:"boolean"}, relevant:{defaultValue:"additions text", type:"property", valueType:"token_list", values:["additions", "removals", "text", "all"]}, required:{defaultValue:"false", type:"property", valueType:"boolean"}, selected:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "undefined"]}, setsize:{type:"property", valueType:"integer"}, sort:{defaultValue:"none", type:"property", valueType:"token", values:["ascending", "descending", "none",
467
+ axs.constants.ARIA_PROPERTIES = {activedescendant:{type:"property", valueType:"idref"}, atomic:{defaultValue:"false", type:"property", valueType:"boolean"}, autocomplete:{defaultValue:"none", type:"property", valueType:"token", values:["inline", "list", "both", "none"]}, busy:{defaultValue:"false", type:"state", valueType:"boolean"}, checked:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "mixed", "undefined"]}, controls:{type:"property", valueType:"idref_list"},
468
+ describedby:{type:"property", valueType:"idref_list"}, disabled:{defaultValue:"false", type:"state", valueType:"boolean"}, dropeffect:{defaultValue:"none", type:"property", valueType:"token_list", values:"copy move link execute popup none".split(" ")}, expanded:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "undefined"]}, flowto:{type:"property", valueType:"idref_list"}, grabbed:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false",
469
+ "undefined"]}, haspopup:{defaultValue:"false", type:"property", valueType:"boolean"}, hidden:{defaultValue:"false", type:"state", valueType:"boolean"}, invalid:{defaultValue:"false", type:"state", valueType:"token", values:["grammar", "false", "spelling", "true"]}, label:{type:"property", valueType:"string"}, labelledby:{type:"property", valueType:"idref_list"}, level:{type:"property", valueType:"integer"}, live:{defaultValue:"off", type:"property", valueType:"token", values:["off", "polite", "assertive"]},
470
+ multiline:{defaultValue:"false", type:"property", valueType:"boolean"}, multiselectable:{defaultValue:"false", type:"property", valueType:"boolean"}, orientation:{defaultValue:"vertical", type:"property", valueType:"token", values:["horizontal", "vertical"]}, owns:{type:"property", valueType:"idref_list"}, posinset:{type:"property", valueType:"integer"}, pressed:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "mixed", "undefined"]}, readonly:{defaultValue:"false",
471
+ type:"property", valueType:"boolean"}, relevant:{defaultValue:"additions text", type:"property", valueType:"token_list", values:["additions", "removals", "text", "all"]}, required:{defaultValue:"false", type:"property", valueType:"boolean"}, selected:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "undefined"]}, setsize:{type:"property", valueType:"integer"}, sort:{defaultValue:"none", type:"property", valueType:"token", values:["ascending", "descending", "none",
472
472
  "other"]}, valuemax:{type:"property", valueType:"decimal"}, valuemin:{type:"property", valueType:"decimal"}, valuenow:{type:"property", valueType:"decimal"}, valuetext:{type:"property", valueType:"string"}};
473
473
  axs.constants.GLOBAL_PROPERTIES = "aria-atomic aria-busy aria-controls aria-describedby aria-disabled aria-dropeffect aria-flowto aria-grabbed aria-haspopup aria-hidden aria-invalid aria-label aria-labelledby aria-live aria-owns aria-relevant".split(" ");
474
474
  axs.constants.NO_ROLE_NAME = " ";
475
- axs.constants.WIDGET_ROLE_TO_NAME = {alert:"aria_role_alert", alertdialog:"aria_role_alertdialog", button:"aria_role_button", checkbox:"aria_role_checkbox", columnheader:"aria_role_columnheader", combobox:"aria_role_combobox", dialog:"aria_role_dialog", grid:"aria_role_grid", gridcell:"aria_role_gridcell", link:"aria_role_link", listbox:"aria_role_listbox", log:"aria_role_log", marquee:"aria_role_marquee", menu:"aria_role_menu", menubar:"aria_role_menubar", menuitem:"aria_role_menuitem", menuitemcheckbox:"aria_role_menuitemcheckbox",
475
+ axs.constants.WIDGET_ROLE_TO_NAME = {alert:"aria_role_alert", alertdialog:"aria_role_alertdialog", button:"aria_role_button", checkbox:"aria_role_checkbox", columnheader:"aria_role_columnheader", combobox:"aria_role_combobox", dialog:"aria_role_dialog", grid:"aria_role_grid", gridcell:"aria_role_gridcell", link:"aria_role_link", listbox:"aria_role_listbox", log:"aria_role_log", marquee:"aria_role_marquee", menu:"aria_role_menu", menubar:"aria_role_menubar", menuitem:"aria_role_menuitem", menuitemcheckbox:"aria_role_menuitemcheckbox",
476
476
  menuitemradio:"aria_role_menuitemradio", option:axs.constants.NO_ROLE_NAME, progressbar:"aria_role_progressbar", radio:"aria_role_radio", radiogroup:"aria_role_radiogroup", rowheader:"aria_role_rowheader", scrollbar:"aria_role_scrollbar", slider:"aria_role_slider", spinbutton:"aria_role_spinbutton", status:"aria_role_status", tab:"aria_role_tab", tabpanel:"aria_role_tabpanel", textbox:"aria_role_textbox", timer:"aria_role_timer", toolbar:"aria_role_toolbar", tooltip:"aria_role_tooltip", treeitem:"aria_role_treeitem"};
477
- axs.constants.STRUCTURE_ROLE_TO_NAME = {article:"aria_role_article", application:"aria_role_application", banner:"aria_role_banner", columnheader:"aria_role_columnheader", complementary:"aria_role_complementary", contentinfo:"aria_role_contentinfo", definition:"aria_role_definition", directory:"aria_role_directory", document:"aria_role_document", form:"aria_role_form", group:"aria_role_group", heading:"aria_role_heading", img:"aria_role_img", list:"aria_role_list", listitem:"aria_role_listitem",
477
+ axs.constants.STRUCTURE_ROLE_TO_NAME = {article:"aria_role_article", application:"aria_role_application", banner:"aria_role_banner", columnheader:"aria_role_columnheader", complementary:"aria_role_complementary", contentinfo:"aria_role_contentinfo", definition:"aria_role_definition", directory:"aria_role_directory", document:"aria_role_document", form:"aria_role_form", group:"aria_role_group", heading:"aria_role_heading", img:"aria_role_img", list:"aria_role_list", listitem:"aria_role_listitem",
478
478
  main:"aria_role_main", math:"aria_role_math", navigation:"aria_role_navigation", note:"aria_role_note", region:"aria_role_region", rowheader:"aria_role_rowheader", search:"aria_role_search", separator:"aria_role_separator"};
479
- axs.constants.ATTRIBUTE_VALUE_TO_STATUS = [{name:"aria-autocomplete", values:{inline:"aria_autocomplete_inline", list:"aria_autocomplete_list", both:"aria_autocomplete_both"}}, {name:"aria-checked", values:{"true":"aria_checked_true", "false":"aria_checked_false", mixed:"aria_checked_mixed"}}, {name:"aria-disabled", values:{"true":"aria_disabled_true"}}, {name:"aria-expanded", values:{"true":"aria_expanded_true", "false":"aria_expanded_false"}}, {name:"aria-invalid", values:{"true":"aria_invalid_true",
480
- grammar:"aria_invalid_grammar", spelling:"aria_invalid_spelling"}}, {name:"aria-multiline", values:{"true":"aria_multiline_true"}}, {name:"aria-multiselectable", values:{"true":"aria_multiselectable_true"}}, {name:"aria-pressed", values:{"true":"aria_pressed_true", "false":"aria_pressed_false", mixed:"aria_pressed_mixed"}}, {name:"aria-readonly", values:{"true":"aria_readonly_true"}}, {name:"aria-required", values:{"true":"aria_required_true"}}, {name:"aria-selected", values:{"true":"aria_selected_true",
479
+ axs.constants.ATTRIBUTE_VALUE_TO_STATUS = [{name:"aria-autocomplete", values:{inline:"aria_autocomplete_inline", list:"aria_autocomplete_list", both:"aria_autocomplete_both"}}, {name:"aria-checked", values:{"true":"aria_checked_true", "false":"aria_checked_false", mixed:"aria_checked_mixed"}}, {name:"aria-disabled", values:{"true":"aria_disabled_true"}}, {name:"aria-expanded", values:{"true":"aria_expanded_true", "false":"aria_expanded_false"}}, {name:"aria-invalid", values:{"true":"aria_invalid_true",
480
+ grammar:"aria_invalid_grammar", spelling:"aria_invalid_spelling"}}, {name:"aria-multiline", values:{"true":"aria_multiline_true"}}, {name:"aria-multiselectable", values:{"true":"aria_multiselectable_true"}}, {name:"aria-pressed", values:{"true":"aria_pressed_true", "false":"aria_pressed_false", mixed:"aria_pressed_mixed"}}, {name:"aria-readonly", values:{"true":"aria_readonly_true"}}, {name:"aria-required", values:{"true":"aria_required_true"}}, {name:"aria-selected", values:{"true":"aria_selected_true",
481
481
  "false":"aria_selected_false"}}];
482
- axs.constants.INPUT_TYPE_TO_INFORMATION_TABLE_MSG = {button:"input_type_button", checkbox:"input_type_checkbox", color:"input_type_color", datetime:"input_type_datetime", "datetime-local":"input_type_datetime_local", date:"input_type_date", email:"input_type_email", file:"input_type_file", image:"input_type_image", month:"input_type_month", number:"input_type_number", password:"input_type_password", radio:"input_type_radio", range:"input_type_range", reset:"input_type_reset", search:"input_type_search",
482
+ axs.constants.INPUT_TYPE_TO_INFORMATION_TABLE_MSG = {button:"input_type_button", checkbox:"input_type_checkbox", color:"input_type_color", datetime:"input_type_datetime", "datetime-local":"input_type_datetime_local", date:"input_type_date", email:"input_type_email", file:"input_type_file", image:"input_type_image", month:"input_type_month", number:"input_type_number", password:"input_type_password", radio:"input_type_radio", range:"input_type_range", reset:"input_type_reset", search:"input_type_search",
483
483
  submit:"input_type_submit", tel:"input_type_tel", text:"input_type_text", url:"input_type_url", week:"input_type_week"};
484
484
  axs.constants.TAG_TO_INFORMATION_TABLE_VERBOSE_MSG = {A:"tag_link", BUTTON:"tag_button", H1:"tag_h1", H2:"tag_h2", H3:"tag_h3", H4:"tag_h4", H5:"tag_h5", H6:"tag_h6", LI:"tag_li", OL:"tag_ol", SELECT:"tag_select", TEXTAREA:"tag_textarea", UL:"tag_ul", SECTION:"tag_section", NAV:"tag_nav", ARTICLE:"tag_article", ASIDE:"tag_aside", HGROUP:"tag_hgroup", HEADER:"tag_header", FOOTER:"tag_footer", TIME:"tag_time", MARK:"tag_mark"};
485
485
  axs.constants.TAG_TO_INFORMATION_TABLE_BRIEF_MSG = {BUTTON:"tag_button", SELECT:"tag_select", TEXTAREA:"tag_textarea"};
@@ -543,19 +543,45 @@ axs.utils.elementHasZeroArea = function(a) {
543
543
  return a.right - a.left && b ? !1 : !0
544
544
  };
545
545
  axs.utils.elementIsOutsideScrollArea = function(a) {
546
- a = a.getBoundingClientRect();
547
- var b = document.body.scrollWidth, c = document.body.scrollTop, d = document.body.scrollLeft;
548
- return a.top >= document.body.scrollHeight || a.bottom <= -c || a.left >= b || a.right <= -d ? !0 : !1
546
+ for(var b = a.parentElement, c = a.ownerDocument.defaultView;b != c.document.body;) {
547
+ if(axs.utils.isClippedBy(a, b)) {
548
+ return!0
549
+ }
550
+ if(axs.utils.canScrollTo(a, b) && !axs.utils.elementIsOutsideScrollArea(b)) {
551
+ return!1
552
+ }
553
+ b = b.parentElement
554
+ }
555
+ return!axs.utils.canScrollTo(a, c.document.body)
556
+ };
557
+ axs.utils.canScrollTo = function(a, b) {
558
+ var c = a.getBoundingClientRect(), d = b.getBoundingClientRect(), e = d.top, f = d.left, g = e - b.scrollTop, e = e - b.scrollTop + b.scrollHeight, h = f - b.scrollLeft + b.scrollWidth;
559
+ if(c.right < f - b.scrollLeft || c.bottom < g || c.left > h || c.top > e) {
560
+ return!1
561
+ }
562
+ f = a.ownerDocument.defaultView;
563
+ g = f.getComputedStyle(b);
564
+ return c.left > d.right || c.top > d.bottom ? "scroll" == g.overflow || "auto" == g.overflow || b instanceof f.HTMLBodyElement : !0
565
+ };
566
+ axs.utils.isClippedBy = function(a, b) {
567
+ var c = a.getBoundingClientRect(), d = b.getBoundingClientRect(), e = d.top - b.scrollTop, f = d.left - b.scrollLeft, g = a.ownerDocument.defaultView.getComputedStyle(b);
568
+ return(c.right < d.left || c.bottom < d.top || c.left > d.right || c.top > d.bottom) && "hidden" == g.overflow ? !0 : c.right < f || c.bottom < e ? "visible" != g.overflow : !1
549
569
  };
550
570
  axs.utils.isAncestor = function(a, b) {
551
571
  return null == b ? !1 : b === a ? !0 : axs.utils.isAncestor(a, b.parentNode)
552
572
  };
553
- axs.utils.overlappingElement = function(a) {
573
+ axs.utils.overlappingElements = function(a) {
554
574
  if(axs.utils.elementHasZeroArea(a)) {
555
575
  return null
556
576
  }
557
- var b = a.getBoundingClientRect(), b = document.elementFromPoint((b.left + b.right) / 2, (b.top + b.bottom) / 2);
558
- return null == b || b == a || axs.utils.isAncestor(b, a) || axs.utils.isAncestor(a, b) ? null : b
577
+ for(var b = [], c = a.getClientRects(), d = 0;d < c.length;d++) {
578
+ var e = c[d], e = document.elementFromPoint((e.left + e.right) / 2, (e.top + e.bottom) / 2);
579
+ if(null != e && e != a && !axs.utils.isAncestor(e, a) && !axs.utils.isAncestor(a, e)) {
580
+ var f = window.getComputedStyle(e, null);
581
+ f && (f = axs.utils.getBgColor(f, e)) && 0 < f.alpha && 0 > b.indexOf(e) && b.push(e)
582
+ }
583
+ }
584
+ return b
559
585
  };
560
586
  axs.utils.elementIsHtmlControl = function(a) {
561
587
  var b = a.ownerDocument.defaultView;
@@ -565,16 +591,7 @@ axs.utils.elementIsAriaWidget = function(a) {
565
591
  return a.hasAttribute("role") && (a = a.getAttribute("role")) && (a = axs.constants.ARIA_ROLES[a]) && "widget" in a.allParentRolesSet ? !0 : !1
566
592
  };
567
593
  axs.utils.elementIsVisible = function(a) {
568
- if(axs.utils.elementIsTransparent(a) || axs.utils.elementHasZeroArea(a) || axs.utils.elementIsOutsideScrollArea(a)) {
569
- return!1
570
- }
571
- if(a = axs.utils.overlappingElement(a)) {
572
- var b = window.getComputedStyle(a, null);
573
- if(b && (a = axs.utils.getBgColor(b, a)) && 0 < a.alpha) {
574
- return!1
575
- }
576
- }
577
- return!0
594
+ return axs.utils.elementIsTransparent(a) || axs.utils.elementHasZeroArea(a) || axs.utils.elementIsOutsideScrollArea(a) || axs.utils.overlappingElements(a).length ? !1 : !0
578
595
  };
579
596
  axs.utils.isLargeFont = function(a) {
580
597
  var b = a.fontSize;
@@ -596,7 +613,7 @@ axs.utils.isLargeFont = function(a) {
596
613
  return b = parseInt(c[1], 10), a && 120 <= b || 150 <= b ? !0 : !1
597
614
  }
598
615
  if(c = b.match(/(\d+)pt/)) {
599
- if(b = parseInt(c[1], 10), a && 14 <= b || 14 <= b) {
616
+ if(b = parseInt(c[1], 10), a && 14 <= b || 18 <= b) {
600
617
  return!0
601
618
  }
602
619
  }
@@ -811,11 +828,12 @@ axs.utils.isNativeTextElement = function(a) {
811
828
  }
812
829
  };
813
830
  axs.utils.isLowContrast = function(a, b, c) {
831
+ a = Math.round(10 * a) / 10;
814
832
  return c ? 4.5 > a || !axs.utils.isLargeFont(b) && 7 > a : 3 > a || !axs.utils.isLargeFont(b) && 4.5 > a
815
833
  };
816
834
  axs.utils.hasLabel = function(a) {
817
835
  var b = a.tagName.toLowerCase(), c = a.type ? a.type.toLowerCase() : "";
818
- if(a.hasAttribute("aria-label") || a.hasAttribute("title") || "img" == b && a.hasAttribute("alt") || "input" == b && "image" == c && a.hasAttribute("alt") || "input" == b && ("submit" == c || "reset" == c) || a.hasAttribute("aria-labelledby") || axs.utils.isNativeTextElement(a) && a.hasAttribute("placeholder") || a.hasAttribute("id") && 0 < document.querySelectorAll("label[for=" + a.id + "]").length) {
836
+ if(a.hasAttribute("aria-label") || a.hasAttribute("title") || "img" == b && a.hasAttribute("alt") || "input" == b && "image" == c && a.hasAttribute("alt") || "input" == b && ("submit" == c || "reset" == c) || a.hasAttribute("aria-labelledby") || axs.utils.isNativeTextElement(a) && a.hasAttribute("placeholder") || a.hasAttribute("id") && 0 < document.querySelectorAll('label[for="' + a.id + '"]').length) {
819
837
  return!0
820
838
  }
821
839
  for(b = a.parentElement;b;) {
@@ -997,8 +1015,36 @@ axs.utils.getQuerySelectorText = function(a) {
997
1015
  axs.properties = {};
998
1016
  axs.properties.TEXT_CONTENT_XPATH = './/text()[normalize-space(.)!=""]/parent::*[name()!="script"]';
999
1017
  axs.properties.getFocusProperties = function(a) {
1000
- a = a.getAttribute("tabindex");
1001
- return void 0 != a ? {tabindex:{value:a, valid:!0}} : null
1018
+ var b = {}, c = a.getAttribute("tabindex");
1019
+ void 0 != c ? b.tabindex = {value:c, valid:!0} : axs.utils.isElementImplicitlyFocusable(a) && (b.implicitlyFocusable = {value:!0, valid:!0});
1020
+ if(0 == Object.keys(b).length) {
1021
+ return null
1022
+ }
1023
+ var d = axs.utils.elementIsTransparent(a), e = axs.utils.elementHasZeroArea(a), f = axs.utils.elementIsOutsideScrollArea(a), g = axs.utils.overlappingElements(a);
1024
+ if(d || e || f || 0 < g.length) {
1025
+ var c = axs.utils.isElementOrAncestorHidden(a), h = {value:!1, valid:c};
1026
+ d && (h.transparent = !0);
1027
+ e && (h.zeroArea = !0);
1028
+ f && (h.outsideScrollArea = !0);
1029
+ g && 0 < g.length && (h.overlappingElements = g);
1030
+ d = {value:c, valid:c};
1031
+ c && (d.reason = axs.properties.getHiddenReason(a));
1032
+ h.hidden = d;
1033
+ b.visible = h
1034
+ }else {
1035
+ b.visible = {value:!0, valid:!0}
1036
+ }
1037
+ return b
1038
+ };
1039
+ axs.properties.getHiddenReason = function(a) {
1040
+ if(!(a && a instanceof a.ownerDocument.defaultView.HTMLElement)) {
1041
+ return null
1042
+ }
1043
+ if(a.hasAttribute("chromevoxignoreariahidden")) {
1044
+ var b = !0
1045
+ }
1046
+ var c = window.getComputedStyle(a, null);
1047
+ return"none" == c.display ? {property:"display: none", on:a} : "hidden" == c.visibility ? {property:"visibility: hidden", on:a} : a.hasAttribute("aria-hidden") && "true" == a.getAttribute("aria-hidden").toLowerCase() && !b ? {property:"aria-hidden", on:a} : axs.properties.getHiddenReason(a.parentElement)
1002
1048
  };
1003
1049
  axs.properties.getColorProperties = function(a) {
1004
1050
  var b = {};
@@ -1034,77 +1080,75 @@ axs.properties.getContrastRatioProperties = function(a) {
1034
1080
  (c = axs.utils.suggestColors(d, e, a, c)) && Object.keys(c).length && (b.suggestedColors = c);
1035
1081
  return b
1036
1082
  };
1037
- axs.properties.findTextAlternatives = function(a, b, c) {
1038
- var d = c || !1;
1083
+ axs.properties.findTextAlternatives = function(a, b, c, d) {
1084
+ var e = c || !1;
1039
1085
  c = axs.utils.asElement(a);
1040
- if(!c || !d && axs.utils.isElementOrAncestorHidden(c)) {
1086
+ if(!c || !e && !d && axs.utils.isElementOrAncestorHidden(c)) {
1041
1087
  return null
1042
1088
  }
1043
1089
  if(a.nodeType == Node.TEXT_NODE) {
1044
1090
  return c = {type:"text"}, c.text = a.textContent, c.lastWord = axs.properties.getLastWord(c.text), b.content = c, a.textContent
1045
1091
  }
1046
1092
  a = null;
1047
- d || (a = axs.properties.getTextFromAriaLabelledby(c, b));
1048
- if(c.hasAttribute("aria-label")) {
1049
- var e = {type:"text"};
1050
- e.text = c.getAttribute("aria-label");
1051
- e.lastWord = axs.properties.getLastWord(e.text);
1052
- a ? e.unused = !0 : d && axs.utils.elementIsHtmlControl(c) || (a = e.text);
1053
- b.ariaLabel = e
1054
- }
1055
- c.hasAttribute("role") && "presentation" == c.getAttribute("role") || (a = axs.properties.getTextFromHostLangaugeAttributes(c, b, a));
1056
- if(d && axs.utils.elementIsHtmlControl(c)) {
1057
- e = c.ownerDocument.defaultView;
1058
- if(c instanceof e.HTMLInputElement) {
1093
+ e || (a = axs.properties.getTextFromAriaLabelledby(c, b));
1094
+ c.hasAttribute("aria-label") && (d = {type:"text"}, d.text = c.getAttribute("aria-label"), d.lastWord = axs.properties.getLastWord(d.text), a ? d.unused = !0 : e && axs.utils.elementIsHtmlControl(c) || (a = d.text), b.ariaLabel = d);
1095
+ c.hasAttribute("role") && "presentation" == c.getAttribute("role") || (a = axs.properties.getTextFromHostLanguageAttributes(c, b, a, e));
1096
+ if(e && axs.utils.elementIsHtmlControl(c)) {
1097
+ d = c.ownerDocument.defaultView;
1098
+ if(c instanceof d.HTMLInputElement) {
1059
1099
  var f = c;
1060
1100
  "text" == f.type && f.value && 0 < f.value.length && (b.controlValue = {text:f.value});
1061
1101
  "range" == f.type && (b.controlValue = {text:f.value})
1062
1102
  }
1063
- c instanceof e.HTMLSelectElement && (b.controlValue = {text:f.value});
1064
- b.controlValue && (f = b.controlValue, a ? f.unused = !0 : a = f.text)
1103
+ c instanceof d.HTMLSelectElement && (b.controlValue = {text:c.value});
1104
+ b.controlValue && (d = b.controlValue, a ? d.unused = !0 : a = d.text)
1065
1105
  }
1066
- if(d && axs.utils.elementIsAriaWidget(c)) {
1067
- d = c.getAttribute("role");
1068
- "textbox" == d && c.textContent && 0 < c.textContent.length && (b.controlValue = {text:c.textContent});
1069
- if("slider" == d || "spinbutton" == d) {
1106
+ if(e && axs.utils.elementIsAriaWidget(c)) {
1107
+ e = c.getAttribute("role");
1108
+ "textbox" == e && c.textContent && 0 < c.textContent.length && (b.controlValue = {text:c.textContent});
1109
+ if("slider" == e || "spinbutton" == e) {
1070
1110
  c.hasAttribute("aria-valuetext") ? b.controlValue = {text:c.getAttribute("aria-valuetext")} : c.hasAttribute("aria-valuenow") && (b.controlValue = {value:c.getAttribute("aria-valuenow"), text:"" + c.getAttribute("aria-valuenow")})
1071
1111
  }
1072
- if("menu" == d) {
1073
- for(var g = c.querySelectorAll("[role=menuitemcheckbox], [role=menuitemradio]"), f = [], e = 0;e < g.length;e++) {
1074
- "true" == g[e].getAttribute("aria-checked") && f.push(g[e])
1112
+ if("menu" == e) {
1113
+ var g = c.querySelectorAll("[role=menuitemcheckbox], [role=menuitemradio]");
1114
+ d = [];
1115
+ for(f = 0;f < g.length;f++) {
1116
+ "true" == g[f].getAttribute("aria-checked") && d.push(g[f])
1075
1117
  }
1076
- if(0 < f.length) {
1118
+ if(0 < d.length) {
1077
1119
  g = "";
1078
- for(e = 0;e < f.length;e++) {
1079
- g += axs.properties.findTextAlternatives(f[e], {}, !0), e < f.length - 1 && (g += ", ")
1120
+ for(f = 0;f < d.length;f++) {
1121
+ g += axs.properties.findTextAlternatives(d[f], {}, !0), f < d.length - 1 && (g += ", ")
1080
1122
  }
1081
1123
  b.controlValue = {text:g}
1082
1124
  }
1083
1125
  }
1084
- if("combobox" == d || "select" == d) {
1126
+ if("combobox" == e || "select" == e) {
1085
1127
  b.controlValue = {text:"TODO"}
1086
1128
  }
1087
- b.controlValue && (f = b.controlValue, a ? f.unused = !0 : a = f.text)
1088
- }
1089
- if(d = axs.properties.getTextFromDescendantContent(c)) {
1090
- f = {type:"text"}, f.text = d, f.lastWord = axs.properties.getLastWord(f.text), a ? f.unused = !0 : a = d, b.content = f
1129
+ b.controlValue && (d = b.controlValue, a ? d.unused = !0 : a = d.text)
1091
1130
  }
1092
- c.hasAttribute("title") && (d = {type:"string", valid:!0}, d.text = c.getAttribute("title"), d.lastWord = axs.properties.getLastWord(d.lastWord), a ? d.unused = !0 : a = d.text, b.title = d);
1131
+ d = !0;
1132
+ c.hasAttribute("role") && (e = c.getAttribute("role"), (e = axs.constants.ARIA_ROLES[e]) && (!e.namefrom || 0 > e.namefrom.indexOf("contents")) && (d = !1));
1133
+ (e = axs.properties.getTextFromDescendantContent(c)) && d && (d = {type:"text"}, d.text = e, d.lastWord = axs.properties.getLastWord(d.text), a ? d.unused = !0 : a = e, b.content = d);
1134
+ c.hasAttribute("title") && (e = {type:"string", valid:!0}, e.text = c.getAttribute("title"), e.lastWord = axs.properties.getLastWord(e.lastWord), a ? e.unused = !0 : a = e.text, b.title = e);
1093
1135
  return 0 == Object.keys(b).length && null == a ? null : a
1094
1136
  };
1095
1137
  axs.properties.getTextFromDescendantContent = function(a) {
1096
- if(a.hasAttribute("role")) {
1097
- var b = a.getAttribute("role");
1098
- if((b = axs.constants.ARIA_ROLES[b]) && (!b.namefrom || 0 > b.namefrom.indexOf("contents"))) {
1099
- return null
1138
+ var b = a.childNodes;
1139
+ a = [];
1140
+ for(var c = 0;c < b.length;c++) {
1141
+ var d = axs.properties.findTextAlternatives(b[c], {}, !0);
1142
+ d && a.push(d.trim())
1143
+ }
1144
+ if(a.length) {
1145
+ b = "";
1146
+ for(c = 0;c < a.length;c++) {
1147
+ b = [b, a[c]].join(" ").trim()
1100
1148
  }
1149
+ return b
1101
1150
  }
1102
- a = a.childNodes;
1103
- for(var b = [], c = 0;c < a.length;c++) {
1104
- var d = axs.properties.findTextAlternatives(a[c], {}, !0);
1105
- d && 0 < d.trim().length && b.push(d.trim())
1106
- }
1107
- return b.length ? b.join(" ") : null
1151
+ return null
1108
1152
  };
1109
1153
  axs.properties.getTextFromAriaLabelledby = function(a, b) {
1110
1154
  var c = null;
@@ -1121,20 +1165,21 @@ axs.properties.getTextFromAriaLabelledby = function(a, b) {
1121
1165
  0 < g.length && (g[g.length - 1].last = !0, e.values = g, e.text = f.join(" "), e.lastWord = axs.properties.getLastWord(e.text), c = e.text, b.ariaLabelledby = e);
1122
1166
  return c
1123
1167
  };
1124
- axs.properties.getTextFromHostLangaugeAttributes = function(a, b, c) {
1168
+ axs.properties.getTextFromHostLanguageAttributes = function(a, b, c, d) {
1125
1169
  if(axs.browserUtils.matchSelector(a, "img")) {
1126
1170
  if(a.hasAttribute("alt")) {
1127
- var d = {type:"string", valid:!0};
1128
- d.text = a.getAttribute("alt");
1129
- c ? d.unused = !0 : c = d.text;
1130
- b.alt = d
1171
+ var e = {type:"string", valid:!0};
1172
+ e.text = a.getAttribute("alt");
1173
+ c ? e.unused = !0 : c = e.text;
1174
+ b.alt = e
1131
1175
  }else {
1132
- d = {valid:!1, errorMessage:"No alt value provided"}, b.alt = d, d = a.src, "string" == typeof d && (c = d.split("/").pop(), b.filename = {text:c})
1176
+ e = {valid:!1, errorMessage:"No alt value provided"}, b.alt = e, e = a.src, "string" == typeof e && (c = e.split("/").pop(), b.filename = {text:c})
1133
1177
  }
1134
1178
  }
1135
- if(axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), video:not([disabled])')) {
1179
+ if(axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), video:not([disabled])') && !d) {
1136
1180
  if(a.hasAttribute("id")) {
1137
- for(var d = document.querySelectorAll("label[for=" + a.id + "]"), e = {}, f = [], g = [], h = 0;h < d.length;h++) {
1181
+ d = document.querySelectorAll('label[for="' + a.id + '"]');
1182
+ for(var e = {}, f = [], g = [], h = 0;h < d.length;h++) {
1138
1183
  var k = {type:"element"}, m = d[h], l = axs.properties.findTextAlternatives(m, {}, !0);
1139
1184
  l && 0 < l.trim().length && (k.text = l.trim(), g.push(l.trim()));
1140
1185
  k.element = m;
@@ -1167,7 +1212,7 @@ axs.properties.getLastWord = function(a) {
1167
1212
  };
1168
1213
  axs.properties.getTextProperties = function(a) {
1169
1214
  var b = {};
1170
- a = axs.properties.findTextAlternatives(a, b);
1215
+ a = axs.properties.findTextAlternatives(a, b, !1, !0);
1171
1216
  if(0 == Object.keys(b).length) {
1172
1217
  if(!a) {
1173
1218
  return null
@@ -1292,28 +1337,31 @@ axs.AuditRule.collectMatchingElements = function(a, b, c) {
1292
1337
  axs.AuditRule.collectMatchingElements(a, b, c), a = a.nextSibling
1293
1338
  }
1294
1339
  };
1295
- axs.AuditRule.prototype.run = function(a, b) {
1296
- var c = a || [], d = [];
1297
- axs.AuditRule.collectMatchingElements(b || document, this.relevantElementMatcher_, d);
1340
+ axs.AuditRule.prototype.run = function(a) {
1341
+ a = a || {};
1342
+ var b = "ignoreSelectors" in a ? a.ignoreSelectors : [], c = "maxResults" in a ? a.maxResults : null, d = [];
1343
+ axs.AuditRule.collectMatchingElements("scope" in a ? a.scope : document, this.relevantElementMatcher_, d);
1298
1344
  var e = [];
1299
1345
  if(!d.length) {
1300
1346
  return{result:axs.constants.AuditResult.NA}
1301
1347
  }
1302
- for(var f = 0;f < d.length;f++) {
1303
- var g = d[f], h;
1348
+ for(a = 0;a < d.length && !(null != c && e.length >= c);a++) {
1349
+ var f = d[a], g;
1304
1350
  a: {
1305
- h = g;
1306
- for(var k = 0;k < c.length;k++) {
1307
- if(axs.browserUtils.matchSelector(h, c[k])) {
1308
- h = !0;
1351
+ g = f;
1352
+ for(var h = 0;h < b.length;h++) {
1353
+ if(axs.browserUtils.matchSelector(g, b[h])) {
1354
+ g = !0;
1309
1355
  break a
1310
1356
  }
1311
1357
  }
1312
- h = !1
1358
+ g = !1
1313
1359
  }
1314
- !h && this.test_(g) && this.addElement(e, g)
1360
+ !g && this.test_(f) && this.addElement(e, f)
1315
1361
  }
1316
- return{result:e.length ? axs.constants.AuditResult.FAIL : axs.constants.AuditResult.PASS, elements:e}
1362
+ b = {result:e.length ? axs.constants.AuditResult.FAIL : axs.constants.AuditResult.PASS, elements:e};
1363
+ a < d.length && (b.resultsTruncated = !0);
1364
+ return b
1317
1365
  };
1318
1366
  axs.AuditRule.specs = {};
1319
1367
  axs.AuditRules = {};
@@ -1370,7 +1418,7 @@ goog.exportProperty(axs.AuditResults.prototype, "toString", axs.AuditResults.pro
1370
1418
  axs.Audit = {};
1371
1419
  axs.AuditConfiguration = function() {
1372
1420
  this.rules_ = {};
1373
- this.auditRulesToIgnore = this.auditRulesToRun = this.scope = null;
1421
+ this.maxResults = this.auditRulesToIgnore = this.auditRulesToRun = this.scope = null;
1374
1422
  this.withConsoleApi = !1;
1375
1423
  goog.exportProperty(this, "scope", this.scope);
1376
1424
  goog.exportProperty(this, "auditRulesToRun", this.auditRulesToRun);
@@ -1384,6 +1432,11 @@ axs.AuditConfiguration.prototype = {ignoreSelectors:function(a, b) {
1384
1432
  Array.prototype.push.call(this.rules_[a].ignore, b)
1385
1433
  }, getIgnoreSelectors:function(a) {
1386
1434
  return a in this.rules_ && "ignore" in this.rules_[a] ? this.rules_[a].ignore : []
1435
+ }, setSeverity:function(a, b) {
1436
+ a in this.rules_ || (this.rules_[a] = {});
1437
+ this.rules_[a].severity = b
1438
+ }, getSeverity:function(a) {
1439
+ return a in this.rules_ && "severity" in this.rules_[a] ? this.rules_[a].severity : null
1387
1440
  }};
1388
1441
  goog.exportProperty(axs.AuditConfiguration.prototype, "ignoreSelectors", axs.AuditConfiguration.prototype.ignoreSelectors);
1389
1442
  goog.exportProperty(axs.AuditConfiguration.prototype, "getIgnoreSelectors", axs.AuditConfiguration.prototype.getIgnoreSelectors);
@@ -1398,13 +1451,19 @@ axs.Audit.run = function(a) {
1398
1451
  }
1399
1452
  }
1400
1453
  for(e = 0;e < d.length;e++) {
1401
- if((f = axs.AuditRules.getRule(d[e])) && !f.disabled && (b || !f.requiresConsoleAPI)) {
1402
- var g = [], h = a.getIgnoreSelectors(f.name);
1403
- (0 < h.length || a.scope) && g.push(h);
1404
- a.scope && g.push(a.scope);
1405
- g = f.run.apply(f, g);
1406
- g.rule = axs.utils.namedValues(f);
1407
- c.push(g)
1454
+ var f = d[e], g = axs.AuditRules.getRule(f);
1455
+ if(g && !g.disabled && (b || !g.requiresConsoleAPI)) {
1456
+ var h = {}, k = a.getIgnoreSelectors(g.name);
1457
+ if(0 < k.length || a.scope) {
1458
+ h.ignoreSelectors = k
1459
+ }
1460
+ a.scope && (h.scope = a.scope);
1461
+ a.maxResults && (h.maxResults = a.maxResults);
1462
+ h = g.run.call(g, h);
1463
+ g = axs.utils.namedValues(g);
1464
+ g.severity = a.getSeverity(f) || g.severity;
1465
+ h.rule = g;
1466
+ c.push(h)
1408
1467
  }
1409
1468
  }
1410
1469
  return c
@@ -1497,7 +1556,11 @@ axs.AuditRule.specs.focusableElementNotVisibleAndNotAriaHidden = {name:"focusabl
1497
1556
  }
1498
1557
  return!0
1499
1558
  }, test:function(a) {
1500
- return axs.utils.isElementOrAncestorHidden(a) ? !1 : !axs.utils.elementIsVisible(a)
1559
+ if(axs.utils.isElementOrAncestorHidden(a)) {
1560
+ return!1
1561
+ }
1562
+ a.focus();
1563
+ return!axs.utils.elementIsVisible(a)
1501
1564
  }, code:"AX_FOCUS_01"};
1502
1565
  axs.AuditRule.specs.imagesWithoutAltText = {name:"imagesWithoutAltText", heading:"Images should have an alt attribute", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_text_02--images-should-have-an-alt-attribute-unless-they-have-an-aria-role-of-presentation", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1503
1566
  return axs.browserUtils.matchSelector(a, "img") && !axs.utils.isElementOrAncestorHidden(a)
@@ -1521,7 +1584,7 @@ axs.AuditRule.specs.mainRoleOnInappropriateElement = {name:"mainRoleOnInappropri
1521
1584
  if(axs.utils.isInlineElement(a)) {
1522
1585
  return!0
1523
1586
  }
1524
- a = axs.properties.findTextAlternatives(a, {});
1587
+ a = axs.properties.getTextFromDescendantContent(a);
1525
1588
  return!a || 50 > a.length ? !0 : !1
1526
1589
  }, code:"AX_ARIA_04"};
1527
1590
  axs.AuditRule.specs.elementsWithMeaningfulBackgroundImage = {name:"elementsWithMeaningfulBackgroundImage", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
@@ -1573,14 +1636,12 @@ axs.AuditRule.specs.requiredAriaAttributeMissing = {name:"requiredAriaAttributeM
1573
1636
  }
1574
1637
  }, code:"AX_ARIA_03"};
1575
1638
  axs.AuditRule.specs.unfocusableElementsWithOnClick = {name:"unfocusableElementsWithOnClick", heading:"Elements with onclick handlers must be focusable", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_focus_02--elements-with-onclick-handlers-must-be-focusable", severity:axs.constants.Severity.WARNING, opt_requiresConsoleAPI:!0, relevantElementMatcher:function(a) {
1576
- return a instanceof a.ownerDocument.defaultView.HTMLBodyElement || axs.utils.isElementOrAncestorHidden(a) && "selected" == a.className ? !1 : "click" in getEventListeners(a) ? !0 : !1
1639
+ return a instanceof a.ownerDocument.defaultView.HTMLBodyElement || axs.utils.isElementOrAncestorHidden(a) ? !1 : "click" in getEventListeners(a) ? !0 : !1
1577
1640
  }, test:function(a) {
1578
- return!a.hasAttribute("tabindex") && !axs.utils.isElementImplicitlyFocusable(a)
1641
+ return!a.hasAttribute("tabindex") && !axs.utils.isElementImplicitlyFocusable(a) && !a.disabled
1579
1642
  }, code:"AX_FOCUS_02"};
1580
1643
  axs.AuditRule.specs.videoWithoutCaptions = {name:"videoWithoutCaptions", heading:"Video elements should use <track> elements to provide captions", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_video_01--video-elements-should-use-track-elements-to-provide-captions", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1581
1644
  return axs.browserUtils.matchSelector(a, "video")
1582
1645
  }, test:function(a) {
1583
1646
  return!a.querySelectorAll("track[kind=captions]").length
1584
1647
  }, code:"AX_VIDEO_01"};
1585
-
1586
-
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: access_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Cundiff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-18 00:00:00.000000000 Z
11
+ date: 2014-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: awesome_print
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: command_line_reporter
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.3'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: json
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Run an accessibility audit on a file or URL from the command line.
@@ -102,10 +102,10 @@ executables:
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
- - .coveralls.yml
106
- - .gitignore
107
- - .rspec
108
- - .travis.yml
105
+ - ".coveralls.yml"
106
+ - ".gitignore"
107
+ - ".rspec"
108
+ - ".travis.yml"
109
109
  - CHANGELOG.md
110
110
  - Gemfile
111
111
  - LICENSE.txt
@@ -137,17 +137,17 @@ require_paths:
137
137
  - lib
138
138
  required_ruby_version: !ruby/object:Gem::Requirement
139
139
  requirements:
140
- - - '>='
140
+ - - ">="
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0'
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - '>='
145
+ - - ">="
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements: []
149
149
  rubyforge_project:
150
- rubygems_version: 2.2.1
150
+ rubygems_version: 2.4.2
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: AccessLint runs Google Accessibility Developer Tools assertions on a page