| OLD | NEW |
| (Empty) | |
| 1 /* |
| 2 * Copyright 2017 Google Inc. |
| 3 * |
| 4 * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 * you may not use this file except in compliance with the License. |
| 6 * You may obtain a copy of the License at |
| 7 * |
| 8 * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 * |
| 10 * Unless required by applicable law or agreed to in writing, software |
| 11 * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 * See the License for the specific language governing permissions and |
| 14 * limitations under the License. |
| 15 * |
| 16 * Generated from http://github.com/GoogleChrome/accessibility-developer-tools/t
ree/9acd1c6e3e72a39a0ec14506d68203a4e8cfafb4 |
| 17 * |
| 18 * See project README for build steps. |
| 19 */ |
| 20 |
| 21 // AUTO-GENERATED CONTENT BELOW: DO NOT EDIT! See above for details. |
| 22 |
| 23 var fn = (function() { |
| 24 var COMPILED = !0, goog = goog || {}; |
| 25 goog.global = this; |
| 26 goog.isDef = function(a) { |
| 27 return void 0 !== a; |
| 28 }; |
| 29 goog.exportPath_ = function(a, b, c) { |
| 30 a = a.split("."); |
| 31 c = c || goog.global; |
| 32 a[0] in c || !c.execScript || c.execScript("var " + a[0]); |
| 33 for (var d;a.length && (d = a.shift());) { |
| 34 !a.length && goog.isDef(b) ? c[d] = b : c = c[d] ? c[d] : c[d] = {}; |
| 35 } |
| 36 }; |
| 37 goog.define = function(a, b) { |
| 38 var c = b; |
| 39 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])); |
| 40 goog.exportPath_(a, c); |
| 41 }; |
| 42 goog.DEBUG = !0; |
| 43 goog.LOCALE = "en"; |
| 44 goog.TRUSTED_SITE = !0; |
| 45 goog.STRICT_MODE_COMPATIBLE = !1; |
| 46 goog.DISALLOW_TEST_ONLY_CODE = COMPILED && !goog.DEBUG; |
| 47 goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING = !1; |
| 48 goog.provide = function(a) { |
| 49 if (goog.isInModuleLoader_()) { |
| 50 throw Error("goog.provide can not be used within a goog.module."); |
| 51 } |
| 52 if (!COMPILED && goog.isProvided_(a)) { |
| 53 throw Error('Namespace "' + a + '" already declared.'); |
| 54 } |
| 55 goog.constructNamespace_(a); |
| 56 }; |
| 57 goog.constructNamespace_ = function(a, b) { |
| 58 if (!COMPILED) { |
| 59 delete goog.implicitNamespaces_[a]; |
| 60 for (var c = a;(c = c.substring(0, c.lastIndexOf("."))) && !goog.getObjectBy
Name(c);) { |
| 61 goog.implicitNamespaces_[c] = !0; |
| 62 } |
| 63 } |
| 64 goog.exportPath_(a, b); |
| 65 }; |
| 66 goog.VALID_MODULE_RE_ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/; |
| 67 goog.module = function(a) { |
| 68 if (!goog.isString(a) || !a || -1 == a.search(goog.VALID_MODULE_RE_)) { |
| 69 throw Error("Invalid module identifier"); |
| 70 } |
| 71 if (!goog.isInModuleLoader_()) { |
| 72 throw Error("Module " + a + " has been loaded incorrectly. Note, modules can
not be loaded as normal scripts. They require some kind of pre-processing step.
You're likely trying to load a module via a script tag or as a part of a concate
nated bundle without rewriting the module. For more info see: https://github.com
/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog
.provide."); |
| 73 } |
| 74 if (goog.moduleLoaderState_.moduleName) { |
| 75 throw Error("goog.module may only be called once per module."); |
| 76 } |
| 77 goog.moduleLoaderState_.moduleName = a; |
| 78 if (!COMPILED) { |
| 79 if (goog.isProvided_(a)) { |
| 80 throw Error('Namespace "' + a + '" already declared.'); |
| 81 } |
| 82 delete goog.implicitNamespaces_[a]; |
| 83 } |
| 84 }; |
| 85 goog.module.get = function(a) { |
| 86 return goog.module.getInternal_(a); |
| 87 }; |
| 88 goog.module.getInternal_ = function(a) { |
| 89 if (!COMPILED) { |
| 90 if (a in goog.loadedModules_) { |
| 91 return goog.loadedModules_[a]; |
| 92 } |
| 93 if (!goog.implicitNamespaces_[a]) { |
| 94 return a = goog.getObjectByName(a), null != a ? a : null; |
| 95 } |
| 96 } |
| 97 return null; |
| 98 }; |
| 99 goog.moduleLoaderState_ = null; |
| 100 goog.isInModuleLoader_ = function() { |
| 101 return null != goog.moduleLoaderState_; |
| 102 }; |
| 103 goog.module.declareLegacyNamespace = function() { |
| 104 if (!COMPILED && !goog.isInModuleLoader_()) { |
| 105 throw Error("goog.module.declareLegacyNamespace must be called from within a
goog.module"); |
| 106 } |
| 107 if (!COMPILED && !goog.moduleLoaderState_.moduleName) { |
| 108 throw Error("goog.module must be called prior to goog.module.declareLegacyNa
mespace."); |
| 109 } |
| 110 goog.moduleLoaderState_.declareLegacyNamespace = !0; |
| 111 }; |
| 112 goog.setTestOnly = function(a) { |
| 113 if (goog.DISALLOW_TEST_ONLY_CODE) { |
| 114 throw a = a || "", Error("Importing test-only code into non-debug environmen
t" + (a ? ": " + a : ".")); |
| 115 } |
| 116 }; |
| 117 goog.forwardDeclare = function(a) { |
| 118 }; |
| 119 COMPILED || (goog.isProvided_ = function(a) { |
| 120 return a in goog.loadedModules_ || !goog.implicitNamespaces_[a] && goog.isDefA
ndNotNull(goog.getObjectByName(a)); |
| 121 }, goog.implicitNamespaces_ = {"goog.module":!0}); |
| 122 goog.getObjectByName = function(a, b) { |
| 123 for (var c = a.split("."), d = b || goog.global, e;e = c.shift();) { |
| 124 if (goog.isDefAndNotNull(d[e])) { |
| 125 d = d[e]; |
| 126 } else { |
| 127 return null; |
| 128 } |
| 129 } |
| 130 return d; |
| 131 }; |
| 132 goog.globalize = function(a, b) { |
| 133 var c = b || goog.global, d; |
| 134 for (d in a) { |
| 135 c[d] = a[d]; |
| 136 } |
| 137 }; |
| 138 goog.addDependency = function(a, b, c, d) { |
| 139 if (goog.DEPENDENCIES_ENABLED) { |
| 140 var e; |
| 141 a = a.replace(/\\/g, "/"); |
| 142 var f = goog.dependencies_; |
| 143 d && "boolean" !== typeof d || (d = d ? {module:"goog"} : {}); |
| 144 for (var g = 0;e = b[g];g++) { |
| 145 f.nameToPath[e] = a, f.loadFlags[a] = d; |
| 146 } |
| 147 for (d = 0;b = c[d];d++) { |
| 148 a in f.requires || (f.requires[a] = {}), f.requires[a][b] = !0; |
| 149 } |
| 150 } |
| 151 }; |
| 152 goog.ENABLE_DEBUG_LOADER = !0; |
| 153 goog.logToConsole_ = function(a) { |
| 154 goog.global.console && goog.global.console.error(a); |
| 155 }; |
| 156 goog.require = function(a) { |
| 157 if (!COMPILED) { |
| 158 goog.ENABLE_DEBUG_LOADER && goog.IS_OLD_IE_ && goog.maybeProcessDeferredDep_
(a); |
| 159 if (goog.isProvided_(a)) { |
| 160 if (goog.isInModuleLoader_()) { |
| 161 return goog.module.getInternal_(a); |
| 162 } |
| 163 } else { |
| 164 if (goog.ENABLE_DEBUG_LOADER) { |
| 165 var b = goog.getPathFromDeps_(a); |
| 166 if (b) { |
| 167 goog.writeScripts_(b); |
| 168 } else { |
| 169 throw a = "goog.require could not find: " + a, goog.logToConsole_(a),
Error(a); |
| 170 } |
| 171 } |
| 172 } |
| 173 return null; |
| 174 } |
| 175 }; |
| 176 goog.basePath = ""; |
| 177 goog.nullFunction = function() { |
| 178 }; |
| 179 goog.abstractMethod = function() { |
| 180 throw Error("unimplemented abstract method"); |
| 181 }; |
| 182 goog.addSingletonGetter = function(a) { |
| 183 a.getInstance = function() { |
| 184 if (a.instance_) { |
| 185 return a.instance_; |
| 186 } |
| 187 goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.len
gth] = a); |
| 188 return a.instance_ = new a; |
| 189 }; |
| 190 }; |
| 191 goog.instantiatedSingletons_ = []; |
| 192 goog.LOAD_MODULE_USING_EVAL = !0; |
| 193 goog.SEAL_MODULE_EXPORTS = goog.DEBUG; |
| 194 goog.loadedModules_ = {}; |
| 195 goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER; |
| 196 goog.TRANSPILE = "detect"; |
| 197 goog.TRANSPILER = "transpile.js"; |
| 198 goog.DEPENDENCIES_ENABLED && (goog.dependencies_ = {loadFlags:{}, nameToPath:{},
requires:{}, visited:{}, written:{}, deferred:{}}, goog.inHtmlDocument_ = funct
ion() { |
| 199 var a = goog.global.document; |
| 200 return null != a && "write" in a; |
| 201 }, goog.findBasePath_ = function() { |
| 202 if (goog.isDef(goog.global.CLOSURE_BASE_PATH)) { |
| 203 goog.basePath = goog.global.CLOSURE_BASE_PATH; |
| 204 } else { |
| 205 if (goog.inHtmlDocument_()) { |
| 206 for (var a = goog.global.document.getElementsByTagName("SCRIPT"), b = a.le
ngth - 1;0 <= b;--b) { |
| 207 var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d; |
| 208 if ("base.js" == c.substr(d - 7, 7)) { |
| 209 goog.basePath = c.substr(0, d - 7); |
| 210 break; |
| 211 } |
| 212 } |
| 213 } |
| 214 } |
| 215 }, goog.importScript_ = function(a, b) { |
| 216 (goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_)(a, b) && (goog.dep
endencies_.written[a] = !0); |
| 217 }, goog.IS_OLD_IE_ = !(goog.global.atob || !goog.global.document || !goog.global
.document.all), goog.importProcessedScript_ = function(a, b, c) { |
| 218 goog.importScript_("", 'goog.retrieveAndExec_("' + a + '", ' + b + ", " + c +
");"); |
| 219 }, goog.queuedModules_ = [], goog.wrapModule_ = function(a, b) { |
| 220 return goog.LOAD_MODULE_USING_EVAL && goog.isDef(goog.global.JSON) ? "goog.loa
dModule(" + goog.global.JSON.stringify(b + "\n//# sourceURL=" + a + "\n") + ");"
: 'goog.loadModule(function(exports) {"use strict";' + b + "\n;return exports})
;\n//# sourceURL=" + a + "\n"; |
| 221 }, goog.loadQueuedModules_ = function() { |
| 222 var a = goog.queuedModules_.length; |
| 223 if (0 < a) { |
| 224 var b = goog.queuedModules_; |
| 225 goog.queuedModules_ = []; |
| 226 for (var c = 0;c < a;c++) { |
| 227 goog.maybeProcessDeferredPath_(b[c]); |
| 228 } |
| 229 } |
| 230 }, goog.maybeProcessDeferredDep_ = function(a) { |
| 231 goog.isDeferredModule_(a) && goog.allDepsAreAvailable_(a) && (a = goog.getPath
FromDeps_(a), goog.maybeProcessDeferredPath_(goog.basePath + a)); |
| 232 }, goog.isDeferredModule_ = function(a) { |
| 233 var b = (a = goog.getPathFromDeps_(a)) && goog.dependencies_.loadFlags[a] || {
}, c = b.lang || "es3"; |
| 234 return a && ("goog" == b.module || goog.needsTranspile_(c)) ? goog.basePath +
a in goog.dependencies_.deferred : !1; |
| 235 }, goog.allDepsAreAvailable_ = function(a) { |
| 236 if ((a = goog.getPathFromDeps_(a)) && a in goog.dependencies_.requires) { |
| 237 for (var b in goog.dependencies_.requires[a]) { |
| 238 if (!goog.isProvided_(b) && !goog.isDeferredModule_(b)) { |
| 239 return !1; |
| 240 } |
| 241 } |
| 242 } |
| 243 return !0; |
| 244 }, goog.maybeProcessDeferredPath_ = function(a) { |
| 245 if (a in goog.dependencies_.deferred) { |
| 246 var b = goog.dependencies_.deferred[a]; |
| 247 delete goog.dependencies_.deferred[a]; |
| 248 goog.globalEval(b); |
| 249 } |
| 250 }, goog.loadModuleFromUrl = function(a) { |
| 251 goog.retrieveAndExec_(a, !0, !1); |
| 252 }, goog.writeScriptSrcNode_ = function(a) { |
| 253 goog.global.document.write('<script type="text/javascript" src="' + a + '">\x3
c/script>'); |
| 254 }, goog.appendScriptSrcNode_ = function(a) { |
| 255 var b = goog.global.document, c = b.createElement("script"); |
| 256 c.type = "text/javascript"; |
| 257 c.src = a; |
| 258 c.defer = !1; |
| 259 c.async = !1; |
| 260 b.head.appendChild(c); |
| 261 }, goog.writeScriptTag_ = function(a, b) { |
| 262 if (goog.inHtmlDocument_()) { |
| 263 var c = goog.global.document; |
| 264 if (!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING && "complete" == c.readyStat
e) { |
| 265 if (/\bdeps.js$/.test(a)) { |
| 266 return !1; |
| 267 } |
| 268 throw Error('Cannot write "' + a + '" after document load'); |
| 269 } |
| 270 if (void 0 === b) { |
| 271 if (goog.IS_OLD_IE_) { |
| 272 var d = " onreadystatechange='goog.onScriptLoad_(this, " + ++goog.lastNo
nModuleScriptIndex_ + ")' "; |
| 273 c.write('<script type="text/javascript" src="' + a + '"' + d + ">\x3c/sc
ript>"); |
| 274 } else { |
| 275 goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING ? goog.appendScriptSrcNode_(a
) : goog.writeScriptSrcNode_(a); |
| 276 } |
| 277 } else { |
| 278 c.write('<script type="text/javascript">' + goog.protectScriptTag_(b) + "\
x3c/script>"); |
| 279 } |
| 280 return !0; |
| 281 } |
| 282 return !1; |
| 283 }, goog.protectScriptTag_ = function(a) { |
| 284 return a.replace(/<\/(SCRIPT)/ig, "\\x3c\\$1"); |
| 285 }, goog.needsTranspile_ = function(a) { |
| 286 if ("always" == goog.TRANSPILE) { |
| 287 return !0; |
| 288 } |
| 289 if ("never" == goog.TRANSPILE) { |
| 290 return !1; |
| 291 } |
| 292 goog.requiresTranspilation_ || (goog.requiresTranspilation_ = goog.createRequi
resTranspilation_()); |
| 293 if (a in goog.requiresTranspilation_) { |
| 294 return goog.requiresTranspilation_[a]; |
| 295 } |
| 296 throw Error("Unknown language mode: " + a); |
| 297 }, goog.requiresTranspilation_ = null, goog.lastNonModuleScriptIndex_ = 0, goog.
onScriptLoad_ = function(a, b) { |
| 298 "complete" == a.readyState && goog.lastNonModuleScriptIndex_ == b && goog.load
QueuedModules_(); |
| 299 return !0; |
| 300 }, goog.writeScripts_ = function(a) { |
| 301 function b(a) { |
| 302 if (!(a in e.written || a in e.visited)) { |
| 303 e.visited[a] = !0; |
| 304 if (a in e.requires) { |
| 305 for (var f in e.requires[a]) { |
| 306 if (!goog.isProvided_(f)) { |
| 307 if (f in e.nameToPath) { |
| 308 b(e.nameToPath[f]); |
| 309 } else { |
| 310 throw Error("Undefined nameToPath for " + f); |
| 311 } |
| 312 } |
| 313 } |
| 314 } |
| 315 a in d || (d[a] = !0, c.push(a)); |
| 316 } |
| 317 } |
| 318 var c = [], d = {}, e = goog.dependencies_; |
| 319 b(a); |
| 320 for (a = 0;a < c.length;a++) { |
| 321 var f = c[a]; |
| 322 goog.dependencies_.written[f] = !0; |
| 323 } |
| 324 var g = goog.moduleLoaderState_; |
| 325 goog.moduleLoaderState_ = null; |
| 326 for (a = 0;a < c.length;a++) { |
| 327 if (f = c[a]) { |
| 328 var h = e.loadFlags[f] || {}, k = goog.needsTranspile_(h.lang || "es3"); |
| 329 "goog" == h.module || k ? goog.importProcessedScript_(goog.basePath + f, "
goog" == h.module, k) : goog.importScript_(goog.basePath + f); |
| 330 } else { |
| 331 throw goog.moduleLoaderState_ = g, Error("Undefined script input"); |
| 332 } |
| 333 } |
| 334 goog.moduleLoaderState_ = g; |
| 335 }, goog.getPathFromDeps_ = function(a) { |
| 336 return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] :
null; |
| 337 }, goog.findBasePath_(), goog.global.CLOSURE_NO_DEPS || goog.importScript_(goog.
basePath + "deps.js")); |
| 338 goog.loadModule = function(a) { |
| 339 var b = goog.moduleLoaderState_; |
| 340 try { |
| 341 goog.moduleLoaderState_ = {moduleName:void 0, declareLegacyNamespace:!1}; |
| 342 var c; |
| 343 if (goog.isFunction(a)) { |
| 344 c = a.call(void 0, {}); |
| 345 } else { |
| 346 if (goog.isString(a)) { |
| 347 c = goog.loadModuleFromSource_.call(void 0, a); |
| 348 } else { |
| 349 throw Error("Invalid module definition"); |
| 350 } |
| 351 } |
| 352 var d = goog.moduleLoaderState_.moduleName; |
| 353 if (!goog.isString(d) || !d) { |
| 354 throw Error('Invalid module name "' + d + '"'); |
| 355 } |
| 356 goog.moduleLoaderState_.declareLegacyNamespace ? goog.constructNamespace_(d,
c) : goog.SEAL_MODULE_EXPORTS && Object.seal && goog.isObject(c) && Object.seal
(c); |
| 357 goog.loadedModules_[d] = c; |
| 358 } finally { |
| 359 goog.moduleLoaderState_ = b; |
| 360 } |
| 361 }; |
| 362 goog.loadModuleFromSource_ = function(a) { |
| 363 eval(a); |
| 364 return {}; |
| 365 }; |
| 366 goog.normalizePath_ = function(a) { |
| 367 a = a.split("/"); |
| 368 for (var b = 0;b < a.length;) { |
| 369 "." == a[b] ? a.splice(b, 1) : b && ".." == a[b] && a[b - 1] && ".." != a[b
- 1] ? a.splice(--b, 2) : b++; |
| 370 } |
| 371 return a.join("/"); |
| 372 }; |
| 373 goog.loadFileSync_ = function(a) { |
| 374 if (goog.global.CLOSURE_LOAD_FILE_SYNC) { |
| 375 return goog.global.CLOSURE_LOAD_FILE_SYNC(a); |
| 376 } |
| 377 try { |
| 378 var b = new goog.global.XMLHttpRequest; |
| 379 b.open("get", a, !1); |
| 380 b.send(); |
| 381 return 0 == b.status || 200 == b.status ? b.responseText : null; |
| 382 } catch (c) { |
| 383 return null; |
| 384 } |
| 385 }; |
| 386 goog.retrieveAndExec_ = function(a, b, c) { |
| 387 if (!COMPILED) { |
| 388 var d = a; |
| 389 a = goog.normalizePath_(a); |
| 390 var e = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_, f = goog.
loadFileSync_(a); |
| 391 if (null == f) { |
| 392 throw Error('Load of "' + a + '" failed'); |
| 393 } |
| 394 c && (f = goog.transpile_.call(goog.global, f, a)); |
| 395 f = b ? goog.wrapModule_(a, f) : f + ("\n//# sourceURL=" + a); |
| 396 goog.IS_OLD_IE_ ? (goog.dependencies_.deferred[d] = f, goog.queuedModules_.p
ush(d)) : e(a, f); |
| 397 } |
| 398 }; |
| 399 goog.transpile_ = function(a, b) { |
| 400 var c = goog.global.$jscomp; |
| 401 c || (goog.global.$jscomp = c = {}); |
| 402 var d = c.transpile; |
| 403 if (!d) { |
| 404 var e = goog.basePath + goog.TRANSPILER, f = goog.loadFileSync_(e); |
| 405 if (f) { |
| 406 eval(f + "\n//# sourceURL=" + e); |
| 407 if (goog.global.$gwtExport && goog.global.$gwtExport.$jscomp && !goog.glob
al.$gwtExport.$jscomp.transpile) { |
| 408 throw Error('The transpiler did not properly export the "transpile" meth
od. $gwtExport: ' + JSON.stringify(goog.global.$gwtExport)); |
| 409 } |
| 410 goog.global.$jscomp.transpile = goog.global.$gwtExport.$jscomp.transpile; |
| 411 c = goog.global.$jscomp; |
| 412 d = c.transpile; |
| 413 } |
| 414 } |
| 415 d || (d = c.transpile = function(a, b) { |
| 416 goog.logToConsole_(b + " requires transpilation but no transpiler was found.
"); |
| 417 return a; |
| 418 }); |
| 419 return d(a, b); |
| 420 }; |
| 421 goog.typeOf = function(a) { |
| 422 var b = typeof a; |
| 423 if ("object" == b) { |
| 424 if (a) { |
| 425 if (a instanceof Array) { |
| 426 return "array"; |
| 427 } |
| 428 if (a instanceof Object) { |
| 429 return b; |
| 430 } |
| 431 var c = Object.prototype.toString.call(a); |
| 432 if ("[object Window]" == c) { |
| 433 return "object"; |
| 434 } |
| 435 if ("[object Array]" == c || "number" == typeof a.length && "undefined" !=
typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyI
sEnumerable("splice")) { |
| 436 return "array"; |
| 437 } |
| 438 if ("[object Function]" == c || "undefined" != typeof a.call && "undefined
" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) { |
| 439 return "function"; |
| 440 } |
| 441 } else { |
| 442 return "null"; |
| 443 } |
| 444 } else { |
| 445 if ("function" == b && "undefined" == typeof a.call) { |
| 446 return "object"; |
| 447 } |
| 448 } |
| 449 return b; |
| 450 }; |
| 451 goog.isNull = function(a) { |
| 452 return null === a; |
| 453 }; |
| 454 goog.isDefAndNotNull = function(a) { |
| 455 return null != a; |
| 456 }; |
| 457 goog.isArray = function(a) { |
| 458 return "array" == goog.typeOf(a); |
| 459 }; |
| 460 goog.isArrayLike = function(a) { |
| 461 var b = goog.typeOf(a); |
| 462 return "array" == b || "object" == b && "number" == typeof a.length; |
| 463 }; |
| 464 goog.isDateLike = function(a) { |
| 465 return goog.isObject(a) && "function" == typeof a.getFullYear; |
| 466 }; |
| 467 goog.isString = function(a) { |
| 468 return "string" == typeof a; |
| 469 }; |
| 470 goog.isBoolean = function(a) { |
| 471 return "boolean" == typeof a; |
| 472 }; |
| 473 goog.isNumber = function(a) { |
| 474 return "number" == typeof a; |
| 475 }; |
| 476 goog.isFunction = function(a) { |
| 477 return "function" == goog.typeOf(a); |
| 478 }; |
| 479 goog.isObject = function(a) { |
| 480 var b = typeof a; |
| 481 return "object" == b && null != a || "function" == b; |
| 482 }; |
| 483 goog.getUid = function(a) { |
| 484 return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_); |
| 485 }; |
| 486 goog.hasUid = function(a) { |
| 487 return !!a[goog.UID_PROPERTY_]; |
| 488 }; |
| 489 goog.removeUid = function(a) { |
| 490 null !== a && "removeAttribute" in a && a.removeAttribute(goog.UID_PROPERTY_); |
| 491 try { |
| 492 delete a[goog.UID_PROPERTY_]; |
| 493 } catch (b) { |
| 494 } |
| 495 }; |
| 496 goog.UID_PROPERTY_ = "closure_uid_" + (1E9 * Math.random() >>> 0); |
| 497 goog.uidCounter_ = 0; |
| 498 goog.getHashCode = goog.getUid; |
| 499 goog.removeHashCode = goog.removeUid; |
| 500 goog.cloneObject = function(a) { |
| 501 var b = goog.typeOf(a); |
| 502 if ("object" == b || "array" == b) { |
| 503 if (a.clone) { |
| 504 return a.clone(); |
| 505 } |
| 506 var b = "array" == b ? [] : {}, c; |
| 507 for (c in a) { |
| 508 b[c] = goog.cloneObject(a[c]); |
| 509 } |
| 510 return b; |
| 511 } |
| 512 return a; |
| 513 }; |
| 514 goog.bindNative_ = function(a, b, c) { |
| 515 return a.call.apply(a.bind, arguments); |
| 516 }; |
| 517 goog.bindJs_ = function(a, b, c) { |
| 518 if (!a) { |
| 519 throw Error(); |
| 520 } |
| 521 if (2 < arguments.length) { |
| 522 var d = Array.prototype.slice.call(arguments, 2); |
| 523 return function() { |
| 524 var c = Array.prototype.slice.call(arguments); |
| 525 Array.prototype.unshift.apply(c, d); |
| 526 return a.apply(b, c); |
| 527 }; |
| 528 } |
| 529 return function() { |
| 530 return a.apply(b, arguments); |
| 531 }; |
| 532 }; |
| 533 goog.bind = function(a, b, c) { |
| 534 Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("n
ative code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_; |
| 535 return goog.bind.apply(null, arguments); |
| 536 }; |
| 537 goog.partial = function(a, b) { |
| 538 var c = Array.prototype.slice.call(arguments, 1); |
| 539 return function() { |
| 540 var b = c.slice(); |
| 541 b.push.apply(b, arguments); |
| 542 return a.apply(this, b); |
| 543 }; |
| 544 }; |
| 545 goog.mixin = function(a, b) { |
| 546 for (var c in b) { |
| 547 a[c] = b[c]; |
| 548 } |
| 549 }; |
| 550 goog.now = goog.TRUSTED_SITE && Date.now || function() { |
| 551 return +new Date; |
| 552 }; |
| 553 goog.globalEval = function(a) { |
| 554 if (goog.global.execScript) { |
| 555 goog.global.execScript(a, "JavaScript"); |
| 556 } else { |
| 557 if (goog.global.eval) { |
| 558 if (null == goog.evalWorksForGlobals_) { |
| 559 if (goog.global.eval("var _evalTest_ = 1;"), "undefined" != typeof goog.
global._evalTest_) { |
| 560 try { |
| 561 delete goog.global._evalTest_; |
| 562 } catch (d) { |
| 563 } |
| 564 goog.evalWorksForGlobals_ = !0; |
| 565 } else { |
| 566 goog.evalWorksForGlobals_ = !1; |
| 567 } |
| 568 } |
| 569 if (goog.evalWorksForGlobals_) { |
| 570 goog.global.eval(a); |
| 571 } else { |
| 572 var b = goog.global.document, c = b.createElement("SCRIPT"); |
| 573 c.type = "text/javascript"; |
| 574 c.defer = !1; |
| 575 c.appendChild(b.createTextNode(a)); |
| 576 b.body.appendChild(c); |
| 577 b.body.removeChild(c); |
| 578 } |
| 579 } else { |
| 580 throw Error("goog.globalEval not available"); |
| 581 } |
| 582 } |
| 583 }; |
| 584 goog.evalWorksForGlobals_ = null; |
| 585 goog.getCssName = function(a, b) { |
| 586 if ("." == String(a).charAt(0)) { |
| 587 throw Error('className passed in goog.getCssName must not start with ".". Yo
u passed: ' + a); |
| 588 } |
| 589 var c = function(a) { |
| 590 return goog.cssNameMapping_[a] || a; |
| 591 }, d = function(a) { |
| 592 a = a.split("-"); |
| 593 for (var b = [], d = 0;d < a.length;d++) { |
| 594 b.push(c(a[d])); |
| 595 } |
| 596 return b.join("-"); |
| 597 }, d = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? c : d
: function(a) { |
| 598 return a; |
| 599 }, d = b ? a + "-" + d(b) : d(a); |
| 600 return goog.global.CLOSURE_CSS_NAME_MAP_FN ? goog.global.CLOSURE_CSS_NAME_MAP_
FN(d) : d; |
| 601 }; |
| 602 goog.setCssNameMapping = function(a, b) { |
| 603 goog.cssNameMapping_ = a; |
| 604 goog.cssNameMappingStyle_ = b; |
| 605 }; |
| 606 !COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goo
g.global.CLOSURE_CSS_NAME_MAPPING); |
| 607 goog.getMsg = function(a, b) { |
| 608 b && (a = a.replace(/\{\$([^}]+)}/g, function(a, d) { |
| 609 return null != b && d in b ? b[d] : a; |
| 610 })); |
| 611 return a; |
| 612 }; |
| 613 goog.getMsgWithFallback = function(a, b) { |
| 614 return a; |
| 615 }; |
| 616 goog.exportSymbol = function(a, b, c) { |
| 617 goog.exportPath_(a, b, c); |
| 618 }; |
| 619 goog.exportProperty = function(a, b, c) { |
| 620 a[b] = c; |
| 621 }; |
| 622 goog.inherits = function(a, b) { |
| 623 function c() { |
| 624 } |
| 625 c.prototype = b.prototype; |
| 626 a.superClass_ = b.prototype; |
| 627 a.prototype = new c; |
| 628 a.prototype.constructor = a; |
| 629 a.base = function(a, c, f) { |
| 630 for (var d = Array(arguments.length - 2), e = 2;e < arguments.length;e++) { |
| 631 d[e - 2] = arguments[e]; |
| 632 } |
| 633 return b.prototype[c].apply(a, d); |
| 634 }; |
| 635 }; |
| 636 goog.base = function(a, b, c) { |
| 637 var d = arguments.callee.caller; |
| 638 if (goog.STRICT_MODE_COMPATIBLE || goog.DEBUG && !d) { |
| 639 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"); |
| 640 } |
| 641 if (d.superClass_) { |
| 642 for (var e = Array(arguments.length - 1), f = 1;f < arguments.length;f++) { |
| 643 e[f - 1] = arguments[f]; |
| 644 } |
| 645 return d.superClass_.constructor.apply(a, e); |
| 646 } |
| 647 e = Array(arguments.length - 2); |
| 648 for (f = 2;f < arguments.length;f++) { |
| 649 e[f - 2] = arguments[f]; |
| 650 } |
| 651 for (var f = !1, g = a.constructor;g;g = g.superClass_ && g.superClass_.constr
uctor) { |
| 652 if (g.prototype[b] === d) { |
| 653 f = !0; |
| 654 } else { |
| 655 if (f) { |
| 656 return g.prototype[b].apply(a, e); |
| 657 } |
| 658 } |
| 659 } |
| 660 if (a[b] === d) { |
| 661 return a.constructor.prototype[b].apply(a, e); |
| 662 } |
| 663 throw Error("goog.base called from a method of one name to a method of a diffe
rent name"); |
| 664 }; |
| 665 goog.scope = function(a) { |
| 666 if (goog.isInModuleLoader_()) { |
| 667 throw Error("goog.scope is not supported within a goog.module."); |
| 668 } |
| 669 a.call(goog.global); |
| 670 }; |
| 671 COMPILED || (goog.global.COMPILED = COMPILED); |
| 672 goog.defineClass = function(a, b) { |
| 673 var c = b.constructor, d = b.statics; |
| 674 c && c != Object.prototype.constructor || (c = function() { |
| 675 throw Error("cannot instantiate an interface (no constructor defined)."); |
| 676 }); |
| 677 c = goog.defineClass.createSealingConstructor_(c, a); |
| 678 a && goog.inherits(c, a); |
| 679 delete b.constructor; |
| 680 delete b.statics; |
| 681 goog.defineClass.applyProperties_(c.prototype, b); |
| 682 null != d && (d instanceof Function ? d(c) : goog.defineClass.applyProperties_
(c, d)); |
| 683 return c; |
| 684 }; |
| 685 goog.defineClass.SEAL_CLASS_INSTANCES = goog.DEBUG; |
| 686 goog.defineClass.createSealingConstructor_ = function(a, b) { |
| 687 if (!goog.defineClass.SEAL_CLASS_INSTANCES) { |
| 688 return a; |
| 689 } |
| 690 var c = !goog.defineClass.isUnsealable_(b), d = function() { |
| 691 var b = a.apply(this, arguments) || this; |
| 692 b[goog.UID_PROPERTY_] = b[goog.UID_PROPERTY_]; |
| 693 this.constructor === d && c && Object.seal instanceof Function && Object.sea
l(b); |
| 694 return b; |
| 695 }; |
| 696 return d; |
| 697 }; |
| 698 goog.defineClass.isUnsealable_ = function(a) { |
| 699 return a && a.prototype && a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]; |
| 700 }; |
| 701 goog.defineClass.OBJECT_PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isProtot
ypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); |
| 702 goog.defineClass.applyProperties_ = function(a, b) { |
| 703 for (var c in b) { |
| 704 Object.prototype.hasOwnProperty.call(b, c) && (a[c] = b[c]); |
| 705 } |
| 706 for (var d = 0;d < goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++) { |
| 707 c = goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d], Object.prototype.hasOwnPro
perty.call(b, c) && (a[c] = b[c]); |
| 708 } |
| 709 }; |
| 710 goog.tagUnsealableClass = function(a) { |
| 711 !COMPILED && goog.defineClass.SEAL_CLASS_INSTANCES && (a.prototype[goog.UNSEAL
ABLE_CONSTRUCTOR_PROPERTY_] = !0); |
| 712 }; |
| 713 goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_ = "goog_defineClass_legacy_unsealable"; |
| 714 goog.createRequiresTranspilation_ = function() { |
| 715 function a(a, b) { |
| 716 d ? c[a] = !0 : b() ? c[a] = !1 : d = c[a] = !0; |
| 717 } |
| 718 function b(a) { |
| 719 try { |
| 720 return !!eval(a); |
| 721 } catch (f) { |
| 722 return !1; |
| 723 } |
| 724 } |
| 725 var c = {es3:!1}, d = !1; |
| 726 a("es5", function() { |
| 727 return b("[1,].length==1"); |
| 728 }); |
| 729 a("es6", function() { |
| 730 return b('(()=>{"use strict";class X{constructor(){if(new.target!=String)thr
ow 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof
String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;
return z.a}{function f(){return 0;}}return f()==3}})()'); |
| 731 }); |
| 732 a("es6-impl", function() { |
| 733 return !0; |
| 734 }); |
| 735 a("es7", function() { |
| 736 return b("2 ** 2 == 4"); |
| 737 }); |
| 738 a("es8", function() { |
| 739 return b("async () => 1, true"); |
| 740 }); |
| 741 return c; |
| 742 }; |
| 743 var axs = {}; |
| 744 axs.browserUtils = {}; |
| 745 axs.browserUtils.matchSelector = function(a, b) { |
| 746 return a.matches ? a.matches(b) : a.webkitMatchesSelector ? a.webkitMatchesSel
ector(b) : a.mozMatchesSelector ? a.mozMatchesSelector(b) : a.msMatchesSelector
? a.msMatchesSelector(b) : !1; |
| 747 }; |
| 748 axs.color = {}; |
| 749 axs.color.Color = function(a, b, c, d) { |
| 750 this.red = a; |
| 751 this.green = b; |
| 752 this.blue = c; |
| 753 this.alpha = d; |
| 754 }; |
| 755 axs.color.YCbCr = function(a) { |
| 756 this.luma = this.z = a[0]; |
| 757 this.Cb = this.x = a[1]; |
| 758 this.Cr = this.y = a[2]; |
| 759 }; |
| 760 axs.color.YCbCr.prototype = {multiply:function(a) { |
| 761 return new axs.color.YCbCr([this.luma * a, this.Cb * a, this.Cr * a]); |
| 762 }, add:function(a) { |
| 763 return new axs.color.YCbCr([this.luma + a.luma, this.Cb + a.Cb, this.Cr + a.Cr
]); |
| 764 }, subtract:function(a) { |
| 765 return new axs.color.YCbCr([this.luma - a.luma, this.Cb - a.Cb, this.Cr - a.Cr
]); |
| 766 }}; |
| 767 axs.color.calculateContrastRatio = function(a, b) { |
| 768 1 > a.alpha && (a = axs.color.flattenColors(a, b)); |
| 769 var c = axs.color.calculateLuminance(a), d = axs.color.calculateLuminance(b); |
| 770 return (Math.max(c, d) + .05) / (Math.min(c, d) + .05); |
| 771 }; |
| 772 axs.color.calculateLuminance = function(a) { |
| 773 return axs.color.toYCbCr(a).luma; |
| 774 }; |
| 775 axs.color.luminanceRatio = function(a, b) { |
| 776 return (Math.max(a, b) + .05) / (Math.min(a, b) + .05); |
| 777 }; |
| 778 axs.color.parseColor = function(a) { |
| 779 if ("transparent" === a) { |
| 780 return new axs.color.Color(0, 0, 0, 0); |
| 781 } |
| 782 var b = a.match(/^rgb\((\d+), (\d+), (\d+)\)$/); |
| 783 if (b) { |
| 784 a = parseInt(b[1], 10); |
| 785 var c = parseInt(b[2], 10), d = parseInt(b[3], 10); |
| 786 return new axs.color.Color(a, c, d, 1); |
| 787 } |
| 788 return (b = a.match(/^rgba\((\d+), (\d+), (\d+), (\d*(\.\d+)?)\)/)) ? (a = par
seInt(b[1], 10), c = parseInt(b[2], 10), d = parseInt(b[3], 10), b = parseFloat(
b[4]), new axs.color.Color(a, c, d, b)) : null; |
| 789 }; |
| 790 axs.color.colorChannelToString = function(a) { |
| 791 a = Math.round(a); |
| 792 return 15 >= a ? "0" + a.toString(16) : a.toString(16); |
| 793 }; |
| 794 axs.color.colorToString = function(a) { |
| 795 return 1 == a.alpha ? "#" + axs.color.colorChannelToString(a.red) + axs.color.
colorChannelToString(a.green) + axs.color.colorChannelToString(a.blue) : "rgba("
+ [a.red, a.green, a.blue, a.alpha].join() + ")"; |
| 796 }; |
| 797 axs.color.luminanceFromContrastRatio = function(a, b, c) { |
| 798 return c ? (a + .05) * b - .05 : (a + .05) / b - .05; |
| 799 }; |
| 800 axs.color.translateColor = function(a, b) { |
| 801 for (var c = b > a.luma ? axs.color.WHITE_YCC : axs.color.BLACK_YCC, d = c ==
axs.color.WHITE_YCC ? axs.color.YCC_CUBE_FACES_WHITE : axs.color.YCC_CUBE_FACES_
BLACK, e = new axs.color.YCbCr([0, a.Cb, a.Cr]), f = new axs.color.YCbCr([1, a.C
b, a.Cr]), f = {a:e, b:f}, e = null, g = 0;g < d.length && !(e = axs.color.findI
ntersection(f, d[g]), 0 <= e.z && 1 >= e.z);g++) { |
| 802 } |
| 803 if (!e) { |
| 804 throw "Couldn't find intersection with YCbCr color cube for Cb=" + a.Cb + ",
Cr=" + a.Cr + "."; |
| 805 } |
| 806 if (e.x != a.x || e.y != a.y) { |
| 807 throw "Intersection has wrong Cb/Cr values."; |
| 808 } |
| 809 if (Math.abs(c.luma - e.luma) < Math.abs(c.luma - b)) { |
| 810 return c = [b, a.Cb, a.Cr], axs.color.fromYCbCrArray(c); |
| 811 } |
| 812 c = (b - e.luma) / (c.luma - e.luma); |
| 813 c = [b, e.Cb - e.Cb * c, e.Cr - e.Cr * c]; |
| 814 return axs.color.fromYCbCrArray(c); |
| 815 }; |
| 816 axs.color.suggestColors = function(a, b, c) { |
| 817 var d = {}, e = axs.color.calculateLuminance(a), f = axs.color.calculateLumina
nce(b), g = f > e, h = axs.color.toYCbCr(b), k = axs.color.toYCbCr(a), m; |
| 818 for (m in c) { |
| 819 var l = c[m], n = axs.color.luminanceFromContrastRatio(e, l + .02, g); |
| 820 if (1 >= n && 0 <= n) { |
| 821 var p = axs.color.translateColor(h, n), l = axs.color.calculateContrastRat
io(p, a), n = {}; |
| 822 n.fg = axs.color.colorToString(p); |
| 823 n.bg = axs.color.colorToString(a); |
| 824 n.contrast = l.toFixed(2); |
| 825 d[m] = n; |
| 826 } else { |
| 827 l = axs.color.luminanceFromContrastRatio(f, l + .02, !g), 1 >= l && 0 <= l
&& (p = axs.color.translateColor(k, l), l = axs.color.calculateContrastRatio(b,
p), n = {}, n.bg = axs.color.colorToString(p), n.fg = axs.color.colorToString(b
), n.contrast = l.toFixed(2), d[m] = n); |
| 828 } |
| 829 } |
| 830 return d; |
| 831 }; |
| 832 axs.color.flattenColors = function(a, b) { |
| 833 var c = a.alpha; |
| 834 return new axs.color.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)); |
| 835 }; |
| 836 axs.color.multiplyMatrixVector = function(a, b) { |
| 837 var c = b[0], d = b[1], e = b[2]; |
| 838 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]; |
| 839 }; |
| 840 axs.color.toYCbCr = function(a) { |
| 841 var b = a.red / 255, c = a.green / 255; |
| 842 a = a.blue / 255; |
| 843 return new axs.color.YCbCr(axs.color.multiplyMatrixVector(axs.color.YCC_MATRIX
, [.03928 >= b ? b / 12.92 : Math.pow((b + .055) / 1.055, 2.4), .03928 >= c ? c
/ 12.92 : Math.pow((c + .055) / 1.055, 2.4), .03928 >= a ? a / 12.92 : Math.pow(
(a + .055) / 1.055, 2.4)])); |
| 844 }; |
| 845 axs.color.fromYCbCr = function(a) { |
| 846 return axs.color.fromYCbCrArray([a.luma, a.Cb, a.Cr]); |
| 847 }; |
| 848 axs.color.fromYCbCrArray = function(a) { |
| 849 var b = axs.color.multiplyMatrixVector(axs.color.INVERTED_YCC_MATRIX, a); |
| 850 a = b[0]; |
| 851 var c = b[1], b = b[2]; |
| 852 return new axs.color.Color(Math.min(Math.max(Math.round(255 * (.00303949 >= a
? 12.92 * a : 1.055 * Math.pow(a, 1 / 2.4) - .055)), 0), 255), Math.min(Math.max
(Math.round(255 * (.00303949 >= c ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - .
055)), 0), 255), Math.min(Math.max(Math.round(255 * (.00303949 >= b ? 12.92 * b
: 1.055 * Math.pow(b, 1 / 2.4) - .055)), 0), 255), 1); |
| 853 }; |
| 854 axs.color.RGBToYCbCrMatrix = function(a, b) { |
| 855 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)]]; |
| 856 }; |
| 857 axs.color.invert3x3Matrix = function(a) { |
| 858 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]; |
| 859 a = a[2][2]; |
| 860 return axs.color.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))); |
| 861 }; |
| 862 axs.color.findIntersection = function(a, b) { |
| 863 var c = [a.a.x - b.p0.x, a.a.y - b.p0.y, a.a.z - b.p0.z], d = axs.color.invert
3x3Matrix([[a.a.x - a.b.x, b.p1.x - b.p0.x, b.p2.x - b.p0.x], [a.a.y - a.b.y, b.
p1.y - b.p0.y, b.p2.y - b.p0.y], [a.a.z - a.b.z, b.p1.z - b.p0.z, b.p2.z - b.p0.
z]]), c = axs.color.multiplyMatrixVector(d, c)[0]; |
| 864 return a.a.add(a.b.subtract(a.a).multiply(c)); |
| 865 }; |
| 866 axs.color.scalarMultiplyMatrix = function(a, b) { |
| 867 for (var c = [], d = 0;3 > d;d++) { |
| 868 c[d] = axs.color.scalarMultiplyVector(a[d], b); |
| 869 } |
| 870 return c; |
| 871 }; |
| 872 axs.color.scalarMultiplyVector = function(a, b) { |
| 873 for (var c = [], d = 0;d < a.length;d++) { |
| 874 c[d] = a[d] * b; |
| 875 } |
| 876 return c; |
| 877 }; |
| 878 axs.color.kR = .2126; |
| 879 axs.color.kB = .0722; |
| 880 axs.color.YCC_MATRIX = axs.color.RGBToYCbCrMatrix(axs.color.kR, axs.color.kB); |
| 881 axs.color.INVERTED_YCC_MATRIX = axs.color.invert3x3Matrix(axs.color.YCC_MATRIX); |
| 882 axs.color.BLACK = new axs.color.Color(0, 0, 0, 1); |
| 883 axs.color.BLACK_YCC = axs.color.toYCbCr(axs.color.BLACK); |
| 884 axs.color.WHITE = new axs.color.Color(255, 255, 255, 1); |
| 885 axs.color.WHITE_YCC = axs.color.toYCbCr(axs.color.WHITE); |
| 886 axs.color.RED = new axs.color.Color(255, 0, 0, 1); |
| 887 axs.color.RED_YCC = axs.color.toYCbCr(axs.color.RED); |
| 888 axs.color.GREEN = new axs.color.Color(0, 255, 0, 1); |
| 889 axs.color.GREEN_YCC = axs.color.toYCbCr(axs.color.GREEN); |
| 890 axs.color.BLUE = new axs.color.Color(0, 0, 255, 1); |
| 891 axs.color.BLUE_YCC = axs.color.toYCbCr(axs.color.BLUE); |
| 892 axs.color.CYAN = new axs.color.Color(0, 255, 255, 1); |
| 893 axs.color.CYAN_YCC = axs.color.toYCbCr(axs.color.CYAN); |
| 894 axs.color.MAGENTA = new axs.color.Color(255, 0, 255, 1); |
| 895 axs.color.MAGENTA_YCC = axs.color.toYCbCr(axs.color.MAGENTA); |
| 896 axs.color.YELLOW = new axs.color.Color(255, 255, 0, 1); |
| 897 axs.color.YELLOW_YCC = axs.color.toYCbCr(axs.color.YELLOW); |
| 898 axs.color.YCC_CUBE_FACES_BLACK = [{p0:axs.color.BLACK_YCC, p1:axs.color.RED_YCC,
p2:axs.color.GREEN_YCC}, {p0:axs.color.BLACK_YCC, p1:axs.color.GREEN_YCC, p2:ax
s.color.BLUE_YCC}, {p0:axs.color.BLACK_YCC, p1:axs.color.BLUE_YCC, p2:axs.color.
RED_YCC}]; |
| 899 axs.color.YCC_CUBE_FACES_WHITE = [{p0:axs.color.WHITE_YCC, p1:axs.color.CYAN_YCC
, p2:axs.color.MAGENTA_YCC}, {p0:axs.color.WHITE_YCC, p1:axs.color.MAGENTA_YCC,
p2:axs.color.YELLOW_YCC}, {p0:axs.color.WHITE_YCC, p1:axs.color.YELLOW_YCC, p2:a
xs.color.CYAN_YCC}]; |
| 900 axs.constants = {}; |
| 901 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", |
| 902 "author"], namerequired:!0, parent:["input"], requiredProperties:["aria-checked"
], properties:["aria-checked"]}, columnheader:{namefrom:["contents", "author"],
namerequired:!0, parent:["gridcell", "sectionhead", "widget"], properties:["aria
-sort"], scope:["row"]}, combobox:{mustcontain:["listbox", "textbox"], namefrom:
["author"], namerequired:!0, parent:["select"], requiredProperties:["aria-expand
ed"], properties:["aria-expanded", "aria-autocomplete", "aria-required"]}, comma
nd:{"abstract":!0, namefrom:["author"], |
| 903 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"], |
| 904 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"], scope:["row"]}, group:{namefrom:[" author"], parent:["section"], pro
perties:["aria-activedescendant"]}, |
| 905 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"]}, |
| 906 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"], scope:["list"]}, log:{namef
rom:[" author"], namerequired:!0, parent:["region"]}, main:{namefrom:["author"],
parent:["landmark"]}, marquee:{namerequired:!0, parent:["section"]}, math:{chil
dpresentational:!0, namefrom:["author"], |
| 907 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"], scope:["menu", "menubar"]},
menuitemcheckbox:{namefrom:["contents", "author"], namerequired:!0, parent:["ch
eckbox", "menuitem"], scope:["menu", "menubar"]}, menuitemradio:{namefrom:["cont
ents", "author"], namerequired:!0, |
| 908 parent:["menuitemcheckbox", "radio"], scope:["menu", "menubar"]}, navigation:{na
mefrom:["author"], parent:["landmark"]}, note:{namefrom:["author"], parent:["sec
tion"]}, option:{namefrom:["contents", "author"], namerequired:!0, parent:["inpu
t"], properties:["aria-checked", "aria-posinset", "aria-selected", "aria-setsize
"]}, presentation:{parent:["structure"]}, progressbar:{childpresentational:!0, n
amefrom:["author"], namerequired:!0, parent:["range"]}, radio:{namefrom:["conten
ts", "author"], namerequired:!0, |
| 909 parent:["checkbox", "option"]}, radiogroup:{mustcontain:["radio"], namefrom:["au
thor"], namerequired:!0, parent:["select"], properties:["aria-required"]}, range
:{"abstract":!0, namefrom:["author"], parent:["widget"], properties:["aria-value
max", "aria-valuemin", "aria-valuenow", "aria-valuetext"]}, region:{namefrom:["
author"], parent:["section"]}, roletype:{"abstract":!0, properties:"aria-atomic
aria-busy aria-controls aria-describedby aria-disabled aria-dropeffect aria-flow
to aria-grabbed aria-haspopup aria-hidden aria-invalid aria-label aria-labelledb
y aria-live aria-owns aria-relevant".split(" ")}, |
| 910 row:{mustcontain:["columnheader", "gridcell", "rowheader"], namefrom:["contents"
, "author"], parent:["group", "widget"], properties:["aria-level", "aria-selecte
d"], scope:["grid", "rowgroup", "treegrid"]}, rowgroup:{mustcontain:["row"], nam
efrom:["contents", "author"], parent:["group"], scope:["grid"]}, rowheader:{name
from:["contents", "author"], namerequired:!0, parent:["gridcell", "sectionhead",
"widget"], properties:["aria-sort"], scope:["row"]}, search:{namefrom:["author"
], parent:["landmark"]}, |
| 911 section:{"abstract":!0, namefrom:["contents", "author"], parent:["structure"], p
roperties:["aria-expanded"]}, sectionhead:{"abstract":!0, namefrom:["contents",
"author"], parent:["structure"], properties:["aria-expanded"]}, select:{"abstrac
t":!0, namefrom:["author"], parent:["composite", "group", "input"]}, separator:{
childpresentational:!0, namefrom:["author"], parent:["structure"], properties:["
aria-expanded", "aria-orientation"]}, scrollbar:{childpresentational:!0, namefro
m:["author"], namerequired:!1, |
| 912 parent:["input", "range"], requiredProperties:["aria-controls", "aria-orientatio
n", "aria-valuemax", "aria-valuemin", "aria-valuenow"], properties:["aria-contro
ls", "aria-orientation", "aria-valuemax", "aria-valuemin", "aria-valuenow"]}, sl
ider:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["inp
ut", "range"], requiredProperties:["aria-valuemax", "aria-valuemin", "aria-value
now"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-orie
ntation"]}, spinbutton:{namefrom:["author"], |
| 913 namerequired:!0, parent:["input", "range"], requiredProperties:["aria-valuemax",
"aria-valuemin", "aria-valuenow"], properties:["aria-valuemax", "aria-valuemin"
, "aria-valuenow", "aria-required"]}, status:{parent:["region"]}, structure:{"ab
stract":!0, parent:["roletype"]}, tab:{namefrom:["contents", "author"], parent:[
"sectionhead", "widget"], properties:["aria-selected"], scope:["tablist"]}, tabl
ist:{mustcontain:["tab"], namefrom:["author"], parent:["composite", "directory"]
, properties:["aria-level"]}, |
| 914 tabpanel:{namefrom:["author"], namerequired:!0, parent:["region"]}, textbox:{nam
efrom:["author"], namerequired:!0, parent:["input"], properties:["aria-activedes
cendant", "aria-autocomplete", "aria-multiline", "aria-readonly", "aria-required
"]}, timer:{namefrom:["author"], namerequired:!0, parent:["status"]}, toolbar:{n
amefrom:["author"], parent:["group"]}, tooltip:{namerequired:!0, parent:["sectio
n"]}, tree:{mustcontain:["group", "treeitem"], namefrom:["author"], namerequired
:!0, parent:["select"], |
| 915 properties:["aria-multiselectable", "aria-required"]}, treegrid:{mustcontain:["r
ow"], namefrom:["author"], namerequired:!0, parent:["grid", "tree"]}, treeitem:{
namefrom:["contents", "author"], namerequired:!0, parent:["listitem", "option"],
scope:["group", "tree"]}, widget:{"abstract":!0, parent:["roletype"]}, window:{
"abstract":!0, namefrom:[" author"], parent:["roletype"], properties:["aria-expa
nded"]}}; |
| 916 axs.constants.WIDGET_ROLES = {}; |
| 917 axs.constants.addAllParentRolesToSet_ = function(a, b) { |
| 918 if (a.parent) { |
| 919 for (var c = a.parent, d = 0;d < c.length;d++) { |
| 920 var e = c[d]; |
| 921 b[e] = !0; |
| 922 axs.constants.addAllParentRolesToSet_(axs.constants.ARIA_ROLES[e], b); |
| 923 } |
| 924 } |
| 925 }; |
| 926 axs.constants.addAllPropertiesToSet_ = function(a, b, c) { |
| 927 var d = a[b]; |
| 928 if (d) { |
| 929 for (var e = 0;e < d.length;e++) { |
| 930 c[d[e]] = !0; |
| 931 } |
| 932 } |
| 933 if (a.parent) { |
| 934 for (a = a.parent, d = 0;d < a.length;d++) { |
| 935 axs.constants.addAllPropertiesToSet_(axs.constants.ARIA_ROLES[a[d]], b, c)
; |
| 936 } |
| 937 } |
| 938 }; |
| 939 for (var roleName in axs.constants.ARIA_ROLES) { |
| 940 var role = axs.constants.ARIA_ROLES[roleName], propertiesSet = {}; |
| 941 axs.constants.addAllPropertiesToSet_(role, "properties", propertiesSet); |
| 942 role.propertiesSet = propertiesSet; |
| 943 var requiredPropertiesSet = {}; |
| 944 axs.constants.addAllPropertiesToSet_(role, "requiredProperties", requiredPrope
rtiesSet); |
| 945 role.requiredPropertiesSet = requiredPropertiesSet; |
| 946 var parentRolesSet = {}; |
| 947 axs.constants.addAllParentRolesToSet_(role, parentRolesSet); |
| 948 role.allParentRolesSet = parentRolesSet; |
| 949 "widget" in parentRolesSet && (axs.constants.WIDGET_ROLES[roleName] = role); |
| 950 } |
| 951 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"}, |
| 952 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", |
| 953 "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"]}, |
| 954 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", |
| 955 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", |
| 956 "other"]}, valuemax:{type:"property", valueType:"decimal"}, valuemin:{type:"prop
erty", valueType:"decimal"}, valuenow:{type:"property", valueType:"decimal"}, va
luetext:{type:"property", valueType:"string"}}; |
| 957 (function() { |
| 958 for (var a in axs.constants.ARIA_PROPERTIES) { |
| 959 var b = axs.constants.ARIA_PROPERTIES[a]; |
| 960 if (b.values) { |
| 961 for (var c = {}, d = 0;d < b.values.length;d++) { |
| 962 c[b.values[d]] = !0; |
| 963 } |
| 964 b.valuesSet = c; |
| 965 } |
| 966 } |
| 967 })(); |
| 968 axs.constants.GLOBAL_PROPERTIES = axs.constants.ARIA_ROLES.roletype.propertiesSe
t; |
| 969 axs.constants.NO_ROLE_NAME = " "; |
| 970 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", |
| 971 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"}; |
| 972 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", |
| 973 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"}; |
| 974 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", |
| 975 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", |
| 976 "false":"aria_selected_false"}}]; |
| 977 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", |
| 978 submit:"input_type_submit", tel:"input_type_tel", text:"input_type_text", url:"i
nput_type_url", week:"input_type_week"}; |
| 979 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"}; |
| 980 axs.constants.TAG_TO_INFORMATION_TABLE_BRIEF_MSG = {BUTTON:"tag_button", SELECT:
"tag_select", TEXTAREA:"tag_textarea"}; |
| 981 axs.constants.MIXED_VALUES = {"true":!0, "false":!0, mixed:!0}; |
| 982 axs.constants.Severity = {INFO:"Info", WARNING:"Warning", SEVERE:"Severe"}; |
| 983 axs.constants.AuditResult = {PASS:"PASS", FAIL:"FAIL", NA:"NA"}; |
| 984 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}; |
| 985 axs.constants.NATIVELY_DISABLEABLE = {BUTTON:!0, INPUT:!0, SELECT:!0, TEXTAREA:!
0, FIELDSET:!0, OPTGROUP:!0, OPTION:!0}; |
| 986 axs.constants.ARIA_TO_HTML_ATTRIBUTE = {"aria-checked":"checked", "aria-disabled
":"disabled", "aria-hidden":"hidden", "aria-expanded":"open", "aria-valuemax":"m
ax", "aria-valuemin":"min", "aria-readonly":"readonly", "aria-required":"require
d", "aria-selected":"selected", "aria-valuenow":"value"}; |
| 987 axs.constants.TAG_TO_IMPLICIT_SEMANTIC_INFO = {A:[{role:"link", allowed:"button
checkbox menuitem menuitemcheckbox menuitemradio tab treeitem".split(" "), selec
tor:"a[href]"}], ADDRESS:[{role:"", allowed:["contentinfo", "presentation"]}], A
REA:[{role:"link", selector:"area[href]"}], ARTICLE:[{role:"article", allowed:["
presentation", "article", "document", "application", "main"]}], ASIDE:[{role:"co
mplementary", allowed:["note", "complementary", "search", "presentation"]}], AUD
IO:[{role:"", allowed:["application", |
| 988 "presentation"]}], BASE:[{role:"", reserved:!0}], BODY:[{role:"document", allowe
d:["presentation"]}], BUTTON:[{role:"button", allowed:["link", "menuitem", "menu
itemcheckbox", "menuitemradio", "radio"], selector:'button:not([aria-pressed]):n
ot([type="menu"])'}, {role:"button", allowed:["button"], selector:"button[aria-p
ressed]"}, {role:"button", attributes:{"aria-haspopup":!0}, allowed:["link", "me
nuitem", "menuitemcheckbox", "menuitemradio", "radio"], selector:'button[type="m
enu"]'}], CAPTION:[{role:"", |
| 989 allowed:["presentation"]}], COL:[{role:"", reserved:!0}], COLGROUP:[{role:"", re
served:!0}], DATALIST:[{role:"listbox", attributes:{"aria-multiselectable":!1},
allowed:["presentation"]}], DEL:[{role:"", allowed:["*"]}], DD:[{role:"", allowe
d:["presentation"]}], DT:[{role:"", allowed:["presentation"]}], DETAILS:[{role:"
group", allowed:["group", "presentation"]}], DIALOG:[{role:"dialog", allowed:"di
alog alert alertdialog application log marquee status".split(" "), selector:"dia
log[open]"}, {role:"dialog", |
| 990 attributes:{"aria-hidden":!0}, allowed:"dialog alert alertdialog application log
marquee status".split(" "), selector:"dialog:not([open])"}], DIV:[{role:"", all
owed:["*"]}], DL:[{role:"list", allowed:["presentation"]}], EMBED:[{role:"", all
owed:["application", "document", "img", "presentation"]}], FIGURE:[{role:"", all
owed:["*"]}], FOOTER:[{role:"", allowed:["contentinfo", "presentation"]}], FORM:
[{role:"form", allowed:["presentation"]}], P:[{role:"", allowed:["*"]}], PRE:[{r
ole:"", allowed:["*"]}], |
| 991 BLOCKQUOTE:[{role:"", allowed:["*"]}], H1:[{role:"heading"}], H2:[{role:"heading
"}], H3:[{role:"heading"}], H4:[{role:"heading"}], H5:[{role:"heading"}], H6:[{r
ole:"heading"}], HEAD:[{role:"", reserved:!0}], HEADER:[{role:"", allowed:["bann
er", "presentation"]}], HR:[{role:"separator", allowed:["presentation"]}], HTML:
[{role:"", reserved:!0}], IFRAME:[{role:"", allowed:["application", "document",
"img", "presentation"], selector:"iframe:not([seamless])"}, {role:"", allowed:["
application", "document", |
| 992 "img", "presentation", "group"], selector:"iframe[seamless]"}], IMG:[{role:"pres
entation", reserved:!0, selector:'img[alt=""]'}, {role:"img", allowed:["*"], sel
ector:'img[alt]:not([alt=""])'}], INPUT:[{role:"button", allowed:["link", "menui
tem", "menuitemcheckbox", "menuitemradio", "radio"], selector:'input[type="butto
n"]:not([aria-pressed])'}, {role:"button", allowed:["button"], selector:'input[t
ype="button"][aria-pressed]'}, {role:"checkbox", allowed:["checkbox"], selector:
'input[type="checkbox"]'}, |
| 993 {role:"", selector:'input[type="color"]'}, {role:"", selector:'input[type="date"
]'}, {role:"", selector:'input[type="datetime"]'}, {role:"textbox", selector:'in
put[type="email"]:not([list])'}, {role:"", selector:'input[type="file"]'}, {role
:"", reserved:!0, selector:'input[type="hidden"]'}, {role:"button", allowed:["bu
tton"], selector:'input[type="image"][aria-pressed]'}, {role:"button", allowed:[
"link", "menuitem", "menuitemcheckbox", "menuitemradio", "radio"], selector:'inp
ut[type="image"]:not([aria-pressed])'}, |
| 994 {role:"", selector:'input[type="month"]'}, {role:"", selector:'input[type="numbe
r"]'}, {role:"textbox", selector:'input[type="password"]'}, {role:"radio", allow
ed:["menuitemradio"], selector:'input[type="radio"]'}, {role:"slider", selector:
'input[type="range"]'}, {role:"button", selector:'input[type="reset"]'}, {role:"
combobox", selector:'input[type="search"][list]'}, {role:"textbox", selector:'in
put[type="search"]:not([list])'}, {role:"button", selector:'input[type="submit"]
'}, {role:"combobox", |
| 995 selector:'input[type="tel"][list]'}, {role:"textbox", selector:'input[type="tel"
]:not([list])'}, {role:"combobox", selector:'input[type="text"][list]'}, {role:"
textbox", selector:'input[type="text"]:not([list])'}, {role:"textbox", selector:
"input:not([type])"}, {role:"", selector:'input[type="time"]'}, {role:"combobox"
, selector:'input[type="url"][list]'}, {role:"textbox", selector:'input[type="ur
l"]:not([list])'}, {role:"", selector:'input[type="week"]'}], INS:[{role:"", all
owed:["*"]}], KEYGEN:[{role:""}], |
| 996 LABEL:[{role:"", allowed:["presentation"]}], LI:[{role:"listitem", allowed:"menu
item menuitemcheckbox menuitemradio option tab treeitem presentation".split(" ")
, selector:'ol:not([role="presentation"])>li, ul:not([role="presentation"])>li'}
, {role:"listitem", allowed:"listitem menuitem menuitemcheckbox menuitemradio op
tion tab treeitem presentation".split(" "), selector:'ol[role="presentation"]>li
, ul[role="presentation"]>li'}], LINK:[{role:"link", reserved:!0, selector:"link
[href]"}], MAIN:[{role:"", |
| 997 allowed:["main", "presentation"]}], MAP:[{role:"", reserved:!0}], MATH:[{role:""
, allowed:["presentation"]}], MENU:[{role:"toolbar", selector:'menu[type="toolba
r"]'}], MENUITEM:[{role:"menuitem", selector:'menuitem[type="command"]'}, {role:
"menuitemcheckbox", selector:'menuitem[type="checkbox"]'}, {role:"menuitemradio"
, selector:'menuitem[type="radio"]'}], META:[{role:"", reserved:!0}], METER:[{ro
le:"progressbar", allowed:["presentation"]}], NAV:[{role:"navigation", allowed:[
"navigation", "presentation"]}], |
| 998 NOSCRIPT:[{role:"", reserved:!0}], OBJECT:[{role:"", allowed:["application", "do
cument", "img", "presentation"]}], OL:[{role:"list", allowed:"directory group li
stbox menu menubar tablist toolbar tree presentation".split(" ")}], OPTGROUP:[{r
ole:"", allowed:["presentation"]}], OPTION:[{role:"option"}], OUTPUT:[{role:"sta
tus", allowed:["*"]}], PARAM:[{role:"", reserved:!0}], PICTURE:[{role:"", reserv
ed:!0}], PROGRESS:[{role:"progressbar", allowed:["presentation"]}], SCRIPT:[{rol
e:"", reserved:!0}], |
| 999 SECTION:[{role:"region", allowed:"alert alertdialog application contentinfo dial
og document log marquee search status presentation".split(" ")}], SELECT:[{role:
"listbox"}], SOURCE:[{role:"", reserved:!0}], SPAN:[{role:"", allowed:["*"]}], S
TYLE:[{role:"", reserved:!0}], SVG:[{role:"", allowed:["application", "document"
, "img", "presentation"]}], SUMMARY:[{role:"", allowed:["presentation"]}], TABLE
:[{role:"", allowed:["*"]}], TEMPLATE:[{role:"", reserved:!0}], TEXTAREA:[{role:
"textbox"}], TBODY:[{role:"rowgroup", |
| 1000 allowed:["*"]}], THEAD:[{role:"rowgroup", allowed:["*"]}], TFOOT:[{role:"rowgrou
p", allowed:["*"]}], TITLE:[{role:"", reserved:!0}], TD:[{role:"", allowed:["*"]
}], TH:[{role:"", allowed:["*"]}], TR:[{role:"", allowed:["*"]}], TRACK:[{role:"
", reserved:!0}], UL:[{role:"list", allowed:"directory group listbox menu menuba
r tablist toolbar tree presentation".split(" ")}], VIDEO:[{role:"", allowed:["ap
plication", "presentation"]}]}; |
| 1001 axs.dom = {}; |
| 1002 axs.dom.parentElement = function(a) { |
| 1003 if (!a) { |
| 1004 return null; |
| 1005 } |
| 1006 a = axs.dom.composedParentNode(a); |
| 1007 if (!a) { |
| 1008 return null; |
| 1009 } |
| 1010 switch(a.nodeType) { |
| 1011 case Node.ELEMENT_NODE: |
| 1012 return a; |
| 1013 default: |
| 1014 return axs.dom.parentElement(a); |
| 1015 } |
| 1016 }; |
| 1017 axs.dom.shadowHost = function(a) { |
| 1018 return "host" in a ? a.host : null; |
| 1019 }; |
| 1020 axs.dom.composedParentNode = function(a) { |
| 1021 if (!a) { |
| 1022 return null; |
| 1023 } |
| 1024 if (a.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { |
| 1025 return axs.dom.shadowHost(a); |
| 1026 } |
| 1027 var b = a.parentNode; |
| 1028 if (!b) { |
| 1029 return null; |
| 1030 } |
| 1031 if (b.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { |
| 1032 return axs.dom.shadowHost(b); |
| 1033 } |
| 1034 if (!b.shadowRoot) { |
| 1035 return b; |
| 1036 } |
| 1037 if (a.nodeType === Node.ELEMENT_NODE || a.nodeType === Node.TEXT_NODE) { |
| 1038 if (b = a.assignedSlot, HTMLSlotElement && b instanceof HTMLSlotElement) { |
| 1039 return axs.dom.composedParentNode(b); |
| 1040 } |
| 1041 } |
| 1042 return "function" === typeof a.getDestinationInsertionPoints && (a = a.getDest
inationInsertionPoints(), 0 < a.length) ? axs.dom.composedParentNode(a[a.length
- 1]) : null; |
| 1043 }; |
| 1044 axs.dom.asElement = function(a) { |
| 1045 switch(a.nodeType) { |
| 1046 case Node.COMMENT_NODE: |
| 1047 break; |
| 1048 case Node.ELEMENT_NODE: |
| 1049 if ("script" == a.localName || "template" == a.localName) { |
| 1050 break; |
| 1051 } |
| 1052 return a; |
| 1053 case Node.DOCUMENT_FRAGMENT_NODE: |
| 1054 return a.host; |
| 1055 case Node.TEXT_NODE: |
| 1056 return axs.dom.parentElement(a); |
| 1057 default: |
| 1058 console.warn("Unhandled node type: ", a.nodeType); |
| 1059 } |
| 1060 return null; |
| 1061 }; |
| 1062 axs.dom.composedTreeSearch = function(a, b, c, d, e) { |
| 1063 if (a === b) { |
| 1064 return !0; |
| 1065 } |
| 1066 if (a.nodeType == Node.ELEMENT_NODE) { |
| 1067 var f = a; |
| 1068 } |
| 1069 var g = !1; |
| 1070 d = Object.create(d); |
| 1071 if (f) { |
| 1072 var h = f.localName; |
| 1073 d.collectIdRefs && (d.idrefs = axs.utils.getReferencedIds(f)); |
| 1074 if (!d.disabled || "legend" === h && axs.browserUtils.matchSelector(f, "fiel
dset>legend:first-of-type")) { |
| 1075 d.disabled = axs.utils.isElementDisabled(f, !0); |
| 1076 } |
| 1077 d.hidden || (d.hidden = axs.utils.isElementHidden(f)); |
| 1078 if (c.preorder && !c.preorder(f, d)) { |
| 1079 return g; |
| 1080 } |
| 1081 var k = f.shadowRoot || f.webkitShadowRoot; |
| 1082 if (k) { |
| 1083 return d.level++, g = axs.dom.composedTreeSearch(k, b, c, d, k), f && c.po
storder && !g && c.postorder(f, d), g; |
| 1084 } |
| 1085 if ("content" == h && "function" === typeof f.getDistributedNodes) { |
| 1086 a = f.getDistributedNodes(); |
| 1087 for (h = 0;h < a.length && !g;h++) { |
| 1088 g = axs.dom.composedTreeSearch(a[h], b, c, d, e); |
| 1089 } |
| 1090 c.postorder && !g && c.postorder.call(null, f, d); |
| 1091 return g; |
| 1092 } |
| 1093 } |
| 1094 for (a = a.firstChild;null != a && !g;) { |
| 1095 g = axs.dom.composedTreeSearch(a, b, c, d, e), a = a.nextSibling; |
| 1096 } |
| 1097 f && c.postorder && !g && c.postorder.call(null, f, d); |
| 1098 return g; |
| 1099 }; |
| 1100 axs.utils = {}; |
| 1101 axs.utils.FOCUSABLE_ELEMENTS_SELECTOR = "input:not([type=hidden]):not([disabled]
),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),a[href]
,iframe,[tabindex]"; |
| 1102 axs.utils.LABELABLE_ELEMENTS_SELECTOR = "button,input:not([type=hidden]),keygen,
meter,output,progress,select,textarea"; |
| 1103 axs.utils.elementIsTransparent = function(a) { |
| 1104 return "0" == a.style.opacity; |
| 1105 }; |
| 1106 axs.utils.elementHasZeroArea = function(a) { |
| 1107 a = a.getBoundingClientRect(); |
| 1108 var b = a.top - a.bottom; |
| 1109 return a.right - a.left && b ? !1 : !0; |
| 1110 }; |
| 1111 axs.utils.elementIsOutsideScrollArea = function(a) { |
| 1112 for (var b = axs.dom.parentElement(a), c = a.ownerDocument.defaultView;b != c.
document.body;) { |
| 1113 if (axs.utils.isClippedBy(a, b)) { |
| 1114 return !0; |
| 1115 } |
| 1116 if (axs.utils.canScrollTo(a, b) && !axs.utils.elementIsOutsideScrollArea(b))
{ |
| 1117 return !1; |
| 1118 } |
| 1119 b = axs.dom.parentElement(b); |
| 1120 } |
| 1121 return !axs.utils.canScrollTo(a, c.document.body); |
| 1122 }; |
| 1123 axs.utils.canScrollTo = function(a, b) { |
| 1124 var c = a.getBoundingClientRect(), d = b.getBoundingClientRect(); |
| 1125 if (b == b.ownerDocument.body) { |
| 1126 var e = d.top, f = d.left; |
| 1127 } else { |
| 1128 e = d.top - b.scrollTop, f = d.left - b.scrollLeft; |
| 1129 } |
| 1130 var g = e + b.scrollHeight, h = f + b.scrollWidth; |
| 1131 if (c.right < f || c.bottom < e || c.left > h || c.top > g) { |
| 1132 return !1; |
| 1133 } |
| 1134 e = a.ownerDocument.defaultView; |
| 1135 f = e.getComputedStyle(b); |
| 1136 return c.left > d.right || c.top > d.bottom ? "scroll" == f.overflow || "auto"
== f.overflow || b instanceof e.HTMLBodyElement : !0; |
| 1137 }; |
| 1138 axs.utils.isClippedBy = function(a, b) { |
| 1139 var c = a.getBoundingClientRect(), d = b.getBoundingClientRect(), e = d.top -
b.scrollTop, f = d.left - b.scrollLeft, g = a.ownerDocument.defaultView.getCompu
tedStyle(b); |
| 1140 return (c.right < d.left || c.bottom < d.top || c.left > d.right || c.top > d.
bottom) && "hidden" == g.overflow ? !0 : c.right < f || c.bottom < e ? "visible"
!= g.overflow : !1; |
| 1141 }; |
| 1142 axs.utils.isAncestor = function(a, b) { |
| 1143 if (null == b) { |
| 1144 return !1; |
| 1145 } |
| 1146 if (b === a) { |
| 1147 return !0; |
| 1148 } |
| 1149 var c = axs.dom.composedParentNode(b); |
| 1150 return axs.utils.isAncestor(a, c); |
| 1151 }; |
| 1152 axs.utils.overlappingElements = function(a) { |
| 1153 if (axs.utils.elementHasZeroArea(a)) { |
| 1154 return null; |
| 1155 } |
| 1156 for (var b = [], c = a.getClientRects(), d = 0;d < c.length;d++) { |
| 1157 var e = c[d], e = document.elementFromPoint((e.left + e.right) / 2, (e.top +
e.bottom) / 2); |
| 1158 if (null != e && e != a && !axs.utils.isAncestor(e, a) && !axs.utils.isAnces
tor(a, e)) { |
| 1159 var f = window.getComputedStyle(e, null); |
| 1160 f && (f = axs.utils.getBgColor(f, e)) && 0 < f.alpha && 0 > b.indexOf(e) &
& b.push(e); |
| 1161 } |
| 1162 } |
| 1163 return b; |
| 1164 }; |
| 1165 axs.utils.elementIsHtmlControl = function(a) { |
| 1166 var b = a.ownerDocument.defaultView; |
| 1167 return a instanceof b.HTMLButtonElement || a instanceof b.HTMLInputElement ||
a instanceof b.HTMLSelectElement || a instanceof b.HTMLTextAreaElement ? !0 : !1
; |
| 1168 }; |
| 1169 axs.utils.elementIsAriaWidget = function(a) { |
| 1170 return a.hasAttribute("role") && (a = a.getAttribute("role")) && (a = axs.cons
tants.ARIA_ROLES[a]) && "widget" in a.allParentRolesSet ? !0 : !1; |
| 1171 }; |
| 1172 axs.utils.elementIsVisible = function(a) { |
| 1173 return axs.utils.elementIsTransparent(a) || axs.utils.elementHasZeroArea(a) ||
axs.utils.elementIsOutsideScrollArea(a) || axs.utils.overlappingElements(a).len
gth ? !1 : !0; |
| 1174 }; |
| 1175 axs.utils.isLargeFont = function(a) { |
| 1176 var b = a.fontSize; |
| 1177 a = "bold" == a.fontWeight; |
| 1178 var c = b.match(/(\d+)px/); |
| 1179 if (c) { |
| 1180 b = parseInt(c[1], 10); |
| 1181 if (c = window.getComputedStyle(document.body, null).fontSize.match(/(\d+)px
/)) { |
| 1182 var d = parseInt(c[1], 10), c = 1.2 * d, d = 1.5 * d; |
| 1183 } else { |
| 1184 c = 19.2, d = 24; |
| 1185 } |
| 1186 return a && b >= c || b >= d; |
| 1187 } |
| 1188 if (c = b.match(/(\d+)em/)) { |
| 1189 return b = parseInt(c[1], 10), a && 1.2 <= b || 1.5 <= b ? !0 : !1; |
| 1190 } |
| 1191 if (c = b.match(/(\d+)%/)) { |
| 1192 return b = parseInt(c[1], 10), a && 120 <= b || 150 <= b ? !0 : !1; |
| 1193 } |
| 1194 if (c = b.match(/(\d+)pt/)) { |
| 1195 if (b = parseInt(c[1], 10), a && 14 <= b || 18 <= b) { |
| 1196 return !0; |
| 1197 } |
| 1198 } |
| 1199 return !1; |
| 1200 }; |
| 1201 axs.utils.getBgColor = function(a, b) { |
| 1202 var c = axs.color.parseColor(a.backgroundColor); |
| 1203 if (!c) { |
| 1204 return null; |
| 1205 } |
| 1206 1 > a.opacity && (c.alpha *= a.opacity); |
| 1207 if (1 > c.alpha) { |
| 1208 var d = axs.utils.getParentBgColor(b); |
| 1209 if (null == d) { |
| 1210 return null; |
| 1211 } |
| 1212 c = axs.color.flattenColors(c, d); |
| 1213 } |
| 1214 return c; |
| 1215 }; |
| 1216 axs.utils.getParentBgColor = function(a) { |
| 1217 var b = a; |
| 1218 a = []; |
| 1219 for (var c = null;b = axs.dom.parentElement(b);) { |
| 1220 var d = window.getComputedStyle(b, null); |
| 1221 if (d) { |
| 1222 var e = axs.color.parseColor(d.backgroundColor); |
| 1223 if (e && (1 > d.opacity && (e.alpha *= d.opacity), 0 != e.alpha && (a.push
(e), 1 == e.alpha))) { |
| 1224 c = !0; |
| 1225 break; |
| 1226 } |
| 1227 } |
| 1228 } |
| 1229 c || a.push(new axs.color.Color(255, 255, 255, 1)); |
| 1230 for (b = a.pop();a.length;) { |
| 1231 c = a.pop(), b = axs.color.flattenColors(c, b); |
| 1232 } |
| 1233 return b; |
| 1234 }; |
| 1235 axs.utils.getFgColor = function(a, b, c) { |
| 1236 var d = axs.color.parseColor(a.color); |
| 1237 if (!d) { |
| 1238 return null; |
| 1239 } |
| 1240 1 > d.alpha && (d = axs.color.flattenColors(d, c)); |
| 1241 1 > a.opacity && (b = axs.utils.getParentBgColor(b), d.alpha *= a.opacity, d =
axs.color.flattenColors(d, b)); |
| 1242 return d; |
| 1243 }; |
| 1244 axs.utils.getContrastRatioForElement = function(a) { |
| 1245 var b = window.getComputedStyle(a, null); |
| 1246 return axs.utils.getContrastRatioForElementWithComputedStyle(b, a); |
| 1247 }; |
| 1248 axs.utils.getContrastRatioForElementWithComputedStyle = function(a, b) { |
| 1249 if (axs.utils.isElementHidden(b)) { |
| 1250 return null; |
| 1251 } |
| 1252 var c = axs.utils.getBgColor(a, b); |
| 1253 if (!c) { |
| 1254 return null; |
| 1255 } |
| 1256 var d = axs.utils.getFgColor(a, b, c); |
| 1257 return d ? axs.color.calculateContrastRatio(d, c) : null; |
| 1258 }; |
| 1259 axs.utils.isNativeTextElement = function(a) { |
| 1260 var b = a.tagName.toLowerCase(); |
| 1261 a = a.type ? a.type.toLowerCase() : ""; |
| 1262 if ("textarea" == b) { |
| 1263 return !0; |
| 1264 } |
| 1265 if ("input" != b) { |
| 1266 return !1; |
| 1267 } |
| 1268 switch(a) { |
| 1269 case "email": |
| 1270 case "number": |
| 1271 case "password": |
| 1272 case "search": |
| 1273 case "text": |
| 1274 case "tel": |
| 1275 case "url": |
| 1276 case "": |
| 1277 return !0; |
| 1278 default: |
| 1279 return !1; |
| 1280 } |
| 1281 }; |
| 1282 axs.utils.isLowContrast = function(a, b, c) { |
| 1283 a = Math.round(10 * a) / 10; |
| 1284 return c ? 4.5 > a || !axs.utils.isLargeFont(b) && 7 > a : 3 > a || !axs.utils
.isLargeFont(b) && 4.5 > a; |
| 1285 }; |
| 1286 axs.utils.hasLabel = function(a) { |
| 1287 var b = a.tagName.toLowerCase(), c = a.type ? a.type.toLowerCase() : ""; |
| 1288 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") || a.hasAttribute("id") && 0 < document.querySelectorAll('label[for="' + a
.id + '"]').length) { |
| 1289 return !0; |
| 1290 } |
| 1291 for (b = axs.dom.parentElement(a);b;) { |
| 1292 if ("label" == b.tagName.toLowerCase() && b.control == a) { |
| 1293 return !0; |
| 1294 } |
| 1295 b = axs.dom.parentElement(b); |
| 1296 } |
| 1297 return !1; |
| 1298 }; |
| 1299 axs.utils.isNativelyDisableable = function(a) { |
| 1300 return a.tagName.toUpperCase() in axs.constants.NATIVELY_DISABLEABLE; |
| 1301 }; |
| 1302 axs.utils.isElementDisabled = function(a, b) { |
| 1303 if (axs.browserUtils.matchSelector(a, b ? "[aria-disabled=true]" : "[aria-disa
bled=true], [aria-disabled=true] *")) { |
| 1304 return !0; |
| 1305 } |
| 1306 if (!axs.utils.isNativelyDisableable(a) || axs.browserUtils.matchSelector(a, "
fieldset>legend:first-of-type *")) { |
| 1307 return !1; |
| 1308 } |
| 1309 for (var c = a;null !== c;c = axs.dom.parentElement(c)) { |
| 1310 if (c.hasAttribute("disabled")) { |
| 1311 return !0; |
| 1312 } |
| 1313 if (b) { |
| 1314 break; |
| 1315 } |
| 1316 } |
| 1317 return !1; |
| 1318 }; |
| 1319 axs.utils.isElementHidden = function(a) { |
| 1320 if (!(a instanceof a.ownerDocument.defaultView.HTMLElement)) { |
| 1321 return !1; |
| 1322 } |
| 1323 if (a.hasAttribute("chromevoxignoreariahidden")) { |
| 1324 var b = !0; |
| 1325 } |
| 1326 var c = window.getComputedStyle(a, null); |
| 1327 return "none" == c.display || "hidden" == c.visibility ? !0 : a.hasAttribute("
aria-hidden") && "true" == a.getAttribute("aria-hidden").toLowerCase() ? !b : !1
; |
| 1328 }; |
| 1329 axs.utils.isElementOrAncestorHidden = function(a) { |
| 1330 return axs.utils.isElementHidden(a) ? !0 : axs.dom.parentElement(a) ? axs.util
s.isElementOrAncestorHidden(axs.dom.parentElement(a)) : !1; |
| 1331 }; |
| 1332 axs.utils.isInlineElement = function(a) { |
| 1333 a = a.tagName.toUpperCase(); |
| 1334 return axs.constants.InlineElements[a]; |
| 1335 }; |
| 1336 axs.utils.getRoles = function(a, b) { |
| 1337 if (!a || a.nodeType !== Node.ELEMENT_NODE || !a.hasAttribute("role") && !b) { |
| 1338 return null; |
| 1339 } |
| 1340 var c = a.getAttribute("role"); |
| 1341 !c && b && (c = axs.properties.getImplicitRole(a)); |
| 1342 if (!c) { |
| 1343 return null; |
| 1344 } |
| 1345 for (var c = c.split(" "), d = {roles:[], valid:!1}, e = 0;e < c.length;e++) { |
| 1346 var f = c[e], g = axs.constants.ARIA_ROLES[f], f = {name:f}; |
| 1347 g && !g["abstract"] ? (f.details = g, d.applied || (d.applied = f), f.valid
= d.valid = !0) : f.valid = !1; |
| 1348 d.roles.push(f); |
| 1349 } |
| 1350 return d; |
| 1351 }; |
| 1352 axs.utils.getAriaPropertyValue = function(a, b, c) { |
| 1353 var d = a.replace(/^aria-/, ""), e = axs.constants.ARIA_PROPERTIES[d], d = {na
me:a, rawValue:b}; |
| 1354 if (!e) { |
| 1355 return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property',
d; |
| 1356 } |
| 1357 e = e.valueType; |
| 1358 if (!e) { |
| 1359 return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property',
d; |
| 1360 } |
| 1361 switch(e) { |
| 1362 case "idref": |
| 1363 a = axs.utils.isValidIDRefValue(b, c), d.valid = a.valid, d.reason = a.rea
son, d.idref = a.idref; |
| 1364 case "idref_list": |
| 1365 a = b.split(/\s+/); |
| 1366 d.valid = !0; |
| 1367 for (b = 0;b < a.length;b++) { |
| 1368 e = axs.utils.isValidIDRefValue(a[b], c), e.valid || (d.valid = !1), d.v
alues ? d.values.push(e) : d.values = [e]; |
| 1369 } |
| 1370 return d; |
| 1371 case "integer": |
| 1372 c = axs.utils.isValidNumber(b); |
| 1373 if (!c.valid) { |
| 1374 return d.valid = !1, d.reason = c.reason, d; |
| 1375 } |
| 1376 Math.floor(c.value) !== c.value ? (d.valid = !1, d.reason = "" + b + " is
not a whole integer") : (d.valid = !0, d.value = c.value); |
| 1377 return d; |
| 1378 case "decimal": |
| 1379 case "number": |
| 1380 c = axs.utils.isValidNumber(b); |
| 1381 d.valid = c.valid; |
| 1382 if (!c.valid) { |
| 1383 return d.reason = c.reason, d; |
| 1384 } |
| 1385 d.value = c.value; |
| 1386 return d; |
| 1387 case "string": |
| 1388 return d.valid = !0, d.value = b, d; |
| 1389 case "token": |
| 1390 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; |
| 1391 case "token_list": |
| 1392 e = b.split(/\s+/); |
| 1393 d.valid = !0; |
| 1394 for (b = 0;b < e.length;b++) { |
| 1395 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]; |
| 1396 } |
| 1397 return d; |
| 1398 case "tristate": |
| 1399 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; |
| 1400 case "boolean": |
| 1401 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; |
| 1402 } |
| 1403 d.valid = !1; |
| 1404 d.reason = "Not a valid ARIA property"; |
| 1405 return d; |
| 1406 }; |
| 1407 axs.utils.isValidTokenValue = function(a, b) { |
| 1408 var c = a.replace(/^aria-/, ""); |
| 1409 return axs.utils.isPossibleValue(b, axs.constants.ARIA_PROPERTIES[c].valuesSet
, a); |
| 1410 }; |
| 1411 axs.utils.isPossibleValue = function(a, b, c) { |
| 1412 return b[a] ? {valid:!0, value:a} : {valid:!1, value:a, reason:'"' + a + '" is
not a valid value for ' + c, possibleValues:Object.keys(b)}; |
| 1413 }; |
| 1414 axs.utils.isValidBoolean = function(a) { |
| 1415 try { |
| 1416 var b = JSON.parse(a); |
| 1417 } catch (c) { |
| 1418 b = ""; |
| 1419 } |
| 1420 return "boolean" != typeof b ? {valid:!1, value:a, reason:'"' + a + '" is not
a true/false value'} : {valid:!0, value:b}; |
| 1421 }; |
| 1422 axs.utils.isValidIDRefValue = function(a, b) { |
| 1423 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 +
'"'}; |
| 1424 }; |
| 1425 axs.utils.isValidNumber = function(a) { |
| 1426 var b = {valid:!1, value:a, reason:'"' + a + '" is not a number'}; |
| 1427 if (!a) { |
| 1428 return b; |
| 1429 } |
| 1430 if (/^0x/i.test(a)) { |
| 1431 return b.reason = '"' + a + '" is not a decimal number', b; |
| 1432 } |
| 1433 a *= 1; |
| 1434 return isFinite(a) ? {valid:!0, value:a} : b; |
| 1435 }; |
| 1436 axs.utils.isElementImplicitlyFocusable = function(a) { |
| 1437 var b = a.ownerDocument.defaultView; |
| 1438 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; |
| 1439 }; |
| 1440 axs.utils.values = function(a) { |
| 1441 var b = [], c; |
| 1442 for (c in a) { |
| 1443 a.hasOwnProperty(c) && "function" != typeof a[c] && b.push(a[c]); |
| 1444 } |
| 1445 return b; |
| 1446 }; |
| 1447 axs.utils.namedValues = function(a) { |
| 1448 var b = {}, c; |
| 1449 for (c in a) { |
| 1450 a.hasOwnProperty(c) && "function" != typeof a[c] && (b[c] = a[c]); |
| 1451 } |
| 1452 return b; |
| 1453 }; |
| 1454 function escapeId(a) { |
| 1455 return a.replace(/[^a-zA-Z0-9_-]/g, function(a) { |
| 1456 return "\\" + a; |
| 1457 }); |
| 1458 } |
| 1459 axs.utils.getQuerySelectorText = function(a) { |
| 1460 if (null == a || "HTML" == a.tagName) { |
| 1461 return "html"; |
| 1462 } |
| 1463 if ("BODY" == a.tagName) { |
| 1464 return "body"; |
| 1465 } |
| 1466 if (a.hasAttribute) { |
| 1467 if (a.id) { |
| 1468 return "#" + escapeId(a.id); |
| 1469 } |
| 1470 if (a.className) { |
| 1471 for (var b = "", c = 0;c < a.classList.length;c++) { |
| 1472 b += "." + a.classList[c]; |
| 1473 } |
| 1474 var d = 0; |
| 1475 if (a.parentNode) { |
| 1476 for (c = 0;c < a.parentNode.children.length;c++) { |
| 1477 var e = a.parentNode.children[c]; |
| 1478 axs.browserUtils.matchSelector(e, b) && d++; |
| 1479 if (e === a) { |
| 1480 break; |
| 1481 } |
| 1482 } |
| 1483 } else { |
| 1484 d = 1; |
| 1485 } |
| 1486 if (1 == d) { |
| 1487 return axs.utils.getQuerySelectorText(a.parentNode) + " > " + b; |
| 1488 } |
| 1489 } |
| 1490 if (a.parentNode) { |
| 1491 b = a.parentNode.children; |
| 1492 d = 1; |
| 1493 for (c = 0;b[c] !== a;) { |
| 1494 b[c].tagName == a.tagName && d++, c++; |
| 1495 } |
| 1496 c = ""; |
| 1497 "BODY" != a.parentNode.tagName && (c = axs.utils.getQuerySelectorText(a.pa
rentNode) + " > "); |
| 1498 return 1 == d ? c + a.tagName : c + a.tagName + ":nth-of-type(" + d + ")"; |
| 1499 } |
| 1500 } else { |
| 1501 if (a.selectorText) { |
| 1502 return a.selectorText; |
| 1503 } |
| 1504 } |
| 1505 return ""; |
| 1506 }; |
| 1507 axs.utils.getAriaIdReferrers = function(a, b) { |
| 1508 var c = function(a) { |
| 1509 var b = axs.constants.ARIA_PROPERTIES[a]; |
| 1510 if (b) { |
| 1511 if ("idref" === b.valueType) { |
| 1512 return "[aria-" + a + "='" + d + "']"; |
| 1513 } |
| 1514 if ("idref_list" === b.valueType) { |
| 1515 return "[aria-" + a + "~='" + d + "']"; |
| 1516 } |
| 1517 } |
| 1518 return ""; |
| 1519 }; |
| 1520 if (!a) { |
| 1521 return null; |
| 1522 } |
| 1523 var d = a.id; |
| 1524 if (!d) { |
| 1525 return null; |
| 1526 } |
| 1527 d = d.replace(/'/g, "\\'"); |
| 1528 if (b) { |
| 1529 var e = b.replace(/^aria-/, ""), f = c(e); |
| 1530 if (f) { |
| 1531 return a.ownerDocument.querySelectorAll(f); |
| 1532 } |
| 1533 } else { |
| 1534 var g = []; |
| 1535 for (e in axs.constants.ARIA_PROPERTIES) { |
| 1536 (f = c(e)) && g.push(f); |
| 1537 } |
| 1538 return a.ownerDocument.querySelectorAll(g.join(",")); |
| 1539 } |
| 1540 return null; |
| 1541 }; |
| 1542 axs.utils.getHtmlIdReferrers = function(a) { |
| 1543 if (!a) { |
| 1544 return null; |
| 1545 } |
| 1546 var b = a.id; |
| 1547 if (!b) { |
| 1548 return null; |
| 1549 } |
| 1550 var b = b.replace(/'/g, "\\'"), c = "[contextmenu='{id}'] [itemref~='{id}'] bu
tton[form='{id}'] button[menu='{id}'] fieldset[form='{id}'] input[form='{id}'] i
nput[list='{id}'] keygen[form='{id}'] label[for='{id}'] label[form='{id}'] menui
tem[command='{id}'] object[form='{id}'] output[for~='{id}'] output[form='{id}']
select[form='{id}'] td[headers~='{id}'] textarea[form='{id}'] tr[headers~='{id}'
]".split(" ").map(function(a) { |
| 1551 return a.replace("{id}", b); |
| 1552 }); |
| 1553 return a.ownerDocument.querySelectorAll(c.join(",")); |
| 1554 }; |
| 1555 axs.utils.getReferencedIds = function(a) { |
| 1556 for (var b = [], c = function(a) { |
| 1557 a && (0 < a.indexOf(" ") ? b = b.concat(f.value.split(" ")) : b.push(a)); |
| 1558 }, d = 0;d < a.attributes.length;d++) { |
| 1559 var e = a.tagName.toLowerCase(), f = a.attributes[d]; |
| 1560 if (f.specified) { |
| 1561 var g = f.name, h = g.match(/aria-(.+)/); |
| 1562 if (h) { |
| 1563 e = axs.constants.ARIA_PROPERTIES[h[1]], !e || "idref" !== e.valueType &
& "idref_list" !== e.valueType || c(f.value); |
| 1564 } else { |
| 1565 switch(g) { |
| 1566 case "contextmenu": |
| 1567 case "itemref": |
| 1568 c(f.value); |
| 1569 break; |
| 1570 case "form": |
| 1571 "button" != e && "fieldset" != e && "input" != e && "keygen" != e &&
"label" != e && "object" != e && "output" != e && "select" != e && "textarea" !
= e || c(f.value); |
| 1572 break; |
| 1573 case "for": |
| 1574 "label" != e && "output" != e || c(f.value); |
| 1575 break; |
| 1576 case "menu": |
| 1577 "button" == e && c(f.value); |
| 1578 break; |
| 1579 case "list": |
| 1580 "input" == e && c(f.value); |
| 1581 break; |
| 1582 case "command": |
| 1583 "menuitem" == e && c(f.value); |
| 1584 break; |
| 1585 case "headers": |
| 1586 "td" != e && "tr" != e || c(f.value); |
| 1587 } |
| 1588 } |
| 1589 } |
| 1590 } |
| 1591 return b; |
| 1592 }; |
| 1593 axs.utils.getIdReferrers = function(a) { |
| 1594 var b = [], c = axs.utils.getHtmlIdReferrers(a); |
| 1595 c && (b = b.concat(Array.prototype.slice.call(c))); |
| 1596 (c = axs.utils.getAriaIdReferrers(a)) && (b = b.concat(Array.prototype.slice.c
all(c))); |
| 1597 return b; |
| 1598 }; |
| 1599 axs.utils.getIdReferents = function(a, b) { |
| 1600 var c = [], d = a.replace(/^aria-/, ""), d = axs.constants.ARIA_PROPERTIES[d]; |
| 1601 if (!d || !b.hasAttribute(a)) { |
| 1602 return c; |
| 1603 } |
| 1604 d = d.valueType; |
| 1605 if ("idref_list" === d || "idref" === d) { |
| 1606 for (var d = b.ownerDocument, e = b.getAttribute(a), e = e.split(/\s+/), f =
0, g = e.length;f < g;f++) { |
| 1607 var h = d.getElementById(e[f]); |
| 1608 h && (c[c.length] = h); |
| 1609 } |
| 1610 } |
| 1611 return c; |
| 1612 }; |
| 1613 axs.utils.getAriaPropertiesByValueType = function(a) { |
| 1614 var b = {}, c; |
| 1615 for (c in axs.constants.ARIA_PROPERTIES) { |
| 1616 var d = axs.constants.ARIA_PROPERTIES[c]; |
| 1617 d && 0 <= a.indexOf(d.valueType) && (b[c] = d); |
| 1618 } |
| 1619 return b; |
| 1620 }; |
| 1621 axs.utils.getSelectorForAriaProperties = function(a) { |
| 1622 a = Object.keys(a).map(function(a) { |
| 1623 return "[aria-" + a + "]"; |
| 1624 }); |
| 1625 a.sort(); |
| 1626 return a.join(","); |
| 1627 }; |
| 1628 axs.utils.findDescendantsWithRole = function(a, b) { |
| 1629 if (!a || !b) { |
| 1630 return []; |
| 1631 } |
| 1632 var c = axs.properties.getSelectorForRole(b); |
| 1633 if (c && (c = a.querySelectorAll(c))) { |
| 1634 c = Array.prototype.map.call(c, function(a) { |
| 1635 return a; |
| 1636 }); |
| 1637 } else { |
| 1638 return []; |
| 1639 } |
| 1640 return c; |
| 1641 }; |
| 1642 axs.properties = {}; |
| 1643 axs.properties.TEXT_CONTENT_XPATH = './/text()[normalize-space(.)!=""]/parent::*
[name()!="script"]'; |
| 1644 axs.properties.getFocusProperties = function(a) { |
| 1645 var b = {}, c = a.getAttribute("tabindex"); |
| 1646 void 0 != c ? b.tabindex = {value:c, valid:!0} : axs.utils.isElementImplicitly
Focusable(a) && (b.implicitlyFocusable = {value:!0, valid:!0}); |
| 1647 if (0 == Object.keys(b).length) { |
| 1648 return null; |
| 1649 } |
| 1650 var d = axs.utils.elementIsTransparent(a), e = axs.utils.elementHasZeroArea(a)
, f = axs.utils.elementIsOutsideScrollArea(a), g = axs.utils.overlappingElements
(a); |
| 1651 if (d || e || f || 0 < g.length) { |
| 1652 var c = axs.utils.isElementOrAncestorHidden(a), h = {value:!1, valid:c}; |
| 1653 d && (h.transparent = !0); |
| 1654 e && (h.zeroArea = !0); |
| 1655 f && (h.outsideScrollArea = !0); |
| 1656 g && 0 < g.length && (h.overlappingElements = g); |
| 1657 d = {value:c, valid:c}; |
| 1658 c && (d.reason = axs.properties.getHiddenReason(a)); |
| 1659 h.hidden = d; |
| 1660 b.visible = h; |
| 1661 } else { |
| 1662 b.visible = {value:!0, valid:!0}; |
| 1663 } |
| 1664 return b; |
| 1665 }; |
| 1666 axs.properties.getHiddenReason = function(a) { |
| 1667 if (!(a && a instanceof a.ownerDocument.defaultView.HTMLElement)) { |
| 1668 return null; |
| 1669 } |
| 1670 if (a.hasAttribute("chromevoxignoreariahidden")) { |
| 1671 var b = !0; |
| 1672 } |
| 1673 var c = window.getComputedStyle(a, null); |
| 1674 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.dom.parentElement(a)); |
| 1675 }; |
| 1676 axs.properties.getColorProperties = function(a) { |
| 1677 var b = {}; |
| 1678 (a = axs.properties.getContrastRatioProperties(a)) && (b.contrastRatio = a); |
| 1679 return 0 == Object.keys(b).length ? null : b; |
| 1680 }; |
| 1681 axs.properties.hasDirectTextDescendant = function(a) { |
| 1682 function b() { |
| 1683 for (var b = c.evaluate(axs.properties.TEXT_CONTENT_XPATH, a, null, XPathRes
ult.ANY_TYPE, null), e = b.iterateNext();null != e;e = b.iterateNext()) { |
| 1684 if (e === a) { |
| 1685 return !0; |
| 1686 } |
| 1687 } |
| 1688 return !1; |
| 1689 } |
| 1690 var c; |
| 1691 c = a.nodeType == Node.DOCUMENT_NODE ? a : a.ownerDocument; |
| 1692 return c.evaluate ? b() : function() { |
| 1693 for (var b = c.createTreeWalker(a, NodeFilter.SHOW_TEXT, null, !1);b.nextNod
e();) { |
| 1694 var e = b.currentNode, f = e.parentNode, f = f.host || f, f = f.tagName.to
LowerCase(); |
| 1695 if (e.nodeValue.trim() && "script" !== f && a !== e) { |
| 1696 return !0; |
| 1697 } |
| 1698 } |
| 1699 return !1; |
| 1700 }(); |
| 1701 }; |
| 1702 axs.properties.getContrastRatioProperties = function(a) { |
| 1703 if (!axs.properties.hasDirectTextDescendant(a)) { |
| 1704 return null; |
| 1705 } |
| 1706 var b = {}, c = window.getComputedStyle(a, null), d = axs.utils.getBgColor(c,
a); |
| 1707 if (!d) { |
| 1708 return null; |
| 1709 } |
| 1710 b.backgroundColor = axs.color.colorToString(d); |
| 1711 var e = axs.utils.getFgColor(c, a, d); |
| 1712 b.foregroundColor = axs.color.colorToString(e); |
| 1713 a = axs.utils.getContrastRatioForElementWithComputedStyle(c, a); |
| 1714 if (!a) { |
| 1715 return null; |
| 1716 } |
| 1717 b.value = a.toFixed(2); |
| 1718 axs.utils.isLowContrast(a, c) && (b.alert = !0); |
| 1719 var f = axs.utils.isLargeFont(c) ? 3 : 4.5, c = axs.utils.isLargeFont(c) ? 4.5
: 7, g = {}; |
| 1720 f > a && (g.AA = f); |
| 1721 c > a && (g.AAA = c); |
| 1722 if (!Object.keys(g).length) { |
| 1723 return b; |
| 1724 } |
| 1725 (d = axs.color.suggestColors(d, e, g)) && Object.keys(d).length && (b.suggeste
dColors = d); |
| 1726 return b; |
| 1727 }; |
| 1728 axs.properties.findTextAlternatives = function(a, b, c, d) { |
| 1729 var e = c || !1; |
| 1730 c = axs.dom.asElement(a); |
| 1731 if (!c || !d && axs.utils.isElementOrAncestorHidden(c)) { |
| 1732 return null; |
| 1733 } |
| 1734 if (a.nodeType == Node.TEXT_NODE) { |
| 1735 return c = {type:"text"}, c.text = a.textContent, c.lastWord = axs.propertie
s.getLastWord(c.text), b.content = c, a.textContent; |
| 1736 } |
| 1737 a = null; |
| 1738 e || (a = axs.properties.getTextFromAriaLabelledby(c, b)); |
| 1739 if (c.hasAttribute("aria-label")) { |
| 1740 var f = {type:"text"}; |
| 1741 f.text = c.getAttribute("aria-label"); |
| 1742 f.lastWord = axs.properties.getLastWord(f.text); |
| 1743 a ? f.unused = !0 : e && axs.utils.elementIsHtmlControl(c) || (a = f.text); |
| 1744 b.ariaLabel = f; |
| 1745 } |
| 1746 c.hasAttribute("role") && "presentation" == c.getAttribute("role") || (a = axs
.properties.getTextFromHostLanguageAttributes(c, b, a, e)); |
| 1747 e && axs.utils.elementIsHtmlControl(c) && (f = c.ownerDocument.defaultView, c
instanceof f.HTMLInputElement && ("text" == c.type && c.value && 0 < c.value.len
gth && (b.controlValue = {text:c.value}), "range" == c.type && (b.controlValue =
{text:c.value})), c instanceof f.HTMLSelectElement && (b.controlValue = {text:c
.value}), b.controlValue && (f = b.controlValue, a ? f.unused = !0 : a = f.text)
); |
| 1748 if (e && axs.utils.elementIsAriaWidget(c)) { |
| 1749 e = c.getAttribute("role"); |
| 1750 "textbox" == e && c.textContent && 0 < c.textContent.length && (b.controlVal
ue = {text:c.textContent}); |
| 1751 if ("slider" == e || "spinbutton" == e) { |
| 1752 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")}); |
| 1753 } |
| 1754 if ("menu" == e) { |
| 1755 for (var g = c.querySelectorAll("[role=menuitemcheckbox], [role=menuitemra
dio]"), f = [], h = 0;h < g.length;h++) { |
| 1756 "true" == g[h].getAttribute("aria-checked") && f.push(g[h]); |
| 1757 } |
| 1758 if (0 < f.length) { |
| 1759 g = ""; |
| 1760 for (h = 0;h < f.length;h++) { |
| 1761 g += axs.properties.findTextAlternatives(f[h], {}, !0), h < f.length -
1 && (g += ", "); |
| 1762 } |
| 1763 b.controlValue = {text:g}; |
| 1764 } |
| 1765 } |
| 1766 if ("combobox" == e || "select" == e) { |
| 1767 b.controlValue = {text:"TODO"}; |
| 1768 } |
| 1769 b.controlValue && (f = b.controlValue, a ? f.unused = !0 : a = f.text); |
| 1770 } |
| 1771 f = !0; |
| 1772 c.hasAttribute("role") && (e = c.getAttribute("role"), (e = axs.constants.ARIA
_ROLES[e]) && (!e.namefrom || 0 > e.namefrom.indexOf("contents")) && (f = !1)); |
| 1773 (d = axs.properties.getTextFromDescendantContent(c, d)) && f && (e = {type:"te
xt"}, e.text = d, e.lastWord = axs.properties.getLastWord(e.text), a ? e.unused
= !0 : a = d, b.content = e); |
| 1774 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); |
| 1775 return 0 == Object.keys(b).length && null == a ? null : a; |
| 1776 }; |
| 1777 axs.properties.getTextFromDescendantContent = function(a, b) { |
| 1778 for (var c = a.childNodes, d = [], e = 0;e < c.length;e++) { |
| 1779 var f = axs.properties.findTextAlternatives(c[e], {}, !0, b); |
| 1780 f && d.push(f.trim()); |
| 1781 } |
| 1782 if (d.length) { |
| 1783 c = ""; |
| 1784 for (e = 0;e < d.length;e++) { |
| 1785 c = [c, d[e]].join(" ").trim(); |
| 1786 } |
| 1787 return c; |
| 1788 } |
| 1789 return null; |
| 1790 }; |
| 1791 axs.properties.getTextFromAriaLabelledby = function(a, b) { |
| 1792 var c = null; |
| 1793 if (!a.hasAttribute("aria-labelledby")) { |
| 1794 return c; |
| 1795 } |
| 1796 for (var d = a.getAttribute("aria-labelledby").split(/\s+/), e = {valid:!0}, f
= [], g = [], h = 0;h < d.length;h++) { |
| 1797 var k = {type:"element"}, m = d[h]; |
| 1798 k.value = m; |
| 1799 var l = document.getElementById(m); |
| 1800 l ? (k.valid = !0, k.text = axs.properties.findTextAlternatives(l, {}, !0, !
0), k.lastWord = axs.properties.getLastWord(k.text), f.push(k.text), k.element =
l) : (k.valid = !1, e.valid = !1, k.errorMessage = {messageKey:"noElementWithId
", args:[m]}); |
| 1801 g.push(k); |
| 1802 } |
| 1803 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); |
| 1804 return c; |
| 1805 }; |
| 1806 axs.properties.getTextFromHostLanguageAttributes = function(a, b, c, d) { |
| 1807 if (axs.browserUtils.matchSelector(a, "img") && a.hasAttribute("alt")) { |
| 1808 var e = {type:"string", valid:!0}; |
| 1809 e.text = a.getAttribute("alt"); |
| 1810 c ? e.unused = !0 : c = e.text; |
| 1811 b.alt = e; |
| 1812 } |
| 1813 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) { |
| 1814 if (a.hasAttribute("id")) { |
| 1815 d = document.querySelectorAll('label[for="' + a.id + '"]'); |
| 1816 for (var e = {}, f = [], g = [], h = 0;h < d.length;h++) { |
| 1817 var k = {type:"element"}, m = d[h], l = axs.properties.findTextAlternati
ves(m, {}, !0); |
| 1818 l && 0 < l.trim().length && (k.text = l.trim(), g.push(l.trim())); |
| 1819 k.element = m; |
| 1820 f.push(k); |
| 1821 } |
| 1822 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); |
| 1823 } |
| 1824 d = axs.dom.parentElement(a); |
| 1825 for (e = {};d;) { |
| 1826 if ("label" == d.tagName.toLowerCase() && (f = d, f.control == a)) { |
| 1827 e.type = "element"; |
| 1828 e.text = axs.properties.findTextAlternatives(f, {}, !0); |
| 1829 e.lastWord = axs.properties.getLastWord(e.text); |
| 1830 e.element = f; |
| 1831 break; |
| 1832 } |
| 1833 d = axs.dom.parentElement(d); |
| 1834 } |
| 1835 e.text && (c ? e.unused = !0 : c = e.text, b.labelWrapped = e); |
| 1836 axs.browserUtils.matchSelector(a, 'input[type="image"]') && a.hasAttribute("
alt") && (e = {type:"string", valid:!0}, e.text = a.getAttribute("alt"), c ? e.u
nused = !0 : c = e.text, b.alt = e); |
| 1837 Object.keys(b).length || (b.noLabel = !0); |
| 1838 } |
| 1839 return c; |
| 1840 }; |
| 1841 axs.properties.getLastWord = function(a) { |
| 1842 if (!a) { |
| 1843 return null; |
| 1844 } |
| 1845 var b = a.lastIndexOf(" ") + 1, c = a.length - 10; |
| 1846 return a.substring(b > c ? b : c); |
| 1847 }; |
| 1848 axs.properties.getTextProperties = function(a) { |
| 1849 var b = {}, c = axs.properties.findTextAlternatives(a, b, !1, !0); |
| 1850 if (0 == Object.keys(b).length && ((a = axs.dom.asElement(a)) && axs.browserUt
ils.matchSelector(a, "img") && (b.alt = {valid:!1, errorMessage:"No alt value pr
ovided"}, a = a.src, "string" == typeof a && (c = a.split("/").pop(), b.filename
= {text:c})), !c)) { |
| 1851 return null; |
| 1852 } |
| 1853 b.hasProperties = !!Object.keys(b).length; |
| 1854 b.computedText = c; |
| 1855 b.lastWord = axs.properties.getLastWord(c); |
| 1856 return b; |
| 1857 }; |
| 1858 axs.properties.getAriaProperties = function(a) { |
| 1859 var b = {}, c = axs.properties.getGlobalAriaProperties(a), d; |
| 1860 for (d in axs.constants.ARIA_PROPERTIES) { |
| 1861 var e = "aria-" + d; |
| 1862 if (a.hasAttribute(e)) { |
| 1863 var f = a.getAttribute(e); |
| 1864 c[e] = axs.utils.getAriaPropertyValue(e, f, a); |
| 1865 } |
| 1866 } |
| 1867 0 < Object.keys(c).length && (b.properties = axs.utils.values(c)); |
| 1868 f = axs.utils.getRoles(a); |
| 1869 if (!f) { |
| 1870 return Object.keys(b).length ? b : null; |
| 1871 } |
| 1872 b.roles = f; |
| 1873 if (!f.valid || !f.roles) { |
| 1874 return b; |
| 1875 } |
| 1876 for (var e = f.roles, g = 0;g < e.length;g++) { |
| 1877 var h = e[g]; |
| 1878 if (h.details && h.details.propertiesSet) { |
| 1879 for (d in h.details.propertiesSet) { |
| 1880 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"})); |
| 1881 } |
| 1882 } |
| 1883 } |
| 1884 0 < Object.keys(c).length && (b.properties = axs.utils.values(c)); |
| 1885 return 0 < Object.keys(b).length ? b : null; |
| 1886 }; |
| 1887 axs.properties.getGlobalAriaProperties = function(a) { |
| 1888 var b = {}, c; |
| 1889 for (c in axs.constants.GLOBAL_PROPERTIES) { |
| 1890 if (a.hasAttribute(c)) { |
| 1891 var d = a.getAttribute(c); |
| 1892 b[c] = axs.utils.getAriaPropertyValue(c, d, a); |
| 1893 } |
| 1894 } |
| 1895 return b; |
| 1896 }; |
| 1897 axs.properties.getVideoProperties = function(a) { |
| 1898 if (!axs.browserUtils.matchSelector(a, "video")) { |
| 1899 return null; |
| 1900 } |
| 1901 var b = {}; |
| 1902 b.captionTracks = axs.properties.getTrackElements(a, "captions"); |
| 1903 b.descriptionTracks = axs.properties.getTrackElements(a, "descriptions"); |
| 1904 b.chapterTracks = axs.properties.getTrackElements(a, "chapters"); |
| 1905 return b; |
| 1906 }; |
| 1907 axs.properties.getTrackElements = function(a, b) { |
| 1908 var c = a.querySelectorAll("track[kind=" + b + "]"), d = {}; |
| 1909 if (!c.length) { |
| 1910 return d.valid = !1, d.reason = {messageKey:"noTracksProvided", args:[[b]]},
d; |
| 1911 } |
| 1912 d.valid = !0; |
| 1913 for (var e = [], f = 0;f < c.length;f++) { |
| 1914 var g = {}, h = c[f].getAttribute("src"), k = c[f].getAttribute("srcLang"),
m = c[f].getAttribute("label"); |
| 1915 h ? (g.valid = !0, g.src = h) : (g.valid = !1, g.reason = {messageKey:"noSrc
Provided"}); |
| 1916 h = ""; |
| 1917 m && (h += m, k && (h += " ")); |
| 1918 k && (h += "(" + k + ")"); |
| 1919 "" == h && (h = "[[object Object]]"); |
| 1920 g.name = h; |
| 1921 e.push(g); |
| 1922 } |
| 1923 d.values = e; |
| 1924 return d; |
| 1925 }; |
| 1926 axs.properties.getAllProperties = function(a) { |
| 1927 var b = axs.dom.asElement(a); |
| 1928 if (!b) { |
| 1929 return {}; |
| 1930 } |
| 1931 var c = {}; |
| 1932 c.ariaProperties = axs.properties.getAriaProperties(b); |
| 1933 c.colorProperties = axs.properties.getColorProperties(b); |
| 1934 c.focusProperties = axs.properties.getFocusProperties(b); |
| 1935 c.textProperties = axs.properties.getTextProperties(a); |
| 1936 c.videoProperties = axs.properties.getVideoProperties(b); |
| 1937 return c; |
| 1938 }; |
| 1939 (function() { |
| 1940 function a(a) { |
| 1941 if (!a) { |
| 1942 return null; |
| 1943 } |
| 1944 var b = a.tagName; |
| 1945 if (!b) { |
| 1946 return null; |
| 1947 } |
| 1948 b = b.toUpperCase(); |
| 1949 b = axs.constants.TAG_TO_IMPLICIT_SEMANTIC_INFO[b]; |
| 1950 if (!b || !b.length) { |
| 1951 return null; |
| 1952 } |
| 1953 for (var d = null, e = 0, f = b.length;e < f;e++) { |
| 1954 var g = b[e]; |
| 1955 if (g.selector) { |
| 1956 if (axs.browserUtils.matchSelector(a, g.selector)) { |
| 1957 return g; |
| 1958 } |
| 1959 } else { |
| 1960 d = g; |
| 1961 } |
| 1962 } |
| 1963 return d; |
| 1964 } |
| 1965 axs.properties.getImplicitRole = function(b) { |
| 1966 return (b = a(b)) ? b.role : ""; |
| 1967 }; |
| 1968 axs.properties.canTakeAriaAttributes = function(b) { |
| 1969 return (b = a(b)) ? !b.reserved : !0; |
| 1970 }; |
| 1971 })(); |
| 1972 axs.properties.getNativelySupportedAttributes = function(a) { |
| 1973 var b = []; |
| 1974 if (!a) { |
| 1975 return b; |
| 1976 } |
| 1977 a = a.cloneNode(!1); |
| 1978 for (var c = Object.keys(axs.constants.ARIA_TO_HTML_ATTRIBUTE), d = 0;d < c.le
ngth;d++) { |
| 1979 var e = c[d]; |
| 1980 axs.constants.ARIA_TO_HTML_ATTRIBUTE[e] in a && (b[b.length] = e); |
| 1981 } |
| 1982 return b; |
| 1983 }; |
| 1984 (function() { |
| 1985 var a = {}; |
| 1986 axs.properties.getSelectorForRole = function(b) { |
| 1987 if (!b) { |
| 1988 return ""; |
| 1989 } |
| 1990 if (a[b] && a.hasOwnProperty(b)) { |
| 1991 return a[b]; |
| 1992 } |
| 1993 var c = ['[role="' + b + '"]']; |
| 1994 Object.keys(axs.constants.TAG_TO_IMPLICIT_SEMANTIC_INFO).forEach(function(a)
{ |
| 1995 var d = axs.constants.TAG_TO_IMPLICIT_SEMANTIC_INFO[a]; |
| 1996 if (d && d.length) { |
| 1997 for (var f = 0;f < d.length;f++) { |
| 1998 var g = d[f]; |
| 1999 if (g.role === b) { |
| 2000 if (g.selector) { |
| 2001 c[c.length] = g.selector; |
| 2002 } else { |
| 2003 c[c.length] = a; |
| 2004 break; |
| 2005 } |
| 2006 } |
| 2007 } |
| 2008 } |
| 2009 }); |
| 2010 return a[b] = c.join(","); |
| 2011 }; |
| 2012 })(); |
| 2013 axs.AuditRule = function(a) { |
| 2014 for (var b = a.opt_requires || {}, c = !0, d = [], e = 0;e < axs.AuditRule.req
uiredFields.length;e++) { |
| 2015 var f = axs.AuditRule.requiredFields[e]; |
| 2016 f in a || (c = !1, d.push(f)); |
| 2017 } |
| 2018 if (!c) { |
| 2019 throw "Invalid spec; the following fields were not specified: " + d.join(",
") + "\n" + JSON.stringify(a); |
| 2020 } |
| 2021 this.name = a.name; |
| 2022 this.severity = a.severity; |
| 2023 this.relevantElementMatcher_ = a.relevantElementMatcher; |
| 2024 this.isRelevant_ = a.isRelevant || function(a, b) { |
| 2025 return !0; |
| 2026 }; |
| 2027 this.test_ = a.test; |
| 2028 this.code = a.code; |
| 2029 this.heading = a.heading || ""; |
| 2030 this.url = a.url || ""; |
| 2031 this.requiresConsoleAPI = !!b.consoleAPI; |
| 2032 this.relevantElements = []; |
| 2033 this.relatedElements = []; |
| 2034 this.collectIdRefs = b.idRefs || !1; |
| 2035 }; |
| 2036 axs.AuditRule.requiredFields = "name severity relevantElementMatcher test code h
eading".split(" "); |
| 2037 axs.AuditRule.NOT_APPLICABLE = {result:axs.constants.AuditResult.NA}; |
| 2038 axs.AuditRule.prototype.addElement = function(a, b) { |
| 2039 a.push(b); |
| 2040 }; |
| 2041 axs.AuditRule.prototype.collectMatchingElement = function(a, b) { |
| 2042 return this.relevantElementMatcher_(a, b) && b.inScope ? (this.relevantElement
s.push({element:a, flags:b}), !0) : !1; |
| 2043 }; |
| 2044 axs.AuditRule.prototype.canRun = function(a) { |
| 2045 return this.disabled || !a.withConsoleApi && this.requiresConsoleAPI ? !1 : !0
; |
| 2046 }; |
| 2047 axs.AuditRule.Result = function(a, b) { |
| 2048 var c = axs.utils.namedValues(b); |
| 2049 c.severity = a.getSeverity(b.name) || c.severity; |
| 2050 this.rule = c; |
| 2051 this.maxResults = a.maxResults; |
| 2052 this.update(axs.constants.AuditResult.NA); |
| 2053 }; |
| 2054 axs.AuditRule.Result.prototype.update = function(a, b) { |
| 2055 if (a === axs.constants.AuditResult.FAIL) { |
| 2056 var c = this.elements || (this.elements = []); |
| 2057 this.result = a; |
| 2058 this.maxResults && this.elements.length >= this.maxResults ? this.resultsTru
ncated = !0 : b && c.push(b); |
| 2059 } else { |
| 2060 a === axs.constants.AuditResult.PASS ? (this.elements || (this.elements = []
), this.result !== axs.constants.AuditResult.FAIL && (this.result = a)) : this.r
esult || (this.result = a); |
| 2061 } |
| 2062 }; |
| 2063 axs.AuditRule.prototype.run = function(a) { |
| 2064 try { |
| 2065 for (var b = this._options || {}, c = new axs.AuditRule.Result(a, this), d;d
= this.relevantElements.shift();) { |
| 2066 var e = d.element, f = d.flags; |
| 2067 this.isRelevant_(e, f) && (this.test_(e, f, b.config) ? c.update(axs.const
ants.AuditResult.FAIL, e) : c.update(axs.constants.AuditResult.PASS, e)); |
| 2068 } |
| 2069 return c; |
| 2070 } finally { |
| 2071 this.relatedElements.length = 0; |
| 2072 } |
| 2073 }; |
| 2074 axs.AuditRules = {}; |
| 2075 (function() { |
| 2076 var a = {}, b = {}; |
| 2077 axs.AuditRules.specs = {}; |
| 2078 axs.AuditRules.addRule = function(c) { |
| 2079 var d = new axs.AuditRule(c); |
| 2080 if (d.code in b) { |
| 2081 throw Error('Can not add audit rule with same code: "' + d.code + '"'); |
| 2082 } |
| 2083 if (d.name in a) { |
| 2084 throw Error('Can not add audit rule with same name: "' + d.name + '"'); |
| 2085 } |
| 2086 a[d.name] = b[d.code] = d; |
| 2087 axs.AuditRules.specs[c.name] = c; |
| 2088 }; |
| 2089 axs.AuditRules.getRule = function(c) { |
| 2090 return a[c] || b[c] || null; |
| 2091 }; |
| 2092 axs.AuditRules.getRules = function(b) { |
| 2093 var c = Object.keys(a); |
| 2094 return b ? c : c.map(function(a) { |
| 2095 return this.getRule(a); |
| 2096 }, axs.AuditRules); |
| 2097 }; |
| 2098 axs.AuditRules.getActiveRules = function(a) { |
| 2099 var b; |
| 2100 b = a.auditRulesToRun && 0 < a.auditRulesToRun.length ? a.auditRulesToRun :
axs.AuditRules.getRules(!0); |
| 2101 if (a.auditRulesToIgnore) { |
| 2102 for (var c = 0;c < a.auditRulesToIgnore.length;c++) { |
| 2103 var f = a.auditRulesToIgnore[c]; |
| 2104 0 > b.indexOf(f) || b.splice(b.indexOf(f), 1); |
| 2105 } |
| 2106 } |
| 2107 return b.map(axs.AuditRules.getRule); |
| 2108 }; |
| 2109 })(); |
| 2110 axs.AuditResults = function() { |
| 2111 this.errors_ = []; |
| 2112 this.warnings_ = []; |
| 2113 }; |
| 2114 goog.exportSymbol("axs.AuditResults", axs.AuditResults); |
| 2115 axs.AuditResults.prototype.addError = function(a) { |
| 2116 "" != a && this.errors_.push(a); |
| 2117 }; |
| 2118 goog.exportProperty(axs.AuditResults.prototype, "addError", axs.AuditResults.pro
totype.addError); |
| 2119 axs.AuditResults.prototype.addWarning = function(a) { |
| 2120 "" != a && this.warnings_.push(a); |
| 2121 }; |
| 2122 goog.exportProperty(axs.AuditResults.prototype, "addWarning", axs.AuditResults.p
rototype.addWarning); |
| 2123 axs.AuditResults.prototype.numErrors = function() { |
| 2124 return this.errors_.length; |
| 2125 }; |
| 2126 goog.exportProperty(axs.AuditResults.prototype, "numErrors", axs.AuditResults.pr
ototype.numErrors); |
| 2127 axs.AuditResults.prototype.numWarnings = function() { |
| 2128 return this.warnings_.length; |
| 2129 }; |
| 2130 goog.exportProperty(axs.AuditResults.prototype, "numWarnings", axs.AuditResults.
prototype.numWarnings); |
| 2131 axs.AuditResults.prototype.getErrors = function() { |
| 2132 return this.errors_; |
| 2133 }; |
| 2134 goog.exportProperty(axs.AuditResults.prototype, "getErrors", axs.AuditResults.pr
ototype.getErrors); |
| 2135 axs.AuditResults.prototype.getWarnings = function() { |
| 2136 return this.warnings_; |
| 2137 }; |
| 2138 goog.exportProperty(axs.AuditResults.prototype, "getWarnings", axs.AuditResults.
prototype.getWarnings); |
| 2139 axs.AuditResults.prototype.toString = function() { |
| 2140 for (var a = "", b = 0;b < this.errors_.length;b++) { |
| 2141 0 == b && (a += "\nErrors:\n"); |
| 2142 var c = this.errors_[b], a = a + (c + "\n\n"); |
| 2143 } |
| 2144 for (b = 0;b < this.warnings_.length;b++) { |
| 2145 0 == b && (a += "\nWarnings:\n"), c = this.warnings_[b], a += c + "\n\n"; |
| 2146 } |
| 2147 return a; |
| 2148 }; |
| 2149 goog.exportProperty(axs.AuditResults.prototype, "toString", axs.AuditResults.pro
totype.toString); |
| 2150 axs.Audit = {}; |
| 2151 axs.AuditConfiguration = function(a) { |
| 2152 null == a && (a = {}); |
| 2153 this.rules_ = {}; |
| 2154 this.maxResults = this.auditRulesToIgnore = this.auditRulesToRun = this.scope
= null; |
| 2155 this.withConsoleApi = !1; |
| 2156 this.showUnsupportedRulesWarning = this.walkDom = !0; |
| 2157 for (var b in this) { |
| 2158 this.hasOwnProperty(b) && b in a && (this[b] = a[b]); |
| 2159 } |
| 2160 goog.exportProperty(this, "scope", this.scope); |
| 2161 goog.exportProperty(this, "auditRulesToRun", this.auditRulesToRun); |
| 2162 goog.exportProperty(this, "auditRulesToIgnore", this.auditRulesToIgnore); |
| 2163 goog.exportProperty(this, "withConsoleApi", this.withConsoleApi); |
| 2164 goog.exportProperty(this, "walkDom", this.walkDom); |
| 2165 goog.exportProperty(this, "showUnsupportedRulesWarning", this.showUnsupportedR
ulesWarning); |
| 2166 }; |
| 2167 goog.exportSymbol("axs.AuditConfiguration", axs.AuditConfiguration); |
| 2168 axs.AuditConfiguration.prototype = {ignoreSelectors:function(a, b) { |
| 2169 a in this.rules_ || (this.rules_[a] = {}); |
| 2170 "ignore" in this.rules_[a] || (this.rules_[a].ignore = []); |
| 2171 Array.prototype.push.call(this.rules_[a].ignore, b); |
| 2172 }, getIgnoreSelectors:function(a) { |
| 2173 return a in this.rules_ && "ignore" in this.rules_[a] ? this.rules_[a].ignore
: []; |
| 2174 }, setSeverity:function(a, b) { |
| 2175 a in this.rules_ || (this.rules_[a] = {}); |
| 2176 this.rules_[a].severity = b; |
| 2177 }, getSeverity:function(a) { |
| 2178 return a in this.rules_ && "severity" in this.rules_[a] ? this.rules_[a].sever
ity : null; |
| 2179 }, setRuleConfig:function(a, b) { |
| 2180 a in this.rules_ || (this.rules_[a] = {}); |
| 2181 this.rules_[a].config = b; |
| 2182 }, getRuleConfig:function(a) { |
| 2183 return a in this.rules_ && "config" in this.rules_[a] ? this.rules_[a].config
: null; |
| 2184 }}; |
| 2185 goog.exportProperty(axs.AuditConfiguration.prototype, "ignoreSelectors", axs.Aud
itConfiguration.prototype.ignoreSelectors); |
| 2186 goog.exportProperty(axs.AuditConfiguration.prototype, "getIgnoreSelectors", axs.
AuditConfiguration.prototype.getIgnoreSelectors); |
| 2187 axs.Audit.unsupportedRulesWarningShown = !1; |
| 2188 axs.Audit.getRulesCannotRun = function(a) { |
| 2189 return a.withConsoleApi ? [] : axs.AuditRules.getRules().filter(function(a) { |
| 2190 return a.requiresConsoleAPI; |
| 2191 }).map(function(a) { |
| 2192 return a.code; |
| 2193 }); |
| 2194 }; |
| 2195 axs.Audit.run = function(a) { |
| 2196 a = a || new axs.AuditConfiguration; |
| 2197 if (!axs.Audit.unsupportedRulesWarningShown && a.showUnsupportedRulesWarning)
{ |
| 2198 var b = axs.Audit.getRulesCannotRun(a); |
| 2199 0 < b.length && (console.warn("Some rules cannot be checked using the axs.Au
dit.run() method call. Use the Chrome plugin to check these rules: " + b.join(",
")), console.warn("To remove this message, pass an AuditConfiguration object to
axs.Audit.run() and set configuration.showUnsupportedRulesWarning = false.")); |
| 2200 axs.Audit.unsupportedRulesWarningShown = !0; |
| 2201 } |
| 2202 b = axs.AuditRules.getActiveRules(a); |
| 2203 a.collectIdRefs = b.some(function(a) { |
| 2204 return a.collectIdRefs; |
| 2205 }); |
| 2206 a.scope || (a.scope = document.documentElement); |
| 2207 axs.Audit.collectMatchingElements(a, b); |
| 2208 for (var c = [], d = 0;d < b.length;d++) { |
| 2209 var e = b[d]; |
| 2210 e.canRun(a) && c.push(e.run(a)); |
| 2211 } |
| 2212 return c; |
| 2213 }; |
| 2214 goog.exportSymbol("axs.Audit.run", axs.Audit.run); |
| 2215 (function() { |
| 2216 function a(a, c) { |
| 2217 var b = a.getIgnoreSelectors(c.name); |
| 2218 if (0 < b.length || a.scope) { |
| 2219 this.ignoreSelectors = b; |
| 2220 } |
| 2221 if (b = a.getRuleConfig(c.name)) { |
| 2222 this.config = b; |
| 2223 } |
| 2224 } |
| 2225 axs.Audit.collectMatchingElements = function(b, c) { |
| 2226 axs.dom.composedTreeSearch(b.walkDom ? document.documentElement : b.scope, n
ull, {preorder:function(d, e) { |
| 2227 e.inScope || (e.inScope = d === b.scope); |
| 2228 for (var f = 0;f < c.length;f++) { |
| 2229 var g = c[f]; |
| 2230 g.canRun(b) && (g._options = new a(b, g), e.ignoring[g.name] || (e.ignor
ing[g.name] = g._options.shouldIgnore(d)) || g.collectMatchingElement(d, e)); |
| 2231 } |
| 2232 return !0; |
| 2233 }}, {walkDom:b.walkDom, collectIdRefs:b.collectIdRefs, level:0, ignoring:{},
disabled:!1, hidden:!1}); |
| 2234 }; |
| 2235 a.prototype.shouldIgnore = function(a) { |
| 2236 var b = this.ignoreSelectors; |
| 2237 if (b) { |
| 2238 for (var d = 0;d < b.length;d++) { |
| 2239 if (axs.browserUtils.matchSelector(a, b[d])) { |
| 2240 return !0; |
| 2241 } |
| 2242 } |
| 2243 } |
| 2244 return !1; |
| 2245 }; |
| 2246 })(); |
| 2247 axs.Audit.auditResults = function(a) { |
| 2248 for (var b = new axs.AuditResults, c = 0;c < a.length;c++) { |
| 2249 var d = a[c]; |
| 2250 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))); |
| 2251 } |
| 2252 return b; |
| 2253 }; |
| 2254 goog.exportSymbol("axs.Audit.auditResults", axs.Audit.auditResults); |
| 2255 axs.Audit.createReport = function(a, b) { |
| 2256 var c; |
| 2257 c = "*** Begin accessibility audit results ***\nAn accessibility audit found "
+ axs.Audit.auditResults(a).toString(); |
| 2258 b && (c = c + "\nFor more information, please see " + b); |
| 2259 return c + "\n*** End accessibility audit results ***"; |
| 2260 }; |
| 2261 goog.exportSymbol("axs.Audit.createReport", axs.Audit.createReport); |
| 2262 axs.Audit.accessibilityErrorMessage = function(a) { |
| 2263 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++) { |
| 2264 var e = a.elements[d], b = b + "\n"; |
| 2265 try { |
| 2266 b += axs.utils.getQuerySelectorText(e); |
| 2267 } catch (f) { |
| 2268 b += " tagName:" + e.tagName, b += " id:" + e.id; |
| 2269 } |
| 2270 } |
| 2271 "" != a.rule.url && (b += "\nSee " + a.rule.url + " for more information."); |
| 2272 return b; |
| 2273 }; |
| 2274 goog.exportSymbol("axs.Audit.accessibilityErrorMessage", axs.Audit.accessibility
ErrorMessage); |
| 2275 axs.AuditRules.addRule({name:"ariaOnReservedElement", heading:"This element does
not support ARIA roles, states and properties", url:"https://github.com/GoogleC
hrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_12", severity:axs.c
onstants.Severity.WARNING, relevantElementMatcher:function(a) { |
| 2276 return !axs.properties.canTakeAriaAttributes(a); |
| 2277 }, test:function(a) { |
| 2278 return null !== axs.properties.getAriaProperties(a); |
| 2279 }, code:"AX_ARIA_12"}); |
| 2280 axs.AuditRules.addRule({name:"ariaOwnsDescendant", heading:"aria-owns should not
be used if ownership is implicit in the DOM", url:"https://github.com/GoogleChr
ome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_06", severity:axs.con
stants.Severity.WARNING, relevantElementMatcher:function(a) { |
| 2281 return axs.browserUtils.matchSelector(a, "[aria-owns]"); |
| 2282 }, test:function(a) { |
| 2283 return axs.utils.getIdReferents("aria-owns", a).some(function(b) { |
| 2284 return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_CONTAINED_BY; |
| 2285 }); |
| 2286 }, code:"AX_ARIA_06"}); |
| 2287 axs.AuditRules.addRule({name:"ariaRoleNotScoped", heading:"Elements with ARIA ro
les must be in the correct scope", url:"https://github.com/GoogleChrome/accessib
ility-developer-tools/wiki/Audit-Rules#ax_aria_09", severity:axs.constants.Sever
ity.SEVERE, relevantElementMatcher:function(a) { |
| 2288 return axs.browserUtils.matchSelector(a, "[role]"); |
| 2289 }, test:function(a) { |
| 2290 var b = axs.utils.getRoles(a); |
| 2291 if (!b || !b.applied) { |
| 2292 return !1; |
| 2293 } |
| 2294 b = b.applied.details.scope; |
| 2295 if (!b || 0 === b.length) { |
| 2296 return !1; |
| 2297 } |
| 2298 for (var c = a;c = axs.dom.parentElement(c);) { |
| 2299 var d = axs.utils.getRoles(c, !0); |
| 2300 if (d && d.applied && 0 <= b.indexOf(d.applied.name)) { |
| 2301 return !1; |
| 2302 } |
| 2303 } |
| 2304 if (a = axs.utils.getAriaIdReferrers(a, "aria-owns")) { |
| 2305 for (c = 0;c < a.length;c++) { |
| 2306 if ((d = axs.utils.getRoles(a[c], !0)) && d.applied && 0 <= b.indexOf(d.ap
plied.name)) { |
| 2307 return !1; |
| 2308 } |
| 2309 } |
| 2310 } |
| 2311 return !0; |
| 2312 }, code:"AX_ARIA_09"}); |
| 2313 axs.AuditRules.addRule({name:"audioWithoutControls", heading:"Audio elements sho
uld have controls", url:"https://github.com/GoogleChrome/accessibility-developer
-tools/wiki/Audit-Rules#ax_audio_01", severity:axs.constants.Severity.WARNING, r
elevantElementMatcher:function(a) { |
| 2314 return axs.browserUtils.matchSelector(a, "audio[autoplay]"); |
| 2315 }, test:function(a) { |
| 2316 return !a.querySelectorAll("[controls]").length && 3 < a.duration; |
| 2317 }, code:"AX_AUDIO_01"}); |
| 2318 (function() { |
| 2319 var a = /^aria\-/; |
| 2320 axs.AuditRules.addRule({name:"badAriaAttribute", heading:"This element has an
invalid ARIA attribute", url:"https://github.com/GoogleChrome/accessibility-deve
loper-tools/wiki/Audit-Rules#ax_aria_11", severity:axs.constants.Severity.WARNIN
G, relevantElementMatcher:function(b) { |
| 2321 b = b.attributes; |
| 2322 for (var c = 0, d = b.length;c < d;c++) { |
| 2323 if (a.test(b[c].name)) { |
| 2324 return !0; |
| 2325 } |
| 2326 } |
| 2327 return !1; |
| 2328 }, test:function(b) { |
| 2329 b = b.attributes; |
| 2330 for (var c = 0, d = b.length;c < d;c++) { |
| 2331 var e = b[c].name; |
| 2332 if (a.test(e) && (e = e.replace(a, ""), !axs.constants.ARIA_PROPERTIES.has
OwnProperty(e))) { |
| 2333 return !0; |
| 2334 } |
| 2335 } |
| 2336 return !1; |
| 2337 }, code:"AX_ARIA_11"}); |
| 2338 })(); |
| 2339 axs.AuditRules.addRule({name:"badAriaAttributeValue", heading:"ARIA state and pr
operty values must be valid", url:"https://github.com/GoogleChrome/accessibility
-developer-tools/wiki/Audit-Rules#ax_aria_04", severity:axs.constants.Severity.S
EVERE, relevantElementMatcher:function(a) { |
| 2340 var b = axs.utils.getSelectorForAriaProperties(axs.constants.ARIA_PROPERTIES); |
| 2341 return axs.browserUtils.matchSelector(a, b); |
| 2342 }, test:function(a) { |
| 2343 for (var b in axs.constants.ARIA_PROPERTIES) { |
| 2344 var c = "aria-" + b; |
| 2345 if (a.hasAttribute(c)) { |
| 2346 var d = a.getAttribute(c); |
| 2347 if (!axs.utils.getAriaPropertyValue(c, d, a).valid) { |
| 2348 return !0; |
| 2349 } |
| 2350 } |
| 2351 } |
| 2352 return !1; |
| 2353 }, code:"AX_ARIA_04"}); |
| 2354 axs.AuditRules.addRule({name:"badAriaRole", heading:"Elements with ARIA roles mu
st use a valid, non-abstract ARIA role", url:"https://github.com/GoogleChrome/ac
cessibility-developer-tools/wiki/Audit-Rules#ax_aria_01", severity:axs.constants
.Severity.SEVERE, relevantElementMatcher:function(a) { |
| 2355 return axs.browserUtils.matchSelector(a, "[role]"); |
| 2356 }, test:function(a) { |
| 2357 return !axs.utils.getRoles(a).valid; |
| 2358 }, code:"AX_ARIA_01"}); |
| 2359 axs.AuditRules.addRule({name:"controlsWithoutLabel", heading:"Controls and media
elements should have labels", url:"https://github.com/GoogleChrome/accessibilit
y-developer-tools/wiki/Audit-Rules#ax_text_01", severity:axs.constants.Severity.
SEVERE, relevantElementMatcher:function(a) { |
| 2360 if (!axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disabl
ed]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]),
video:not([disabled])') || "presentation" == a.getAttribute("role")) { |
| 2361 return !1; |
| 2362 } |
| 2363 if (0 <= a.tabIndex) { |
| 2364 return !0; |
| 2365 } |
| 2366 for (a = axs.dom.parentElement(a);null != a;a = axs.dom.parentElement(a)) { |
| 2367 if (axs.utils.elementIsAriaWidget(a)) { |
| 2368 return !1; |
| 2369 } |
| 2370 } |
| 2371 return !0; |
| 2372 }, test:function(a, b) { |
| 2373 if (b.hidden || "input" == a.tagName.toLowerCase() && "button" == a.type && a.
value.length || "button" == a.tagName.toLowerCase() && a.textContent.replace(/^\
s+|\s+$/g, "").length || axs.utils.hasLabel(a)) { |
| 2374 return !1; |
| 2375 } |
| 2376 var c = axs.properties.findTextAlternatives(a, {}); |
| 2377 return null === c || "" === c.trim() ? !0 : !1; |
| 2378 }, code:"AX_TEXT_01", ruleName:"Controls and media elements should have labels"}
); |
| 2379 axs.AuditRules.addRule({name:"duplicateId", heading:"Any ID referred to via an I
DREF must be unique in the DOM", url:"https://github.com/GoogleChrome/accessibil
ity-developer-tools/wiki/Audit-Rules#ax_html_02", severity:axs.constants.Severit
y.SEVERE, opt_requires:{idRefs:!0}, relevantElementMatcher:function(a, b) { |
| 2380 b.idrefs.length && !b.hidden && this.relatedElements.push({element:a, flags:b}
); |
| 2381 return a.hasAttribute("id") ? !0 : !1; |
| 2382 }, isRelevant:function(a, b) { |
| 2383 var c = a.id, d = b.level; |
| 2384 return this.relatedElements.some(function(a) { |
| 2385 var b = a.flags.idrefs; |
| 2386 return a.flags.level === d && 0 <= b.indexOf(c); |
| 2387 }); |
| 2388 }, test:function(a) { |
| 2389 var b = "[id='" + a.id.replace(/'/g, "\\'") + "']"; |
| 2390 return 1 < a.ownerDocument.querySelectorAll(b).length; |
| 2391 }, code:"AX_HTML_02"}); |
| 2392 |
| 2393 return axs; |
| 2394 }); |
| 2395 |
| 2396 // Define AMD module if possible, export globals otherwise. |
| 2397 if (typeof define !== 'undefined' && define.amd) { |
| 2398 define([], fn); |
| 2399 } else { |
| 2400 var axs = fn.call(this); |
| 2401 } |
| 2402 |
| OLD | NEW |