2 * Copyright 2013 Google Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 * Generated from http://github.com/GoogleChrome/accessibility-developer-tools/tree/f1baac17140e5f4bc8b6587ea8231df44f80028e
18 * See project README for build steps.
21 // AUTO-GENERATED CONTENT BELOW: DO NOT EDIT! See above for details.
23 var COMPILED = !0, goog = goog || {};
25 goog.exportPath_ = function(a, b, c) {
28 a[0] in c || !c.execScript || c.execScript("var " + a[0]);
29 for(var d;a.length && (d = a.shift());) {
30 a.length || void 0 === b ? c = c[d] ? c[d] : c[d] = {} : c[d] = b
33 goog.define = function(a, b) {
35 COMPILED || goog.global.CLOSURE_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES, a) && (c = goog.global.CLOSURE_DEFINES[a]);
36 goog.exportPath_(a, c)
40 goog.TRUSTED_SITE = !0;
41 goog.provide = function(a) {
43 if(goog.isProvided_(a)) {
44 throw Error('Namespace "' + a + '" already declared.');
46 delete goog.implicitNamespaces_[a];
47 for(var b = a;(b = b.substring(0, b.lastIndexOf("."))) && !goog.getObjectByName(b);) {
48 goog.implicitNamespaces_[b] = !0
53 goog.setTestOnly = function(a) {
54 if(COMPILED && !goog.DEBUG) {
55 throw a = a || "", Error("Importing test-only code into non-debug environment" + a ? ": " + a : ".");
58 COMPILED || (goog.isProvided_ = function(a) {
59 return!goog.implicitNamespaces_[a] && !!goog.getObjectByName(a)
60 }, goog.implicitNamespaces_ = {});
61 goog.getObjectByName = function(a, b) {
62 for(var c = a.split("."), d = b || goog.global, e;e = c.shift();) {
63 if(goog.isDefAndNotNull(d[e])) {
71 goog.globalize = function(a, b) {
72 var c = b || goog.global, d;
77 goog.addDependency = function(a, b, c) {
78 if(goog.DEPENDENCIES_ENABLED) {
80 a = a.replace(/\\/g, "/");
81 for(var e = goog.dependencies_, f = 0;d = b[f];f++) {
82 e.nameToPath[d] = a, a in e.pathToNames || (e.pathToNames[a] = {}), e.pathToNames[a][d] = !0
84 for(d = 0;b = c[d];d++) {
85 a in e.requires || (e.requires[a] = {}), e.requires[a][b] = !0
89 goog.ENABLE_DEBUG_LOADER = !0;
90 goog.require = function(a) {
91 if(!COMPILED && !goog.isProvided_(a)) {
92 if(goog.ENABLE_DEBUG_LOADER) {
93 var b = goog.getPathFromDeps_(a);
95 goog.included_[b] = !0;
100 a = "goog.require could not find: " + a;
101 goog.global.console && goog.global.console.error(a);
106 goog.nullFunction = function() {
108 goog.identityFunction = function(a, b) {
111 goog.abstractMethod = function() {
112 throw Error("unimplemented abstract method");
114 goog.addSingletonGetter = function(a) {
115 a.getInstance = function() {
119 goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = a);
120 return a.instance_ = new a
123 goog.instantiatedSingletons_ = [];
124 goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;
125 goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathToNames:{}, nameToPath:{}, requires:{}, visited:{}, written:{}}, goog.inHtmlDocument_ = function() {
126 var a = goog.global.document;
127 return"undefined" != typeof a && "write" in a
128 }, goog.findBasePath_ = function() {
129 if(goog.global.CLOSURE_BASE_PATH) {
130 goog.basePath = goog.global.CLOSURE_BASE_PATH
132 if(goog.inHtmlDocument_()) {
133 for(var a = goog.global.document.getElementsByTagName("script"), b = a.length - 1;0 <= b;--b) {
134 var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d;
135 if("base.js" == c.substr(d - 7, 7)) {
136 goog.basePath = c.substr(0, d - 7);
142 }, goog.importScript_ = function(a) {
143 var b = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_;
144 !goog.dependencies_.written[a] && b(a) && (goog.dependencies_.written[a] = !0)
145 }, goog.writeScriptTag_ = function(a) {
146 if(goog.inHtmlDocument_()) {
147 var b = goog.global.document;
148 if("complete" == b.readyState) {
149 if(/\bdeps.js$/.test(a)) {
152 throw Error('Cannot write "' + a + '" after document load');
154 b.write('<script type="text/javascript" src="' + a + '">\x3c/script>');
158 }, goog.writeScripts_ = function() {
160 if(!(e in d.written)) {
161 if(!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) {
162 for(var g in d.requires[e]) {
163 if(!goog.isProvided_(g)) {
164 if(g in d.nameToPath) {
167 throw Error("Undefined nameToPath for " + g);
172 e in c || (c[e] = !0, b.push(e))
175 var b = [], c = {}, d = goog.dependencies_, e;
176 for(e in goog.included_) {
179 for(e = 0;e < b.length;e++) {
181 goog.importScript_(goog.basePath + b[e])
183 throw Error("Undefined script input");
186 }, goog.getPathFromDeps_ = function(a) {
187 return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] : null
188 }, goog.findBasePath_(), goog.global.CLOSURE_NO_DEPS || goog.importScript_(goog.basePath + "deps.js"));
189 goog.typeOf = function(a) {
193 if(a instanceof Array) {
196 if(a instanceof Object) {
199 var c = Object.prototype.toString.call(a);
200 if("[object Window]" == c) {
203 if("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) {
206 if("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) {
213 if("function" == b && "undefined" == typeof a.call) {
219 goog.isDef = function(a) {
222 goog.isNull = function(a) {
225 goog.isDefAndNotNull = function(a) {
228 goog.isArray = function(a) {
229 return"array" == goog.typeOf(a)
231 goog.isArrayLike = function(a) {
232 var b = goog.typeOf(a);
233 return"array" == b || "object" == b && "number" == typeof a.length
235 goog.isDateLike = function(a) {
236 return goog.isObject(a) && "function" == typeof a.getFullYear
238 goog.isString = function(a) {
239 return"string" == typeof a
241 goog.isBoolean = function(a) {
242 return"boolean" == typeof a
244 goog.isNumber = function(a) {
245 return"number" == typeof a
247 goog.isFunction = function(a) {
248 return"function" == goog.typeOf(a)
250 goog.isObject = function(a) {
252 return"object" == b && null != a || "function" == b
254 goog.getUid = function(a) {
255 return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_)
257 goog.removeUid = function(a) {
258 "removeAttribute" in a && a.removeAttribute(goog.UID_PROPERTY_);
260 delete a[goog.UID_PROPERTY_]
264 goog.UID_PROPERTY_ = "closure_uid_" + (1E9 * Math.random() >>> 0);
265 goog.uidCounter_ = 0;
266 goog.getHashCode = goog.getUid;
267 goog.removeHashCode = goog.removeUid;
268 goog.cloneObject = function(a) {
269 var b = goog.typeOf(a);
270 if("object" == b || "array" == b) {
274 var b = "array" == b ? [] : {}, c;
276 b[c] = goog.cloneObject(a[c])
282 goog.bindNative_ = function(a, b, c) {
283 return a.call.apply(a.bind, arguments)
285 goog.bindJs_ = function(a, b, c) {
289 if(2 < arguments.length) {
290 var d = Array.prototype.slice.call(arguments, 2);
292 var c = Array.prototype.slice.call(arguments);
293 Array.prototype.unshift.apply(c, d);
298 return a.apply(b, arguments)
301 goog.bind = function(a, b, c) {
302 Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_;
303 return goog.bind.apply(null, arguments)
305 goog.partial = function(a, b) {
306 var c = Array.prototype.slice.call(arguments, 1);
308 var b = Array.prototype.slice.call(arguments);
309 b.unshift.apply(b, c);
310 return a.apply(this, b)
313 goog.mixin = function(a, b) {
318 goog.now = goog.TRUSTED_SITE && Date.now || function() {
321 goog.globalEval = function(a) {
322 if(goog.global.execScript) {
323 goog.global.execScript(a, "JavaScript")
325 if(goog.global.eval) {
326 if(null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ = 1;"), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalWorksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals_) {
329 var b = goog.global.document, c = b.createElement("script");
330 c.type = "text/javascript";
332 c.appendChild(b.createTextNode(a));
333 b.body.appendChild(c);
334 b.body.removeChild(c)
337 throw Error("goog.globalEval not available");
341 goog.evalWorksForGlobals_ = null;
342 goog.getCssName = function(a, b) {
343 var c = function(a) {
344 return goog.cssNameMapping_[a] || a
347 for(var b = [], d = 0;d < a.length;d++) {
351 }, d = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? c : d : function(a) {
354 return b ? a + "-" + d(b) : d(a)
356 goog.setCssNameMapping = function(a, b) {
357 goog.cssNameMapping_ = a;
358 goog.cssNameMappingStyle_ = b
360 !COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING);
361 goog.getMsg = function(a, b) {
364 var e = ("" + c[d]).replace(/\$/g, "$$$$");
365 a = a.replace(RegExp("\\{\\$" + d + "\\}", "gi"), e)
369 goog.getMsgWithFallback = function(a, b) {
372 goog.exportSymbol = function(a, b, c) {
373 goog.exportPath_(a, b, c)
375 goog.exportProperty = function(a, b, c) {
378 goog.inherits = function(a, b) {
381 c.prototype = b.prototype;
382 a.superClass_ = b.prototype;
384 a.prototype.constructor = a
386 goog.base = function(a, b, c) {
387 var d = arguments.callee.caller;
388 if(goog.DEBUG && !d) {
389 throw Error("arguments.caller not defined. goog.base() expects not to be running in strict mode. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");
392 return d.superClass_.constructor.apply(a, Array.prototype.slice.call(arguments, 1))
394 for(var e = Array.prototype.slice.call(arguments, 2), f = !1, g = a.constructor;g;g = g.superClass_ && g.superClass_.constructor) {
395 if(g.prototype[b] === d) {
399 return g.prototype[b].apply(a, e)
404 return a.constructor.prototype[b].apply(a, e)
406 throw Error("goog.base called from a method of one name to a method of a different name");
408 goog.scope = function(a) {
412 axs.browserUtils = {};
413 axs.browserUtils.matchSelector = function(a, b) {
414 return a.webkitMatchesSelector ? a.webkitMatchesSelector(b) : a.mozMatchesSelector ? a.mozMatchesSelector(b) : !1
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 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 axs.constants.WIDGET_ROLES = {};
433 axs.constants.addAllParentRolesToSet_ = function(a, b) {
435 for(var c = a.parent, d = 0;d < c.length;d++) {
438 axs.constants.addAllParentRolesToSet_(axs.constants.ARIA_ROLES[e], b)
442 axs.constants.addAllPropertiesToSet_ = function(a, b, c) {
445 for(var e = 0;e < d.length;e++) {
450 for(a = a.parent, d = 0;d < a.length;d++) {
451 axs.constants.addAllPropertiesToSet_(axs.constants.ARIA_ROLES[a[d]], b, c)
455 for(var roleName in axs.constants.ARIA_ROLES) {
456 var role = axs.constants.ARIA_ROLES[roleName], propertiesSet = {};
457 axs.constants.addAllPropertiesToSet_(role, "properties", propertiesSet);
458 role.propertiesSet = propertiesSet;
459 var requiredPropertiesSet = {};
460 axs.constants.addAllPropertiesToSet_(role, "requiredProperties", requiredPropertiesSet);
461 role.requiredPropertiesSet = requiredPropertiesSet;
462 var parentRolesSet = {};
463 axs.constants.addAllParentRolesToSet_(role, parentRolesSet);
464 role.allParentRolesSet = parentRolesSet;
465 "widget" in parentRolesSet && (axs.constants.WIDGET_ROLES[roleName] = role)
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 "other"]}, valuemax:{type:"property", valueType:"decimal"}, valuemin:{type:"property", valueType:"decimal"}, valuenow:{type:"property", valueType:"decimal"}, valuetext:{type:"property", valueType:"string"}};
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 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",
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",
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",
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",
483 submit:"input_type_submit", tel:"input_type_tel", text:"input_type_text", url:"input_type_url", week:"input_type_week"};
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 axs.constants.TAG_TO_INFORMATION_TABLE_BRIEF_MSG = {BUTTON:"tag_button", SELECT:"tag_select", TEXTAREA:"tag_textarea"};
486 axs.constants.MIXED_VALUES = {"true":!0, "false":!0, mixed:!0};
488 for(var a in axs.constants.ARIA_PROPERTIES) {
489 var b = axs.constants.ARIA_PROPERTIES[a];
491 for(var c = {}, d = 0;d < b.values.length;d++) {
498 axs.constants.Severity = {INFO:"Info", WARNING:"Warning", SEVERE:"Severe"};
499 axs.constants.AuditResult = {PASS:"PASS", FAIL:"FAIL", NA:"NA"};
500 axs.constants.InlineElements = {TT:!0, I:!0, B:!0, BIG:!0, SMALL:!0, EM:!0, STRONG:!0, DFN:!0, CODE:!0, SAMP:!0, KBD:!0, VAR:!0, CITE:!0, ABBR:!0, ACRONYM:!0, A:!0, IMG:!0, OBJECT:!0, BR:!0, SCRIPT:!0, MAP:!0, Q:!0, SUB:!0, SUP:!0, SPAN:!0, BDO:!0, INPUT:!0, SELECT:!0, TEXTAREA:!0, LABEL:!0, BUTTON:!0};
502 axs.utils.FOCUSABLE_ELEMENTS_SELECTOR = "input:not([type=hidden]):not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),a[href],iframe,[tabindex]";
503 axs.utils.Color = function(a, b, c, d) {
509 axs.utils.calculateContrastRatio = function(a, b) {
513 1 > a.alpha && (a = axs.utils.flattenColors(a, b));
514 var c = axs.utils.calculateLuminance(a), d = axs.utils.calculateLuminance(b);
515 return(Math.max(c, d) + 0.05) / (Math.min(c, d) + 0.05)
517 axs.utils.luminanceRatio = function(a, b) {
518 return(Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05)
520 axs.utils.asElement = function(a) {
522 case Node.COMMENT_NODE:
524 case Node.ELEMENT_NODE:
525 if("script" == a.tagName.toLowerCase()) {
533 return console.warn("Unhandled node type: ", a.nodeType), null
537 axs.utils.elementIsTransparent = function(a) {
538 return"0" == a.style.opacity
540 axs.utils.elementHasZeroArea = function(a) {
541 a = a.getBoundingClientRect();
542 var b = a.top - a.bottom;
543 return a.right - a.left && b ? !1 : !0
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
550 axs.utils.isAncestor = function(a, b) {
551 return null == b ? !1 : b === a ? !0 : axs.utils.isAncestor(a, b.parentNode)
553 axs.utils.overlappingElement = function(a) {
554 if(axs.utils.elementHasZeroArea(a)) {
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
560 axs.utils.elementIsHtmlControl = function(a) {
561 var b = a.ownerDocument.defaultView;
562 return a instanceof b.HTMLButtonElement || a instanceof b.HTMLInputElement || a instanceof b.HTMLSelectElement || a instanceof b.HTMLTextAreaElement ? !0 : !1
564 axs.utils.elementIsAriaWidget = function(a) {
565 return a.hasAttribute("role") && (a = a.getAttribute("role")) && (a = axs.constants.ARIA_ROLES[a]) && "widget" in a.allParentRolesSet ? !0 : !1
567 axs.utils.elementIsVisible = function(a) {
568 if(axs.utils.elementIsTransparent(a) || axs.utils.elementHasZeroArea(a) || axs.utils.elementIsOutsideScrollArea(a)) {
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) {
579 axs.utils.isLargeFont = function(a) {
581 a = "bold" == a.fontWeight;
582 var c = b.match(/(\d+)px/);
584 b = parseInt(c[1], 10);
585 if(c = window.getComputedStyle(document.body, null).fontSize.match(/(\d+)px/)) {
586 var d = parseInt(c[1], 10), c = 1.2 * d, d = 1.5 * d
590 return a && b >= c || b >= d
592 if(c = b.match(/(\d+)em/)) {
593 return b = parseInt(c[1], 10), a && 1.2 <= b || 1.5 <= b ? !0 : !1
595 if(c = b.match(/(\d+)%/)) {
596 return b = parseInt(c[1], 10), a && 120 <= b || 150 <= b ? !0 : !1
598 if(c = b.match(/(\d+)pt/)) {
599 if(b = parseInt(c[1], 10), a && 14 <= b || 14 <= b) {
605 axs.utils.getBgColor = function(a, b) {
606 var c = axs.utils.parseColor(a.backgroundColor);
610 1 > a.opacity && (c.alpha *= a.opacity);
612 var d = axs.utils.getParentBgColor(b);
616 c = axs.utils.flattenColors(c, d)
620 axs.utils.getParentBgColor = function(a) {
623 for(var c = null;b = b.parentElement;) {
624 var d = window.getComputedStyle(b, null);
626 var e = axs.utils.parseColor(d.backgroundColor);
627 if(e && (1 > d.opacity && (e.alpha *= d.opacity), 0 != e.alpha && (a.push(e), 1 == e.alpha))) {
633 c || a.push(new axs.utils.Color(255, 255, 255, 1));
634 for(b = a.pop();a.length;) {
635 c = a.pop(), b = axs.utils.flattenColors(c, b)
639 axs.utils.getFgColor = function(a, b, c) {
640 var d = axs.utils.parseColor(a.color);
644 1 > d.alpha && (d = axs.utils.flattenColors(d, c));
645 1 > a.opacity && (b = axs.utils.getParentBgColor(b), d.alpha *= a.opacity, d = axs.utils.flattenColors(d, b));
648 axs.utils.parseColor = function(a) {
649 var b = a.match(/^rgb\((\d+), (\d+), (\d+)\)$/);
651 a = parseInt(b[1], 10);
652 var c = parseInt(b[2], 10), b = parseInt(b[3], 10), d;
653 return new axs.utils.Color(a, c, b, 1)
655 return(b = a.match(/^rgba\((\d+), (\d+), (\d+), (\d+(\.\d+)?)\)/)) ? (d = parseInt(b[4], 10), a = parseInt(b[1], 10), c = parseInt(b[2], 10), b = parseInt(b[3], 10), new axs.utils.Color(a, c, b, d)) : null
657 axs.utils.colorChannelToString = function(a) {
659 return 15 >= a ? "0" + a.toString(16) : a.toString(16)
661 axs.utils.colorToString = function(a) {
662 return 1 == a.alpha ? "#" + axs.utils.colorChannelToString(a.red) + axs.utils.colorChannelToString(a.green) + axs.utils.colorChannelToString(a.blue) : "rgba(" + [a.red, a.green, a.blue, a.alpha].join() + ")"
664 axs.utils.luminanceFromContrastRatio = function(a, b, c) {
665 return c ? (a + 0.05) * b - 0.05 : (a + 0.05) / b - 0.05
667 axs.utils.translateColor = function(a, b) {
668 var c = a[0], c = (b - c) / ((c > b ? 0 : 1) - c);
669 return axs.utils.fromYCC([b, a[1] - a[1] * c, a[2] - a[2] * c])
671 axs.utils.suggestColors = function(a, b, c, d) {
672 if(!axs.utils.isLowContrast(c, d, !0)) {
675 var e = {}, f = axs.utils.calculateLuminance(a), g = axs.utils.calculateLuminance(b), h = axs.utils.isLargeFont(d) ? 3 : 4.5, k = axs.utils.isLargeFont(d) ? 4.5 : 7, m = g > f, l = axs.utils.luminanceFromContrastRatio(f, h + 0.02, m), n = axs.utils.luminanceFromContrastRatio(f, k + 0.02, m), q = axs.utils.toYCC(b);
676 if(axs.utils.isLowContrast(c, d, !1) && 1 >= l && 0 <= l) {
677 var p = axs.utils.translateColor(q, l), l = axs.utils.calculateContrastRatio(p, a);
678 axs.utils.calculateLuminance(p);
680 f.fg = axs.utils.colorToString(p);
681 f.bg = axs.utils.colorToString(a);
682 f.contrast = l.toFixed(2);
685 axs.utils.isLowContrast(c, d, !0) && 1 >= n && 0 <= n && (n = axs.utils.translateColor(q, n), l = axs.utils.calculateContrastRatio(n, a), f = {}, f.fg = axs.utils.colorToString(n), f.bg = axs.utils.colorToString(a), f.contrast = l.toFixed(2), e.AAA = f);
686 h = axs.utils.luminanceFromContrastRatio(g, h + 0.02, !m);
687 g = axs.utils.luminanceFromContrastRatio(g, k + 0.02, !m);
688 a = axs.utils.toYCC(a);
689 !("AA" in e) && axs.utils.isLowContrast(c, d, !1) && 1 >= h && 0 <= h && (k = axs.utils.translateColor(a, h), l = axs.utils.calculateContrastRatio(b, k), f = {}, f.bg = axs.utils.colorToString(k), f.fg = axs.utils.colorToString(b), f.contrast = l.toFixed(2), e.AA = f);
690 !("AAA" in e) && axs.utils.isLowContrast(c, d, !0) && 1 >= g && 0 <= g && (c = axs.utils.translateColor(a, g), l = axs.utils.calculateContrastRatio(b, c), f = {}, f.bg = axs.utils.colorToString(c), f.fg = axs.utils.colorToString(b), f.contrast = l.toFixed(2), e.AAA = f);
693 axs.utils.flattenColors = function(a, b) {
695 return new axs.utils.Color((1 - c) * b.red + c * a.red, (1 - c) * b.green + c * a.green, (1 - c) * b.blue + c * a.blue, a.alpha + b.alpha * (1 - a.alpha))
697 axs.utils.calculateLuminance = function(a) {
698 return axs.utils.toYCC(a)[0]
700 axs.utils.RGBToYCCMatrix = function(a, b) {
701 return[[a, 1 - a - b, b], [-a / (2 - 2 * b), (a + b - 1) / (2 - 2 * b), (1 - b) / (2 - 2 * b)], [(1 - a) / (2 - 2 * a), (a + b - 1) / (2 - 2 * a), -b / (2 - 2 * a)]]
703 axs.utils.invert3x3Matrix = function(a) {
704 var b = a[0][0], c = a[0][1], d = a[0][2], e = a[1][0], f = a[1][1], g = a[1][2], h = a[2][0], k = a[2][1];
706 return axs.utils.scalarMultiplyMatrix([[f * a - g * k, d * k - c * a, c * g - d * f], [g * h - e * a, b * a - d * h, d * e - b * g], [e * k - f * h, h * c - b * k, b * f - c * e]], 1 / (b * (f * a - g * k) - c * (a * e - g * h) + d * (e * k - f * h)))
708 axs.utils.scalarMultiplyMatrix = function(a, b) {
709 for(var c = [[], [], []], d = 0;3 > d;d++) {
710 for(var e = 0;3 > e;e++) {
711 c[d][e] = a[d][e] * b
716 axs.utils.kR = 0.2126;
717 axs.utils.kB = 0.0722;
718 axs.utils.YCC_MATRIX = axs.utils.RGBToYCCMatrix(axs.utils.kR, axs.utils.kB);
719 axs.utils.INVERTED_YCC_MATRIX = axs.utils.invert3x3Matrix(axs.utils.YCC_MATRIX);
720 axs.utils.convertColor = function(a, b) {
721 var c = b[0], d = b[1], e = b[2];
722 return[a[0][0] * c + a[0][1] * d + a[0][2] * e, a[1][0] * c + a[1][1] * d + a[1][2] * e, a[2][0] * c + a[2][1] * d + a[2][2] * e]
724 axs.utils.multiplyMatrices = function(a, b) {
725 for(var c = [[], [], []], d = 0;3 > d;d++) {
726 for(var e = 0;3 > e;e++) {
727 c[d][e] = a[d][0] * b[0][e] + a[d][1] * b[1][e] + a[d][2] * b[2][e]
732 axs.utils.toYCC = function(a) {
733 var b = a.red / 255, c = a.green / 255;
735 b = 0.03928 >= b ? b / 12.92 : Math.pow((b + 0.055) / 1.055, 2.4);
736 c = 0.03928 >= c ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
737 a = 0.03928 >= a ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4);
738 return axs.utils.convertColor(axs.utils.YCC_MATRIX, [b, c, a])
740 axs.utils.fromYCC = function(a) {
741 var b = axs.utils.convertColor(axs.utils.INVERTED_YCC_MATRIX, a), c = b[0];
744 c = 0.00303949 >= c ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;
745 a = 0.00303949 >= a ? 12.92 * a : 1.055 * Math.pow(a, 1 / 2.4) - 0.055;
746 b = 0.00303949 >= b ? 12.92 * b : 1.055 * Math.pow(b, 1 / 2.4) - 0.055;
747 c = Math.min(Math.max(Math.round(255 * c), 0), 255);
748 a = Math.min(Math.max(Math.round(255 * a), 0), 255);
749 b = Math.min(Math.max(Math.round(255 * b), 0), 255);
750 return new axs.utils.Color(c, a, b, 1)
752 axs.utils.scalarMultiplyMatrix = function(a, b) {
753 for(var c = [[], [], []], d = 0;3 > d;d++) {
754 for(var e = 0;3 > e;e++) {
755 c[d][e] = a[d][e] * b
760 axs.utils.multiplyMatrices = function(a, b) {
761 for(var c = [[], [], []], d = 0;3 > d;d++) {
762 for(var e = 0;3 > e;e++) {
763 c[d][e] = a[d][0] * b[0][e] + a[d][1] * b[1][e] + a[d][2] * b[2][e]
768 axs.utils.getContrastRatioForElement = function(a) {
769 var b = window.getComputedStyle(a, null);
770 return axs.utils.getContrastRatioForElementWithComputedStyle(b, a)
772 axs.utils.getContrastRatioForElementWithComputedStyle = function(a, b) {
773 if(axs.utils.isElementHidden(b)) {
776 var c = axs.utils.getBgColor(a, b);
780 var d = axs.utils.getFgColor(a, b, c);
781 return d ? axs.utils.calculateContrastRatio(d, c) : null
783 axs.utils.isNativeTextElement = function(a) {
784 var b = a.tagName.toLowerCase();
785 a = a.type ? a.type.toLowerCase() : "";
786 if("textarea" == b) {
813 axs.utils.isLowContrast = function(a, b, c) {
814 return c ? 4.5 > a || !axs.utils.isLargeFont(b) && 7 > a : 3 > a || !axs.utils.isLargeFont(b) && 4.5 > a
816 axs.utils.hasLabel = function(a) {
817 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) {
821 for(b = a.parentElement;b;) {
822 if("label" == b.tagName.toLowerCase() && b.control == a) {
829 axs.utils.isElementHidden = function(a) {
830 if(!(a instanceof a.ownerDocument.defaultView.HTMLElement)) {
833 if(a.hasAttribute("chromevoxignoreariahidden")) {
836 var c = window.getComputedStyle(a, null);
837 return"none" == c.display || "hidden" == c.visibility ? !0 : a.hasAttribute("aria-hidden") && "true" == a.getAttribute("aria-hidden").toLowerCase() ? !b : !1
839 axs.utils.isElementOrAncestorHidden = function(a) {
840 return axs.utils.isElementHidden(a) ? !0 : a.parentElement ? axs.utils.isElementOrAncestorHidden(a.parentElement) : !1
842 axs.utils.isInlineElement = function(a) {
843 a = a.tagName.toUpperCase();
844 return axs.constants.InlineElements[a]
846 axs.utils.getRoles = function(a) {
847 if(!a.hasAttribute("role")) {
850 a = a.getAttribute("role").split(" ");
851 for(var b = [], c = !0, d = 0;d < a.length;d++) {
853 axs.constants.ARIA_ROLES[e] ? b.push({name:e, details:axs.constants.ARIA_ROLES[e], valid:!0}) : (b.push({name:e, valid:!1}), c = !1)
855 return{roles:b, valid:c}
857 axs.utils.getAriaPropertyValue = function(a, b, c) {
858 var d = a.replace(/^aria-/, ""), e = axs.constants.ARIA_PROPERTIES[d], d = {name:a, rawValue:b};
860 return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property', d
864 return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property', d
868 a = axs.utils.isValidIDRefValue(b, c), d.valid = a.valid, d.reason = a.reason, d.idref = a.idref;
872 for(b = 0;b < a.length;b++) {
873 e = axs.utils.isValidIDRefValue(a[b], c), e.valid || (d.valid = !1), d.values ? d.values.push(e) : d.values = [e]
879 c = axs.utils.isValidNumber(b);
881 return d.valid = !1, d.reason = c.reason, d
883 Math.floor(c.value) != c.value ? (d.valid = !1, d.reason = "" + b + " is not a whole integer") : (d.valid = !0, d.value = c.value);
886 c = axs.utils.isValidNumber(b), c.valid && (d.valid = !0, d.value = c.value);
888 return d.valid = !0, d.value = b, d;
890 return c = axs.utils.isValidTokenValue(a, b.toLowerCase()), c.valid ? (d.valid = !0, d.value = c.value) : (d.valid = !1, d.value = b, d.reason = c.reason), d;
894 for(b = 0;b < e.length;b++) {
895 c = axs.utils.isValidTokenValue(a, e[b].toLowerCase()), c.valid || (d.valid = !1, d.reason ? (d.reason = [d.reason], d.reason.push(c.reason)) : (d.reason = c.reason, d.possibleValues = c.possibleValues)), d.values ? d.values.push(c.value) : d.values = [c.value]
899 return c = axs.utils.isPossibleValue(b.toLowerCase(), axs.constants.MIXED_VALUES, a), c.valid ? (d.valid = !0, d.value = c.value) : (d.valid = !1, d.value = b, d.reason = c.reason), d;
901 return c = axs.utils.isValidBoolean(b), c.valid ? (d.valid = !0, d.value = c.value) : (d.valid = !1, d.value = b, d.reason = c.reason), d
904 d.reason = "Not a valid ARIA property";
907 axs.utils.isValidTokenValue = function(a, b) {
908 var c = a.replace(/^aria-/, "");
909 return axs.utils.isPossibleValue(b, axs.constants.ARIA_PROPERTIES[c].valuesSet, a)
911 axs.utils.isPossibleValue = function(a, b, c) {
912 return b[a] ? {valid:!0, value:a} : {valid:!1, value:a, reason:'"' + a + '" is not a valid value for ' + c, possibleValues:Object.keys(b)}
914 axs.utils.isValidBoolean = function(a) {
916 var b = JSON.parse(a)
920 return"boolean" != typeof b ? {valid:!1, value:a, reason:'"' + a + '" is not a true/false value'} : {valid:!0, value:b}
922 axs.utils.isValidIDRefValue = function(a, b) {
923 return 0 == a.length ? {valid:!0, idref:a} : b.ownerDocument.getElementById(a) ? {valid:!0, idref:a} : {valid:!1, idref:a, reason:'No element with ID "' + a + '"'}
925 axs.utils.isValidNumber = function(a) {
927 var b = JSON.parse(a)
929 return{valid:!1, value:a, reason:'"' + a + '" is not a number'}
931 return"number" != typeof b ? {valid:!1, value:a, reason:'"' + a + '" is not a number'} : {valid:!0, value:b}
933 axs.utils.isElementImplicitlyFocusable = function(a) {
934 var b = a.ownerDocument.defaultView;
935 return a instanceof b.HTMLAnchorElement || a instanceof b.HTMLAreaElement ? a.hasAttribute("href") : a instanceof b.HTMLInputElement || a instanceof b.HTMLSelectElement || a instanceof b.HTMLTextAreaElement || a instanceof b.HTMLButtonElement || a instanceof b.HTMLIFrameElement ? !a.disabled : !1
937 axs.utils.values = function(a) {
940 a.hasOwnProperty(c) && "function" != typeof a[c] && b.push(a[c])
944 axs.utils.namedValues = function(a) {
947 a.hasOwnProperty(c) && "function" != typeof a[c] && (b[c] = a[c])
951 axs.utils.getQuerySelectorText = function(a) {
952 if(null == a || "HTML" == a.tagName) {
955 if("BODY" == a.tagName) {
963 for(var b = "", c = 0;c < a.classList.length;c++) {
964 b += "." + a.classList[c]
968 for(c = 0;c < a.parentNode.children.length;c++) {
969 var e = a.parentNode.children[c];
970 axs.browserUtils.matchSelector(e, b) && d++;
978 return 1 == d ? axs.utils.getQuerySelectorText(a.parentNode) + " > " + b : axs.utils.getQuerySelectorText(a.parentNode) + " > " + b + ":nth-of-type(" + d + ")"
981 b = a.parentNode.children;
983 for(c = 0;b[c] !== a;) {
984 b[c].tagName == a.tagName && d++, c++
987 "BODY" != a.parentNode.tagName && (c = axs.utils.getQuerySelectorText(a.parentNode) + " > ");
988 return 1 == d ? c + a.tagName : c + a.tagName + ":nth-of-type(" + d + ")"
992 return a.selectorText
998 axs.properties.TEXT_CONTENT_XPATH = './/text()[normalize-space(.)!=""]/parent::*[name()!="script"]';
999 axs.properties.getFocusProperties = function(a) {
1000 a = a.getAttribute("tabindex");
1001 return void 0 != a ? {tabindex:{value:a, valid:!0}} : null
1003 axs.properties.getColorProperties = function(a) {
1005 (a = axs.properties.getContrastRatioProperties(a)) && (b.contrastRatio = a);
1006 return 0 == Object.keys(b).length ? null : b
1008 axs.properties.hasDirectTextDescendant = function(a) {
1009 for(var b = (a.nodeType == Node.DOCUMENT_NODE ? a : a.ownerDocument).evaluate(axs.properties.TEXT_CONTENT_XPATH, a, null, XPathResult.ANY_TYPE, null), c = !1, d = b.iterateNext();null != d;d = b.iterateNext()) {
1017 axs.properties.getContrastRatioProperties = function(a) {
1018 if(!axs.properties.hasDirectTextDescendant(a)) {
1021 var b = {}, c = window.getComputedStyle(a, null), d = axs.utils.getBgColor(c, a);
1025 b.backgroundColor = axs.utils.colorToString(d);
1026 var e = axs.utils.getFgColor(c, a, d);
1027 b.foregroundColor = axs.utils.colorToString(e);
1028 a = axs.utils.getContrastRatioForElementWithComputedStyle(c, a);
1032 b.value = a.toFixed(2);
1033 axs.utils.isLowContrast(a, c) && (b.alert = !0);
1034 (c = axs.utils.suggestColors(d, e, a, c)) && Object.keys(c).length && (b.suggestedColors = c);
1037 axs.properties.findTextAlternatives = function(a, b, c) {
1039 c = axs.utils.asElement(a);
1040 if(!c || !d && axs.utils.isElementOrAncestorHidden(c)) {
1043 if(a.nodeType == Node.TEXT_NODE) {
1044 return c = {type:"text"}, c.text = a.textContent, c.lastWord = axs.properties.getLastWord(c.text), b.content = c, a.textContent
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);
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) {
1060 "text" == f.type && f.value && 0 < f.value.length && (b.controlValue = {text:f.value});
1061 "range" == f.type && (b.controlValue = {text:f.value})
1063 c instanceof e.HTMLSelectElement && (b.controlValue = {text:f.value});
1064 b.controlValue && (f = b.controlValue, a ? f.unused = !0 : a = f.text)
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) {
1070 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")})
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])
1078 for(e = 0;e < f.length;e++) {
1079 g += axs.properties.findTextAlternatives(f[e], {}, !0), e < f.length - 1 && (g += ", ")
1081 b.controlValue = {text:g}
1084 if("combobox" == d || "select" == d) {
1085 b.controlValue = {text:"TODO"}
1087 b.controlValue && (f = b.controlValue, a ? f.unused = !0 : a = f.text)
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
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);
1093 return 0 == Object.keys(b).length && null == a ? null : a
1095 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"))) {
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())
1107 return b.length ? b.join(" ") : null
1109 axs.properties.getTextFromAriaLabelledby = function(a, b) {
1111 if(!a.hasAttribute("aria-labelledby")) {
1114 for(var d = a.getAttribute("aria-labelledby").split(/\s+/), e = {valid:!0}, f = [], g = [], h = 0;h < d.length;h++) {
1115 var k = {type:"element"}, m = d[h];
1117 var l = document.getElementById(m);
1118 l ? (k.valid = !0, k.text = axs.properties.findTextAlternatives(l, {}, !0), k.lastWord = axs.properties.getLastWord(k.text), f.push(l.textContent.trim()), k.element = l) : (k.valid = !1, e.valid = !1, k.errorMessage = {messageKey:"noElementWithId", args:[m]});
1121 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);
1124 axs.properties.getTextFromHostLangaugeAttributes = function(a, b, c) {
1125 if(axs.browserUtils.matchSelector(a, "img")) {
1126 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;
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})
1135 if(axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), video:not([disabled])')) {
1136 if(a.hasAttribute("id")) {
1137 for(var d = document.querySelectorAll("label[for=" + a.id + "]"), e = {}, f = [], g = [], h = 0;h < d.length;h++) {
1138 var k = {type:"element"}, m = d[h], l = axs.properties.findTextAlternatives(m, {}, !0);
1139 l && 0 < l.trim().length && (k.text = l.trim(), g.push(l.trim()));
1143 0 < f.length && (f[f.length - 1].last = !0, e.values = f, e.text = g.join(" "), e.lastWord = axs.properties.getLastWord(e.text), c ? e.unused = !0 : c = e.text, b.labelFor = e)
1145 d = a.parentElement;
1147 if("label" == d.tagName.toLowerCase() && (f = d, f.control == a)) {
1149 e.text = axs.properties.findTextAlternatives(f, {}, !0);
1150 e.lastWord = axs.properties.getLastWord(e.text);
1156 e.text && (c ? e.unused = !0 : c = e.text, b.labelWrapped = e);
1157 Object.keys(b).length || (b.noLabel = !0)
1161 axs.properties.getLastWord = function(a) {
1165 var b = a.lastIndexOf(" ") + 1, c = a.length - 10;
1166 return a.substring(b > c ? b : c)
1168 axs.properties.getTextProperties = function(a) {
1170 a = axs.properties.findTextAlternatives(a, b);
1171 if(0 == Object.keys(b).length) {
1175 b.hasProperties = !1
1177 b.hasProperties = !0
1180 b.lastWord = axs.properties.getLastWord(a);
1183 axs.properties.getAriaProperties = function(a) {
1184 var b = {}, c = axs.properties.getGlobalAriaProperties(a), d;
1185 for(d in axs.constants.ARIA_PROPERTIES) {
1186 var e = "aria-" + d;
1187 if(a.hasAttribute(e)) {
1188 var f = a.getAttribute(e);
1189 c[e] = axs.utils.getAriaPropertyValue(e, f, a)
1192 0 < Object.keys(c).length && (b.properties = axs.utils.values(c));
1193 f = axs.utils.getRoles(a);
1195 return Object.keys(b).length ? b : null
1198 if(!f.valid || !f.roles) {
1201 for(var e = f.roles, g = 0;g < e.length;g++) {
1203 if(h.details && h.details.propertiesSet) {
1204 for(d in h.details.propertiesSet) {
1205 d in c || (a.hasAttribute(d) ? (f = a.getAttribute(d), c[d] = axs.utils.getAriaPropertyValue(d, f, a), "values" in c[d] && (f = c[d].values, f[f.length - 1].isLast = !0)) : h.details.requiredPropertiesSet[d] && (c[d] = {name:d, valid:!1, reason:"Required property not set"}))
1209 0 < Object.keys(c).length && (b.properties = axs.utils.values(c));
1210 return 0 < Object.keys(b).length ? b : null
1212 axs.properties.getGlobalAriaProperties = function(a) {
1213 for(var b = {}, c = 0;c < axs.constants.GLOBAL_PROPERTIES.length;c++) {
1214 var d = axs.constants.GLOBAL_PROPERTIES[c];
1215 if(a.hasAttribute(d)) {
1216 var e = a.getAttribute(d);
1217 b[d] = axs.utils.getAriaPropertyValue(d, e, a)
1222 axs.properties.getVideoProperties = function(a) {
1223 if(!axs.browserUtils.matchSelector(a, "video")) {
1227 b.captionTracks = axs.properties.getTrackElements(a, "captions");
1228 b.descriptionTracks = axs.properties.getTrackElements(a, "descriptions");
1229 b.chapterTracks = axs.properties.getTrackElements(a, "chapters");
1232 axs.properties.getTrackElements = function(a, b) {
1233 var c = a.querySelectorAll("track[kind=" + b + "]"), d = {};
1235 return d.valid = !1, d.reason = {messageKey:"noTracksProvided", args:[[b]]}, d
1238 for(var e = [], f = 0;f < c.length;f++) {
1239 var g = {}, h = c[f].getAttribute("src"), k = c[f].getAttribute("srcLang"), m = c[f].getAttribute("label");
1240 h ? (g.valid = !0, g.src = h) : (g.valid = !1, g.reason = {messageKey:"noSrcProvided"});
1242 m && (h += m, k && (h += " "));
1243 k && (h += "(" + k + ")");
1244 "" == h && (h = "[[object Object]]");
1251 axs.properties.getAllProperties = function(a) {
1252 var b = axs.utils.asElement(a);
1257 c.ariaProperties = axs.properties.getAriaProperties(b);
1258 c.colorProperties = axs.properties.getColorProperties(b);
1259 c.focusProperties = axs.properties.getFocusProperties(b);
1260 c.textProperties = axs.properties.getTextProperties(a);
1261 c.videoProperties = axs.properties.getVideoProperties(b);
1264 axs.AuditRule = function(a) {
1265 for(var b = !0, c = [], d = 0;d < axs.AuditRule.requiredFields.length;d++) {
1266 var e = axs.AuditRule.requiredFields[d];
1267 e in a || (b = !1, c.push(e))
1270 throw"Invalid spec; the following fields were not specified: " + c.join(", ") + "\n" + JSON.stringify(a);
1273 this.severity = a.severity;
1274 this.relevantElementMatcher_ = a.relevantElementMatcher;
1275 this.test_ = a.test;
1277 this.heading = a.heading || "";
1278 this.url = a.url || "";
1279 this.requiresConsoleAPI = !!a.opt_requiresConsoleAPI
1281 axs.AuditRule.requiredFields = "name severity relevantElementMatcher test code heading".split(" ");
1282 axs.AuditRule.NOT_APPLICABLE = {result:axs.constants.AuditResult.NA};
1283 axs.AuditRule.prototype.addElement = function(a, b) {
1286 axs.AuditRule.collectMatchingElements = function(a, b, c) {
1287 if(a.nodeType == Node.ELEMENT_NODE) {
1290 d && b.call(null, d) && c.push(d);
1291 for(a = a.firstChild;null != a;) {
1292 axs.AuditRule.collectMatchingElements(a, b, c), a = a.nextSibling
1295 axs.AuditRule.prototype.run = function(a, b) {
1296 var c = a || [], d = [];
1297 axs.AuditRule.collectMatchingElements(b || document, this.relevantElementMatcher_, d);
1300 return{result:axs.constants.AuditResult.NA}
1302 for(var f = 0;f < d.length;f++) {
1306 for(var k = 0;k < c.length;k++) {
1307 if(axs.browserUtils.matchSelector(h, c[k])) {
1314 !h && this.test_(g) && this.addElement(e, g)
1316 return{result:e.length ? axs.constants.AuditResult.FAIL : axs.constants.AuditResult.PASS, elements:e}
1318 axs.AuditRule.specs = {};
1319 axs.AuditRules = {};
1320 axs.AuditRules.getRule = function(a) {
1321 if(!axs.AuditRules.rules) {
1322 axs.AuditRules.rules = {};
1323 for(var b in axs.AuditRule.specs) {
1324 var c = axs.AuditRule.specs[b], d = new axs.AuditRule(c);
1325 axs.AuditRules.rules[c.name] = d
1328 return axs.AuditRules.rules[a]
1330 axs.AuditResults = function() {
1334 goog.exportSymbol("axs.AuditResults", axs.AuditResults);
1335 axs.AuditResults.prototype.addError = function(a) {
1336 "" != a && this.errors_.push(a)
1338 goog.exportProperty(axs.AuditResults.prototype, "addError", axs.AuditResults.prototype.addError);
1339 axs.AuditResults.prototype.addWarning = function(a) {
1340 "" != a && this.warnings_.push(a)
1342 goog.exportProperty(axs.AuditResults.prototype, "addWarning", axs.AuditResults.prototype.addWarning);
1343 axs.AuditResults.prototype.numErrors = function() {
1344 return this.errors_.length
1346 goog.exportProperty(axs.AuditResults.prototype, "numErrors", axs.AuditResults.prototype.numErrors);
1347 axs.AuditResults.prototype.numWarnings = function() {
1348 return this.warnings_.length
1350 goog.exportProperty(axs.AuditResults.prototype, "numWarnings", axs.AuditResults.prototype.numWarnings);
1351 axs.AuditResults.prototype.getErrors = function() {
1354 goog.exportProperty(axs.AuditResults.prototype, "getErrors", axs.AuditResults.prototype.getErrors);
1355 axs.AuditResults.prototype.getWarnings = function() {
1356 return this.warnings_
1358 goog.exportProperty(axs.AuditResults.prototype, "getWarnings", axs.AuditResults.prototype.getWarnings);
1359 axs.AuditResults.prototype.toString = function() {
1360 for(var a = "", b = 0;b < this.errors_.length;b++) {
1361 0 == b && (a += "\nErrors:\n");
1362 var c = this.errors_[b], a = a + (c + "\n\n")
1364 for(b = 0;b < this.warnings_.length;b++) {
1365 0 == b && (a += "\nWarnings:\n"), c = this.warnings_[b], a += c + "\n\n"
1369 goog.exportProperty(axs.AuditResults.prototype, "toString", axs.AuditResults.prototype.toString);
1371 axs.AuditConfiguration = function() {
1373 this.auditRulesToIgnore = this.auditRulesToRun = this.scope = null;
1374 this.withConsoleApi = !1;
1375 goog.exportProperty(this, "scope", this.scope);
1376 goog.exportProperty(this, "auditRulesToRun", this.auditRulesToRun);
1377 goog.exportProperty(this, "auditRulesToIgnore", this.auditRulesToIgnore);
1378 goog.exportProperty(this, "withConsoleApi", this.withConsoleApi)
1380 goog.exportSymbol("axs.AuditConfiguration", axs.AuditConfiguration);
1381 axs.AuditConfiguration.prototype = {ignoreSelectors:function(a, b) {
1382 a in this.rules_ || (this.rules_[a] = {});
1383 "ignore" in this.rules_[a] || (this.rules_[a].ignore = []);
1384 Array.prototype.push.call(this.rules_[a].ignore, b)
1385 }, getIgnoreSelectors:function(a) {
1386 return a in this.rules_ && "ignore" in this.rules_[a] ? this.rules_[a].ignore : []
1388 goog.exportProperty(axs.AuditConfiguration.prototype, "ignoreSelectors", axs.AuditConfiguration.prototype.ignoreSelectors);
1389 goog.exportProperty(axs.AuditConfiguration.prototype, "getIgnoreSelectors", axs.AuditConfiguration.prototype.getIgnoreSelectors);
1390 axs.Audit.run = function(a) {
1391 a = a || new axs.AuditConfiguration;
1392 var b = a.withConsoleApi, c = [], d;
1393 d = a.auditRulesToRun && 0 < a.auditRulesToRun.length ? a.auditRulesToRun : Object.keys(axs.AuditRule.specs);
1394 if(a.auditRulesToIgnore) {
1395 for(var e = 0;e < a.auditRulesToIgnore.length;e++) {
1396 var f = a.auditRulesToIgnore[e];
1397 0 > d.indexOf(f) || d.splice(d.indexOf(f), 1)
1400 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);
1412 goog.exportSymbol("axs.Audit.run", axs.Audit.run);
1413 axs.Audit.auditResults = function(a) {
1414 for(var b = new axs.AuditResults, c = 0;c < a.length;c++) {
1416 d.result == axs.constants.AuditResult.FAIL && (d.rule.severity == axs.constants.Severity.SEVERE ? b.addError(axs.Audit.accessibilityErrorMessage(d)) : b.addWarning(axs.Audit.accessibilityErrorMessage(d)))
1420 goog.exportSymbol("axs.Audit.auditResults", axs.Audit.auditResults);
1421 axs.Audit.createReport = function(a, b) {
1423 c = "*** Begin accessibility audit results ***\nAn accessibility audit found " + axs.Audit.auditResults(a).toString();
1424 b && (c += "\nFor more information, please see ", c += b);
1425 return c += "\n*** End accessibility audit results ***"
1427 goog.exportSymbol("axs.Audit.createReport", axs.Audit.createReport);
1428 axs.Audit.accessibilityErrorMessage = function(a) {
1429 for(var b = a.rule.severity == axs.constants.Severity.SEVERE ? "Error: " : "Warning: ", b = b + (a.rule.code + " (" + a.rule.heading + ") failed on the following " + (1 == a.elements.length ? "element" : "elements")), b = 1 == a.elements.length ? b + ":" : b + (" (1 - " + Math.min(5, a.elements.length) + " of " + a.elements.length + "):"), c = Math.min(a.elements.length, 5), d = 0;d < c;d++) {
1430 var e = a.elements[d], b = b + "\n";
1432 b += axs.utils.getQuerySelectorText(e)
1434 b += " tagName:" + e.tagName, b += " id:" + e.id
1437 "" != a.rule.url && (b += "\nSee " + a.rule.url + " for more information.");
1440 goog.exportSymbol("axs.Audit.accessibilityErrorMessage", axs.Audit.accessibilityErrorMessage);
1441 axs.AuditRule.specs.audioWithoutControls = {name:"audioWithoutControls", heading:"Audio elements should have controls", url:"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1442 return axs.browserUtils.matchSelector(a, "audio[autoplay]")
1443 }, test:function(a) {
1444 return!a.querySelectorAll("[controls]").length && 3 < a.duration
1445 }, code:"AX_AUDIO_01"};
1446 axs.AuditRule.specs.badAriaAttributeValue = {name:"badAriaAttributeValue", heading:"ARIA state and property values must be valid", url:"", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
1448 for(c in axs.constants.ARIA_PROPERTIES) {
1449 b += "[aria-" + c + "],"
1451 b = b.substring(0, b.length - 1);
1452 return axs.browserUtils.matchSelector(a, b)
1453 }, test:function(a) {
1454 for(var b in axs.constants.ARIA_PROPERTIES) {
1455 var c = "aria-" + b;
1456 if(a.hasAttribute(c)) {
1457 var d = a.getAttribute(c);
1458 if(!axs.utils.getAriaPropertyValue(c, d, a).valid) {
1464 }, code:"AX_ARIA_04"};
1465 axs.AuditRule.specs.badAriaRole = {name:"badAriaRole", heading:"Elements with ARIA roles must use a valid, non-abstract ARIA role", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_aria_01--elements-with-aria-roles-must-use-a-valid-non-abstract-aria-role", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
1466 return axs.browserUtils.matchSelector(a, "[role]")
1467 }, test:function(a) {
1468 return!axs.utils.getRoles(a).valid
1469 }, code:"AX_ARIA_01"};
1470 axs.AuditRule.specs.controlsWithoutLabel = {name:"controlsWithoutLabel", heading:"Controls and media elements should have labels", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_text_01--controls-and-media-elements-should-have-labels", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
1471 if(!axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), video:not([disabled])')) {
1474 if(0 <= a.tabIndex) {
1477 for(a = a.parentElement;null != a;a = a.parentElement) {
1478 if(axs.utils.elementIsAriaWidget(a)) {
1483 }, test:function(a) {
1484 return axs.utils.isElementOrAncestorHidden(a) || "input" == a.tagName.toLowerCase() && "button" == a.type && a.value.length || "button" == a.tagName.toLowerCase() && a.textContent.replace(/^\s+|\s+$/g, "").length ? !1 : axs.utils.hasLabel(a) ? !1 : !0
1485 }, code:"AX_TEXT_01", ruleName:"Controls and media elements should have labels"};
1486 axs.AuditRule.specs.focusableElementNotVisibleAndNotAriaHidden = {name:"focusableElementNotVisibleAndNotAriaHidden", heading:"These elements are focusable but either invisible or obscured by another element", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_focus_01--these-elements-are-focusable-but-either-invisible-or-obscured-by-another-element", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1487 if(!axs.browserUtils.matchSelector(a, axs.utils.FOCUSABLE_ELEMENTS_SELECTOR)) {
1490 if(0 <= a.tabIndex) {
1493 for(a = a.parentElement;null != a;a = a.parentElement) {
1494 if(axs.utils.elementIsAriaWidget(a)) {
1499 }, test:function(a) {
1500 return axs.utils.isElementOrAncestorHidden(a) ? !1 : !axs.utils.elementIsVisible(a)
1501 }, code:"AX_FOCUS_01"};
1502 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 return axs.browserUtils.matchSelector(a, "img") && !axs.utils.isElementOrAncestorHidden(a)
1504 }, test:function(a) {
1505 return!a.hasAttribute("alt") && "presentation" != a.getAttribute("role")
1506 }, code:"AX_TEXT_02"};
1507 axs.AuditRule.specs.linkWithUnclearPurpose = {name:"linkWithUnclearPurpose", heading:"The purpose of each link should be clear from the link text", url:"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1508 return axs.browserUtils.matchSelector(a, "a")
1509 }, test:function(a) {
1510 return/^\s*click\s*here\s*[^a-z]?$/i.test(a.textContent)
1511 }, code:"AX_TITLE_01"};
1512 axs.AuditRule.specs.lowContrastElements = {name:"lowContrastElements", heading:"Text elements should have a reasonable contrast ratio", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_color_01--text-elements-should-have-a-reasonable-contrast-ratio", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1513 return axs.properties.hasDirectTextDescendant(a)
1514 }, test:function(a) {
1515 var b = window.getComputedStyle(a, null);
1516 return(a = axs.utils.getContrastRatioForElementWithComputedStyle(b, a)) && axs.utils.isLowContrast(a, b)
1517 }, code:"AX_COLOR_01"};
1518 axs.AuditRule.specs.mainRoleOnInappropriateElement = {name:"mainRoleOnInappropriateElement", heading:"role=main should only appear on significant elements", url:"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1519 return axs.browserUtils.matchSelector(a, "[role~=main]")
1520 }, test:function(a) {
1521 if(axs.utils.isInlineElement(a)) {
1524 a = axs.properties.findTextAlternatives(a, {});
1525 return!a || 50 > a.length ? !0 : !1
1526 }, code:"AX_ARIA_04"};
1527 axs.AuditRule.specs.elementsWithMeaningfulBackgroundImage = {name:"elementsWithMeaningfulBackgroundImage", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1528 return!axs.utils.isElementOrAncestorHidden(a)
1529 }, heading:"Meaningful images should not be used in element backgrounds", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_image_01--meaningful-images-should-not-be-used-in-element-backgrounds", test:function(a) {
1530 if(a.textContent && 0 < a.textContent.length) {
1533 a = window.getComputedStyle(a, null);
1534 var b = a.backgroundImage;
1535 if(!b || "undefined" === b || "none" === b || 0 != b.indexOf("url")) {
1538 b = parseInt(a.width, 10);
1539 a = parseInt(a.height, 10);
1540 return 150 > b && 150 > a
1541 }, code:"AX_IMAGE_01"};
1542 axs.AuditRule.specs.nonExistentAriaLabelledbyElement = {name:"nonExistentAriaLabelledbyElement", heading:"aria-labelledby attributes should refer to an element which exists in the DOM", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_aria_02--aria-labelledby-attributes-should-refer-to-an-element-which-exists-in-the-dom", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1543 return axs.browserUtils.matchSelector(a, "[aria-labelledby]")
1544 }, test:function(a) {
1545 a = a.getAttribute("aria-labelledby").split(/\s+/);
1546 for(var b = 0;b < a.length;b++) {
1547 if(!document.getElementById(a[b])) {
1552 }, code:"AX_ARIA_02"};
1553 axs.AuditRule.specs.pageWithoutTitle = {name:"pageWithoutTitle", heading:"The web page should have a title that describes topic or purpose", url:"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1554 return"html" == a.tagName.toLowerCase()
1555 }, test:function(a) {
1556 a = a.querySelector("head");
1557 return a ? (a = a.querySelector("title")) ? !a.textContent : !0 : !0
1558 }, code:"AX_TITLE_01"};
1559 axs.AuditRule.specs.requiredAriaAttributeMissing = {name:"requiredAriaAttributeMissing", heading:"Elements with ARIA roles must have all required attributes for that role", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_aria_03--elements-with-aria-roles-must-have-all-required-attributes-for-that-role", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
1560 return axs.browserUtils.matchSelector(a, "[role]")
1561 }, test:function(a) {
1562 var b = axs.utils.getRoles(a);
1566 for(var c = 0;c < b.roles.length;c++) {
1567 var d = b.roles[c].details.requiredPropertiesSet, e;
1569 if(d = e.replace(/^aria-/, ""), !("defaultValue" in axs.constants.ARIA_PROPERTIES[d] || a.hasAttribute(e))) {
1574 }, code:"AX_ARIA_03"};
1575 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
1577 }, test:function(a) {
1578 return!a.hasAttribute("tabindex") && !axs.utils.isElementImplicitlyFocusable(a)
1579 }, code:"AX_FOCUS_02"};
1580 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 return axs.browserUtils.matchSelector(a, "video")
1582 }, test:function(a) {
1583 return!a.querySelectorAll("track[kind=captions]").length
1584 }, code:"AX_VIDEO_01"};