Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: third_party/accessibility-audit/axs_testing.js

Issue 290493004: Bring accessibility-audit up to date (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/accessibility-audit/README.chromium ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with 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 6 * You may obtain a copy of the License at
7 * 7 *
8 * http://www.apache.org/licenses/LICENSE-2.0 8 * http://www.apache.org/licenses/LICENSE-2.0
9 * 9 *
10 * Unless required by applicable law or agreed to in writing, software 10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, 11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 * 15 *
16 * Generated from http://github.com/GoogleChrome/accessibility-developer-tools/t ree/2f50bfddc20fb2b4e08e4106ac0f97ac892b31f1 16 * Generated from http://github.com/GoogleChrome/accessibility-developer-tools/t ree/3d4893b4ecd0eb8f4765e04479213d04b240f3e0
17 * 17 *
18 * See project README for build steps. 18 * See project README for build steps.
19 */ 19 */
20 20
21 // AUTO-GENERATED CONTENT BELOW: DO NOT EDIT! See above for details. 21 // AUTO-GENERATED CONTENT BELOW: DO NOT EDIT! See above for details.
22 22
23 var COMPILED = !0, goog = goog || {}; 23 var COMPILED = !0, goog = goog || {};
24 goog.global = this; 24 goog.global = this;
25 goog.isDef = function(a) {
26 return void 0 !== a;
27 };
25 goog.exportPath_ = function(a, b, c) { 28 goog.exportPath_ = function(a, b, c) {
26 a = a.split("."); 29 a = a.split(".");
27 c = c || goog.global; 30 c = c || goog.global;
28 a[0] in c || !c.execScript || c.execScript("var " + a[0]); 31 a[0] in c || !c.execScript || c.execScript("var " + a[0]);
29 for(var d;a.length && (d = a.shift());) { 32 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 !a.length && goog.isDef(b) ? c[d] = b : c = c[d] ? c[d] : c[d] = {};
31 } 34 }
32 }; 35 };
33 goog.define = function(a, b) { 36 goog.define = function(a, b) {
34 var c = b; 37 var c = b;
35 COMPILED || goog.global.CLOSURE_DEFINES && Object.prototype.hasOwnProperty.cal l(goog.global.CLOSURE_DEFINES, a) && (c = goog.global.CLOSURE_DEFINES[a]); 38 COMPILED || (goog.global.CLOSURE_UNCOMPILED_DEFINES && Object.prototype.hasOwn Property.call(goog.global.CLOSURE_UNCOMPILED_DEFINES, a) ? c = goog.global.CLOSU RE_UNCOMPILED_DEFINES[a] : goog.global.CLOSURE_DEFINES && Object.prototype.hasOw nProperty.call(goog.global.CLOSURE_DEFINES, a) && (c = goog.global.CLOSURE_DEFIN ES[a]));
36 goog.exportPath_(a, c) 39 goog.exportPath_(a, c);
37 }; 40 };
38 goog.DEBUG = !0; 41 goog.DEBUG = !0;
39 goog.LOCALE = "en"; 42 goog.LOCALE = "en";
40 goog.TRUSTED_SITE = !0; 43 goog.TRUSTED_SITE = !0;
44 goog.STRICT_MODE_COMPATIBLE = !1;
41 goog.provide = function(a) { 45 goog.provide = function(a) {
42 if(!COMPILED) { 46 if (!COMPILED) {
43 if(goog.isProvided_(a)) { 47 if (goog.isProvided_(a)) {
44 throw Error('Namespace "' + a + '" already declared.'); 48 throw Error('Namespace "' + a + '" already declared.');
45 } 49 }
46 delete goog.implicitNamespaces_[a]; 50 delete goog.implicitNamespaces_[a];
47 for(var b = a;(b = b.substring(0, b.lastIndexOf("."))) && !goog.getObjectByN ame(b);) { 51 for (var b = a;(b = b.substring(0, b.lastIndexOf("."))) && !goog.getObjectBy Name(b);) {
48 goog.implicitNamespaces_[b] = !0 52 goog.implicitNamespaces_[b] = !0;
49 } 53 }
50 } 54 }
51 goog.exportPath_(a) 55 goog.exportPath_(a);
52 }; 56 };
53 goog.setTestOnly = function(a) { 57 goog.setTestOnly = function(a) {
54 if(COMPILED && !goog.DEBUG) { 58 if (COMPILED && !goog.DEBUG) {
55 throw a = a || "", Error("Importing test-only code into non-debug environmen t" + a ? ": " + a : "."); 59 throw a = a || "", Error("Importing test-only code into non-debug environmen t" + a ? ": " + a : ".");
56 } 60 }
57 }; 61 };
62 goog.forwardDeclare = function(a) {
63 };
58 COMPILED || (goog.isProvided_ = function(a) { 64 COMPILED || (goog.isProvided_ = function(a) {
59 return!goog.implicitNamespaces_[a] && !!goog.getObjectByName(a) 65 return!goog.implicitNamespaces_[a] && goog.isDefAndNotNull(goog.getObjectByNam e(a));
60 }, goog.implicitNamespaces_ = {}); 66 }, goog.implicitNamespaces_ = {});
61 goog.getObjectByName = function(a, b) { 67 goog.getObjectByName = function(a, b) {
62 for(var c = a.split("."), d = b || goog.global, e;e = c.shift();) { 68 for (var c = a.split("."), d = b || goog.global, e;e = c.shift();) {
63 if(goog.isDefAndNotNull(d[e])) { 69 if (goog.isDefAndNotNull(d[e])) {
64 d = d[e] 70 d = d[e];
65 }else { 71 } else {
66 return null 72 return null;
67 } 73 }
68 } 74 }
69 return d 75 return d;
70 }; 76 };
71 goog.globalize = function(a, b) { 77 goog.globalize = function(a, b) {
72 var c = b || goog.global, d; 78 var c = b || goog.global, d;
73 for(d in a) { 79 for (d in a) {
74 c[d] = a[d] 80 c[d] = a[d];
75 } 81 }
76 }; 82 };
77 goog.addDependency = function(a, b, c) { 83 goog.addDependency = function(a, b, c) {
78 if(goog.DEPENDENCIES_ENABLED) { 84 if (goog.DEPENDENCIES_ENABLED) {
79 var d; 85 var d;
80 a = a.replace(/\\/g, "/"); 86 a = a.replace(/\\/g, "/");
81 for(var e = goog.dependencies_, f = 0;d = b[f];f++) { 87 for (var e = goog.dependencies_, f = 0;d = b[f];f++) {
82 e.nameToPath[d] = a, a in e.pathToNames || (e.pathToNames[a] = {}), e.path ToNames[a][d] = !0 88 e.nameToPath[d] = a, a in e.pathToNames || (e.pathToNames[a] = {}), e.path ToNames[a][d] = !0;
83 } 89 }
84 for(d = 0;b = c[d];d++) { 90 for (d = 0;b = c[d];d++) {
85 a in e.requires || (e.requires[a] = {}), e.requires[a][b] = !0 91 a in e.requires || (e.requires[a] = {}), e.requires[a][b] = !0;
86 } 92 }
87 } 93 }
88 }; 94 };
89 goog.ENABLE_DEBUG_LOADER = !0; 95 goog.ENABLE_DEBUG_LOADER = !0;
90 goog.require = function(a) { 96 goog.require = function(a) {
91 if(!COMPILED && !goog.isProvided_(a)) { 97 if (!COMPILED && !goog.isProvided_(a)) {
92 if(goog.ENABLE_DEBUG_LOADER) { 98 if (goog.ENABLE_DEBUG_LOADER) {
93 var b = goog.getPathFromDeps_(a); 99 var b = goog.getPathFromDeps_(a);
94 if(b) { 100 if (b) {
95 goog.included_[b] = !0; 101 goog.included_[b] = !0;
96 goog.writeScripts_(); 102 goog.writeScripts_();
97 return 103 return;
98 } 104 }
99 } 105 }
100 a = "goog.require could not find: " + a; 106 a = "goog.require could not find: " + a;
101 goog.global.console && goog.global.console.error(a); 107 goog.global.console && goog.global.console.error(a);
102 throw Error(a); 108 throw Error(a);
103 } 109 }
104 }; 110 };
105 goog.basePath = ""; 111 goog.basePath = "";
106 goog.nullFunction = function() { 112 goog.nullFunction = function() {
107 }; 113 };
108 goog.identityFunction = function(a, b) { 114 goog.identityFunction = function(a, b) {
109 return a 115 return a;
110 }; 116 };
111 goog.abstractMethod = function() { 117 goog.abstractMethod = function() {
112 throw Error("unimplemented abstract method"); 118 throw Error("unimplemented abstract method");
113 }; 119 };
114 goog.addSingletonGetter = function(a) { 120 goog.addSingletonGetter = function(a) {
115 a.getInstance = function() { 121 a.getInstance = function() {
116 if(a.instance_) { 122 if (a.instance_) {
117 return a.instance_ 123 return a.instance_;
118 } 124 }
119 goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.len gth] = a); 125 goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.len gth] = a);
120 return a.instance_ = new a 126 return a.instance_ = new a;
121 } 127 };
122 }; 128 };
123 goog.instantiatedSingletons_ = []; 129 goog.instantiatedSingletons_ = [];
124 goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER; 130 goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;
125 goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathToN ames:{}, nameToPath:{}, requires:{}, visited:{}, written:{}}, goog.inHtmlDocumen t_ = function() { 131 goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathToN ames:{}, nameToPath:{}, requires:{}, visited:{}, written:{}}, goog.inHtmlDocumen t_ = function() {
126 var a = goog.global.document; 132 var a = goog.global.document;
127 return"undefined" != typeof a && "write" in a 133 return "undefined" != typeof a && "write" in a;
128 }, goog.findBasePath_ = function() { 134 }, goog.findBasePath_ = function() {
129 if(goog.global.CLOSURE_BASE_PATH) { 135 if (goog.global.CLOSURE_BASE_PATH) {
130 goog.basePath = goog.global.CLOSURE_BASE_PATH 136 goog.basePath = goog.global.CLOSURE_BASE_PATH;
131 }else { 137 } else {
132 if(goog.inHtmlDocument_()) { 138 if (goog.inHtmlDocument_()) {
133 for(var a = goog.global.document.getElementsByTagName("script"), b = a.len gth - 1;0 <= b;--b) { 139 for (var a = goog.global.document.getElementsByTagName("script"), b = a.le ngth - 1;0 <= b;--b) {
134 var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d; 140 var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d;
135 if("base.js" == c.substr(d - 7, 7)) { 141 if ("base.js" == c.substr(d - 7, 7)) {
136 goog.basePath = c.substr(0, d - 7); 142 goog.basePath = c.substr(0, d - 7);
137 break 143 break;
138 } 144 }
139 } 145 }
140 } 146 }
141 } 147 }
142 }, goog.importScript_ = function(a) { 148 }, goog.importScript_ = function(a) {
143 var b = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_; 149 var b = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_;
144 !goog.dependencies_.written[a] && b(a) && (goog.dependencies_.written[a] = !0) 150 !goog.dependencies_.written[a] && b(a) && (goog.dependencies_.written[a] = !0) ;
145 }, goog.writeScriptTag_ = function(a) { 151 }, goog.writeScriptTag_ = function(a) {
146 if(goog.inHtmlDocument_()) { 152 if (goog.inHtmlDocument_()) {
147 var b = goog.global.document; 153 var b = goog.global.document;
148 if("complete" == b.readyState) { 154 if ("complete" == b.readyState) {
149 if(/\bdeps.js$/.test(a)) { 155 if (/\bdeps.js$/.test(a)) {
150 return!1 156 return!1;
151 } 157 }
152 throw Error('Cannot write "' + a + '" after document load'); 158 throw Error('Cannot write "' + a + '" after document load');
153 } 159 }
154 b.write('<script type="text/javascript" src="' + a + '">\x3c/script>'); 160 b.write('<script type="text/javascript" src="' + a + '">\x3c/script>');
155 return!0 161 return!0;
156 } 162 }
157 return!1 163 return!1;
158 }, goog.writeScripts_ = function() { 164 }, goog.writeScripts_ = function() {
159 function a(e) { 165 function a(e) {
160 if(!(e in d.written)) { 166 if (!(e in d.written)) {
161 if(!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) { 167 if (!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) {
162 for(var g in d.requires[e]) { 168 for (var g in d.requires[e]) {
163 if(!goog.isProvided_(g)) { 169 if (!goog.isProvided_(g)) {
164 if(g in d.nameToPath) { 170 if (g in d.nameToPath) {
165 a(d.nameToPath[g]) 171 a(d.nameToPath[g]);
166 }else { 172 } else {
167 throw Error("Undefined nameToPath for " + g); 173 throw Error("Undefined nameToPath for " + g);
168 } 174 }
169 } 175 }
170 } 176 }
171 } 177 }
172 e in c || (c[e] = !0, b.push(e)) 178 e in c || (c[e] = !0, b.push(e));
173 } 179 }
174 } 180 }
175 var b = [], c = {}, d = goog.dependencies_, e; 181 var b = [], c = {}, d = goog.dependencies_, e;
176 for(e in goog.included_) { 182 for (e in goog.included_) {
177 d.written[e] || a(e) 183 d.written[e] || a(e);
178 } 184 }
179 for(e = 0;e < b.length;e++) { 185 for (e = 0;e < b.length;e++) {
180 if(b[e]) { 186 if (b[e]) {
181 goog.importScript_(goog.basePath + b[e]) 187 goog.importScript_(goog.basePath + b[e]);
182 }else { 188 } else {
183 throw Error("Undefined script input"); 189 throw Error("Undefined script input");
184 } 190 }
185 } 191 }
186 }, goog.getPathFromDeps_ = function(a) { 192 }, goog.getPathFromDeps_ = function(a) {
187 return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] : null 193 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")); 194 }, goog.findBasePath_(), goog.global.CLOSURE_NO_DEPS || goog.importScript_(goog. basePath + "deps.js"));
189 goog.typeOf = function(a) { 195 goog.typeOf = function(a) {
190 var b = typeof a; 196 var b = typeof a;
191 if("object" == b) { 197 if ("object" == b) {
192 if(a) { 198 if (a) {
193 if(a instanceof Array) { 199 if (a instanceof Array) {
194 return"array" 200 return "array";
195 } 201 }
196 if(a instanceof Object) { 202 if (a instanceof Object) {
197 return b 203 return b;
198 } 204 }
199 var c = Object.prototype.toString.call(a); 205 var c = Object.prototype.toString.call(a);
200 if("[object Window]" == c) { 206 if ("[object Window]" == c) {
201 return"object" 207 return "object";
202 } 208 }
203 if("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIs Enumerable("splice")) { 209 if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyI sEnumerable("splice")) {
204 return"array" 210 return "array";
205 } 211 }
206 if("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) { 212 if ("[object Function]" == c || "undefined" != typeof a.call && "undefined " != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) {
207 return"function" 213 return "function";
208 } 214 }
209 }else { 215 } else {
210 return"null" 216 return "null";
211 } 217 }
212 }else { 218 } else {
213 if("function" == b && "undefined" == typeof a.call) { 219 if ("function" == b && "undefined" == typeof a.call) {
214 return"object" 220 return "object";
215 } 221 }
216 } 222 }
217 return b 223 return b;
218 };
219 goog.isDef = function(a) {
220 return void 0 !== a
221 }; 224 };
222 goog.isNull = function(a) { 225 goog.isNull = function(a) {
223 return null === a 226 return null === a;
224 }; 227 };
225 goog.isDefAndNotNull = function(a) { 228 goog.isDefAndNotNull = function(a) {
226 return null != a 229 return null != a;
227 }; 230 };
228 goog.isArray = function(a) { 231 goog.isArray = function(a) {
229 return"array" == goog.typeOf(a) 232 return "array" == goog.typeOf(a);
230 }; 233 };
231 goog.isArrayLike = function(a) { 234 goog.isArrayLike = function(a) {
232 var b = goog.typeOf(a); 235 var b = goog.typeOf(a);
233 return"array" == b || "object" == b && "number" == typeof a.length 236 return "array" == b || "object" == b && "number" == typeof a.length;
234 }; 237 };
235 goog.isDateLike = function(a) { 238 goog.isDateLike = function(a) {
236 return goog.isObject(a) && "function" == typeof a.getFullYear 239 return goog.isObject(a) && "function" == typeof a.getFullYear;
237 }; 240 };
238 goog.isString = function(a) { 241 goog.isString = function(a) {
239 return"string" == typeof a 242 return "string" == typeof a;
240 }; 243 };
241 goog.isBoolean = function(a) { 244 goog.isBoolean = function(a) {
242 return"boolean" == typeof a 245 return "boolean" == typeof a;
243 }; 246 };
244 goog.isNumber = function(a) { 247 goog.isNumber = function(a) {
245 return"number" == typeof a 248 return "number" == typeof a;
246 }; 249 };
247 goog.isFunction = function(a) { 250 goog.isFunction = function(a) {
248 return"function" == goog.typeOf(a) 251 return "function" == goog.typeOf(a);
249 }; 252 };
250 goog.isObject = function(a) { 253 goog.isObject = function(a) {
251 var b = typeof a; 254 var b = typeof a;
252 return"object" == b && null != a || "function" == b 255 return "object" == b && null != a || "function" == b;
253 }; 256 };
254 goog.getUid = function(a) { 257 goog.getUid = function(a) {
255 return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_) 258 return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_);
259 };
260 goog.hasUid = function(a) {
261 return!!a[goog.UID_PROPERTY_];
256 }; 262 };
257 goog.removeUid = function(a) { 263 goog.removeUid = function(a) {
258 "removeAttribute" in a && a.removeAttribute(goog.UID_PROPERTY_); 264 "removeAttribute" in a && a.removeAttribute(goog.UID_PROPERTY_);
259 try { 265 try {
260 delete a[goog.UID_PROPERTY_] 266 delete a[goog.UID_PROPERTY_];
261 }catch(b) { 267 } catch (b) {
262 } 268 }
263 }; 269 };
264 goog.UID_PROPERTY_ = "closure_uid_" + (1E9 * Math.random() >>> 0); 270 goog.UID_PROPERTY_ = "closure_uid_" + (1E9 * Math.random() >>> 0);
265 goog.uidCounter_ = 0; 271 goog.uidCounter_ = 0;
266 goog.getHashCode = goog.getUid; 272 goog.getHashCode = goog.getUid;
267 goog.removeHashCode = goog.removeUid; 273 goog.removeHashCode = goog.removeUid;
268 goog.cloneObject = function(a) { 274 goog.cloneObject = function(a) {
269 var b = goog.typeOf(a); 275 var b = goog.typeOf(a);
270 if("object" == b || "array" == b) { 276 if ("object" == b || "array" == b) {
271 if(a.clone) { 277 if (a.clone) {
272 return a.clone() 278 return a.clone();
273 } 279 }
274 var b = "array" == b ? [] : {}, c; 280 var b = "array" == b ? [] : {}, c;
275 for(c in a) { 281 for (c in a) {
276 b[c] = goog.cloneObject(a[c]) 282 b[c] = goog.cloneObject(a[c]);
277 } 283 }
278 return b 284 return b;
279 } 285 }
280 return a 286 return a;
281 }; 287 };
282 goog.bindNative_ = function(a, b, c) { 288 goog.bindNative_ = function(a, b, c) {
283 return a.call.apply(a.bind, arguments) 289 return a.call.apply(a.bind, arguments);
284 }; 290 };
285 goog.bindJs_ = function(a, b, c) { 291 goog.bindJs_ = function(a, b, c) {
286 if(!a) { 292 if (!a) {
287 throw Error(); 293 throw Error();
288 } 294 }
289 if(2 < arguments.length) { 295 if (2 < arguments.length) {
290 var d = Array.prototype.slice.call(arguments, 2); 296 var d = Array.prototype.slice.call(arguments, 2);
291 return function() { 297 return function() {
292 var c = Array.prototype.slice.call(arguments); 298 var c = Array.prototype.slice.call(arguments);
293 Array.prototype.unshift.apply(c, d); 299 Array.prototype.unshift.apply(c, d);
294 return a.apply(b, c) 300 return a.apply(b, c);
295 } 301 };
296 } 302 }
297 return function() { 303 return function() {
298 return a.apply(b, arguments) 304 return a.apply(b, arguments);
299 } 305 };
300 }; 306 };
301 goog.bind = function(a, b, c) { 307 goog.bind = function(a, b, c) {
302 Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("n ative code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_; 308 Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("n ative code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_;
303 return goog.bind.apply(null, arguments) 309 return goog.bind.apply(null, arguments);
304 }; 310 };
305 goog.partial = function(a, b) { 311 goog.partial = function(a, b) {
306 var c = Array.prototype.slice.call(arguments, 1); 312 var c = Array.prototype.slice.call(arguments, 1);
307 return function() { 313 return function() {
308 var b = Array.prototype.slice.call(arguments); 314 var b = c.slice();
309 b.unshift.apply(b, c); 315 b.push.apply(b, arguments);
310 return a.apply(this, b) 316 return a.apply(this, b);
311 } 317 };
312 }; 318 };
313 goog.mixin = function(a, b) { 319 goog.mixin = function(a, b) {
314 for(var c in b) { 320 for (var c in b) {
315 a[c] = b[c] 321 a[c] = b[c];
316 } 322 }
317 }; 323 };
318 goog.now = goog.TRUSTED_SITE && Date.now || function() { 324 goog.now = goog.TRUSTED_SITE && Date.now || function() {
319 return+new Date 325 return+new Date;
320 }; 326 };
321 goog.globalEval = function(a) { 327 goog.globalEval = function(a) {
322 if(goog.global.execScript) { 328 if (goog.global.execScript) {
323 goog.global.execScript(a, "JavaScript") 329 goog.global.execScript(a, "JavaScript");
324 }else { 330 } else {
325 if(goog.global.eval) { 331 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.evalWo rksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals _) { 332 if (null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ = 1;" ), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalW orksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobal s_) {
327 goog.global.eval(a) 333 goog.global.eval(a);
328 }else { 334 } else {
329 var b = goog.global.document, c = b.createElement("script"); 335 var b = goog.global.document, c = b.createElement("script");
330 c.type = "text/javascript"; 336 c.type = "text/javascript";
331 c.defer = !1; 337 c.defer = !1;
332 c.appendChild(b.createTextNode(a)); 338 c.appendChild(b.createTextNode(a));
333 b.body.appendChild(c); 339 b.body.appendChild(c);
334 b.body.removeChild(c) 340 b.body.removeChild(c);
335 } 341 }
336 }else { 342 } else {
337 throw Error("goog.globalEval not available"); 343 throw Error("goog.globalEval not available");
338 } 344 }
339 } 345 }
340 }; 346 };
341 goog.evalWorksForGlobals_ = null; 347 goog.evalWorksForGlobals_ = null;
342 goog.getCssName = function(a, b) { 348 goog.getCssName = function(a, b) {
343 var c = function(a) { 349 var c = function(a) {
344 return goog.cssNameMapping_[a] || a 350 return goog.cssNameMapping_[a] || a;
345 }, d = function(a) { 351 }, d = function(a) {
346 a = a.split("-"); 352 a = a.split("-");
347 for(var b = [], d = 0;d < a.length;d++) { 353 for (var b = [], d = 0;d < a.length;d++) {
348 b.push(c(a[d])) 354 b.push(c(a[d]));
349 } 355 }
350 return b.join("-") 356 return b.join("-");
351 }, d = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? c : d : function(a) { 357 }, d = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? c : d : function(a) {
352 return a 358 return a;
353 }; 359 };
354 return b ? a + "-" + d(b) : d(a) 360 return b ? a + "-" + d(b) : d(a);
355 }; 361 };
356 goog.setCssNameMapping = function(a, b) { 362 goog.setCssNameMapping = function(a, b) {
357 goog.cssNameMapping_ = a; 363 goog.cssNameMapping_ = a;
358 goog.cssNameMappingStyle_ = b 364 goog.cssNameMappingStyle_ = b;
359 }; 365 };
360 !COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goo g.global.CLOSURE_CSS_NAME_MAPPING); 366 !COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goo g.global.CLOSURE_CSS_NAME_MAPPING);
361 goog.getMsg = function(a, b) { 367 goog.getMsg = function(a, b) {
362 var c = b || {}, d; 368 var c = b || {}, d;
363 for(d in c) { 369 for (d in c) {
364 var e = ("" + c[d]).replace(/\$/g, "$$$$"); 370 var e = ("" + c[d]).replace(/\$/g, "$$$$");
365 a = a.replace(RegExp("\\{\\$" + d + "\\}", "gi"), e) 371 a = a.replace(new RegExp("\\{\\$" + d + "\\}", "gi"), e);
366 } 372 }
367 return a 373 return a;
368 }; 374 };
369 goog.getMsgWithFallback = function(a, b) { 375 goog.getMsgWithFallback = function(a, b) {
370 return a 376 return a;
371 }; 377 };
372 goog.exportSymbol = function(a, b, c) { 378 goog.exportSymbol = function(a, b, c) {
373 goog.exportPath_(a, b, c) 379 goog.exportPath_(a, b, c);
374 }; 380 };
375 goog.exportProperty = function(a, b, c) { 381 goog.exportProperty = function(a, b, c) {
376 a[b] = c 382 a[b] = c;
377 }; 383 };
378 goog.inherits = function(a, b) { 384 goog.inherits = function(a, b) {
379 function c() { 385 function c() {
380 } 386 }
381 c.prototype = b.prototype; 387 c.prototype = b.prototype;
382 a.superClass_ = b.prototype; 388 a.superClass_ = b.prototype;
383 a.prototype = new c; 389 a.prototype = new c;
384 a.prototype.constructor = a 390 a.prototype.constructor = a;
391 a.base = function(a, c, f) {
392 var g = Array.prototype.slice.call(arguments, 2);
393 return b.prototype[c].apply(a, g);
394 };
385 }; 395 };
386 goog.base = function(a, b, c) { 396 goog.base = function(a, b, c) {
387 var d = arguments.callee.caller; 397 var d = arguments.callee.caller;
388 if(goog.DEBUG && !d) { 398 if (goog.STRICT_MODE_COMPATIBLE || goog.DEBUG && !d) {
389 throw Error("arguments.caller not defined. goog.base() expects not to be ru nning in strict mode. See http://www.ecma-international.org/ecma-262/5.1/#sec-C" ); 399 throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");
390 } 400 }
391 if(d.superClass_) { 401 if (d.superClass_) {
392 return d.superClass_.constructor.apply(a, Array.prototype.slice.call(argumen ts, 1)) 402 return d.superClass_.constructor.apply(a, Array.prototype.slice.call(argumen ts, 1));
393 } 403 }
394 for(var e = Array.prototype.slice.call(arguments, 2), f = !1, g = a.constructo r;g;g = g.superClass_ && g.superClass_.constructor) { 404 for (var e = Array.prototype.slice.call(arguments, 2), f = !1, g = a.construct or;g;g = g.superClass_ && g.superClass_.constructor) {
395 if(g.prototype[b] === d) { 405 if (g.prototype[b] === d) {
396 f = !0 406 f = !0;
397 }else { 407 } else {
398 if(f) { 408 if (f) {
399 return g.prototype[b].apply(a, e) 409 return g.prototype[b].apply(a, e);
400 } 410 }
401 } 411 }
402 } 412 }
403 if(a[b] === d) { 413 if (a[b] === d) {
404 return a.constructor.prototype[b].apply(a, e) 414 return a.constructor.prototype[b].apply(a, e);
405 } 415 }
406 throw Error("goog.base called from a method of one name to a method of a diffe rent name"); 416 throw Error("goog.base called from a method of one name to a method of a diffe rent name");
407 }; 417 };
408 goog.scope = function(a) { 418 goog.scope = function(a) {
409 a.call(goog.global) 419 a.call(goog.global);
410 }; 420 };
411 var axs = {}; 421 var axs = {};
412 axs.browserUtils = {}; 422 axs.browserUtils = {};
413 axs.browserUtils.matchSelector = function(a, b) { 423 axs.browserUtils.matchSelector = function(a, b) {
414 return a.webkitMatchesSelector ? a.webkitMatchesSelector(b) : a.mozMatchesSele ctor ? a.mozMatchesSelector(b) : !1 424 return a.webkitMatchesSelector ? a.webkitMatchesSelector(b) : a.mozMatchesSele ctor ? a.mozMatchesSelector(b) : !1;
415 }; 425 };
416 axs.constants = {}; 426 axs.constants = {};
417 axs.constants.ARIA_ROLES = {alert:{namefrom:["author"], parent:["region"]}, aler tdialog:{namefrom:["author"], namerequired:!0, parent:["alert", "dialog"]}, appl ication:{namefrom:["author"], namerequired:!0, parent:["landmark"]}, article:{na mefrom:["author"], parent:["document", "region"]}, banner:{namefrom:["author"], parent:["landmark"]}, button:{childpresentational:!0, namefrom:["contents", "aut hor"], namerequired:!0, parent:["command"], properties:["aria-expanded", "aria-p ressed"]}, checkbox:{namefrom:["contents", 427 axs.constants.ARIA_ROLES = {alert:{namefrom:["author"], parent:["region"]}, aler tdialog:{namefrom:["author"], namerequired:!0, parent:["alert", "dialog"]}, appl ication:{namefrom:["author"], namerequired:!0, parent:["landmark"]}, article:{na mefrom:["author"], parent:["document", "region"]}, banner:{namefrom:["author"], parent:["landmark"]}, button:{childpresentational:!0, namefrom:["contents", "aut hor"], namerequired:!0, parent:["command"], properties:["aria-expanded", "aria-p ressed"]}, 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"], nam erequired:!0, parent:["select"], requiredProperties:["aria-expanded"], propertie s:["aria-expanded", "aria-autocomplete", "aria-required"]}, command:{"abstract": !0, namefrom:["author"], 428 "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"], nam erequired:!0, parent:["select"], requiredProperties:["aria-expanded"], propertie s:["aria-expanded", "aria-autocomplete", "aria-required"]}, command:{"abstract": !0, namefrom:["author"],
419 parent:["widget"]}, complementary:{namefrom:["author"], parent:["landmark"]}, co mposite:{"abstract":!0, childpresentational:!1, namefrom:["author"], parent:["wi dget"], properties:["aria-activedescendant"]}, contentinfo:{namefrom:["author"], parent:["landmark"]}, definition:{namefrom:["author"], parent:["section"]}, dia log:{namefrom:["author"], namerequired:!0, parent:["window"]}, directory:{namefr om:["contents", "author"], parent:["list"]}, document:{namefrom:[" author"], nam erequired:!0, parent:["structure"], 429 parent:["widget"]}, complementary:{namefrom:["author"], parent:["landmark"]}, co mposite:{"abstract":!0, childpresentational:!1, namefrom:["author"], parent:["wi dget"], properties:["aria-activedescendant"]}, contentinfo:{namefrom:["author"], parent:["landmark"]}, definition:{namefrom:["author"], parent:["section"]}, dia log:{namefrom:["author"], namerequired:!0, parent:["window"]}, directory:{namefr om:["contents", "author"], parent:["list"]}, document:{namefrom:[" author"], nam erequired:!0, parent:["structure"],
420 properties:["aria-expanded"]}, form:{namefrom:["author"], parent:["landmark"]}, grid:{mustcontain:["row", "rowgroup"], namefrom:["author"], namerequired:!0, par ent:["composite", "region"], properties:["aria-level", "aria-multiselectable", " aria-readonly"]}, gridcell:{namefrom:["contents", "author"], namerequired:!0, pa rent:["section", "widget"], properties:["aria-readonly", "aria-required", "aria- selected"]}, group:{namefrom:[" author"], parent:["section"], properties:["aria- activedescendant"]}, 430 properties:["aria-expanded"]}, form:{namefrom:["author"], parent:["landmark"]}, grid:{mustcontain:["row", "rowgroup"], namefrom:["author"], namerequired:!0, par ent:["composite", "region"], properties:["aria-level", "aria-multiselectable", " aria-readonly"]}, gridcell:{namefrom:["contents", "author"], namerequired:!0, pa rent:["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"]}, im g:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["sectio n"]}, 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"]}, 431 heading:{namerequired:!0, parent:["sectionhead"], properties:["aria-level"]}, im g:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["sectio n"]}, 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"]}, listite m:{namefrom:["contents", "author"], namerequired:!0, parent:["section"], propert ies:["aria-level", "aria-posinset", "aria-setsize"]}, log:{namefrom:[" author"], namerequired:!0, parent:["region"]}, main:{namefrom:["author"], parent:["landma rk"]}, marquee:{namerequired:!0, parent:["section"]}, math:{childpresentational: !0, namefrom:["author"], 432 listbox:{mustcontain:["option"], namefrom:["author"], namerequired:!0, parent:[" list", "select"], properties:["aria-multiselectable", "aria-required"]}, listite m:{namefrom:["contents", "author"], namerequired:!0, parent:["section"], propert ies:["aria-level", "aria-posinset", "aria-setsize"]}, log:{namefrom:[" author"], namerequired:!0, parent:["region"]}, main:{namefrom:["author"], parent:["landma rk"]}, marquee:{namerequired:!0, parent:["section"]}, math:{childpresentational: !0, namefrom:["author"],
423 parent:["section"]}, menu:{mustcontain:["group", "menuitemradio", "menuitem", "m enuitemcheckbox"], namefrom:["author"], namerequired:!0, parent:["list", "select "]}, menubar:{namefrom:["author"], parent:["menu"]}, menuitem:{namefrom:["conten ts", "author"], namerequired:!0, parent:["command"]}, menuitemcheckbox:{namefrom :["contents", "author"], namerequired:!0, parent:["checkbox", "menuitem"]}, menu itemradio:{namefrom:["contents", "author"], namerequired:!0, parent:["menuitemch eckbox", "radio"]}, navigation:{namefrom:["author"], 433 parent:["section"]}, menu:{mustcontain:["group", "menuitemradio", "menuitem", "m enuitemcheckbox"], namefrom:["author"], namerequired:!0, parent:["list", "select "]}, menubar:{namefrom:["author"], parent:["menu"]}, menuitem:{namefrom:["conten ts", "author"], namerequired:!0, parent:["command"]}, menuitemcheckbox:{namefrom :["contents", "author"], namerequired:!0, parent:["checkbox", "menuitem"]}, menu itemradio:{namefrom:["contents", "author"], namerequired:!0, parent:["menuitemch eckbox", "radio"]}, navigation:{namefrom:["author"],
424 parent:["landmark"]}, note:{namefrom:["author"], parent:["section"]}, option:{na mefrom:["contents", "author"], namerequired:!0, parent:["input"], properties:["a ria-checked", "aria-posinset", "aria-selected", "aria-setsize"]}, presentation:{ parent:["structure"]}, progressbar:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["range"]}, radio:{namefrom:["contents", "author"], nam erequired:!0, parent:["checkbox", "option"]}, radiogroup:{mustcontain:["radio"], namefrom:["author"], 434 parent:["landmark"]}, note:{namefrom:["author"], parent:["section"]}, option:{na mefrom:["contents", "author"], namerequired:!0, parent:["input"], properties:["a ria-checked", "aria-posinset", "aria-selected", "aria-setsize"]}, presentation:{ parent:["structure"]}, progressbar:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["range"]}, radio:{namefrom:["contents", "author"], nam erequired:!0, parent:["checkbox", "option"]}, radiogroup:{mustcontain:["radio"], namefrom:["author"],
425 namerequired:!0, parent:["select"], properties:["aria-required"]}, range:{"abstr act":!0, namefrom:["author"], parent:["widget"], properties:["aria-valuemax", "a ria-valuemin", "aria-valuenow", "aria-valuetext"]}, region:{namefrom:[" author"] , parent:["section"]}, roletype:{"abstract":!0, properties:"aria-atomic aria-bus y aria-controls aria-describedby aria-disabled aria-dropeffect aria-flowto aria- grabbed aria-haspopup aria-hidden aria-invalid aria-label aria-labelledby aria-l ive aria-owns aria-relevant".split(" ")}, 435 namerequired:!0, parent:["select"], properties:["aria-required"]}, range:{"abstr act":!0, namefrom:["author"], parent:["widget"], properties:["aria-valuemax", "a ria-valuemin", "aria-valuenow", "aria-valuetext"]}, region:{namefrom:[" author"] , parent:["section"]}, roletype:{"abstract":!0, properties:"aria-atomic aria-bus y aria-controls aria-describedby aria-disabled aria-dropeffect aria-flowto aria- grabbed aria-haspopup aria-hidden aria-invalid aria-label aria-labelledby aria-l ive aria-owns aria-relevant".split(" ")},
426 row:{mustcontain:["columnheader", "gridcell", "rowheader"], namefrom:["contents" , "author"], parent:["group", "widget"], properties:["aria-level", "aria-selecte d"]}, rowgroup:{mustcontain:["row"], namefrom:["contents", "author"], parent:["g roup"]}, rowheader:{namefrom:["contents", "author"], namerequired:!0, parent:["g ridcell", "sectionhead", "widget"], properties:["aria-sort"]}, search:{namefrom: ["author"], parent:["landmark"]}, section:{"abstract":!0, namefrom:["contents", "author"], parent:["structure"], 436 row:{mustcontain:["columnheader", "gridcell", "rowheader"], namefrom:["contents" , "author"], parent:["group", "widget"], properties:["aria-level", "aria-selecte d"]}, rowgroup:{mustcontain:["row"], namefrom:["contents", "author"], parent:["g roup"]}, rowheader:{namefrom:["contents", "author"], namerequired:!0, parent:["g ridcell", "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:{"abstra ct":!0, namefrom:["author"], parent:["composite", "group", "input"]}, separator: {childpresentational:!0, namefrom:["author"], parent:["structure"], properties:[ "aria-expanded", "aria-orientation"]}, scrollbar:{childpresentational:!0, namefr om:["author"], namerequired:!1, parent:["input", "range"], requiredProperties:[" aria-controls", "aria-orientation", 437 properties:["aria-expanded"]}, sectionhead:{"abstract":!0, namefrom:["contents", "author"], parent:["structure"], properties:["aria-expanded"]}, select:{"abstra ct":!0, namefrom:["author"], parent:["composite", "group", "input"]}, separator: {childpresentational:!0, namefrom:["author"], parent:["structure"], properties:[ "aria-expanded", "aria-orientation"]}, scrollbar:{childpresentational:!0, namefr om:["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-orientat ion"]}, spinbutton:{namefrom:["author"], namerequired:!0, parent:["input", "rang e"], requiredProperties:["aria-valuemax", 438 "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-orientat ion"]}, spinbutton:{namefrom:["author"], namerequired:!0, parent:["input", "rang e"], requiredProperties:["aria-valuemax",
429 "aria-valuemin", "aria-valuenow"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-required"]}, status:{parent:["region"]}, structure:{"abs tract":!0, parent:["roletype"]}, tab:{namefrom:["contents", "author"], parent:[" sectionhead", "widget"], properties:["aria-selected"]}, tablist:{mustcontain:["t ab"], namefrom:["author"], parent:["composite", "directory"], properties:["aria- level"]}, tabpanel:{namefrom:["author"], namerequired:!0, parent:["region"]}, te xtbox:{namefrom:["author"], 439 "aria-valuemin", "aria-valuenow"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-required"]}, status:{parent:["region"]}, structure:{"abs tract":!0, parent:["roletype"]}, tab:{namefrom:["contents", "author"], parent:[" sectionhead", "widget"], properties:["aria-selected"]}, tablist:{mustcontain:["t ab"], namefrom:["author"], parent:["composite", "directory"], properties:["aria- level"]}, tabpanel:{namefrom:["author"], namerequired:!0, parent:["region"]}, te xtbox:{namefrom:["author"],
430 namerequired:!0, parent:["input"], properties:["aria-activedescendant", "aria-au tocomplete", "aria-multiline", "aria-readonly", "aria-required"]}, timer:{namefr om:["author"], namerequired:!0, parent:["status"]}, toolbar:{namefrom:["author"] , parent:["group"]}, tooltip:{namerequired:!0, parent:["section"]}, tree:{mustco ntain:["group", "treeitem"], namefrom:["author"], namerequired:!0, parent:["sele ct"], properties:["aria-multiselectable", "aria-required"]}, treegrid:{mustconta in:["row"], namefrom:["author"], 440 namerequired:!0, parent:["input"], properties:["aria-activedescendant", "aria-au tocomplete", "aria-multiline", "aria-readonly", "aria-required"]}, timer:{namefr om:["author"], namerequired:!0, parent:["status"]}, toolbar:{namefrom:["author"] , parent:["group"]}, tooltip:{namerequired:!0, parent:["section"]}, tree:{mustco ntain:["group", "treeitem"], namefrom:["author"], namerequired:!0, parent:["sele ct"], properties:["aria-multiselectable", "aria-required"]}, treegrid:{mustconta in:["row"], namefrom:["author"],
431 namerequired:!0, parent:["grid", "tree"]}, treeitem:{namefrom:["contents", "auth or"], namerequired:!0, parent:["listitem", "option"]}, widget:{"abstract":!0, pa rent:["roletype"]}, window:{"abstract":!0, namefrom:[" author"], parent:["rolety pe"], properties:["aria-expanded"]}}; 441 namerequired:!0, parent:["grid", "tree"]}, treeitem:{namefrom:["contents", "auth or"], namerequired:!0, parent:["listitem", "option"]}, widget:{"abstract":!0, pa rent:["roletype"]}, window:{"abstract":!0, namefrom:[" author"], parent:["rolety pe"], properties:["aria-expanded"]}};
432 axs.constants.WIDGET_ROLES = {}; 442 axs.constants.WIDGET_ROLES = {};
433 axs.constants.addAllParentRolesToSet_ = function(a, b) { 443 axs.constants.addAllParentRolesToSet_ = function(a, b) {
434 if(a.parent) { 444 if (a.parent) {
435 for(var c = a.parent, d = 0;d < c.length;d++) { 445 for (var c = a.parent, d = 0;d < c.length;d++) {
436 var e = c[d]; 446 var e = c[d];
437 b[e] = !0; 447 b[e] = !0;
438 axs.constants.addAllParentRolesToSet_(axs.constants.ARIA_ROLES[e], b) 448 axs.constants.addAllParentRolesToSet_(axs.constants.ARIA_ROLES[e], b);
439 } 449 }
440 } 450 }
441 }; 451 };
442 axs.constants.addAllPropertiesToSet_ = function(a, b, c) { 452 axs.constants.addAllPropertiesToSet_ = function(a, b, c) {
443 var d = a[b]; 453 var d = a[b];
444 if(d) { 454 if (d) {
445 for(var e = 0;e < d.length;e++) { 455 for (var e = 0;e < d.length;e++) {
446 c[d[e]] = !0 456 c[d[e]] = !0;
447 } 457 }
448 } 458 }
449 if(a.parent) { 459 if (a.parent) {
450 for(a = a.parent, d = 0;d < a.length;d++) { 460 for (a = a.parent, d = 0;d < a.length;d++) {
451 axs.constants.addAllPropertiesToSet_(axs.constants.ARIA_ROLES[a[d]], b, c) 461 axs.constants.addAllPropertiesToSet_(axs.constants.ARIA_ROLES[a[d]], b, c) ;
452 } 462 }
453 } 463 }
454 }; 464 };
455 for(var roleName in axs.constants.ARIA_ROLES) { 465 for (var roleName in axs.constants.ARIA_ROLES) {
456 var role = axs.constants.ARIA_ROLES[roleName], propertiesSet = {}; 466 var role = axs.constants.ARIA_ROLES[roleName], propertiesSet = {};
457 axs.constants.addAllPropertiesToSet_(role, "properties", propertiesSet); 467 axs.constants.addAllPropertiesToSet_(role, "properties", propertiesSet);
458 role.propertiesSet = propertiesSet; 468 role.propertiesSet = propertiesSet;
459 var requiredPropertiesSet = {}; 469 var requiredPropertiesSet = {};
460 axs.constants.addAllPropertiesToSet_(role, "requiredProperties", requiredPrope rtiesSet); 470 axs.constants.addAllPropertiesToSet_(role, "requiredProperties", requiredPrope rtiesSet);
461 role.requiredPropertiesSet = requiredPropertiesSet; 471 role.requiredPropertiesSet = requiredPropertiesSet;
462 var parentRolesSet = {}; 472 var parentRolesSet = {};
463 axs.constants.addAllParentRolesToSet_(role, parentRolesSet); 473 axs.constants.addAllParentRolesToSet_(role, parentRolesSet);
464 role.allParentRolesSet = parentRolesSet; 474 role.allParentRolesSet = parentRolesSet;
465 "widget" in parentRolesSet && (axs.constants.WIDGET_ROLES[roleName] = role) 475 "widget" in parentRolesSet && (axs.constants.WIDGET_ROLES[roleName] = role);
466 } 476 }
467 axs.constants.ARIA_PROPERTIES = {activedescendant:{type:"property", valueType:"i dref"}, atomic:{defaultValue:"false", type:"property", valueType:"boolean"}, aut ocomplete:{defaultValue:"none", type:"property", valueType:"token", values:["inl ine", "list", "both", "none"]}, busy:{defaultValue:"false", type:"state", valueT ype:"boolean"}, checked:{defaultValue:"undefined", type:"state", valueType:"toke n", values:["true", "false", "mixed", "undefined"]}, controls:{type:"property", valueType:"idref_list"}, 477 axs.constants.ARIA_PROPERTIES = {activedescendant:{type:"property", valueType:"i dref"}, atomic:{defaultValue:"false", type:"property", valueType:"boolean"}, aut ocomplete:{defaultValue:"none", type:"property", valueType:"token", values:["inl ine", "list", "both", "none"]}, busy:{defaultValue:"false", type:"state", valueT ype:"boolean"}, checked:{defaultValue:"undefined", type:"state", valueType:"toke n", values:["true", "false", "mixed", "undefined"]}, controls:{type:"property", valueType:"idref_list"},
468 describedby:{type:"property", valueType:"idref_list"}, disabled:{defaultValue:"f alse", 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:"id ref_list"}, grabbed:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", 478 describedby:{type:"property", valueType:"idref_list"}, disabled:{defaultValue:"f alse", 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:"id ref_list"}, grabbed:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false",
469 "undefined"]}, haspopup:{defaultValue:"false", type:"property", valueType:"boole an"}, hidden:{defaultValue:"false", type:"state", valueType:"boolean"}, invalid: {defaultValue:"false", type:"state", valueType:"token", values:["grammar", "fals e", "spelling", "true"]}, label:{type:"property", valueType:"string"}, labelledb y:{type:"property", valueType:"idref_list"}, level:{type:"property", valueType:" integer"}, live:{defaultValue:"off", type:"property", valueType:"token", values: ["off", "polite", "assertive"]}, 479 "undefined"]}, haspopup:{defaultValue:"false", type:"property", valueType:"boole an"}, hidden:{defaultValue:"false", type:"state", valueType:"boolean"}, invalid: {defaultValue:"false", type:"state", valueType:"token", values:["grammar", "fals e", "spelling", "true"]}, label:{type:"property", valueType:"string"}, labelledb y:{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"}, multisel ectable:{defaultValue:"false", type:"property", valueType:"boolean"}, orientatio n:{defaultValue:"vertical", type:"property", valueType:"token", values:["horizon tal", "vertical"]}, owns:{type:"property", valueType:"idref_list"}, posinset:{ty pe:"property", valueType:"integer"}, pressed:{defaultValue:"undefined", type:"st ate", valueType:"token", values:["true", "false", "mixed", "undefined"]}, readon ly:{defaultValue:"false", 480 multiline:{defaultValue:"false", type:"property", valueType:"boolean"}, multisel ectable:{defaultValue:"false", type:"property", valueType:"boolean"}, orientatio n:{defaultValue:"vertical", type:"property", valueType:"token", values:["horizon tal", "vertical"]}, owns:{type:"property", valueType:"idref_list"}, posinset:{ty pe:"property", valueType:"integer"}, pressed:{defaultValue:"undefined", type:"st ate", valueType:"token", values:["true", "false", "mixed", "undefined"]}, readon ly:{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"}, s ort:{defaultValue:"none", type:"property", valueType:"token", values:["ascending ", "descending", "none", 481 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"}, s ort:{defaultValue:"none", type:"property", valueType:"token", values:["ascending ", "descending", "none",
472 "other"]}, valuemax:{type:"property", valueType:"decimal"}, valuemin:{type:"prop erty", valueType:"decimal"}, valuenow:{type:"property", valueType:"decimal"}, va luetext:{type:"property", valueType:"string"}}; 482 "other"]}, valuemax:{type:"property", valueType:"decimal"}, valuemin:{type:"prop erty", valueType:"decimal"}, valuenow:{type:"property", valueType:"decimal"}, va luetext:{type:"property", valueType:"string"}};
473 axs.constants.GLOBAL_PROPERTIES = "aria-atomic aria-busy aria-controls aria-desc ribedby aria-disabled aria-dropeffect aria-flowto aria-grabbed aria-haspopup ari a-hidden aria-invalid aria-label aria-labelledby aria-live aria-owns aria-releva nt".split(" "); 483 axs.constants.GLOBAL_PROPERTIES = "aria-atomic aria-busy aria-controls aria-desc ribedby aria-disabled aria-dropeffect aria-flowto aria-grabbed aria-haspopup ari a-hidden aria-invalid aria-label aria-labelledby aria-live aria-owns aria-releva nt".split(" ");
474 axs.constants.NO_ROLE_NAME = " "; 484 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", col umnheader:"aria_role_columnheader", combobox:"aria_role_combobox", dialog:"aria_ role_dialog", grid:"aria_role_grid", gridcell:"aria_role_gridcell", link:"aria_r ole_link", listbox:"aria_role_listbox", log:"aria_role_log", marquee:"aria_role_ marquee", menu:"aria_role_menu", menubar:"aria_role_menubar", menuitem:"aria_rol e_menuitem", menuitemcheckbox:"aria_role_menuitemcheckbox", 485 axs.constants.WIDGET_ROLE_TO_NAME = {alert:"aria_role_alert", alertdialog:"aria_ role_alertdialog", button:"aria_role_button", checkbox:"aria_role_checkbox", col umnheader:"aria_role_columnheader", combobox:"aria_role_combobox", dialog:"aria_ role_dialog", grid:"aria_role_grid", gridcell:"aria_role_gridcell", link:"aria_r ole_link", listbox:"aria_role_listbox", log:"aria_role_log", marquee:"aria_role_ marquee", menu:"aria_role_menu", menubar:"aria_role_menubar", menuitem:"aria_rol e_menuitem", menuitemcheckbox:"aria_role_menuitemcheckbox",
476 menuitemradio:"aria_role_menuitemradio", option:axs.constants.NO_ROLE_NAME, prog ressbar:"aria_role_progressbar", radio:"aria_role_radio", radiogroup:"aria_role_ radiogroup", rowheader:"aria_role_rowheader", scrollbar:"aria_role_scrollbar", s lider:"aria_role_slider", spinbutton:"aria_role_spinbutton", status:"aria_role_s tatus", tab:"aria_role_tab", tabpanel:"aria_role_tabpanel", textbox:"aria_role_t extbox", timer:"aria_role_timer", toolbar:"aria_role_toolbar", tooltip:"aria_rol e_tooltip", treeitem:"aria_role_treeitem"}; 486 menuitemradio:"aria_role_menuitemradio", option:axs.constants.NO_ROLE_NAME, prog ressbar:"aria_role_progressbar", radio:"aria_role_radio", radiogroup:"aria_role_ radiogroup", rowheader:"aria_role_rowheader", scrollbar:"aria_role_scrollbar", s lider:"aria_role_slider", spinbutton:"aria_role_spinbutton", status:"aria_role_s tatus", tab:"aria_role_tab", tabpanel:"aria_role_tabpanel", textbox:"aria_role_t extbox", timer:"aria_role_timer", toolbar:"aria_role_toolbar", tooltip:"aria_rol e_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_col umnheader", complementary:"aria_role_complementary", contentinfo:"aria_role_cont entinfo", definition:"aria_role_definition", directory:"aria_role_directory", do cument:"aria_role_document", form:"aria_role_form", group:"aria_role_group", hea ding:"aria_role_heading", img:"aria_role_img", list:"aria_role_list", listitem:" aria_role_listitem", 487 axs.constants.STRUCTURE_ROLE_TO_NAME = {article:"aria_role_article", application :"aria_role_application", banner:"aria_role_banner", columnheader:"aria_role_col umnheader", complementary:"aria_role_complementary", contentinfo:"aria_role_cont entinfo", definition:"aria_role_definition", directory:"aria_role_directory", do cument:"aria_role_document", form:"aria_role_form", group:"aria_role_group", hea ding:"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_rowheade r", search:"aria_role_search", separator:"aria_role_separator"}; 488 main:"aria_role_main", math:"aria_role_math", navigation:"aria_role_navigation", note:"aria_role_note", region:"aria_role_region", rowheader:"aria_role_rowheade r", search:"aria_role_search", separator:"aria_role_separator"};
479 axs.constants.ATTRIBUTE_VALUE_TO_STATUS = [{name:"aria-autocomplete", values:{in line:"aria_autocomplete_inline", list:"aria_autocomplete_list", both:"aria_autoc omplete_both"}}, {name:"aria-checked", values:{"true":"aria_checked_true", "fals e":"aria_checked_false", mixed:"aria_checked_mixed"}}, {name:"aria-disabled", va lues:{"true":"aria_disabled_true"}}, {name:"aria-expanded", values:{"true":"aria _expanded_true", "false":"aria_expanded_false"}}, {name:"aria-invalid", values:{ "true":"aria_invalid_true", 489 axs.constants.ATTRIBUTE_VALUE_TO_STATUS = [{name:"aria-autocomplete", values:{in line:"aria_autocomplete_inline", list:"aria_autocomplete_list", both:"aria_autoc omplete_both"}}, {name:"aria-checked", values:{"true":"aria_checked_true", "fals e":"aria_checked_false", mixed:"aria_checked_mixed"}}, {name:"aria-disabled", va lues:{"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:{"t rue":"aria_pressed_true", "false":"aria_pressed_false", mixed:"aria_pressed_mixe d"}}, {name:"aria-readonly", values:{"true":"aria_readonly_true"}}, {name:"aria- required", values:{"true":"aria_required_true"}}, {name:"aria-selected", values: {"true":"aria_selected_true", 490 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:{"t rue":"aria_pressed_true", "false":"aria_pressed_false", mixed:"aria_pressed_mixe d"}}, {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"}}]; 491 "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", mon th:"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", 492 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", mon th:"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:"i nput_type_url", week:"input_type_week"}; 493 submit:"input_type_submit", tel:"input_type_tel", text:"input_type_text", url:"i nput_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:"ta g_h6", LI:"tag_li", OL:"tag_ol", SELECT:"tag_select", TEXTAREA:"tag_textarea", U L:"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"}; 494 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:"ta g_h6", LI:"tag_li", OL:"tag_ol", SELECT:"tag_select", TEXTAREA:"tag_textarea", U L:"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"}; 495 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}; 496 axs.constants.MIXED_VALUES = {"true":!0, "false":!0, mixed:!0};
487 (function() { 497 (function() {
488 for(var a in axs.constants.ARIA_PROPERTIES) { 498 for (var a in axs.constants.ARIA_PROPERTIES) {
489 var b = axs.constants.ARIA_PROPERTIES[a]; 499 var b = axs.constants.ARIA_PROPERTIES[a];
490 if(b.values) { 500 if (b.values) {
491 for(var c = {}, d = 0;d < b.values.length;d++) { 501 for (var c = {}, d = 0;d < b.values.length;d++) {
492 c[b.values[d]] = !0 502 c[b.values[d]] = !0;
493 } 503 }
494 b.valuesSet = c 504 b.valuesSet = c;
495 } 505 }
496 } 506 }
497 })(); 507 })();
498 axs.constants.Severity = {INFO:"Info", WARNING:"Warning", SEVERE:"Severe"}; 508 axs.constants.Severity = {INFO:"Info", WARNING:"Warning", SEVERE:"Severe"};
499 axs.constants.AuditResult = {PASS:"PASS", FAIL:"FAIL", NA:"NA"}; 509 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, STRO NG:!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}; 510 axs.constants.InlineElements = {TT:!0, I:!0, B:!0, BIG:!0, SMALL:!0, EM:!0, STRO NG:!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};
501 axs.utils = {}; 511 axs.utils = {};
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]"; 512 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) { 513 axs.utils.Color = function(a, b, c, d) {
504 this.red = a; 514 this.red = a;
505 this.green = b; 515 this.green = b;
506 this.blue = c; 516 this.blue = c;
507 this.alpha = d 517 this.alpha = d;
508 }; 518 };
509 axs.utils.calculateContrastRatio = function(a, b) { 519 axs.utils.calculateContrastRatio = function(a, b) {
510 if(!a || !b) { 520 if (!a || !b) {
511 return null 521 return null;
512 } 522 }
513 1 > a.alpha && (a = axs.utils.flattenColors(a, b)); 523 1 > a.alpha && (a = axs.utils.flattenColors(a, b));
514 var c = axs.utils.calculateLuminance(a), d = axs.utils.calculateLuminance(b); 524 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) 525 return(Math.max(c, d) + .05) / (Math.min(c, d) + .05);
516 }; 526 };
517 axs.utils.luminanceRatio = function(a, b) { 527 axs.utils.luminanceRatio = function(a, b) {
518 return(Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05) 528 return(Math.max(a, b) + .05) / (Math.min(a, b) + .05);
529 };
530 axs.utils.parentElement = function(a) {
531 if (!a) {
532 return null;
533 }
534 if (a.nodeType == Node.DOCUMENT_FRAGMENT_NODE) {
535 return a.host;
536 }
537 var b = a.parentElement;
538 if (b) {
539 return b;
540 }
541 a = a.parentNode;
542 if (!a) {
543 return null;
544 }
545 switch(a.nodeType) {
546 case Node.ELEMENT_NODE:
547 return a;
548 case Node.DOCUMENT_FRAGMENT_NODE:
549 return a.host;
550 default:
551 return null;
552 }
519 }; 553 };
520 axs.utils.asElement = function(a) { 554 axs.utils.asElement = function(a) {
521 switch(a.nodeType) { 555 switch(a.nodeType) {
522 case Node.COMMENT_NODE: 556 case Node.COMMENT_NODE:
523 return null; 557 return null;
524 case Node.ELEMENT_NODE: 558 case Node.ELEMENT_NODE:
525 if("script" == a.tagName.toLowerCase()) { 559 if ("script" == a.tagName.toLowerCase()) {
526 return null 560 return null;
527 } 561 }
528 break; 562 break;
529 case Node.TEXT_NODE: 563 case Node.TEXT_NODE:
530 a = a.parentElement; 564 a = axs.utils.parentElement(a);
531 break; 565 break;
532 default: 566 default:
533 return console.warn("Unhandled node type: ", a.nodeType), null 567 return console.warn("Unhandled node type: ", a.nodeType), null;
534 } 568 }
535 return a 569 return a;
536 }; 570 };
537 axs.utils.elementIsTransparent = function(a) { 571 axs.utils.elementIsTransparent = function(a) {
538 return"0" == a.style.opacity 572 return "0" == a.style.opacity;
539 }; 573 };
540 axs.utils.elementHasZeroArea = function(a) { 574 axs.utils.elementHasZeroArea = function(a) {
541 a = a.getBoundingClientRect(); 575 a = a.getBoundingClientRect();
542 var b = a.top - a.bottom; 576 var b = a.top - a.bottom;
543 return a.right - a.left && b ? !1 : !0 577 return a.right - a.left && b ? !1 : !0;
544 }; 578 };
545 axs.utils.elementIsOutsideScrollArea = function(a) { 579 axs.utils.elementIsOutsideScrollArea = function(a) {
546 a = a.getBoundingClientRect(); 580 for (var b = axs.utils.parentElement(a), c = a.ownerDocument.defaultView;b != c.document.body;) {
547 var b = document.body.scrollWidth, c = document.body.scrollTop, d = document.b ody.scrollLeft; 581 if (axs.utils.isClippedBy(a, b)) {
548 return a.top >= document.body.scrollHeight || a.bottom <= -c || a.left >= b || a.right <= -d ? !0 : !1 582 return!0;
583 }
584 if (axs.utils.canScrollTo(a, b) && !axs.utils.elementIsOutsideScrollArea(b)) {
585 return!1;
586 }
587 b = axs.utils.parentElement(b);
588 }
589 return!axs.utils.canScrollTo(a, c.document.body);
590 };
591 axs.utils.canScrollTo = function(a, b) {
592 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;
593 if (c.right < f - b.scrollLeft || c.bottom < g || c.left > h || c.top > e) {
594 return!1;
595 }
596 f = a.ownerDocument.defaultView;
597 g = f.getComputedStyle(b);
598 return c.left > d.right || c.top > d.bottom ? "scroll" == g.overflow || "auto" == g.overflow || b instanceof f.HTMLBodyElement : !0;
599 };
600 axs.utils.isClippedBy = function(a, b) {
601 var c = a.getBoundingClientRect(), d = b.getBoundingClientRect(), e = d.top - b.scrollTop, f = d.left - b.scrollLeft, g = a.ownerDocument.defaultView.getCompu tedStyle(b);
602 return(c.right < d.left || c.bottom < d.top || c.left > d.right || c.top > d.b ottom) && "hidden" == g.overflow ? !0 : c.right < f || c.bottom < e ? "visible" != g.overflow : !1;
549 }; 603 };
550 axs.utils.isAncestor = function(a, b) { 604 axs.utils.isAncestor = function(a, b) {
551 return null == b ? !1 : b === a ? !0 : axs.utils.isAncestor(a, b.parentNode) 605 return null == b ? !1 : b === a ? !0 : axs.utils.isAncestor(a, b.parentNode);
552 }; 606 };
553 axs.utils.overlappingElements = function(a) { 607 axs.utils.overlappingElements = function(a) {
554 if(axs.utils.elementHasZeroArea(a)) { 608 if (axs.utils.elementHasZeroArea(a)) {
555 return null 609 return null;
556 } 610 }
557 for(var b = [], c = a.getClientRects(), d = 0;d < c.length;d++) { 611 for (var b = [], c = a.getClientRects(), d = 0;d < c.length;d++) {
558 var e = c[d], e = document.elementFromPoint((e.left + e.right) / 2, (e.top + e.bottom) / 2); 612 var e = c[d], e = document.elementFromPoint((e.left + e.right) / 2, (e.top + e.bottom) / 2);
559 if(null != e && e != a && !axs.utils.isAncestor(e, a) && !axs.utils.isAncest or(a, e)) { 613 if (null != e && e != a && !axs.utils.isAncestor(e, a) && !axs.utils.isAnces tor(a, e)) {
560 var f = window.getComputedStyle(e, null); 614 var f = window.getComputedStyle(e, null);
561 f && (f = axs.utils.getBgColor(f, e)) && 0 < f.alpha && 0 > b.indexOf(e) & & b.push(e) 615 f && (f = axs.utils.getBgColor(f, e)) && 0 < f.alpha && 0 > b.indexOf(e) & & b.push(e);
562 } 616 }
563 } 617 }
564 return b 618 return b;
565 }; 619 };
566 axs.utils.elementIsHtmlControl = function(a) { 620 axs.utils.elementIsHtmlControl = function(a) {
567 var b = a.ownerDocument.defaultView; 621 var b = a.ownerDocument.defaultView;
568 return a instanceof b.HTMLButtonElement || a instanceof b.HTMLInputElement || a instanceof b.HTMLSelectElement || a instanceof b.HTMLTextAreaElement ? !0 : !1 622 return a instanceof b.HTMLButtonElement || a instanceof b.HTMLInputElement || a instanceof b.HTMLSelectElement || a instanceof b.HTMLTextAreaElement ? !0 : !1 ;
569 }; 623 };
570 axs.utils.elementIsAriaWidget = function(a) { 624 axs.utils.elementIsAriaWidget = function(a) {
571 return a.hasAttribute("role") && (a = a.getAttribute("role")) && (a = axs.cons tants.ARIA_ROLES[a]) && "widget" in a.allParentRolesSet ? !0 : !1 625 return a.hasAttribute("role") && (a = a.getAttribute("role")) && (a = axs.cons tants.ARIA_ROLES[a]) && "widget" in a.allParentRolesSet ? !0 : !1;
572 }; 626 };
573 axs.utils.elementIsVisible = function(a) { 627 axs.utils.elementIsVisible = function(a) {
574 return axs.utils.elementIsTransparent(a) || axs.utils.elementHasZeroArea(a) || axs.utils.elementIsOutsideScrollArea(a) || axs.utils.overlappingElements(a).len gth ? !1 : !0 628 return axs.utils.elementIsTransparent(a) || axs.utils.elementHasZeroArea(a) || axs.utils.elementIsOutsideScrollArea(a) || axs.utils.overlappingElements(a).len gth ? !1 : !0;
575 }; 629 };
576 axs.utils.isLargeFont = function(a) { 630 axs.utils.isLargeFont = function(a) {
577 var b = a.fontSize; 631 var b = a.fontSize;
578 a = "bold" == a.fontWeight; 632 a = "bold" == a.fontWeight;
579 var c = b.match(/(\d+)px/); 633 var c = b.match(/(\d+)px/);
580 if(c) { 634 if (c) {
581 b = parseInt(c[1], 10); 635 b = parseInt(c[1], 10);
582 if(c = window.getComputedStyle(document.body, null).fontSize.match(/(\d+)px/ )) { 636 if (c = window.getComputedStyle(document.body, null).fontSize.match(/(\d+)px /)) {
583 var d = parseInt(c[1], 10), c = 1.2 * d, d = 1.5 * d 637 var d = parseInt(c[1], 10), c = 1.2 * d, d = 1.5 * d
584 }else { 638 } else {
585 c = 19.2, d = 24 639 c = 19.2, d = 24;
586 } 640 }
587 return a && b >= c || b >= d 641 return a && b >= c || b >= d;
588 } 642 }
589 if(c = b.match(/(\d+)em/)) { 643 if (c = b.match(/(\d+)em/)) {
590 return b = parseInt(c[1], 10), a && 1.2 <= b || 1.5 <= b ? !0 : !1 644 return b = parseInt(c[1], 10), a && 1.2 <= b || 1.5 <= b ? !0 : !1;
591 } 645 }
592 if(c = b.match(/(\d+)%/)) { 646 if (c = b.match(/(\d+)%/)) {
593 return b = parseInt(c[1], 10), a && 120 <= b || 150 <= b ? !0 : !1 647 return b = parseInt(c[1], 10), a && 120 <= b || 150 <= b ? !0 : !1;
594 } 648 }
595 if(c = b.match(/(\d+)pt/)) { 649 if (c = b.match(/(\d+)pt/)) {
596 if(b = parseInt(c[1], 10), a && 14 <= b || 18 <= b) { 650 if (b = parseInt(c[1], 10), a && 14 <= b || 18 <= b) {
597 return!0 651 return!0;
598 } 652 }
599 } 653 }
600 return!1 654 return!1;
601 }; 655 };
602 axs.utils.getBgColor = function(a, b) { 656 axs.utils.getBgColor = function(a, b) {
603 var c = axs.utils.parseColor(a.backgroundColor); 657 var c = axs.utils.parseColor(a.backgroundColor);
604 if(!c) { 658 if (!c) {
605 return null 659 return null;
606 } 660 }
607 1 > a.opacity && (c.alpha *= a.opacity); 661 1 > a.opacity && (c.alpha *= a.opacity);
608 if(1 > c.alpha) { 662 if (1 > c.alpha) {
609 var d = axs.utils.getParentBgColor(b); 663 var d = axs.utils.getParentBgColor(b);
610 if(null == d) { 664 if (null == d) {
611 return null 665 return null;
612 } 666 }
613 c = axs.utils.flattenColors(c, d) 667 c = axs.utils.flattenColors(c, d);
614 } 668 }
615 return c 669 return c;
616 }; 670 };
617 axs.utils.getParentBgColor = function(a) { 671 axs.utils.getParentBgColor = function(a) {
618 var b = a; 672 var b = a;
619 a = []; 673 a = [];
620 for(var c = null;b = b.parentElement;) { 674 for (var c = null;b = axs.utils.parentElement(b);) {
621 var d = window.getComputedStyle(b, null); 675 var d = window.getComputedStyle(b, null);
622 if(d) { 676 if (d) {
623 var e = axs.utils.parseColor(d.backgroundColor); 677 var e = axs.utils.parseColor(d.backgroundColor);
624 if(e && (1 > d.opacity && (e.alpha *= d.opacity), 0 != e.alpha && (a.push( e), 1 == e.alpha))) { 678 if (e && (1 > d.opacity && (e.alpha *= d.opacity), 0 != e.alpha && (a.push (e), 1 == e.alpha))) {
625 c = !0; 679 c = !0;
626 break 680 break;
627 } 681 }
628 } 682 }
629 } 683 }
630 c || a.push(new axs.utils.Color(255, 255, 255, 1)); 684 c || a.push(new axs.utils.Color(255, 255, 255, 1));
631 for(b = a.pop();a.length;) { 685 for (b = a.pop();a.length;) {
632 c = a.pop(), b = axs.utils.flattenColors(c, b) 686 c = a.pop(), b = axs.utils.flattenColors(c, b);
633 } 687 }
634 return b 688 return b;
635 }; 689 };
636 axs.utils.getFgColor = function(a, b, c) { 690 axs.utils.getFgColor = function(a, b, c) {
637 var d = axs.utils.parseColor(a.color); 691 var d = axs.utils.parseColor(a.color);
638 if(!d) { 692 if (!d) {
639 return null 693 return null;
640 } 694 }
641 1 > d.alpha && (d = axs.utils.flattenColors(d, c)); 695 1 > d.alpha && (d = axs.utils.flattenColors(d, c));
642 1 > a.opacity && (b = axs.utils.getParentBgColor(b), d.alpha *= a.opacity, d = axs.utils.flattenColors(d, b)); 696 1 > a.opacity && (b = axs.utils.getParentBgColor(b), d.alpha *= a.opacity, d = axs.utils.flattenColors(d, b));
643 return d 697 return d;
644 }; 698 };
645 axs.utils.parseColor = function(a) { 699 axs.utils.parseColor = function(a) {
646 var b = a.match(/^rgb\((\d+), (\d+), (\d+)\)$/); 700 var b = a.match(/^rgb\((\d+), (\d+), (\d+)\)$/);
647 if(b) { 701 if (b) {
648 a = parseInt(b[1], 10); 702 a = parseInt(b[1], 10);
649 var c = parseInt(b[2], 10), b = parseInt(b[3], 10), d; 703 var c = parseInt(b[2], 10), b = parseInt(b[3], 10), d;
650 return new axs.utils.Color(a, c, b, 1) 704 return new axs.utils.Color(a, c, b, 1);
651 } 705 }
652 return(b = a.match(/^rgba\((\d+), (\d+), (\d+), (\d+(\.\d+)?)\)/)) ? (d = pars eInt(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 706 return(b = a.match(/^rgba\((\d+), (\d+), (\d+), (\d+(\.\d+)?)\)/)) ? (d = pars eInt(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;
653 }; 707 };
654 axs.utils.colorChannelToString = function(a) { 708 axs.utils.colorChannelToString = function(a) {
655 a = Math.round(a); 709 a = Math.round(a);
656 return 15 >= a ? "0" + a.toString(16) : a.toString(16) 710 return 15 >= a ? "0" + a.toString(16) : a.toString(16);
657 }; 711 };
658 axs.utils.colorToString = function(a) { 712 axs.utils.colorToString = function(a) {
659 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() + ")" 713 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() + ")";
660 }; 714 };
661 axs.utils.luminanceFromContrastRatio = function(a, b, c) { 715 axs.utils.luminanceFromContrastRatio = function(a, b, c) {
662 return c ? (a + 0.05) * b - 0.05 : (a + 0.05) / b - 0.05 716 return c ? (a + .05) * b - .05 : (a + .05) / b - .05;
663 }; 717 };
664 axs.utils.translateColor = function(a, b) { 718 axs.utils.translateColor = function(a, b) {
665 var c = a[0], c = (b - c) / ((c > b ? 0 : 1) - c); 719 var c = a[0], c = (b - c) / ((c > b ? 0 : 1) - c);
666 return axs.utils.fromYCC([b, a[1] - a[1] * c, a[2] - a[2] * c]) 720 return axs.utils.fromYCC([b, a[1] - a[1] * c, a[2] - a[2] * c]);
667 }; 721 };
668 axs.utils.suggestColors = function(a, b, c, d) { 722 axs.utils.suggestColors = function(a, b, c, d) {
669 if(!axs.utils.isLowContrast(c, d, !0)) { 723 if (!axs.utils.isLowContrast(c, d, !0)) {
670 return null 724 return null;
671 } 725 }
672 var e = {}, f = axs.utils.calculateLuminance(a), g = axs.utils.calculateLumina nce(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); 726 var e = {}, f = axs.utils.calculateLuminance(a), g = axs.utils.calculateLumina nce(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 + .02, m), n = axs.utils.luminanceFromContrastRatio(f, k + .02, m), q = axs.utils.toYCC(b);
673 if(axs.utils.isLowContrast(c, d, !1) && 1 >= l && 0 <= l) { 727 if (axs.utils.isLowContrast(c, d, !1) && 1 >= l && 0 <= l) {
674 var p = axs.utils.translateColor(q, l), l = axs.utils.calculateContrastRatio (p, a); 728 var p = axs.utils.translateColor(q, l), l = axs.utils.calculateContrastRatio (p, a);
675 axs.utils.calculateLuminance(p); 729 axs.utils.calculateLuminance(p);
676 f = {}; 730 f = {};
677 f.fg = axs.utils.colorToString(p); 731 f.fg = axs.utils.colorToString(p);
678 f.bg = axs.utils.colorToString(a); 732 f.bg = axs.utils.colorToString(a);
679 f.contrast = l.toFixed(2); 733 f.contrast = l.toFixed(2);
680 e.AA = f 734 e.AA = f;
681 } 735 }
682 axs.utils.isLowContrast(c, d, !0) && 1 >= n && 0 <= n && (n = axs.utils.transl ateColor(q, n), l = axs.utils.calculateContrastRatio(n, a), f = {}, f.fg = axs.u tils.colorToString(n), f.bg = axs.utils.colorToString(a), f.contrast = l.toFixed (2), e.AAA = f); 736 axs.utils.isLowContrast(c, d, !0) && 1 >= n && 0 <= n && (n = axs.utils.transl ateColor(q, n), l = axs.utils.calculateContrastRatio(n, a), f = {}, f.fg = axs.u tils.colorToString(n), f.bg = axs.utils.colorToString(a), f.contrast = l.toFixed (2), e.AAA = f);
683 h = axs.utils.luminanceFromContrastRatio(g, h + 0.02, !m); 737 h = axs.utils.luminanceFromContrastRatio(g, h + .02, !m);
684 g = axs.utils.luminanceFromContrastRatio(g, k + 0.02, !m); 738 g = axs.utils.luminanceFromContrastRatio(g, k + .02, !m);
685 a = axs.utils.toYCC(a); 739 a = axs.utils.toYCC(a);
686 !("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.cont rast = l.toFixed(2), e.AA = f); 740 !("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.cont rast = l.toFixed(2), e.AA = f);
687 !("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.con trast = l.toFixed(2), e.AAA = f); 741 !("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.con trast = l.toFixed(2), e.AAA = f);
688 return e 742 return e;
689 }; 743 };
690 axs.utils.flattenColors = function(a, b) { 744 axs.utils.flattenColors = function(a, b) {
691 var c = a.alpha; 745 var c = a.alpha;
692 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)) 746 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));
693 }; 747 };
694 axs.utils.calculateLuminance = function(a) { 748 axs.utils.calculateLuminance = function(a) {
695 return axs.utils.toYCC(a)[0] 749 return axs.utils.toYCC(a)[0];
696 }; 750 };
697 axs.utils.RGBToYCCMatrix = function(a, b) { 751 axs.utils.RGBToYCCMatrix = function(a, b) {
698 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)]] 752 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)]];
699 }; 753 };
700 axs.utils.invert3x3Matrix = function(a) { 754 axs.utils.invert3x3Matrix = function(a) {
701 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]; 755 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];
702 a = a[2][2]; 756 a = a[2][2];
703 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))) 757 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)));
704 }; 758 };
705 axs.utils.scalarMultiplyMatrix = function(a, b) { 759 axs.utils.scalarMultiplyMatrix = function(a, b) {
706 for(var c = [[], [], []], d = 0;3 > d;d++) { 760 for (var c = [[], [], []], d = 0;3 > d;d++) {
707 for(var e = 0;3 > e;e++) { 761 for (var e = 0;3 > e;e++) {
708 c[d][e] = a[d][e] * b 762 c[d][e] = a[d][e] * b;
709 } 763 }
710 } 764 }
711 return c 765 return c;
712 }; 766 };
713 axs.utils.kR = 0.2126; 767 axs.utils.kR = .2126;
714 axs.utils.kB = 0.0722; 768 axs.utils.kB = .0722;
715 axs.utils.YCC_MATRIX = axs.utils.RGBToYCCMatrix(axs.utils.kR, axs.utils.kB); 769 axs.utils.YCC_MATRIX = axs.utils.RGBToYCCMatrix(axs.utils.kR, axs.utils.kB);
716 axs.utils.INVERTED_YCC_MATRIX = axs.utils.invert3x3Matrix(axs.utils.YCC_MATRIX); 770 axs.utils.INVERTED_YCC_MATRIX = axs.utils.invert3x3Matrix(axs.utils.YCC_MATRIX);
717 axs.utils.convertColor = function(a, b) { 771 axs.utils.convertColor = function(a, b) {
718 var c = b[0], d = b[1], e = b[2]; 772 var c = b[0], d = b[1], e = b[2];
719 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] 773 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];
720 }; 774 };
721 axs.utils.multiplyMatrices = function(a, b) { 775 axs.utils.multiplyMatrices = function(a, b) {
722 for(var c = [[], [], []], d = 0;3 > d;d++) { 776 for (var c = [[], [], []], d = 0;3 > d;d++) {
723 for(var e = 0;3 > e;e++) { 777 for (var e = 0;3 > e;e++) {
724 c[d][e] = a[d][0] * b[0][e] + a[d][1] * b[1][e] + a[d][2] * b[2][e] 778 c[d][e] = a[d][0] * b[0][e] + a[d][1] * b[1][e] + a[d][2] * b[2][e];
725 } 779 }
726 } 780 }
727 return c 781 return c;
728 }; 782 };
729 axs.utils.toYCC = function(a) { 783 axs.utils.toYCC = function(a) {
730 var b = a.red / 255, c = a.green / 255; 784 var b = a.red / 255, c = a.green / 255;
731 a = a.blue / 255; 785 a = a.blue / 255;
732 b = 0.03928 >= b ? b / 12.92 : Math.pow((b + 0.055) / 1.055, 2.4); 786 b = .03928 >= b ? b / 12.92 : Math.pow((b + .055) / 1.055, 2.4);
733 c = 0.03928 >= c ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4); 787 c = .03928 >= c ? c / 12.92 : Math.pow((c + .055) / 1.055, 2.4);
734 a = 0.03928 >= a ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4); 788 a = .03928 >= a ? a / 12.92 : Math.pow((a + .055) / 1.055, 2.4);
735 return axs.utils.convertColor(axs.utils.YCC_MATRIX, [b, c, a]) 789 return axs.utils.convertColor(axs.utils.YCC_MATRIX, [b, c, a]);
736 }; 790 };
737 axs.utils.fromYCC = function(a) { 791 axs.utils.fromYCC = function(a) {
738 var b = axs.utils.convertColor(axs.utils.INVERTED_YCC_MATRIX, a), c = b[0]; 792 var b = axs.utils.convertColor(axs.utils.INVERTED_YCC_MATRIX, a), c = b[0];
739 a = b[1]; 793 a = b[1];
740 b = b[2]; 794 b = b[2];
741 c = 0.00303949 >= c ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055; 795 c = .00303949 >= c ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - .055;
742 a = 0.00303949 >= a ? 12.92 * a : 1.055 * Math.pow(a, 1 / 2.4) - 0.055; 796 a = .00303949 >= a ? 12.92 * a : 1.055 * Math.pow(a, 1 / 2.4) - .055;
743 b = 0.00303949 >= b ? 12.92 * b : 1.055 * Math.pow(b, 1 / 2.4) - 0.055; 797 b = .00303949 >= b ? 12.92 * b : 1.055 * Math.pow(b, 1 / 2.4) - .055;
744 c = Math.min(Math.max(Math.round(255 * c), 0), 255); 798 c = Math.min(Math.max(Math.round(255 * c), 0), 255);
745 a = Math.min(Math.max(Math.round(255 * a), 0), 255); 799 a = Math.min(Math.max(Math.round(255 * a), 0), 255);
746 b = Math.min(Math.max(Math.round(255 * b), 0), 255); 800 b = Math.min(Math.max(Math.round(255 * b), 0), 255);
747 return new axs.utils.Color(c, a, b, 1) 801 return new axs.utils.Color(c, a, b, 1);
748 }; 802 };
749 axs.utils.scalarMultiplyMatrix = function(a, b) { 803 axs.utils.scalarMultiplyMatrix = function(a, b) {
750 for(var c = [[], [], []], d = 0;3 > d;d++) { 804 for (var c = [[], [], []], d = 0;3 > d;d++) {
751 for(var e = 0;3 > e;e++) { 805 for (var e = 0;3 > e;e++) {
752 c[d][e] = a[d][e] * b 806 c[d][e] = a[d][e] * b;
753 } 807 }
754 } 808 }
755 return c 809 return c;
756 }; 810 };
757 axs.utils.multiplyMatrices = function(a, b) { 811 axs.utils.multiplyMatrices = function(a, b) {
758 for(var c = [[], [], []], d = 0;3 > d;d++) { 812 for (var c = [[], [], []], d = 0;3 > d;d++) {
759 for(var e = 0;3 > e;e++) { 813 for (var e = 0;3 > e;e++) {
760 c[d][e] = a[d][0] * b[0][e] + a[d][1] * b[1][e] + a[d][2] * b[2][e] 814 c[d][e] = a[d][0] * b[0][e] + a[d][1] * b[1][e] + a[d][2] * b[2][e];
761 } 815 }
762 } 816 }
763 return c 817 return c;
764 }; 818 };
765 axs.utils.getContrastRatioForElement = function(a) { 819 axs.utils.getContrastRatioForElement = function(a) {
766 var b = window.getComputedStyle(a, null); 820 var b = window.getComputedStyle(a, null);
767 return axs.utils.getContrastRatioForElementWithComputedStyle(b, a) 821 return axs.utils.getContrastRatioForElementWithComputedStyle(b, a);
768 }; 822 };
769 axs.utils.getContrastRatioForElementWithComputedStyle = function(a, b) { 823 axs.utils.getContrastRatioForElementWithComputedStyle = function(a, b) {
770 if(axs.utils.isElementHidden(b)) { 824 if (axs.utils.isElementHidden(b)) {
771 return null 825 return null;
772 } 826 }
773 var c = axs.utils.getBgColor(a, b); 827 var c = axs.utils.getBgColor(a, b);
774 if(!c) { 828 if (!c) {
775 return null 829 return null;
776 } 830 }
777 var d = axs.utils.getFgColor(a, b, c); 831 var d = axs.utils.getFgColor(a, b, c);
778 return d ? axs.utils.calculateContrastRatio(d, c) : null 832 return d ? axs.utils.calculateContrastRatio(d, c) : null;
779 }; 833 };
780 axs.utils.isNativeTextElement = function(a) { 834 axs.utils.isNativeTextElement = function(a) {
781 var b = a.tagName.toLowerCase(); 835 var b = a.tagName.toLowerCase();
782 a = a.type ? a.type.toLowerCase() : ""; 836 a = a.type ? a.type.toLowerCase() : "";
783 if("textarea" == b) { 837 if ("textarea" == b) {
784 return!0 838 return!0;
785 } 839 }
786 if("input" != b) { 840 if ("input" != b) {
787 return!1 841 return!1;
788 } 842 }
789 switch(a) { 843 switch(a) {
790 case "email": 844 case "email":
791 ; 845 ;
792 case "number": 846 case "number":
793 ; 847 ;
794 case "password": 848 case "password":
795 ; 849 ;
796 case "search": 850 case "search":
797 ; 851 ;
798 case "text": 852 case "text":
799 ; 853 ;
800 case "tel": 854 case "tel":
801 ; 855 ;
802 case "url": 856 case "url":
803 ; 857 ;
804 case "": 858 case "":
805 return!0; 859 return!0;
806 default: 860 default:
807 return!1 861 return!1;
808 } 862 }
809 }; 863 };
810 axs.utils.isLowContrast = function(a, b, c) { 864 axs.utils.isLowContrast = function(a, b, c) {
811 a = Math.round(10 * a) / 10; 865 a = Math.round(10 * a) / 10;
812 return c ? 4.5 > a || !axs.utils.isLargeFont(b) && 7 > a : 3 > a || !axs.utils .isLargeFont(b) && 4.5 > a 866 return c ? 4.5 > a || !axs.utils.isLargeFont(b) && 7 > a : 3 > a || !axs.utils .isLargeFont(b) && 4.5 > a;
813 }; 867 };
814 axs.utils.hasLabel = function(a) { 868 axs.utils.hasLabel = function(a) {
815 var b = a.tagName.toLowerCase(), c = a.type ? a.type.toLowerCase() : ""; 869 var b = a.tagName.toLowerCase(), c = a.type ? a.type.toLowerCase() : "";
816 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-labelled by") || axs.utils.isNativeTextElement(a) && a.hasAttribute("placeholder") || a.h asAttribute("id") && 0 < document.querySelectorAll('label[for="' + a.id + '"]'). length) { 870 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-labelle dby") || axs.utils.isNativeTextElement(a) && a.hasAttribute("placeholder") || a. hasAttribute("id") && 0 < document.querySelectorAll('label[for="' + a.id + '"]') .length) {
817 return!0 871 return!0;
818 } 872 }
819 for(b = a.parentElement;b;) { 873 for (b = axs.utils.parentElement(a);b;) {
820 if("label" == b.tagName.toLowerCase() && b.control == a) { 874 if ("label" == b.tagName.toLowerCase() && b.control == a) {
821 return!0 875 return!0;
822 } 876 }
823 b = b.parentElement 877 b = axs.utils.parentElement(b);
824 } 878 }
825 return!1 879 return!1;
826 }; 880 };
827 axs.utils.isElementHidden = function(a) { 881 axs.utils.isElementHidden = function(a) {
828 if(!(a instanceof a.ownerDocument.defaultView.HTMLElement)) { 882 if (!(a instanceof a.ownerDocument.defaultView.HTMLElement)) {
829 return!1 883 return!1;
830 } 884 }
831 if(a.hasAttribute("chromevoxignoreariahidden")) { 885 if (a.hasAttribute("chromevoxignoreariahidden")) {
832 var b = !0 886 var b = !0
833 } 887 }
834 var c = window.getComputedStyle(a, null); 888 var c = window.getComputedStyle(a, null);
835 return"none" == c.display || "hidden" == c.visibility ? !0 : a.hasAttribute("a ria-hidden") && "true" == a.getAttribute("aria-hidden").toLowerCase() ? !b : !1 889 return "none" == c.display || "hidden" == c.visibility ? !0 : a.hasAttribute(" aria-hidden") && "true" == a.getAttribute("aria-hidden").toLowerCase() ? !b : !1 ;
836 }; 890 };
837 axs.utils.isElementOrAncestorHidden = function(a) { 891 axs.utils.isElementOrAncestorHidden = function(a) {
838 return axs.utils.isElementHidden(a) ? !0 : a.parentElement ? axs.utils.isEleme ntOrAncestorHidden(a.parentElement) : !1 892 return axs.utils.isElementHidden(a) ? !0 : axs.utils.parentElement(a) ? axs.ut ils.isElementOrAncestorHidden(axs.utils.parentElement(a)) : !1;
839 }; 893 };
840 axs.utils.isInlineElement = function(a) { 894 axs.utils.isInlineElement = function(a) {
841 a = a.tagName.toUpperCase(); 895 a = a.tagName.toUpperCase();
842 return axs.constants.InlineElements[a] 896 return axs.constants.InlineElements[a];
843 }; 897 };
844 axs.utils.getRoles = function(a) { 898 axs.utils.getRoles = function(a) {
845 if(!a.hasAttribute("role")) { 899 if (!a.hasAttribute("role")) {
846 return!1 900 return!1;
847 } 901 }
848 a = a.getAttribute("role").split(" "); 902 a = a.getAttribute("role").split(" ");
849 for(var b = [], c = !0, d = 0;d < a.length;d++) { 903 for (var b = [], c = !0, d = 0;d < a.length;d++) {
850 var e = a[d]; 904 var e = a[d];
851 axs.constants.ARIA_ROLES[e] ? b.push({name:e, details:axs.constants.ARIA_ROL ES[e], valid:!0}) : (b.push({name:e, valid:!1}), c = !1) 905 axs.constants.ARIA_ROLES[e] ? b.push({name:e, details:axs.constants.ARIA_ROL ES[e], valid:!0}) : (b.push({name:e, valid:!1}), c = !1);
852 } 906 }
853 return{roles:b, valid:c} 907 return{roles:b, valid:c};
854 }; 908 };
855 axs.utils.getAriaPropertyValue = function(a, b, c) { 909 axs.utils.getAriaPropertyValue = function(a, b, c) {
856 var d = a.replace(/^aria-/, ""), e = axs.constants.ARIA_PROPERTIES[d], d = {na me:a, rawValue:b}; 910 var d = a.replace(/^aria-/, ""), e = axs.constants.ARIA_PROPERTIES[d], d = {na me:a, rawValue:b};
857 if(!e) { 911 if (!e) {
858 return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property', d 912 return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property', d;
859 } 913 }
860 e = e.valueType; 914 e = e.valueType;
861 if(!e) { 915 if (!e) {
862 return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property', d 916 return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property', d;
863 } 917 }
864 switch(e) { 918 switch(e) {
865 case "idref": 919 case "idref":
866 a = axs.utils.isValidIDRefValue(b, c), d.valid = a.valid, d.reason = a.rea son, d.idref = a.idref; 920 a = axs.utils.isValidIDRefValue(b, c), d.valid = a.valid, d.reason = a.rea son, d.idref = a.idref;
867 case "idref_list": 921 case "idref_list":
868 a = b.split(/\s+/); 922 a = b.split(/\s+/);
869 d.valid = !0; 923 d.valid = !0;
870 for(b = 0;b < a.length;b++) { 924 for (b = 0;b < a.length;b++) {
871 e = axs.utils.isValidIDRefValue(a[b], c), e.valid || (d.valid = !1), d.v alues ? d.values.push(e) : d.values = [e] 925 e = axs.utils.isValidIDRefValue(a[b], c), e.valid || (d.valid = !1), d.v alues ? d.values.push(e) : d.values = [e];
872 } 926 }
873 return d; 927 return d;
874 case "integer": 928 case "integer":
875 ; 929 ;
876 case "decimal": 930 case "decimal":
877 c = axs.utils.isValidNumber(b); 931 c = axs.utils.isValidNumber(b);
878 if(!c.valid) { 932 if (!c.valid) {
879 return d.valid = !1, d.reason = c.reason, d 933 return d.valid = !1, d.reason = c.reason, d;
880 } 934 }
881 Math.floor(c.value) != c.value ? (d.valid = !1, d.reason = "" + b + " is n ot a whole integer") : (d.valid = !0, d.value = c.value); 935 Math.floor(c.value) != c.value ? (d.valid = !1, d.reason = "" + b + " is n ot a whole integer") : (d.valid = !0, d.value = c.value);
882 return d; 936 return d;
883 case "number": 937 case "number":
884 c = axs.utils.isValidNumber(b), c.valid && (d.valid = !0, d.value = c.valu e); 938 c = axs.utils.isValidNumber(b), c.valid && (d.valid = !0, d.value = c.valu e);
885 case "string": 939 case "string":
886 return d.valid = !0, d.value = b, d; 940 return d.valid = !0, d.value = b, d;
887 case "token": 941 case "token":
888 return c = axs.utils.isValidTokenValue(a, b.toLowerCase()), c.valid ? (d.v alid = !0, d.value = c.value) : (d.valid = !1, d.value = b, d.reason = c.reason) , d; 942 return c = axs.utils.isValidTokenValue(a, b.toLowerCase()), c.valid ? (d.v alid = !0, d.value = c.value) : (d.valid = !1, d.value = b, d.reason = c.reason) , d;
889 case "token_list": 943 case "token_list":
890 e = b.split(/\s+/); 944 e = b.split(/\s+/);
891 d.valid = !0; 945 d.valid = !0;
892 for(b = 0;b < e.length;b++) { 946 for (b = 0;b < e.length;b++) {
893 c = axs.utils.isValidTokenValue(a, e[b].toLowerCase()), c.valid || (d.va lid = !1, d.reason ? (d.reason = [d.reason], d.reason.push(c.reason)) : (d.reaso n = c.reason, d.possibleValues = c.possibleValues)), d.values ? d.values.push(c. value) : d.values = [c.value] 947 c = axs.utils.isValidTokenValue(a, e[b].toLowerCase()), c.valid || (d.va lid = !1, d.reason ? (d.reason = [d.reason], d.reason.push(c.reason)) : (d.reaso n = c.reason, d.possibleValues = c.possibleValues)), d.values ? d.values.push(c. value) : d.values = [c.value];
894 } 948 }
895 return d; 949 return d;
896 case "tristate": 950 case "tristate":
897 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; 951 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;
898 case "boolean": 952 case "boolean":
899 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 953 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;
900 } 954 }
901 d.valid = !1; 955 d.valid = !1;
902 d.reason = "Not a valid ARIA property"; 956 d.reason = "Not a valid ARIA property";
903 return d 957 return d;
904 }; 958 };
905 axs.utils.isValidTokenValue = function(a, b) { 959 axs.utils.isValidTokenValue = function(a, b) {
906 var c = a.replace(/^aria-/, ""); 960 var c = a.replace(/^aria-/, "");
907 return axs.utils.isPossibleValue(b, axs.constants.ARIA_PROPERTIES[c].valuesSet , a) 961 return axs.utils.isPossibleValue(b, axs.constants.ARIA_PROPERTIES[c].valuesSet , a);
908 }; 962 };
909 axs.utils.isPossibleValue = function(a, b, c) { 963 axs.utils.isPossibleValue = function(a, b, c) {
910 return b[a] ? {valid:!0, value:a} : {valid:!1, value:a, reason:'"' + a + '" is not a valid value for ' + c, possibleValues:Object.keys(b)} 964 return b[a] ? {valid:!0, value:a} : {valid:!1, value:a, reason:'"' + a + '" is not a valid value for ' + c, possibleValues:Object.keys(b)};
911 }; 965 };
912 axs.utils.isValidBoolean = function(a) { 966 axs.utils.isValidBoolean = function(a) {
913 try { 967 try {
914 var b = JSON.parse(a) 968 var b = JSON.parse(a);
915 }catch(c) { 969 } catch (c) {
916 b = "" 970 b = "";
917 } 971 }
918 return"boolean" != typeof b ? {valid:!1, value:a, reason:'"' + a + '" is not a true/false value'} : {valid:!0, value:b} 972 return "boolean" != typeof b ? {valid:!1, value:a, reason:'"' + a + '" is not a true/false value'} : {valid:!0, value:b};
919 }; 973 };
920 axs.utils.isValidIDRefValue = function(a, b) { 974 axs.utils.isValidIDRefValue = function(a, b) {
921 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 + '"'} 975 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 + '"'};
922 }; 976 };
923 axs.utils.isValidNumber = function(a) { 977 axs.utils.isValidNumber = function(a) {
924 try { 978 try {
925 var b = JSON.parse(a) 979 var b = JSON.parse(a);
926 }catch(c) { 980 } catch (c) {
927 return{valid:!1, value:a, reason:'"' + a + '" is not a number'} 981 return{valid:!1, value:a, reason:'"' + a + '" is not a number'};
928 } 982 }
929 return"number" != typeof b ? {valid:!1, value:a, reason:'"' + a + '" is not a number'} : {valid:!0, value:b} 983 return "number" != typeof b ? {valid:!1, value:a, reason:'"' + a + '" is not a number'} : {valid:!0, value:b};
930 }; 984 };
931 axs.utils.isElementImplicitlyFocusable = function(a) { 985 axs.utils.isElementImplicitlyFocusable = function(a) {
932 var b = a.ownerDocument.defaultView; 986 var b = a.ownerDocument.defaultView;
933 return a instanceof b.HTMLAnchorElement || a instanceof b.HTMLAreaElement ? a. hasAttribute("href") : a instanceof b.HTMLInputElement || a instanceof b.HTMLSel ectElement || a instanceof b.HTMLTextAreaElement || a instanceof b.HTMLButtonEle ment || a instanceof b.HTMLIFrameElement ? !a.disabled : !1 987 return a instanceof b.HTMLAnchorElement || a instanceof b.HTMLAreaElement ? a. hasAttribute("href") : a instanceof b.HTMLInputElement || a instanceof b.HTMLSel ectElement || a instanceof b.HTMLTextAreaElement || a instanceof b.HTMLButtonEle ment || a instanceof b.HTMLIFrameElement ? !a.disabled : !1;
934 }; 988 };
935 axs.utils.values = function(a) { 989 axs.utils.values = function(a) {
936 var b = [], c; 990 var b = [], c;
937 for(c in a) { 991 for (c in a) {
938 a.hasOwnProperty(c) && "function" != typeof a[c] && b.push(a[c]) 992 a.hasOwnProperty(c) && "function" != typeof a[c] && b.push(a[c]);
939 } 993 }
940 return b 994 return b;
941 }; 995 };
942 axs.utils.namedValues = function(a) { 996 axs.utils.namedValues = function(a) {
943 var b = {}, c; 997 var b = {}, c;
944 for(c in a) { 998 for (c in a) {
945 a.hasOwnProperty(c) && "function" != typeof a[c] && (b[c] = a[c]) 999 a.hasOwnProperty(c) && "function" != typeof a[c] && (b[c] = a[c]);
946 } 1000 }
947 return b 1001 return b;
948 }; 1002 };
949 axs.utils.getQuerySelectorText = function(a) { 1003 axs.utils.getQuerySelectorText = function(a) {
950 if(null == a || "HTML" == a.tagName) { 1004 if (null == a || "HTML" == a.tagName) {
951 return"html" 1005 return "html";
952 } 1006 }
953 if("BODY" == a.tagName) { 1007 if ("BODY" == a.tagName) {
954 return"body" 1008 return "body";
955 } 1009 }
956 if(a.hasAttribute) { 1010 if (a.hasAttribute) {
957 if(a.id) { 1011 if (a.id) {
958 return"#" + a.id 1012 return "#" + a.id;
959 } 1013 }
960 if(a.className) { 1014 if (a.className) {
961 for(var b = "", c = 0;c < a.classList.length;c++) { 1015 for (var b = "", c = 0;c < a.classList.length;c++) {
962 b += "." + a.classList[c] 1016 b += "." + a.classList[c];
963 } 1017 }
964 var d = 0; 1018 var d = 0;
965 if(a.parentNode) { 1019 if (a.parentNode) {
966 for(c = 0;c < a.parentNode.children.length;c++) { 1020 for (c = 0;c < a.parentNode.children.length;c++) {
967 var e = a.parentNode.children[c]; 1021 var e = a.parentNode.children[c];
968 axs.browserUtils.matchSelector(e, b) && d++; 1022 axs.browserUtils.matchSelector(e, b) && d++;
969 if(e === a) { 1023 if (e === a) {
970 break 1024 break;
971 } 1025 }
972 } 1026 }
973 }else { 1027 } else {
974 d = 1 1028 d = 1;
975 } 1029 }
976 return 1 == d ? axs.utils.getQuerySelectorText(a.parentNode) + " > " + b : axs.utils.getQuerySelectorText(a.parentNode) + " > " + b + ":nth-of-type(" + d + ")" 1030 return 1 == d ? axs.utils.getQuerySelectorText(a.parentNode) + " > " + b : axs.utils.getQuerySelectorText(a.parentNode) + " > " + b + ":nth-of-type(" + d + ")";
977 } 1031 }
978 if(a.parentNode) { 1032 if (a.parentNode) {
979 b = a.parentNode.children; 1033 b = a.parentNode.children;
980 d = 1; 1034 d = 1;
981 for(c = 0;b[c] !== a;) { 1035 for (c = 0;b[c] !== a;) {
982 b[c].tagName == a.tagName && d++, c++ 1036 b[c].tagName == a.tagName && d++, c++;
983 } 1037 }
984 c = ""; 1038 c = "";
985 "BODY" != a.parentNode.tagName && (c = axs.utils.getQuerySelectorText(a.pa rentNode) + " > "); 1039 "BODY" != a.parentNode.tagName && (c = axs.utils.getQuerySelectorText(a.pa rentNode) + " > ");
986 return 1 == d ? c + a.tagName : c + a.tagName + ":nth-of-type(" + d + ")" 1040 return 1 == d ? c + a.tagName : c + a.tagName + ":nth-of-type(" + d + ")";
987 } 1041 }
988 }else { 1042 } else {
989 if(a.selectorText) { 1043 if (a.selectorText) {
990 return a.selectorText 1044 return a.selectorText;
991 } 1045 }
992 } 1046 }
993 return"" 1047 return "";
994 }; 1048 };
995 axs.properties = {}; 1049 axs.properties = {};
996 axs.properties.TEXT_CONTENT_XPATH = './/text()[normalize-space(.)!=""]/parent::* [name()!="script"]'; 1050 axs.properties.TEXT_CONTENT_XPATH = './/text()[normalize-space(.)!=""]/parent::* [name()!="script"]';
997 axs.properties.getFocusProperties = function(a) { 1051 axs.properties.getFocusProperties = function(a) {
998 var b = {}, c = a.getAttribute("tabindex"); 1052 var b = {}, c = a.getAttribute("tabindex");
999 void 0 != c ? b.tabindex = {value:c, valid:!0} : axs.utils.isElementImplicitly Focusable(a) && (b.implicitlyFocusable = {value:!0, valid:!0}); 1053 void 0 != c ? b.tabindex = {value:c, valid:!0} : axs.utils.isElementImplicitly Focusable(a) && (b.implicitlyFocusable = {value:!0, valid:!0});
1000 if(0 == Object.keys(b).length) { 1054 if (0 == Object.keys(b).length) {
1001 return null 1055 return null;
1002 } 1056 }
1003 var c = axs.utils.elementIsTransparent(a), d = axs.utils.elementHasZeroArea(a) , e = axs.utils.elementIsOutsideScrollArea(a), f = axs.utils.overlappingElements (a); 1057 var d = axs.utils.elementIsTransparent(a), e = axs.utils.elementHasZeroArea(a) , f = axs.utils.elementIsOutsideScrollArea(a), g = axs.utils.overlappingElements (a);
1004 if(c || d || e || 0 < f.length) { 1058 if (d || e || f || 0 < g.length) {
1005 var g = axs.utils.isElementOrAncestorHidden(a), h = {value:!1, valid:g}; 1059 var c = axs.utils.isElementOrAncestorHidden(a), h = {value:!1, valid:c};
1006 c && (h.transparent = !0); 1060 d && (h.transparent = !0);
1007 d && (h.zeroArea = !0); 1061 e && (h.zeroArea = !0);
1008 e && (h.outsideScrollArea = !0); 1062 f && (h.outsideScrollArea = !0);
1009 0 < f.length && (h.overlappingElements = f); 1063 g && 0 < g.length && (h.overlappingElements = g);
1010 h.hidden = {value:g, reason:axs.properties.getHiddenReason(a), valid:g}; 1064 d = {value:c, valid:c};
1011 b.visible = h 1065 c && (d.reason = axs.properties.getHiddenReason(a));
1012 }else { 1066 h.hidden = d;
1013 b.visible = {value:!0, valid:!0} 1067 b.visible = h;
1014 } 1068 } else {
1015 return b 1069 b.visible = {value:!0, valid:!0};
1070 }
1071 return b;
1016 }; 1072 };
1017 axs.properties.getHiddenReason = function(a) { 1073 axs.properties.getHiddenReason = function(a) {
1018 if(!(a && a instanceof a.ownerDocument.defaultView.HTMLElement)) { 1074 if (!(a && a instanceof a.ownerDocument.defaultView.HTMLElement)) {
1019 return null 1075 return null;
1020 } 1076 }
1021 if(a.hasAttribute("chromevoxignoreariahidden")) { 1077 if (a.hasAttribute("chromevoxignoreariahidden")) {
1022 var b = !0 1078 var b = !0
1023 } 1079 }
1024 var c = window.getComputedStyle(a, null); 1080 var c = window.getComputedStyle(a, null);
1025 return"none" == c.display ? {property:"display: none", on:a} : "hidden" == c.v isibility ? {property:"visibility: hidden", on:a} : a.hasAttribute("aria-hidden" ) && "true" == a.getAttribute("aria-hidden").toLowerCase() && !b ? {property:"ar ia-hidden", on:a} : axs.properties.getHiddenReason(a.parentElement) 1081 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:"a ria-hidden", on:a} : axs.properties.getHiddenReason(axs.utils.parentElement(a));
1026 }; 1082 };
1027 axs.properties.getColorProperties = function(a) { 1083 axs.properties.getColorProperties = function(a) {
1028 var b = {}; 1084 var b = {};
1029 (a = axs.properties.getContrastRatioProperties(a)) && (b.contrastRatio = a); 1085 (a = axs.properties.getContrastRatioProperties(a)) && (b.contrastRatio = a);
1030 return 0 == Object.keys(b).length ? null : b 1086 return 0 == Object.keys(b).length ? null : b;
1031 }; 1087 };
1032 axs.properties.hasDirectTextDescendant = function(a) { 1088 axs.properties.hasDirectTextDescendant = function(a) {
1033 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()) { 1089 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()) {
1034 if(d === a) { 1090 if (d === a) {
1035 c = !0; 1091 c = !0;
1036 break 1092 break;
1037 } 1093 }
1038 } 1094 }
1039 return c 1095 return c;
1040 }; 1096 };
1041 axs.properties.getContrastRatioProperties = function(a) { 1097 axs.properties.getContrastRatioProperties = function(a) {
1042 if(!axs.properties.hasDirectTextDescendant(a)) { 1098 if (!axs.properties.hasDirectTextDescendant(a)) {
1043 return null 1099 return null;
1044 } 1100 }
1045 var b = {}, c = window.getComputedStyle(a, null), d = axs.utils.getBgColor(c, a); 1101 var b = {}, c = window.getComputedStyle(a, null), d = axs.utils.getBgColor(c, a);
1046 if(!d) { 1102 if (!d) {
1047 return null 1103 return null;
1048 } 1104 }
1049 b.backgroundColor = axs.utils.colorToString(d); 1105 b.backgroundColor = axs.utils.colorToString(d);
1050 var e = axs.utils.getFgColor(c, a, d); 1106 var e = axs.utils.getFgColor(c, a, d);
1051 b.foregroundColor = axs.utils.colorToString(e); 1107 b.foregroundColor = axs.utils.colorToString(e);
1052 a = axs.utils.getContrastRatioForElementWithComputedStyle(c, a); 1108 a = axs.utils.getContrastRatioForElementWithComputedStyle(c, a);
1053 if(!a) { 1109 if (!a) {
1054 return null 1110 return null;
1055 } 1111 }
1056 b.value = a.toFixed(2); 1112 b.value = a.toFixed(2);
1057 axs.utils.isLowContrast(a, c) && (b.alert = !0); 1113 axs.utils.isLowContrast(a, c) && (b.alert = !0);
1058 (c = axs.utils.suggestColors(d, e, a, c)) && Object.keys(c).length && (b.sugge stedColors = c); 1114 (c = axs.utils.suggestColors(d, e, a, c)) && Object.keys(c).length && (b.sugge stedColors = c);
1059 return b 1115 return b;
1060 }; 1116 };
1061 axs.properties.findTextAlternatives = function(a, b, c) { 1117 axs.properties.findTextAlternatives = function(a, b, c, d) {
1062 var d = c || !1; 1118 var e = c || !1;
1063 c = axs.utils.asElement(a); 1119 c = axs.utils.asElement(a);
1064 if(!c || !d && axs.utils.isElementOrAncestorHidden(c)) { 1120 if (!c || !e && !d && axs.utils.isElementOrAncestorHidden(c)) {
1065 return null 1121 return null;
1066 } 1122 }
1067 if(a.nodeType == Node.TEXT_NODE) { 1123 if (a.nodeType == Node.TEXT_NODE) {
1068 return c = {type:"text"}, c.text = a.textContent, c.lastWord = axs.propertie s.getLastWord(c.text), b.content = c, a.textContent 1124 return c = {type:"text"}, c.text = a.textContent, c.lastWord = axs.propertie s.getLastWord(c.text), b.content = c, a.textContent;
1069 } 1125 }
1070 a = null; 1126 a = null;
1071 d || (a = axs.properties.getTextFromAriaLabelledby(c, b)); 1127 e || (a = axs.properties.getTextFromAriaLabelledby(c, b));
1072 if(c.hasAttribute("aria-label")) { 1128 c.hasAttribute("aria-label") && (d = {type:"text"}, d.text = c.getAttribute("a ria-label"), d.lastWord = axs.properties.getLastWord(d.text), a ? d.unused = !0 : e && axs.utils.elementIsHtmlControl(c) || (a = d.text), b.ariaLabel = d);
1073 var e = {type:"text"}; 1129 c.hasAttribute("role") && "presentation" == c.getAttribute("role") || (a = axs .properties.getTextFromHostLanguageAttributes(c, b, a, e));
1074 e.text = c.getAttribute("aria-label"); 1130 if (e && axs.utils.elementIsHtmlControl(c)) {
1075 e.lastWord = axs.properties.getLastWord(e.text); 1131 d = c.ownerDocument.defaultView;
1076 a ? e.unused = !0 : d && axs.utils.elementIsHtmlControl(c) || (a = e.text); 1132 if (c instanceof d.HTMLInputElement) {
1077 b.ariaLabel = e
1078 }
1079 c.hasAttribute("role") && "presentation" == c.getAttribute("role") || (a = axs .properties.getTextFromHostLanguageAttributes(c, b, a));
1080 if(d && axs.utils.elementIsHtmlControl(c)) {
1081 e = c.ownerDocument.defaultView;
1082 if(c instanceof e.HTMLInputElement) {
1083 var f = c; 1133 var f = c;
1084 "text" == f.type && f.value && 0 < f.value.length && (b.controlValue = {te xt:f.value}); 1134 "text" == f.type && f.value && 0 < f.value.length && (b.controlValue = {te xt:f.value});
1085 "range" == f.type && (b.controlValue = {text:f.value}) 1135 "range" == f.type && (b.controlValue = {text:f.value});
1086 } 1136 }
1087 c instanceof e.HTMLSelectElement && (b.controlValue = {text:c.value}); 1137 c instanceof d.HTMLSelectElement && (b.controlValue = {text:c.value});
1088 b.controlValue && (e = b.controlValue, a ? e.unused = !0 : a = e.text) 1138 b.controlValue && (d = b.controlValue, a ? d.unused = !0 : a = d.text);
1089 } 1139 }
1090 if(d && axs.utils.elementIsAriaWidget(c)) { 1140 if (e && axs.utils.elementIsAriaWidget(c)) {
1091 d = c.getAttribute("role"); 1141 e = c.getAttribute("role");
1092 "textbox" == d && c.textContent && 0 < c.textContent.length && (b.controlVal ue = {text:c.textContent}); 1142 "textbox" == e && c.textContent && 0 < c.textContent.length && (b.controlVal ue = {text:c.textContent});
1093 if("slider" == d || "spinbutton" == d) { 1143 if ("slider" == e || "spinbutton" == e) {
1094 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")}) 1144 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")});
1095 } 1145 }
1096 if("menu" == d) { 1146 if ("menu" == e) {
1097 for(var g = c.querySelectorAll("[role=menuitemcheckbox], [role=menuitemrad io]"), e = [], f = 0;f < g.length;f++) { 1147 var g = c.querySelectorAll("[role=menuitemcheckbox], [role=menuitemradio]" );
1098 "true" == g[f].getAttribute("aria-checked") && e.push(g[f]) 1148 d = [];
1099 } 1149 for (f = 0;f < g.length;f++) {
1100 if(0 < e.length) { 1150 "true" == g[f].getAttribute("aria-checked") && d.push(g[f]);
1151 }
1152 if (0 < d.length) {
1101 g = ""; 1153 g = "";
1102 for(f = 0;f < e.length;f++) { 1154 for (f = 0;f < d.length;f++) {
1103 g += axs.properties.findTextAlternatives(e[f], {}, !0), f < e.length - 1 && (g += ", ") 1155 g += axs.properties.findTextAlternatives(d[f], {}, !0), f < d.length - 1 && (g += ", ");
1104 } 1156 }
1105 b.controlValue = {text:g} 1157 b.controlValue = {text:g};
1106 } 1158 }
1107 } 1159 }
1108 if("combobox" == d || "select" == d) { 1160 if ("combobox" == e || "select" == e) {
1109 b.controlValue = {text:"TODO"} 1161 b.controlValue = {text:"TODO"};
1110 } 1162 }
1111 b.controlValue && (e = b.controlValue, a ? e.unused = !0 : a = e.text) 1163 b.controlValue && (d = b.controlValue, a ? d.unused = !0 : a = d.text);
1112 } 1164 }
1113 e = !0; 1165 d = !0;
1114 c.hasAttribute("role") && (d = c.getAttribute("role"), (d = axs.constants.ARIA _ROLES[d]) && (!d.namefrom || 0 > d.namefrom.indexOf("contents")) && (e = !1)); 1166 c.hasAttribute("role") && (e = c.getAttribute("role"), (e = axs.constants.ARIA _ROLES[e]) && (!e.namefrom || 0 > e.namefrom.indexOf("contents")) && (d = !1));
1115 (d = axs.properties.getTextFromDescendantContent(c)) && e && (e = {type:"text" }, e.text = d, e.lastWord = axs.properties.getLastWord(e.text), a ? e.unused = ! 0 : a = d, b.content = e); 1167 (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);
1116 c.hasAttribute("title") && (d = {type:"string", valid:!0}, d.text = c.getAttri bute("title"), d.lastWord = axs.properties.getLastWord(d.lastWord), a ? d.unused = !0 : a = d.text, b.title = d); 1168 c.hasAttribute("title") && (e = {type:"string", valid:!0}, e.text = c.getAttri bute("title"), e.lastWord = axs.properties.getLastWord(e.lastWord), a ? e.unused = !0 : a = e.text, b.title = e);
1117 return 0 == Object.keys(b).length && null == a ? null : a 1169 return 0 == Object.keys(b).length && null == a ? null : a;
1118 }; 1170 };
1119 axs.properties.getTextFromDescendantContent = function(a) { 1171 axs.properties.getTextFromDescendantContent = function(a) {
1120 a = a.childNodes; 1172 var b = a.childNodes;
1121 for(var b = [], c = 0;c < a.length;c++) { 1173 a = [];
1122 var d = axs.properties.findTextAlternatives(a[c], {}, !0); 1174 for (var c = 0;c < b.length;c++) {
1123 d && 0 < d.trim().length && b.push(d.trim()) 1175 var d = axs.properties.findTextAlternatives(b[c], {}, !0);
1124 } 1176 d && a.push(d.trim());
1125 return b.length ? b.join(" ") : null 1177 }
1178 if (a.length) {
1179 b = "";
1180 for (c = 0;c < a.length;c++) {
1181 b = [b, a[c]].join(" ").trim();
1182 }
1183 return b;
1184 }
1185 return null;
1126 }; 1186 };
1127 axs.properties.getTextFromAriaLabelledby = function(a, b) { 1187 axs.properties.getTextFromAriaLabelledby = function(a, b) {
1128 var c = null; 1188 var c = null;
1129 if(!a.hasAttribute("aria-labelledby")) { 1189 if (!a.hasAttribute("aria-labelledby")) {
1130 return c 1190 return c;
1131 } 1191 }
1132 for(var d = a.getAttribute("aria-labelledby").split(/\s+/), e = {valid:!0}, f = [], g = [], h = 0;h < d.length;h++) { 1192 for (var d = a.getAttribute("aria-labelledby").split(/\s+/), e = {valid:!0}, f = [], g = [], h = 0;h < d.length;h++) {
1133 var k = {type:"element"}, m = d[h]; 1193 var k = {type:"element"}, m = d[h];
1134 k.value = m; 1194 k.value = m;
1135 var l = document.getElementById(m); 1195 var l = document.getElementById(m);
1136 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:"noEle mentWithId", args:[m]}); 1196 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:"noEle mentWithId", args:[m]});
1137 g.push(k) 1197 g.push(k);
1138 } 1198 }
1139 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); 1199 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);
1140 return c 1200 return c;
1141 }; 1201 };
1142 axs.properties.getTextFromHostLanguageAttributes = function(a, b, c) { 1202 axs.properties.getTextFromHostLanguageAttributes = function(a, b, c, d) {
1143 if(axs.browserUtils.matchSelector(a, "img")) { 1203 if (axs.browserUtils.matchSelector(a, "img")) {
1144 if(a.hasAttribute("alt")) { 1204 if (a.hasAttribute("alt")) {
1145 var d = {type:"string", valid:!0}; 1205 var e = {type:"string", valid:!0};
1146 d.text = a.getAttribute("alt"); 1206 e.text = a.getAttribute("alt");
1147 c ? d.unused = !0 : c = d.text; 1207 c ? e.unused = !0 : c = e.text;
1148 b.alt = d 1208 b.alt = e;
1149 }else { 1209 } else {
1150 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}) 1210 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});
1151 } 1211 }
1152 } 1212 }
1153 if(axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disabled ]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), vi deo:not([disabled])')) { 1213 if (axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disable d]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), v ideo:not([disabled])') && !d) {
1154 if(a.hasAttribute("id")) { 1214 if (a.hasAttribute("id")) {
1155 for(var d = document.querySelectorAll('label[for="' + a.id + '"]'), e = {} , f = [], g = [], h = 0;h < d.length;h++) { 1215 d = document.querySelectorAll('label[for="' + a.id + '"]');
1216 for (var e = {}, f = [], g = [], h = 0;h < d.length;h++) {
1156 var k = {type:"element"}, m = d[h], l = axs.properties.findTextAlternati ves(m, {}, !0); 1217 var k = {type:"element"}, m = d[h], l = axs.properties.findTextAlternati ves(m, {}, !0);
1157 l && 0 < l.trim().length && (k.text = l.trim(), g.push(l.trim())); 1218 l && 0 < l.trim().length && (k.text = l.trim(), g.push(l.trim()));
1158 k.element = m; 1219 k.element = m;
1159 f.push(k) 1220 f.push(k);
1160 } 1221 }
1161 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) 1222 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);
1162 } 1223 }
1163 d = a.parentElement; 1224 d = axs.utils.parentElement(a);
1164 for(e = {};d;) { 1225 for (e = {};d;) {
1165 if("label" == d.tagName.toLowerCase() && (f = d, f.control == a)) { 1226 if ("label" == d.tagName.toLowerCase() && (f = d, f.control == a)) {
1166 e.type = "element"; 1227 e.type = "element";
1167 e.text = axs.properties.findTextAlternatives(f, {}, !0); 1228 e.text = axs.properties.findTextAlternatives(f, {}, !0);
1168 e.lastWord = axs.properties.getLastWord(e.text); 1229 e.lastWord = axs.properties.getLastWord(e.text);
1169 e.element = f; 1230 e.element = f;
1170 break 1231 break;
1171 } 1232 }
1172 d = d.parentElement 1233 d = axs.utils.parentElement(d);
1173 } 1234 }
1174 e.text && (c ? e.unused = !0 : c = e.text, b.labelWrapped = e); 1235 e.text && (c ? e.unused = !0 : c = e.text, b.labelWrapped = e);
1175 Object.keys(b).length || (b.noLabel = !0) 1236 Object.keys(b).length || (b.noLabel = !0);
1176 } 1237 }
1177 return c 1238 return c;
1178 }; 1239 };
1179 axs.properties.getLastWord = function(a) { 1240 axs.properties.getLastWord = function(a) {
1180 if(!a) { 1241 if (!a) {
1181 return null 1242 return null;
1182 } 1243 }
1183 var b = a.lastIndexOf(" ") + 1, c = a.length - 10; 1244 var b = a.lastIndexOf(" ") + 1, c = a.length - 10;
1184 return a.substring(b > c ? b : c) 1245 return a.substring(b > c ? b : c);
1185 }; 1246 };
1186 axs.properties.getTextProperties = function(a) { 1247 axs.properties.getTextProperties = function(a) {
1187 var b = {}; 1248 var b = {};
1188 a = axs.properties.findTextAlternatives(a, b); 1249 a = axs.properties.findTextAlternatives(a, b, !1, !0);
1189 if(0 == Object.keys(b).length) { 1250 if (0 == Object.keys(b).length) {
1190 if(!a) { 1251 if (!a) {
1191 return null 1252 return null;
1192 } 1253 }
1193 b.hasProperties = !1 1254 b.hasProperties = !1;
1194 }else { 1255 } else {
1195 b.hasProperties = !0 1256 b.hasProperties = !0;
1196 } 1257 }
1197 b.computedText = a; 1258 b.computedText = a;
1198 b.lastWord = axs.properties.getLastWord(a); 1259 b.lastWord = axs.properties.getLastWord(a);
1199 return b 1260 return b;
1200 }; 1261 };
1201 axs.properties.getAriaProperties = function(a) { 1262 axs.properties.getAriaProperties = function(a) {
1202 var b = {}, c = axs.properties.getGlobalAriaProperties(a), d; 1263 var b = {}, c = axs.properties.getGlobalAriaProperties(a), d;
1203 for(d in axs.constants.ARIA_PROPERTIES) { 1264 for (d in axs.constants.ARIA_PROPERTIES) {
1204 var e = "aria-" + d; 1265 var e = "aria-" + d;
1205 if(a.hasAttribute(e)) { 1266 if (a.hasAttribute(e)) {
1206 var f = a.getAttribute(e); 1267 var f = a.getAttribute(e);
1207 c[e] = axs.utils.getAriaPropertyValue(e, f, a) 1268 c[e] = axs.utils.getAriaPropertyValue(e, f, a);
1208 } 1269 }
1209 } 1270 }
1210 0 < Object.keys(c).length && (b.properties = axs.utils.values(c)); 1271 0 < Object.keys(c).length && (b.properties = axs.utils.values(c));
1211 f = axs.utils.getRoles(a); 1272 f = axs.utils.getRoles(a);
1212 if(!f) { 1273 if (!f) {
1213 return Object.keys(b).length ? b : null 1274 return Object.keys(b).length ? b : null;
1214 } 1275 }
1215 b.roles = f; 1276 b.roles = f;
1216 if(!f.valid || !f.roles) { 1277 if (!f.valid || !f.roles) {
1217 return b 1278 return b;
1218 } 1279 }
1219 for(var e = f.roles, g = 0;g < e.length;g++) { 1280 for (var e = f.roles, g = 0;g < e.length;g++) {
1220 var h = e[g]; 1281 var h = e[g];
1221 if(h.details && h.details.propertiesSet) { 1282 if (h.details && h.details.propertiesSet) {
1222 for(d in h.details.propertiesSet) { 1283 for (d in h.details.propertiesSet) {
1223 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, vali d:!1, reason:"Required property not set"})) 1284 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, vali d:!1, reason:"Required property not set"}));
1224 } 1285 }
1225 } 1286 }
1226 } 1287 }
1227 0 < Object.keys(c).length && (b.properties = axs.utils.values(c)); 1288 0 < Object.keys(c).length && (b.properties = axs.utils.values(c));
1228 return 0 < Object.keys(b).length ? b : null 1289 return 0 < Object.keys(b).length ? b : null;
1229 }; 1290 };
1230 axs.properties.getGlobalAriaProperties = function(a) { 1291 axs.properties.getGlobalAriaProperties = function(a) {
1231 for(var b = {}, c = 0;c < axs.constants.GLOBAL_PROPERTIES.length;c++) { 1292 for (var b = {}, c = 0;c < axs.constants.GLOBAL_PROPERTIES.length;c++) {
1232 var d = axs.constants.GLOBAL_PROPERTIES[c]; 1293 var d = axs.constants.GLOBAL_PROPERTIES[c];
1233 if(a.hasAttribute(d)) { 1294 if (a.hasAttribute(d)) {
1234 var e = a.getAttribute(d); 1295 var e = a.getAttribute(d);
1235 b[d] = axs.utils.getAriaPropertyValue(d, e, a) 1296 b[d] = axs.utils.getAriaPropertyValue(d, e, a);
1236 } 1297 }
1237 } 1298 }
1238 return b 1299 return b;
1239 }; 1300 };
1240 axs.properties.getVideoProperties = function(a) { 1301 axs.properties.getVideoProperties = function(a) {
1241 if(!axs.browserUtils.matchSelector(a, "video")) { 1302 if (!axs.browserUtils.matchSelector(a, "video")) {
1242 return null 1303 return null;
1243 } 1304 }
1244 var b = {}; 1305 var b = {};
1245 b.captionTracks = axs.properties.getTrackElements(a, "captions"); 1306 b.captionTracks = axs.properties.getTrackElements(a, "captions");
1246 b.descriptionTracks = axs.properties.getTrackElements(a, "descriptions"); 1307 b.descriptionTracks = axs.properties.getTrackElements(a, "descriptions");
1247 b.chapterTracks = axs.properties.getTrackElements(a, "chapters"); 1308 b.chapterTracks = axs.properties.getTrackElements(a, "chapters");
1248 return b 1309 return b;
1249 }; 1310 };
1250 axs.properties.getTrackElements = function(a, b) { 1311 axs.properties.getTrackElements = function(a, b) {
1251 var c = a.querySelectorAll("track[kind=" + b + "]"), d = {}; 1312 var c = a.querySelectorAll("track[kind=" + b + "]"), d = {};
1252 if(!c.length) { 1313 if (!c.length) {
1253 return d.valid = !1, d.reason = {messageKey:"noTracksProvided", args:[[b]]}, d 1314 return d.valid = !1, d.reason = {messageKey:"noTracksProvided", args:[[b]]}, d;
1254 } 1315 }
1255 d.valid = !0; 1316 d.valid = !0;
1256 for(var e = [], f = 0;f < c.length;f++) { 1317 for (var e = [], f = 0;f < c.length;f++) {
1257 var g = {}, h = c[f].getAttribute("src"), k = c[f].getAttribute("srcLang"), m = c[f].getAttribute("label"); 1318 var g = {}, h = c[f].getAttribute("src"), k = c[f].getAttribute("srcLang"), m = c[f].getAttribute("label");
1258 h ? (g.valid = !0, g.src = h) : (g.valid = !1, g.reason = {messageKey:"noSrc Provided"}); 1319 h ? (g.valid = !0, g.src = h) : (g.valid = !1, g.reason = {messageKey:"noSrc Provided"});
1259 h = ""; 1320 h = "";
1260 m && (h += m, k && (h += " ")); 1321 m && (h += m, k && (h += " "));
1261 k && (h += "(" + k + ")"); 1322 k && (h += "(" + k + ")");
1262 "" == h && (h = "[[object Object]]"); 1323 "" == h && (h = "[[object Object]]");
1263 g.name = h; 1324 g.name = h;
1264 e.push(g) 1325 e.push(g);
1265 } 1326 }
1266 d.values = e; 1327 d.values = e;
1267 return d 1328 return d;
1268 }; 1329 };
1269 axs.properties.getAllProperties = function(a) { 1330 axs.properties.getAllProperties = function(a) {
1270 var b = axs.utils.asElement(a); 1331 var b = axs.utils.asElement(a);
1271 if(!b) { 1332 if (!b) {
1272 return{} 1333 return{};
1273 } 1334 }
1274 var c = {}; 1335 var c = {};
1275 c.ariaProperties = axs.properties.getAriaProperties(b); 1336 c.ariaProperties = axs.properties.getAriaProperties(b);
1276 c.colorProperties = axs.properties.getColorProperties(b); 1337 c.colorProperties = axs.properties.getColorProperties(b);
1277 c.focusProperties = axs.properties.getFocusProperties(b); 1338 c.focusProperties = axs.properties.getFocusProperties(b);
1278 c.textProperties = axs.properties.getTextProperties(a); 1339 c.textProperties = axs.properties.getTextProperties(a);
1279 c.videoProperties = axs.properties.getVideoProperties(b); 1340 c.videoProperties = axs.properties.getVideoProperties(b);
1280 return c 1341 return c;
1281 }; 1342 };
1282 axs.AuditRule = function(a) { 1343 axs.AuditRule = function(a) {
1283 for(var b = !0, c = [], d = 0;d < axs.AuditRule.requiredFields.length;d++) { 1344 for (var b = !0, c = [], d = 0;d < axs.AuditRule.requiredFields.length;d++) {
1284 var e = axs.AuditRule.requiredFields[d]; 1345 var e = axs.AuditRule.requiredFields[d];
1285 e in a || (b = !1, c.push(e)) 1346 e in a || (b = !1, c.push(e));
1286 } 1347 }
1287 if(!b) { 1348 if (!b) {
1288 throw"Invalid spec; the following fields were not specified: " + c.join(", " ) + "\n" + JSON.stringify(a); 1349 throw "Invalid spec; the following fields were not specified: " + c.join(", ") + "\n" + JSON.stringify(a);
1289 } 1350 }
1290 this.name = a.name; 1351 this.name = a.name;
1291 this.severity = a.severity; 1352 this.severity = a.severity;
1292 this.relevantElementMatcher_ = a.relevantElementMatcher; 1353 this.relevantElementMatcher_ = a.relevantElementMatcher;
1293 this.test_ = a.test; 1354 this.test_ = a.test;
1294 this.code = a.code; 1355 this.code = a.code;
1295 this.heading = a.heading || ""; 1356 this.heading = a.heading || "";
1296 this.url = a.url || ""; 1357 this.url = a.url || "";
1297 this.requiresConsoleAPI = !!a.opt_requiresConsoleAPI 1358 this.requiresConsoleAPI = !!a.opt_requiresConsoleAPI;
1298 }; 1359 };
1299 axs.AuditRule.requiredFields = "name severity relevantElementMatcher test code h eading".split(" "); 1360 axs.AuditRule.requiredFields = "name severity relevantElementMatcher test code h eading".split(" ");
1300 axs.AuditRule.NOT_APPLICABLE = {result:axs.constants.AuditResult.NA}; 1361 axs.AuditRule.NOT_APPLICABLE = {result:axs.constants.AuditResult.NA};
1301 axs.AuditRule.prototype.addElement = function(a, b) { 1362 axs.AuditRule.prototype.addElement = function(a, b) {
1302 a.push(b) 1363 a.push(b);
1303 }; 1364 };
1304 axs.AuditRule.collectMatchingElements = function(a, b, c) { 1365 axs.AuditRule.collectMatchingElements = function(a, b, c, d) {
1305 if(a.nodeType == Node.ELEMENT_NODE) { 1366 if (a.nodeType == Node.ELEMENT_NODE) {
1306 var d = a 1367 var e = a
1307 } 1368 }
1308 d && b.call(null, d) && c.push(d); 1369 e && b.call(null, e) && c.push(e);
1309 for(a = a.firstChild;null != a;) { 1370 if (e) {
1310 axs.AuditRule.collectMatchingElements(a, b, c), a = a.nextSibling 1371 var f = e.shadowRoot || e.webkitShadowRoot;
1372 if (f) {
1373 axs.AuditRule.collectMatchingElements(f, b, c, f);
1374 return;
1375 }
1376 }
1377 if (e && "content" == e.localName) {
1378 for (e = e.getDistributedNodes(), a = 0;a < e.length;a++) {
1379 axs.AuditRule.collectMatchingElements(e[a], b, c, d);
1380 }
1381 } else {
1382 if (e && "shadow" == e.localName) {
1383 a = e, d ? (d = d.olderShadowRoot || a.olderShadowRoot) && axs.AuditRule.c ollectMatchingElements(d, b, c, d) : console.warn("ShadowRoot not provided for", e);
1384 } else {
1385 for (e = a.firstChild;null != e;) {
1386 axs.AuditRule.collectMatchingElements(e, b, c, d), e = e.nextSibling;
1387 }
1388 }
1311 } 1389 }
1312 }; 1390 };
1313 axs.AuditRule.prototype.run = function(a) { 1391 axs.AuditRule.prototype.run = function(a) {
1314 a = a || {}; 1392 a = a || {};
1315 var b = "ignoreSelectors" in a ? a.ignoreSelectors : [], c = "maxResults" in a ? a.maxResults : null, d = []; 1393 var b = "ignoreSelectors" in a ? a.ignoreSelectors : [], c = "maxResults" in a ? a.maxResults : null, d = [];
1316 axs.AuditRule.collectMatchingElements("scope" in a ? a.scope : document, this. relevantElementMatcher_, d); 1394 axs.AuditRule.collectMatchingElements("scope" in a ? a.scope : document, this. relevantElementMatcher_, d);
1317 var e = []; 1395 var e = [];
1318 if(!d.length) { 1396 if (!d.length) {
1319 return{result:axs.constants.AuditResult.NA} 1397 return{result:axs.constants.AuditResult.NA};
1320 } 1398 }
1321 for(a = 0;a < d.length && !(null != c && e.length >= c);a++) { 1399 for (a = 0;a < d.length && !(null != c && e.length >= c);a++) {
1322 var f = d[a], g; 1400 var f = d[a], g;
1323 a: { 1401 a: {
1324 g = f; 1402 g = f;
1325 for(var h = 0;h < b.length;h++) { 1403 for (var h = 0;h < b.length;h++) {
1326 if(axs.browserUtils.matchSelector(g, b[h])) { 1404 if (axs.browserUtils.matchSelector(g, b[h])) {
1327 g = !0; 1405 g = !0;
1328 break a 1406 break a;
1329 } 1407 }
1330 } 1408 }
1331 g = !1 1409 g = !1;
1332 } 1410 }
1333 !g && this.test_(f) && this.addElement(e, f) 1411 !g && this.test_(f) && this.addElement(e, f);
1334 } 1412 }
1335 b = {result:e.length ? axs.constants.AuditResult.FAIL : axs.constants.AuditRes ult.PASS, elements:e}; 1413 b = {result:e.length ? axs.constants.AuditResult.FAIL : axs.constants.AuditRes ult.PASS, elements:e};
1336 a < d.length && (b.resultsTruncated = !0); 1414 a < d.length && (b.resultsTruncated = !0);
1337 return b 1415 return b;
1338 }; 1416 };
1339 axs.AuditRule.specs = {}; 1417 axs.AuditRule.specs = {};
1340 axs.AuditRules = {}; 1418 axs.AuditRules = {};
1341 axs.AuditRules.getRule = function(a) { 1419 axs.AuditRules.getRule = function(a) {
1342 if(!axs.AuditRules.rules) { 1420 if (!axs.AuditRules.rules) {
1343 axs.AuditRules.rules = {}; 1421 axs.AuditRules.rules = {};
1344 for(var b in axs.AuditRule.specs) { 1422 for (var b in axs.AuditRule.specs) {
1345 var c = axs.AuditRule.specs[b], d = new axs.AuditRule(c); 1423 var c = axs.AuditRule.specs[b], d = new axs.AuditRule(c);
1346 axs.AuditRules.rules[c.name] = d 1424 axs.AuditRules.rules[c.name] = d;
1347 } 1425 }
1348 } 1426 }
1349 return axs.AuditRules.rules[a] 1427 return axs.AuditRules.rules[a];
1350 }; 1428 };
1351 axs.AuditResults = function() { 1429 axs.AuditResults = function() {
1352 this.errors_ = []; 1430 this.errors_ = [];
1353 this.warnings_ = [] 1431 this.warnings_ = [];
1354 }; 1432 };
1355 goog.exportSymbol("axs.AuditResults", axs.AuditResults); 1433 goog.exportSymbol("axs.AuditResults", axs.AuditResults);
1356 axs.AuditResults.prototype.addError = function(a) { 1434 axs.AuditResults.prototype.addError = function(a) {
1357 "" != a && this.errors_.push(a) 1435 "" != a && this.errors_.push(a);
1358 }; 1436 };
1359 goog.exportProperty(axs.AuditResults.prototype, "addError", axs.AuditResults.pro totype.addError); 1437 goog.exportProperty(axs.AuditResults.prototype, "addError", axs.AuditResults.pro totype.addError);
1360 axs.AuditResults.prototype.addWarning = function(a) { 1438 axs.AuditResults.prototype.addWarning = function(a) {
1361 "" != a && this.warnings_.push(a) 1439 "" != a && this.warnings_.push(a);
1362 }; 1440 };
1363 goog.exportProperty(axs.AuditResults.prototype, "addWarning", axs.AuditResults.p rototype.addWarning); 1441 goog.exportProperty(axs.AuditResults.prototype, "addWarning", axs.AuditResults.p rototype.addWarning);
1364 axs.AuditResults.prototype.numErrors = function() { 1442 axs.AuditResults.prototype.numErrors = function() {
1365 return this.errors_.length 1443 return this.errors_.length;
1366 }; 1444 };
1367 goog.exportProperty(axs.AuditResults.prototype, "numErrors", axs.AuditResults.pr ototype.numErrors); 1445 goog.exportProperty(axs.AuditResults.prototype, "numErrors", axs.AuditResults.pr ototype.numErrors);
1368 axs.AuditResults.prototype.numWarnings = function() { 1446 axs.AuditResults.prototype.numWarnings = function() {
1369 return this.warnings_.length 1447 return this.warnings_.length;
1370 }; 1448 };
1371 goog.exportProperty(axs.AuditResults.prototype, "numWarnings", axs.AuditResults. prototype.numWarnings); 1449 goog.exportProperty(axs.AuditResults.prototype, "numWarnings", axs.AuditResults. prototype.numWarnings);
1372 axs.AuditResults.prototype.getErrors = function() { 1450 axs.AuditResults.prototype.getErrors = function() {
1373 return this.errors_ 1451 return this.errors_;
1374 }; 1452 };
1375 goog.exportProperty(axs.AuditResults.prototype, "getErrors", axs.AuditResults.pr ototype.getErrors); 1453 goog.exportProperty(axs.AuditResults.prototype, "getErrors", axs.AuditResults.pr ototype.getErrors);
1376 axs.AuditResults.prototype.getWarnings = function() { 1454 axs.AuditResults.prototype.getWarnings = function() {
1377 return this.warnings_ 1455 return this.warnings_;
1378 }; 1456 };
1379 goog.exportProperty(axs.AuditResults.prototype, "getWarnings", axs.AuditResults. prototype.getWarnings); 1457 goog.exportProperty(axs.AuditResults.prototype, "getWarnings", axs.AuditResults. prototype.getWarnings);
1380 axs.AuditResults.prototype.toString = function() { 1458 axs.AuditResults.prototype.toString = function() {
1381 for(var a = "", b = 0;b < this.errors_.length;b++) { 1459 for (var a = "", b = 0;b < this.errors_.length;b++) {
1382 0 == b && (a += "\nErrors:\n"); 1460 0 == b && (a += "\nErrors:\n");
1383 var c = this.errors_[b], a = a + (c + "\n\n") 1461 var c = this.errors_[b], a = a + (c + "\n\n");
1384 } 1462 }
1385 for(b = 0;b < this.warnings_.length;b++) { 1463 for (b = 0;b < this.warnings_.length;b++) {
1386 0 == b && (a += "\nWarnings:\n"), c = this.warnings_[b], a += c + "\n\n" 1464 0 == b && (a += "\nWarnings:\n"), c = this.warnings_[b], a += c + "\n\n";
1387 } 1465 }
1388 return a 1466 return a;
1389 }; 1467 };
1390 goog.exportProperty(axs.AuditResults.prototype, "toString", axs.AuditResults.pro totype.toString); 1468 goog.exportProperty(axs.AuditResults.prototype, "toString", axs.AuditResults.pro totype.toString);
1391 axs.Audit = {}; 1469 axs.Audit = {};
1392 axs.AuditConfiguration = function() { 1470 axs.AuditConfiguration = function() {
1393 this.rules_ = {}; 1471 this.rules_ = {};
1394 this.maxResults = this.auditRulesToIgnore = this.auditRulesToRun = this.scope = null; 1472 this.maxResults = this.auditRulesToIgnore = this.auditRulesToRun = this.scope = null;
1395 this.withConsoleApi = !1; 1473 this.withConsoleApi = !1;
1474 this.showUnsupportedRulesWarning = !0;
1396 goog.exportProperty(this, "scope", this.scope); 1475 goog.exportProperty(this, "scope", this.scope);
1397 goog.exportProperty(this, "auditRulesToRun", this.auditRulesToRun); 1476 goog.exportProperty(this, "auditRulesToRun", this.auditRulesToRun);
1398 goog.exportProperty(this, "auditRulesToIgnore", this.auditRulesToIgnore); 1477 goog.exportProperty(this, "auditRulesToIgnore", this.auditRulesToIgnore);
1399 goog.exportProperty(this, "withConsoleApi", this.withConsoleApi) 1478 goog.exportProperty(this, "withConsoleApi", this.withConsoleApi);
1479 goog.exportProperty(this, "showUnsupportedRulesWarning", this.showUnsupportedR ulesWarning);
1400 }; 1480 };
1401 goog.exportSymbol("axs.AuditConfiguration", axs.AuditConfiguration); 1481 goog.exportSymbol("axs.AuditConfiguration", axs.AuditConfiguration);
1402 axs.AuditConfiguration.prototype = {ignoreSelectors:function(a, b) { 1482 axs.AuditConfiguration.prototype = {ignoreSelectors:function(a, b) {
1403 a in this.rules_ || (this.rules_[a] = {}); 1483 a in this.rules_ || (this.rules_[a] = {});
1404 "ignore" in this.rules_[a] || (this.rules_[a].ignore = []); 1484 "ignore" in this.rules_[a] || (this.rules_[a].ignore = []);
1405 Array.prototype.push.call(this.rules_[a].ignore, b) 1485 Array.prototype.push.call(this.rules_[a].ignore, b);
1406 }, getIgnoreSelectors:function(a) { 1486 }, getIgnoreSelectors:function(a) {
1407 return a in this.rules_ && "ignore" in this.rules_[a] ? this.rules_[a].ignore : [] 1487 return a in this.rules_ && "ignore" in this.rules_[a] ? this.rules_[a].ignore : [];
1408 }, setSeverity:function(a, b) { 1488 }, setSeverity:function(a, b) {
1409 a in this.rules_ || (this.rules_[a] = {}); 1489 a in this.rules_ || (this.rules_[a] = {});
1410 this.rules_[a].severity = b 1490 this.rules_[a].severity = b;
1411 }, getSeverity:function(a) { 1491 }, getSeverity:function(a) {
1412 return a in this.rules_ && "severity" in this.rules_[a] ? this.rules_[a].sever ity : null 1492 return a in this.rules_ && "severity" in this.rules_[a] ? this.rules_[a].sever ity : null;
1413 }}; 1493 }};
1414 goog.exportProperty(axs.AuditConfiguration.prototype, "ignoreSelectors", axs.Aud itConfiguration.prototype.ignoreSelectors); 1494 goog.exportProperty(axs.AuditConfiguration.prototype, "ignoreSelectors", axs.Aud itConfiguration.prototype.ignoreSelectors);
1415 goog.exportProperty(axs.AuditConfiguration.prototype, "getIgnoreSelectors", axs. AuditConfiguration.prototype.getIgnoreSelectors); 1495 goog.exportProperty(axs.AuditConfiguration.prototype, "getIgnoreSelectors", axs. AuditConfiguration.prototype.getIgnoreSelectors);
1496 axs.Audit.unsupportedRulesWarningShown = !1;
1497 axs.Audit.getRulesCannotRun = function(a) {
1498 return a.withConsoleApi ? [] : Object.keys(axs.AuditRule.specs).filter(functio n(a) {
1499 return axs.AuditRules.getRule(a).requiresConsoleAPI;
1500 }).map(function(a) {
1501 return axs.AuditRules.getRule(a).code;
1502 });
1503 };
1416 axs.Audit.run = function(a) { 1504 axs.Audit.run = function(a) {
1417 a = a || new axs.AuditConfiguration; 1505 a = a || new axs.AuditConfiguration;
1418 var b = a.withConsoleApi, c = [], d; 1506 var b = a.withConsoleApi, c = [], d;
1419 d = a.auditRulesToRun && 0 < a.auditRulesToRun.length ? a.auditRulesToRun : Ob ject.keys(axs.AuditRule.specs); 1507 d = a.auditRulesToRun && 0 < a.auditRulesToRun.length ? a.auditRulesToRun : Ob ject.keys(axs.AuditRule.specs);
1420 if(a.auditRulesToIgnore) { 1508 if (a.auditRulesToIgnore) {
1421 for(var e = 0;e < a.auditRulesToIgnore.length;e++) { 1509 for (var e = 0;e < a.auditRulesToIgnore.length;e++) {
1422 var f = a.auditRulesToIgnore[e]; 1510 var f = a.auditRulesToIgnore[e];
1423 0 > d.indexOf(f) || d.splice(d.indexOf(f), 1) 1511 0 > d.indexOf(f) || d.splice(d.indexOf(f), 1);
1424 } 1512 }
1425 } 1513 }
1426 for(e = 0;e < d.length;e++) { 1514 !axs.Audit.unsupportedRulesWarningShown && a.showUnsupportedRulesWarning && (e = axs.Audit.getRulesCannotRun(a), 0 < e.length && (console.warn("Some rules can not be checked using the axs.Audit.run() method call. Use the Chrome plugin to c heck these rules: " + e.join(", ")), console.warn("To remove this message, pass an AuditConfiguration object to axs.Audit.run() and set configuration.showUnsupp ortedRulesWarning = false.")), axs.Audit.unsupportedRulesWarningShown = !0);
1515 for (e = 0;e < d.length;e++) {
1427 var f = d[e], g = axs.AuditRules.getRule(f); 1516 var f = d[e], g = axs.AuditRules.getRule(f);
1428 if(g && !g.disabled && (b || !g.requiresConsoleAPI)) { 1517 if (g && !g.disabled && (b || !g.requiresConsoleAPI)) {
1429 var h = {}, k = a.getIgnoreSelectors(g.name); 1518 var h = {}, k = a.getIgnoreSelectors(g.name);
1430 if(0 < k.length || a.scope) { 1519 if (0 < k.length || a.scope) {
1431 h.ignoreSelectors = k 1520 h.ignoreSelectors = k;
1432 } 1521 }
1433 a.scope && (h.scope = a.scope); 1522 a.scope && (h.scope = a.scope);
1434 a.maxResults && (h.maxResults = a.maxResults); 1523 a.maxResults && (h.maxResults = a.maxResults);
1435 h = g.run.call(g, h); 1524 h = g.run.call(g, h);
1436 g = axs.utils.namedValues(g); 1525 g = axs.utils.namedValues(g);
1437 g.severity = a.getSeverity(f) || g.severity; 1526 g.severity = a.getSeverity(f) || g.severity;
1438 h.rule = g; 1527 h.rule = g;
1439 c.push(h) 1528 c.push(h);
1440 } 1529 }
1441 } 1530 }
1442 return c 1531 return c;
1443 }; 1532 };
1444 goog.exportSymbol("axs.Audit.run", axs.Audit.run); 1533 goog.exportSymbol("axs.Audit.run", axs.Audit.run);
1445 axs.Audit.auditResults = function(a) { 1534 axs.Audit.auditResults = function(a) {
1446 for(var b = new axs.AuditResults, c = 0;c < a.length;c++) { 1535 for (var b = new axs.AuditResults, c = 0;c < a.length;c++) {
1447 var d = a[c]; 1536 var d = a[c];
1448 d.result == axs.constants.AuditResult.FAIL && (d.rule.severity == axs.consta nts.Severity.SEVERE ? b.addError(axs.Audit.accessibilityErrorMessage(d)) : b.add Warning(axs.Audit.accessibilityErrorMessage(d))) 1537 d.result == axs.constants.AuditResult.FAIL && (d.rule.severity == axs.consta nts.Severity.SEVERE ? b.addError(axs.Audit.accessibilityErrorMessage(d)) : b.add Warning(axs.Audit.accessibilityErrorMessage(d)));
1449 } 1538 }
1450 return b 1539 return b;
1451 }; 1540 };
1452 goog.exportSymbol("axs.Audit.auditResults", axs.Audit.auditResults); 1541 goog.exportSymbol("axs.Audit.auditResults", axs.Audit.auditResults);
1453 axs.Audit.createReport = function(a, b) { 1542 axs.Audit.createReport = function(a, b) {
1454 var c; 1543 var c;
1455 c = "*** Begin accessibility audit results ***\nAn accessibility audit found " + axs.Audit.auditResults(a).toString(); 1544 c = "*** Begin accessibility audit results ***\nAn accessibility audit found " + axs.Audit.auditResults(a).toString();
1456 b && (c += "\nFor more information, please see ", c += b); 1545 b && (c += "\nFor more information, please see ", c += b);
1457 return c += "\n*** End accessibility audit results ***" 1546 return c += "\n*** End accessibility audit results ***";
1458 }; 1547 };
1459 goog.exportSymbol("axs.Audit.createReport", axs.Audit.createReport); 1548 goog.exportSymbol("axs.Audit.createReport", axs.Audit.createReport);
1460 axs.Audit.accessibilityErrorMessage = function(a) { 1549 axs.Audit.accessibilityErrorMessage = function(a) {
1461 for(var b = a.rule.severity == axs.constants.Severity.SEVERE ? "Error: " : "Wa rning: ", b = b + (a.rule.code + " (" + a.rule.heading + ") failed on the follow ing " + (1 == a.elements.length ? "element" : "elements")), b = 1 == a.elements. length ? b + ":" : b + (" (1 - " + Math.min(5, a.elements.length) + " of " + a.e lements.length + "):"), c = Math.min(a.elements.length, 5), d = 0;d < c;d++) { 1550 for (var b = a.rule.severity == axs.constants.Severity.SEVERE ? "Error: " : "W arning: ", b = b + (a.rule.code + " (" + a.rule.heading + ") failed on the follo wing " + (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++) {
1462 var e = a.elements[d], b = b + "\n"; 1551 var e = a.elements[d], b = b + "\n";
1463 try { 1552 try {
1464 b += axs.utils.getQuerySelectorText(e) 1553 b += axs.utils.getQuerySelectorText(e);
1465 }catch(f) { 1554 } catch (f) {
1466 b += " tagName:" + e.tagName, b += " id:" + e.id 1555 b += " tagName:" + e.tagName, b += " id:" + e.id;
1467 } 1556 }
1468 } 1557 }
1469 "" != a.rule.url && (b += "\nSee " + a.rule.url + " for more information."); 1558 "" != a.rule.url && (b += "\nSee " + a.rule.url + " for more information.");
1470 return b 1559 return b;
1471 }; 1560 };
1472 goog.exportSymbol("axs.Audit.accessibilityErrorMessage", axs.Audit.accessibility ErrorMessage); 1561 goog.exportSymbol("axs.Audit.accessibilityErrorMessage", axs.Audit.accessibility ErrorMessage);
1473 axs.AuditRule.specs.audioWithoutControls = {name:"audioWithoutControls", heading :"Audio elements should have controls", url:"", severity:axs.constants.Severity. WARNING, relevantElementMatcher:function(a) { 1562 axs.AuditRule.specs.audioWithoutControls = {name:"audioWithoutControls", heading :"Audio elements should have controls", url:"", severity:axs.constants.Severity. WARNING, relevantElementMatcher:function(a) {
1474 return axs.browserUtils.matchSelector(a, "audio[autoplay]") 1563 return axs.browserUtils.matchSelector(a, "audio[autoplay]");
1475 }, test:function(a) { 1564 }, test:function(a) {
1476 return!a.querySelectorAll("[controls]").length && 3 < a.duration 1565 return!a.querySelectorAll("[controls]").length && 3 < a.duration;
1477 }, code:"AX_AUDIO_01"}; 1566 }, code:"AX_AUDIO_01"};
1478 axs.AuditRule.specs.badAriaAttributeValue = {name:"badAriaAttributeValue", headi ng:"ARIA state and property values must be valid", url:"", severity:axs.constant s.Severity.SEVERE, relevantElementMatcher:function(a) { 1567 axs.AuditRule.specs.badAriaAttributeValue = {name:"badAriaAttributeValue", headi ng:"ARIA state and property values must be valid", url:"", severity:axs.constant s.Severity.SEVERE, relevantElementMatcher:function(a) {
1479 var b = "", c; 1568 var b = "", c;
1480 for(c in axs.constants.ARIA_PROPERTIES) { 1569 for (c in axs.constants.ARIA_PROPERTIES) {
1481 b += "[aria-" + c + "]," 1570 b += "[aria-" + c + "],";
1482 } 1571 }
1483 b = b.substring(0, b.length - 1); 1572 b = b.substring(0, b.length - 1);
1484 return axs.browserUtils.matchSelector(a, b) 1573 return axs.browserUtils.matchSelector(a, b);
1485 }, test:function(a) { 1574 }, test:function(a) {
1486 for(var b in axs.constants.ARIA_PROPERTIES) { 1575 for (var b in axs.constants.ARIA_PROPERTIES) {
1487 var c = "aria-" + b; 1576 var c = "aria-" + b;
1488 if(a.hasAttribute(c)) { 1577 if (a.hasAttribute(c)) {
1489 var d = a.getAttribute(c); 1578 var d = a.getAttribute(c);
1490 if(!axs.utils.getAriaPropertyValue(c, d, a).valid) { 1579 if (!axs.utils.getAriaPropertyValue(c, d, a).valid) {
1491 return!0 1580 return!0;
1492 } 1581 }
1493 } 1582 }
1494 } 1583 }
1495 return!1 1584 return!1;
1496 }, code:"AX_ARIA_04"}; 1585 }, code:"AX_ARIA_04"};
1497 axs.AuditRule.specs.badAriaRole = {name:"badAriaRole", heading:"Elements with AR IA roles must use a valid, non-abstract ARIA role", url:"https://github.com/Goog leChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_aria_01--elements-wi th-aria-roles-must-use-a-valid-non-abstract-aria-role", severity:axs.constants.S everity.SEVERE, relevantElementMatcher:function(a) { 1586 axs.AuditRule.specs.badAriaRole = {name:"badAriaRole", heading:"Elements with AR IA roles must use a valid, non-abstract ARIA role", url:"https://github.com/Goog leChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_aria_01--elements-wi th-aria-roles-must-use-a-valid-non-abstract-aria-role", severity:axs.constants.S everity.SEVERE, relevantElementMatcher:function(a) {
1498 return axs.browserUtils.matchSelector(a, "[role]") 1587 return axs.browserUtils.matchSelector(a, "[role]");
1499 }, test:function(a) { 1588 }, test:function(a) {
1500 return!axs.utils.getRoles(a).valid 1589 return!axs.utils.getRoles(a).valid;
1501 }, code:"AX_ARIA_01"}; 1590 }, code:"AX_ARIA_01"};
1502 axs.AuditRule.specs.controlsWithoutLabel = {name:"controlsWithoutLabel", heading :"Controls and media elements should have labels", url:"https://github.com/Googl eChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_text_01--controls-and -media-elements-should-have-labels", severity:axs.constants.Severity.SEVERE, rel evantElementMatcher:function(a) { 1591 axs.AuditRule.specs.controlsWithoutLabel = {name:"controlsWithoutLabel", heading :"Controls and media elements should have labels", url:"https://github.com/Googl eChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_text_01--controls-and -media-elements-should-have-labels", severity:axs.constants.Severity.SEVERE, rel evantElementMatcher:function(a) {
1503 if(!axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disable d]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), v ideo:not([disabled])')) { 1592 if (!axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disabl ed]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), video:not([disabled])')) {
1504 return!1 1593 return!1;
1505 } 1594 }
1506 if(0 <= a.tabIndex) { 1595 if (0 <= a.tabIndex) {
1507 return!0 1596 return!0;
1508 } 1597 }
1509 for(a = a.parentElement;null != a;a = a.parentElement) { 1598 for (a = axs.utils.parentElement(a);null != a;a = axs.utils.parentElement(a)) {
1510 if(axs.utils.elementIsAriaWidget(a)) { 1599 if (axs.utils.elementIsAriaWidget(a)) {
1511 return!1 1600 return!1;
1512 } 1601 }
1513 } 1602 }
1514 return!0 1603 return!0;
1515 }, test:function(a) { 1604 }, test:function(a) {
1516 return axs.utils.isElementOrAncestorHidden(a) || "input" == a.tagName.toLowerC ase() && "button" == a.type && a.value.length || "button" == a.tagName.toLowerCa se() && a.textContent.replace(/^\s+|\s+$/g, "").length ? !1 : axs.utils.hasLabel (a) ? !1 : !0 1605 return axs.utils.isElementOrAncestorHidden(a) || "input" == a.tagName.toLowerC ase() && "button" == a.type && a.value.length || "button" == a.tagName.toLowerCa se() && a.textContent.replace(/^\s+|\s+$/g, "").length ? !1 : axs.utils.hasLabel (a) ? !1 : !0;
1517 }, code:"AX_TEXT_01", ruleName:"Controls and media elements should have labels"} ; 1606 }, code:"AX_TEXT_01", ruleName:"Controls and media elements should have labels"} ;
1518 axs.AuditRule.specs.focusableElementNotVisibleAndNotAriaHidden = {name:"focusabl eElementNotVisibleAndNotAriaHidden", heading:"These elements are focusable but e ither invisible or obscured by another element", url:"https://github.com/GoogleC hrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_focus_01--these-element s-are-focusable-but-either-invisible-or-obscured-by-another-element", severity:a xs.constants.Severity.WARNING, relevantElementMatcher:function(a) { 1607 axs.AuditRule.specs.focusableElementNotVisibleAndNotAriaHidden = {name:"focusabl eElementNotVisibleAndNotAriaHidden", heading:"These elements are focusable but e ither invisible or obscured by another element", url:"https://github.com/GoogleC hrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_focus_01--these-element s-are-focusable-but-either-invisible-or-obscured-by-another-element", severity:a xs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1519 if(!axs.browserUtils.matchSelector(a, axs.utils.FOCUSABLE_ELEMENTS_SELECTOR)) { 1608 if (!axs.browserUtils.matchSelector(a, axs.utils.FOCUSABLE_ELEMENTS_SELECTOR)) {
1520 return!1 1609 return!1;
1521 } 1610 }
1522 if(0 <= a.tabIndex) { 1611 if (0 <= a.tabIndex) {
1523 return!0 1612 return!0;
1524 } 1613 }
1525 for(a = a.parentElement;null != a;a = a.parentElement) { 1614 for (a = axs.utils.parentElement(a);null != a;a = axs.utils.parentElement(a)) {
1526 if(axs.utils.elementIsAriaWidget(a)) { 1615 if (axs.utils.elementIsAriaWidget(a)) {
1527 return!1 1616 return!1;
1528 } 1617 }
1529 } 1618 }
1530 return!0 1619 return!0;
1531 }, test:function(a) { 1620 }, test:function(a) {
1532 return axs.utils.isElementOrAncestorHidden(a) ? !1 : !axs.utils.elementIsVisib le(a) 1621 if (axs.utils.isElementOrAncestorHidden(a)) {
1622 return!1;
1623 }
1624 a.focus();
1625 return!axs.utils.elementIsVisible(a);
1533 }, code:"AX_FOCUS_01"}; 1626 }, code:"AX_FOCUS_01"};
1534 axs.AuditRule.specs.imagesWithoutAltText = {name:"imagesWithoutAltText", heading :"Images should have an alt attribute", url:"https://github.com/GoogleChrome/acc essibility-developer-tools/wiki/Audit-Rules#-ax_text_02--images-should-have-an-a lt-attribute-unless-they-have-an-aria-role-of-presentation", severity:axs.consta nts.Severity.WARNING, relevantElementMatcher:function(a) { 1627 axs.AuditRule.specs.imagesWithoutAltText = {name:"imagesWithoutAltText", heading :"Images should have an alt attribute", url:"https://github.com/GoogleChrome/acc essibility-developer-tools/wiki/Audit-Rules#-ax_text_02--images-should-have-an-a lt-attribute-unless-they-have-an-aria-role-of-presentation", severity:axs.consta nts.Severity.WARNING, relevantElementMatcher:function(a) {
1535 return axs.browserUtils.matchSelector(a, "img") && !axs.utils.isElementOrAnces torHidden(a) 1628 return axs.browserUtils.matchSelector(a, "img") && !axs.utils.isElementOrAnces torHidden(a);
1536 }, test:function(a) { 1629 }, test:function(a) {
1537 return!a.hasAttribute("alt") && "presentation" != a.getAttribute("role") 1630 return!a.hasAttribute("alt") && "presentation" != a.getAttribute("role");
1538 }, code:"AX_TEXT_02"}; 1631 }, code:"AX_TEXT_02"};
1539 axs.AuditRule.specs.linkWithUnclearPurpose = {name:"linkWithUnclearPurpose", hea ding:"The purpose of each link should be clear from the link text", url:"", seve rity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) { 1632 axs.AuditRule.specs.linkWithUnclearPurpose = {name:"linkWithUnclearPurpose", hea ding:"The purpose of each link should be clear from the link text", url:"", seve rity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1540 return axs.browserUtils.matchSelector(a, "a") 1633 return axs.browserUtils.matchSelector(a, "a");
1541 }, test:function(a) { 1634 }, test:function(a) {
1542 return/^\s*click\s*here\s*[^a-z]?$/i.test(a.textContent) 1635 return/^\s*click\s*here\s*[^a-z]?$/i.test(a.textContent);
1543 }, code:"AX_TITLE_01"}; 1636 }, code:"AX_TITLE_01"};
1544 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-e lements-should-have-a-reasonable-contrast-ratio", severity:axs.constants.Severit y.WARNING, relevantElementMatcher:function(a) { 1637 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-e lements-should-have-a-reasonable-contrast-ratio", severity:axs.constants.Severit y.WARNING, relevantElementMatcher:function(a) {
1545 return axs.properties.hasDirectTextDescendant(a) 1638 return axs.properties.hasDirectTextDescendant(a);
1546 }, test:function(a) { 1639 }, test:function(a) {
1547 var b = window.getComputedStyle(a, null); 1640 var b = window.getComputedStyle(a, null);
1548 return(a = axs.utils.getContrastRatioForElementWithComputedStyle(b, a)) && axs .utils.isLowContrast(a, b) 1641 return(a = axs.utils.getContrastRatioForElementWithComputedStyle(b, a)) && axs .utils.isLowContrast(a, b);
1549 }, code:"AX_COLOR_01"}; 1642 }, code:"AX_COLOR_01"};
1550 axs.AuditRule.specs.mainRoleOnInappropriateElement = {name:"mainRoleOnInappropri ateElement", heading:"role=main should only appear on significant elements", url :"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) { 1643 axs.AuditRule.specs.mainRoleOnInappropriateElement = {name:"mainRoleOnInappropri ateElement", heading:"role=main should only appear on significant elements", url :"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1551 return axs.browserUtils.matchSelector(a, "[role~=main]") 1644 return axs.browserUtils.matchSelector(a, "[role~=main]");
1552 }, test:function(a) { 1645 }, test:function(a) {
1553 if(axs.utils.isInlineElement(a)) { 1646 if (axs.utils.isInlineElement(a)) {
1554 return!0 1647 return!0;
1555 } 1648 }
1556 a = axs.properties.getTextFromDescendantContent(a); 1649 a = axs.properties.getTextFromDescendantContent(a);
1557 return!a || 50 > a.length ? !0 : !1 1650 return!a || 50 > a.length ? !0 : !1;
1558 }, code:"AX_ARIA_04"}; 1651 }, code:"AX_ARIA_04"};
1559 axs.AuditRule.specs.elementsWithMeaningfulBackgroundImage = {name:"elementsWithM eaningfulBackgroundImage", severity:axs.constants.Severity.WARNING, relevantElem entMatcher:function(a) { 1652 axs.AuditRule.specs.elementsWithMeaningfulBackgroundImage = {name:"elementsWithM eaningfulBackgroundImage", severity:axs.constants.Severity.WARNING, relevantElem entMatcher:function(a) {
1560 return!axs.utils.isElementOrAncestorHidden(a) 1653 return!axs.utils.isElementOrAncestorHidden(a);
1561 }, heading:"Meaningful images should not be used in element backgrounds", url:"h ttps://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-a x_image_01--meaningful-images-should-not-be-used-in-element-backgrounds", test:f unction(a) { 1654 }, heading:"Meaningful images should not be used in element backgrounds", url:"h ttps://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-a x_image_01--meaningful-images-should-not-be-used-in-element-backgrounds", test:f unction(a) {
1562 if(a.textContent && 0 < a.textContent.length) { 1655 if (a.textContent && 0 < a.textContent.length) {
1563 return!1 1656 return!1;
1564 } 1657 }
1565 a = window.getComputedStyle(a, null); 1658 a = window.getComputedStyle(a, null);
1566 var b = a.backgroundImage; 1659 var b = a.backgroundImage;
1567 if(!b || "undefined" === b || "none" === b || 0 != b.indexOf("url")) { 1660 if (!b || "undefined" === b || "none" === b || 0 != b.indexOf("url")) {
1568 return!1 1661 return!1;
1569 } 1662 }
1570 b = parseInt(a.width, 10); 1663 b = parseInt(a.width, 10);
1571 a = parseInt(a.height, 10); 1664 a = parseInt(a.height, 10);
1572 return 150 > b && 150 > a 1665 return 150 > b && 150 > a;
1573 }, code:"AX_IMAGE_01"}; 1666 }, code:"AX_IMAGE_01"};
1574 axs.AuditRule.specs.nonExistentAriaLabelledbyElement = {name:"nonExistentAriaLab elledbyElement", heading:"aria-labelledby attributes should refer to an element which exists in the DOM", url:"https://github.com/GoogleChrome/accessibility-dev eloper-tools/wiki/Audit-Rules#-ax_aria_02--aria-labelledby-attributes-should-ref er-to-an-element-which-exists-in-the-dom", severity:axs.constants.Severity.WARNI NG, relevantElementMatcher:function(a) { 1667 axs.AuditRule.specs.nonExistentAriaLabelledbyElement = {name:"nonExistentAriaLab elledbyElement", heading:"aria-labelledby attributes should refer to an element which exists in the DOM", url:"https://github.com/GoogleChrome/accessibility-dev eloper-tools/wiki/Audit-Rules#-ax_aria_02--aria-labelledby-attributes-should-ref er-to-an-element-which-exists-in-the-dom", severity:axs.constants.Severity.WARNI NG, relevantElementMatcher:function(a) {
1575 return axs.browserUtils.matchSelector(a, "[aria-labelledby]") 1668 return axs.browserUtils.matchSelector(a, "[aria-labelledby]");
1576 }, test:function(a) { 1669 }, test:function(a) {
1577 a = a.getAttribute("aria-labelledby").split(/\s+/); 1670 a = a.getAttribute("aria-labelledby").split(/\s+/);
1578 for(var b = 0;b < a.length;b++) { 1671 for (var b = 0;b < a.length;b++) {
1579 if(!document.getElementById(a[b])) { 1672 if (!document.getElementById(a[b])) {
1580 return!0 1673 return!0;
1581 } 1674 }
1582 } 1675 }
1583 return!1 1676 return!1;
1584 }, code:"AX_ARIA_02"}; 1677 }, code:"AX_ARIA_02"};
1585 axs.AuditRule.specs.pageWithoutTitle = {name:"pageWithoutTitle", heading:"The we b page should have a title that describes topic or purpose", url:"", severity:ax s.constants.Severity.WARNING, relevantElementMatcher:function(a) { 1678 axs.AuditRule.specs.pageWithoutTitle = {name:"pageWithoutTitle", heading:"The we b page should have a title that describes topic or purpose", url:"", severity:ax s.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1586 return"html" == a.tagName.toLowerCase() 1679 return "html" == a.tagName.toLowerCase();
1587 }, test:function(a) { 1680 }, test:function(a) {
1588 a = a.querySelector("head"); 1681 a = a.querySelector("head");
1589 return a ? (a = a.querySelector("title")) ? !a.textContent : !0 : !0 1682 return a ? (a = a.querySelector("title")) ? !a.textContent : !0 : !0;
1590 }, code:"AX_TITLE_01"}; 1683 }, code:"AX_TITLE_01"};
1591 axs.AuditRule.specs.requiredAriaAttributeMissing = {name:"requiredAriaAttributeM issing", 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-at tributes-for-that-role", severity:axs.constants.Severity.SEVERE, relevantElement Matcher:function(a) { 1684 axs.AuditRule.specs.requiredAriaAttributeMissing = {name:"requiredAriaAttributeM issing", 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-at tributes-for-that-role", severity:axs.constants.Severity.SEVERE, relevantElement Matcher:function(a) {
1592 return axs.browserUtils.matchSelector(a, "[role]") 1685 return axs.browserUtils.matchSelector(a, "[role]");
1593 }, test:function(a) { 1686 }, test:function(a) {
1594 var b = axs.utils.getRoles(a); 1687 var b = axs.utils.getRoles(a);
1595 if(!b.valid) { 1688 if (!b.valid) {
1596 return!1 1689 return!1;
1597 } 1690 }
1598 for(var c = 0;c < b.roles.length;c++) { 1691 for (var c = 0;c < b.roles.length;c++) {
1599 var d = b.roles[c].details.requiredPropertiesSet, e; 1692 var d = b.roles[c].details.requiredPropertiesSet, e;
1600 for(e in d) { 1693 for (e in d) {
1601 if(d = e.replace(/^aria-/, ""), !("defaultValue" in axs.constants.ARIA_PRO PERTIES[d] || a.hasAttribute(e))) { 1694 if (d = e.replace(/^aria-/, ""), !("defaultValue" in axs.constants.ARIA_PR OPERTIES[d] || a.hasAttribute(e))) {
1602 return!0 1695 return!0;
1603 } 1696 }
1604 } 1697 }
1605 } 1698 }
1606 }, code:"AX_ARIA_03"}; 1699 }, code:"AX_ARIA_03"};
1607 axs.AuditRule.specs.unfocusableElementsWithOnClick = {name:"unfocusableElementsW ithOnClick", heading:"Elements with onclick handlers must be focusable", url:"ht tps://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax _focus_02--elements-with-onclick-handlers-must-be-focusable", severity:axs.const ants.Severity.WARNING, opt_requiresConsoleAPI:!0, relevantElementMatcher:functio n(a) { 1700 axs.AuditRule.specs.unfocusableElementsWithOnClick = {name:"unfocusableElementsW ithOnClick", heading:"Elements with onclick handlers must be focusable", url:"ht tps://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax _focus_02--elements-with-onclick-handlers-must-be-focusable", severity:axs.const ants.Severity.WARNING, opt_requiresConsoleAPI:!0, relevantElementMatcher:functio n(a) {
1608 return a instanceof a.ownerDocument.defaultView.HTMLBodyElement || axs.utils.i sElementOrAncestorHidden(a) ? !1 : "click" in getEventListeners(a) ? !0 : !1 1701 return a instanceof a.ownerDocument.defaultView.HTMLBodyElement || axs.utils.i sElementOrAncestorHidden(a) ? !1 : "click" in getEventListeners(a) ? !0 : !1;
1609 }, test:function(a) { 1702 }, test:function(a) {
1610 return!a.hasAttribute("tabindex") && !axs.utils.isElementImplicitlyFocusable(a ) 1703 return!a.hasAttribute("tabindex") && !axs.utils.isElementImplicitlyFocusable(a ) && !a.disabled;
1611 }, code:"AX_FOCUS_02"}; 1704 }, code:"AX_FOCUS_02"};
1612 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) { 1705 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) {
1613 return axs.browserUtils.matchSelector(a, "video") 1706 return axs.browserUtils.matchSelector(a, "video");
1614 }, test:function(a) { 1707 }, test:function(a) {
1615 return!a.querySelectorAll("track[kind=captions]").length 1708 return!a.querySelectorAll("track[kind=captions]").length;
1616 }, code:"AX_VIDEO_01"}; 1709 }, code:"AX_VIDEO_01"};
1617 1710
1618 1711
OLDNEW
« no previous file with comments | « third_party/accessibility-audit/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698