168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)/* 268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * Copyright 2013 Google Inc. 368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * 468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * Licensed under the Apache License, Version 2.0 (the "License"); 568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * you may not use this file except in compliance with the License. 668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * You may obtain a copy of the License at 768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * 868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * http://www.apache.org/licenses/LICENSE-2.0 968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * 1068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * Unless required by applicable law or agreed to in writing, software 1168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * distributed under the License is distributed on an "AS IS" BASIS, 1268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * See the License for the specific language governing permissions and 1468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * limitations under the License. 1568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * 164e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) * Generated from http://github.com/GoogleChrome/accessibility-developer-tools/tree/2f50bfddc20fb2b4e08e4106ac0f97ac892b31f1 1768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * 1868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) * See project README for build steps. 1968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) */ 2068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 2168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)// AUTO-GENERATED CONTENT BELOW: DO NOT EDIT! See above for details. 2268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 2368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)var COMPILED = !0, goog = goog || {}; 2468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.global = this; 2568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportPath_ = function(a, b, c) { 2668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.split("."); 2768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = c || goog.global; 2868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a[0] in c || !c.execScript || c.execScript("var " + a[0]); 2968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var d;a.length && (d = a.shift());) { 3068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a.length || void 0 === b ? c = c[d] ? c[d] : c[d] = {} : c[d] = b 3168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 3268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 3368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.define = function(a, b) { 3468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = b; 3568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) COMPILED || goog.global.CLOSURE_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES, a) && (c = goog.global.CLOSURE_DEFINES[a]); 3668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.exportPath_(a, c) 3768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 3868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.DEBUG = !0; 3968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.LOCALE = "en"; 4068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.TRUSTED_SITE = !0; 4168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.provide = function(a) { 4268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!COMPILED) { 4368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(goog.isProvided_(a)) { 4468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) throw Error('Namespace "' + a + '" already declared.'); 4568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 4668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) delete goog.implicitNamespaces_[a]; 4768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var b = a;(b = b.substring(0, b.lastIndexOf("."))) && !goog.getObjectByName(b);) { 4868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.implicitNamespaces_[b] = !0 4968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 5068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 5168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.exportPath_(a) 5268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 5368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.setTestOnly = function(a) { 5468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(COMPILED && !goog.DEBUG) { 5568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) throw a = a || "", Error("Importing test-only code into non-debug environment" + a ? ": " + a : "."); 5668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 5768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 5868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)COMPILED || (goog.isProvided_ = function(a) { 5968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!goog.implicitNamespaces_[a] && !!goog.getObjectByName(a) 6068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, goog.implicitNamespaces_ = {}); 6168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.getObjectByName = function(a, b) { 6268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var c = a.split("."), d = b || goog.global, e;e = c.shift();) { 6368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(goog.isDefAndNotNull(d[e])) { 6468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d = d[e] 6568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 6668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 6768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 6868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 6968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d 7068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 7168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.globalize = function(a, b) { 7268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = b || goog.global, d; 7368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(d in a) { 7468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c[d] = a[d] 7568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 7668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 7768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.addDependency = function(a, b, c) { 7868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(goog.DEPENDENCIES_ENABLED) { 7968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d; 8068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.replace(/\\/g, "/"); 8168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var e = goog.dependencies_, f = 0;d = b[f];f++) { 8268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e.nameToPath[d] = a, a in e.pathToNames || (e.pathToNames[a] = {}), e.pathToNames[a][d] = !0 8368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 8468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(d = 0;b = c[d];d++) { 8568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a in e.requires || (e.requires[a] = {}), e.requires[a][b] = !0 8668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 8768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 8868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 8968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.ENABLE_DEBUG_LOADER = !0; 9068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.require = function(a) { 9168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!COMPILED && !goog.isProvided_(a)) { 9268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(goog.ENABLE_DEBUG_LOADER) { 9368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = goog.getPathFromDeps_(a); 9468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(b) { 9568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.included_[b] = !0; 9668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.writeScripts_(); 9768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return 9868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 9968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 10068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = "goog.require could not find: " + a; 10168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.global.console && goog.global.console.error(a); 10268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) throw Error(a); 10368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 10468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 10568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.basePath = ""; 10668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.nullFunction = function() { 10768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 10868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.identityFunction = function(a, b) { 10968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a 11068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 11168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.abstractMethod = function() { 11268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) throw Error("unimplemented abstract method"); 11368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 11468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.addSingletonGetter = function(a) { 11568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a.getInstance = function() { 11668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.instance_) { 11768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.instance_ 11868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 11968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = a); 12068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.instance_ = new a 12168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 12268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 12368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.instantiatedSingletons_ = []; 12468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER; 12568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathToNames:{}, nameToPath:{}, requires:{}, visited:{}, written:{}}, goog.inHtmlDocument_ = function() { 12668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var a = goog.global.document; 12768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"undefined" != typeof a && "write" in a 12868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, goog.findBasePath_ = function() { 12968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(goog.global.CLOSURE_BASE_PATH) { 13068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.basePath = goog.global.CLOSURE_BASE_PATH 13168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 13268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(goog.inHtmlDocument_()) { 13368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var a = goog.global.document.getElementsByTagName("script"), b = a.length - 1;0 <= b;--b) { 13468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d; 13568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("base.js" == c.substr(d - 7, 7)) { 13668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.basePath = c.substr(0, d - 7); 13768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) break 13868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 13968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 14068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 14168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 14268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, goog.importScript_ = function(a) { 14368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_; 14468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) !goog.dependencies_.written[a] && b(a) && (goog.dependencies_.written[a] = !0) 14568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, goog.writeScriptTag_ = function(a) { 14668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(goog.inHtmlDocument_()) { 14768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = goog.global.document; 14868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("complete" == b.readyState) { 14968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(/\bdeps.js$/.test(a)) { 15068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 15168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 15268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) throw Error('Cannot write "' + a + '" after document load'); 15368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 15468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.write('<script type="text/javascript" src="' + a + '">\x3c/script>'); 15568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0 15668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 15768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 15868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, goog.writeScripts_ = function() { 15968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) function a(e) { 16068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!(e in d.written)) { 16168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) { 16268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var g in d.requires[e]) { 16368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!goog.isProvided_(g)) { 16468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(g in d.nameToPath) { 16568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a(d.nameToPath[g]) 16668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 16768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) throw Error("Undefined nameToPath for " + g); 16868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 16968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 17068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 17168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 17268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e in c || (c[e] = !0, b.push(e)) 17368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 17468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 17568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = [], c = {}, d = goog.dependencies_, e; 17668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(e in goog.included_) { 17768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d.written[e] || a(e) 17868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 17968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(e = 0;e < b.length;e++) { 18068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(b[e]) { 18168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.importScript_(goog.basePath + b[e]) 18268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 18368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) throw Error("Undefined script input"); 18468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 18568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 18668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, goog.getPathFromDeps_ = function(a) { 18768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] : null 18868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, goog.findBasePath_(), goog.global.CLOSURE_NO_DEPS || goog.importScript_(goog.basePath + "deps.js")); 18968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.typeOf = function(a) { 19068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = typeof a; 19168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("object" == b) { 19268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a) { 19368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a instanceof Array) { 19468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"array" 19568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 19668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a instanceof Object) { 19768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b 19868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 19968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = Object.prototype.toString.call(a); 20068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("[object Window]" == c) { 20168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"object" 20268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 20368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) { 20468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"array" 20568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 20668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) { 20768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"function" 20868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 20968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 21068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"null" 21168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 21268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 21368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("function" == b && "undefined" == typeof a.call) { 21468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"object" 21568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 21668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 21768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b 21868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 21968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.isDef = function(a) { 22068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return void 0 !== a 22168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 22268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.isNull = function(a) { 22368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null === a 22468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 22568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.isDefAndNotNull = function(a) { 22668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null != a 22768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 22868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.isArray = function(a) { 22968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"array" == goog.typeOf(a) 23068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 23168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.isArrayLike = function(a) { 23268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = goog.typeOf(a); 23368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"array" == b || "object" == b && "number" == typeof a.length 23468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 23568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.isDateLike = function(a) { 23668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return goog.isObject(a) && "function" == typeof a.getFullYear 23768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 23868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.isString = function(a) { 23968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"string" == typeof a 24068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 24168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.isBoolean = function(a) { 24268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"boolean" == typeof a 24368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 24468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.isNumber = function(a) { 24568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"number" == typeof a 24668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 24768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.isFunction = function(a) { 24868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"function" == goog.typeOf(a) 24968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 25068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.isObject = function(a) { 25168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = typeof a; 25268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"object" == b && null != a || "function" == b 25368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 25468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.getUid = function(a) { 25568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_) 25668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 25768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.removeUid = function(a) { 25868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) "removeAttribute" in a && a.removeAttribute(goog.UID_PROPERTY_); 25968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) try { 26068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) delete a[goog.UID_PROPERTY_] 26168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }catch(b) { 26268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 26368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 26468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.UID_PROPERTY_ = "closure_uid_" + (1E9 * Math.random() >>> 0); 26568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.uidCounter_ = 0; 26668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.getHashCode = goog.getUid; 26768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.removeHashCode = goog.removeUid; 26868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.cloneObject = function(a) { 26968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = goog.typeOf(a); 27068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("object" == b || "array" == b) { 27168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.clone) { 27268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.clone() 27368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 27468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = "array" == b ? [] : {}, c; 27568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(c in a) { 27668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b[c] = goog.cloneObject(a[c]) 27768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 27868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b 27968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 28068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a 28168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 28268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.bindNative_ = function(a, b, c) { 28368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.call.apply(a.bind, arguments) 28468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 28568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.bindJs_ = function(a, b, c) { 28668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!a) { 28768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) throw Error(); 28868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 28968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(2 < arguments.length) { 29068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = Array.prototype.slice.call(arguments, 2); 29168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return function() { 29268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = Array.prototype.slice.call(arguments); 29368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) Array.prototype.unshift.apply(c, d); 29468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.apply(b, c) 29568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 29668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 29768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return function() { 29868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.apply(b, arguments) 29968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 30068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 30168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.bind = function(a, b, c) { 30268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_; 30368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return goog.bind.apply(null, arguments) 30468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 30568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.partial = function(a, b) { 30668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = Array.prototype.slice.call(arguments, 1); 30768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return function() { 30868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = Array.prototype.slice.call(arguments); 30968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.unshift.apply(b, c); 31068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.apply(this, b) 31168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 31268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 31368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.mixin = function(a, b) { 31468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var c in b) { 31568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a[c] = b[c] 31668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 31768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 31868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.now = goog.TRUSTED_SITE && Date.now || function() { 31968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return+new Date 32068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 32168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.globalEval = function(a) { 32268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(goog.global.execScript) { 32368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.global.execScript(a, "JavaScript") 32468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 32568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(goog.global.eval) { 32668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ = 1;"), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalWorksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals_) { 32768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.global.eval(a) 32868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 32968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = goog.global.document, c = b.createElement("script"); 33068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c.type = "text/javascript"; 33168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c.defer = !1; 33268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c.appendChild(b.createTextNode(a)); 33368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.body.appendChild(c); 33468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.body.removeChild(c) 33568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 33668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 33768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) throw Error("goog.globalEval not available"); 33868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 33968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 34068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 34168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.evalWorksForGlobals_ = null; 34268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.getCssName = function(a, b) { 34368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = function(a) { 34468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return goog.cssNameMapping_[a] || a 34568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }, d = function(a) { 34668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.split("-"); 34768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var b = [], d = 0;d < a.length;d++) { 34868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.push(c(a[d])) 34968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 35068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b.join("-") 35168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }, d = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? c : d : function(a) { 35268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a 35368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }; 35468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b ? a + "-" + d(b) : d(a) 35568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 35668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.setCssNameMapping = function(a, b) { 35768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.cssNameMapping_ = a; 35868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.cssNameMappingStyle_ = b 35968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 36068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)!COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING); 36168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.getMsg = function(a, b) { 36268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = b || {}, d; 36368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(d in c) { 36468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var e = ("" + c[d]).replace(/\$/g, "$$$$"); 36568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.replace(RegExp("\\{\\$" + d + "\\}", "gi"), e) 36668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 36768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a 36868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 36968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.getMsgWithFallback = function(a, b) { 37068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a 37168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 37268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportSymbol = function(a, b, c) { 37368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.exportPath_(a, b, c) 37468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 37568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportProperty = function(a, b, c) { 37668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a[b] = c 37768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 37868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.inherits = function(a, b) { 37968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) function c() { 38068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 38168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c.prototype = b.prototype; 38268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a.superClass_ = b.prototype; 38368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a.prototype = new c; 38468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a.prototype.constructor = a 38568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 38668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.base = function(a, b, c) { 38768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = arguments.callee.caller; 38868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(goog.DEBUG && !d) { 38968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) throw Error("arguments.caller not defined. goog.base() expects not to be running in strict mode. See http://www.ecma-international.org/ecma-262/5.1/#sec-C"); 39068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 39168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(d.superClass_) { 39268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d.superClass_.constructor.apply(a, Array.prototype.slice.call(arguments, 1)) 39368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 39468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var e = Array.prototype.slice.call(arguments, 2), f = !1, g = a.constructor;g;g = g.superClass_ && g.superClass_.constructor) { 39568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(g.prototype[b] === d) { 39668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) f = !0 39768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 39868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(f) { 39968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return g.prototype[b].apply(a, e) 40068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 40168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 40268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 40368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a[b] === d) { 40468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.constructor.prototype[b].apply(a, e) 40568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 40668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) throw Error("goog.base called from a method of one name to a method of a different name"); 40768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 40868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.scope = function(a) { 40968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a.call(goog.global) 41068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 41168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)var axs = {}; 41268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.browserUtils = {}; 41368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.browserUtils.matchSelector = function(a, b) { 41468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.webkitMatchesSelector ? a.webkitMatchesSelector(b) : a.mozMatchesSelector ? a.mozMatchesSelector(b) : !1 41568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 41668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants = {}; 41768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.ARIA_ROLES = {alert:{namefrom:["author"], parent:["region"]}, alertdialog:{namefrom:["author"], namerequired:!0, parent:["alert", "dialog"]}, application:{namefrom:["author"], namerequired:!0, parent:["landmark"]}, article:{namefrom:["author"], parent:["document", "region"]}, banner:{namefrom:["author"], parent:["landmark"]}, button:{childpresentational:!0, namefrom:["contents", "author"], namerequired:!0, parent:["command"], properties:["aria-expanded", "aria-pressed"]}, checkbox:{namefrom:["contents", 41868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)"author"], namerequired:!0, parent:["input"], requiredProperties:["aria-checked"], properties:["aria-checked"]}, columnheader:{namefrom:["contents", "author"], namerequired:!0, parent:["gridcell", "sectionhead", "widget"], properties:["aria-sort"]}, combobox:{mustcontain:["listbox", "textbox"], namefrom:["author"], namerequired:!0, parent:["select"], requiredProperties:["aria-expanded"], properties:["aria-expanded", "aria-autocomplete", "aria-required"]}, command:{"abstract":!0, namefrom:["author"], 41968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)parent:["widget"]}, complementary:{namefrom:["author"], parent:["landmark"]}, composite:{"abstract":!0, childpresentational:!1, namefrom:["author"], parent:["widget"], properties:["aria-activedescendant"]}, contentinfo:{namefrom:["author"], parent:["landmark"]}, definition:{namefrom:["author"], parent:["section"]}, dialog:{namefrom:["author"], namerequired:!0, parent:["window"]}, directory:{namefrom:["contents", "author"], parent:["list"]}, document:{namefrom:[" author"], namerequired:!0, parent:["structure"], 42068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)properties:["aria-expanded"]}, form:{namefrom:["author"], parent:["landmark"]}, grid:{mustcontain:["row", "rowgroup"], namefrom:["author"], namerequired:!0, parent:["composite", "region"], properties:["aria-level", "aria-multiselectable", "aria-readonly"]}, gridcell:{namefrom:["contents", "author"], namerequired:!0, parent:["section", "widget"], properties:["aria-readonly", "aria-required", "aria-selected"]}, group:{namefrom:[" author"], parent:["section"], properties:["aria-activedescendant"]}, 42168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)heading:{namerequired:!0, parent:["sectionhead"], properties:["aria-level"]}, img:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["section"]}, input:{"abstract":!0, namefrom:["author"], parent:["widget"]}, landmark:{"abstract":!0, namefrom:["contents", "author"], namerequired:!1, parent:["region"]}, link:{namefrom:["contents", "author"], namerequired:!0, parent:["command"], properties:["aria-expanded"]}, list:{mustcontain:["group", "listitem"], namefrom:["author"], parent:["region"]}, 42268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)listbox:{mustcontain:["option"], namefrom:["author"], namerequired:!0, parent:["list", "select"], properties:["aria-multiselectable", "aria-required"]}, listitem:{namefrom:["contents", "author"], namerequired:!0, parent:["section"], properties:["aria-level", "aria-posinset", "aria-setsize"]}, log:{namefrom:[" author"], namerequired:!0, parent:["region"]}, main:{namefrom:["author"], parent:["landmark"]}, marquee:{namerequired:!0, parent:["section"]}, math:{childpresentational:!0, namefrom:["author"], 42368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)parent:["section"]}, menu:{mustcontain:["group", "menuitemradio", "menuitem", "menuitemcheckbox"], namefrom:["author"], namerequired:!0, parent:["list", "select"]}, menubar:{namefrom:["author"], parent:["menu"]}, menuitem:{namefrom:["contents", "author"], namerequired:!0, parent:["command"]}, menuitemcheckbox:{namefrom:["contents", "author"], namerequired:!0, parent:["checkbox", "menuitem"]}, menuitemradio:{namefrom:["contents", "author"], namerequired:!0, parent:["menuitemcheckbox", "radio"]}, navigation:{namefrom:["author"], 42468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)parent:["landmark"]}, note:{namefrom:["author"], parent:["section"]}, option:{namefrom:["contents", "author"], namerequired:!0, parent:["input"], properties:["aria-checked", "aria-posinset", "aria-selected", "aria-setsize"]}, presentation:{parent:["structure"]}, progressbar:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["range"]}, radio:{namefrom:["contents", "author"], namerequired:!0, parent:["checkbox", "option"]}, radiogroup:{mustcontain:["radio"], namefrom:["author"], 42568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)namerequired:!0, parent:["select"], properties:["aria-required"]}, range:{"abstract":!0, namefrom:["author"], parent:["widget"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext"]}, region:{namefrom:[" author"], parent:["section"]}, roletype:{"abstract":!0, properties:"aria-atomic aria-busy aria-controls aria-describedby aria-disabled aria-dropeffect aria-flowto aria-grabbed aria-haspopup aria-hidden aria-invalid aria-label aria-labelledby aria-live aria-owns aria-relevant".split(" ")}, 42668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)row:{mustcontain:["columnheader", "gridcell", "rowheader"], namefrom:["contents", "author"], parent:["group", "widget"], properties:["aria-level", "aria-selected"]}, rowgroup:{mustcontain:["row"], namefrom:["contents", "author"], parent:["group"]}, rowheader:{namefrom:["contents", "author"], namerequired:!0, parent:["gridcell", "sectionhead", "widget"], properties:["aria-sort"]}, search:{namefrom:["author"], parent:["landmark"]}, section:{"abstract":!0, namefrom:["contents", "author"], parent:["structure"], 42768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)properties:["aria-expanded"]}, sectionhead:{"abstract":!0, namefrom:["contents", "author"], parent:["structure"], properties:["aria-expanded"]}, select:{"abstract":!0, namefrom:["author"], parent:["composite", "group", "input"]}, separator:{childpresentational:!0, namefrom:["author"], parent:["structure"], properties:["aria-expanded", "aria-orientation"]}, scrollbar:{childpresentational:!0, namefrom:["author"], namerequired:!1, parent:["input", "range"], requiredProperties:["aria-controls", "aria-orientation", 42868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)"aria-valuemax", "aria-valuemin", "aria-valuenow"], properties:["aria-controls", "aria-orientation", "aria-valuemax", "aria-valuemin", "aria-valuenow"]}, slider:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["input", "range"], requiredProperties:["aria-valuemax", "aria-valuemin", "aria-valuenow"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-orientation"]}, spinbutton:{namefrom:["author"], namerequired:!0, parent:["input", "range"], requiredProperties:["aria-valuemax", 42968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)"aria-valuemin", "aria-valuenow"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-required"]}, status:{parent:["region"]}, structure:{"abstract":!0, parent:["roletype"]}, tab:{namefrom:["contents", "author"], parent:["sectionhead", "widget"], properties:["aria-selected"]}, tablist:{mustcontain:["tab"], namefrom:["author"], parent:["composite", "directory"], properties:["aria-level"]}, tabpanel:{namefrom:["author"], namerequired:!0, parent:["region"]}, textbox:{namefrom:["author"], 43068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)namerequired:!0, parent:["input"], properties:["aria-activedescendant", "aria-autocomplete", "aria-multiline", "aria-readonly", "aria-required"]}, timer:{namefrom:["author"], namerequired:!0, parent:["status"]}, toolbar:{namefrom:["author"], parent:["group"]}, tooltip:{namerequired:!0, parent:["section"]}, tree:{mustcontain:["group", "treeitem"], namefrom:["author"], namerequired:!0, parent:["select"], properties:["aria-multiselectable", "aria-required"]}, treegrid:{mustcontain:["row"], namefrom:["author"], 43168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)namerequired:!0, parent:["grid", "tree"]}, treeitem:{namefrom:["contents", "author"], namerequired:!0, parent:["listitem", "option"]}, widget:{"abstract":!0, parent:["roletype"]}, window:{"abstract":!0, namefrom:[" author"], parent:["roletype"], properties:["aria-expanded"]}}; 43268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.WIDGET_ROLES = {}; 43368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.addAllParentRolesToSet_ = function(a, b) { 43468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.parent) { 43568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var c = a.parent, d = 0;d < c.length;d++) { 43668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var e = c[d]; 43768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b[e] = !0; 43868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) axs.constants.addAllParentRolesToSet_(axs.constants.ARIA_ROLES[e], b) 43968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 44068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 44168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 44268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.addAllPropertiesToSet_ = function(a, b, c) { 44368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = a[b]; 44468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(d) { 44568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var e = 0;e < d.length;e++) { 44668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c[d[e]] = !0 44768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 44868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 44968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.parent) { 45068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(a = a.parent, d = 0;d < a.length;d++) { 45168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) axs.constants.addAllPropertiesToSet_(axs.constants.ARIA_ROLES[a[d]], b, c) 45268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 45368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 45468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 45568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)for(var roleName in axs.constants.ARIA_ROLES) { 45668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var role = axs.constants.ARIA_ROLES[roleName], propertiesSet = {}; 45768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) axs.constants.addAllPropertiesToSet_(role, "properties", propertiesSet); 45868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) role.propertiesSet = propertiesSet; 45968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var requiredPropertiesSet = {}; 46068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) axs.constants.addAllPropertiesToSet_(role, "requiredProperties", requiredPropertiesSet); 46168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) role.requiredPropertiesSet = requiredPropertiesSet; 46268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var parentRolesSet = {}; 46368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) axs.constants.addAllParentRolesToSet_(role, parentRolesSet); 46468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) role.allParentRolesSet = parentRolesSet; 46568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) "widget" in parentRolesSet && (axs.constants.WIDGET_ROLES[roleName] = role) 46668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)} 46768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.ARIA_PROPERTIES = {activedescendant:{type:"property", valueType:"idref"}, atomic:{defaultValue:"false", type:"property", valueType:"boolean"}, autocomplete:{defaultValue:"none", type:"property", valueType:"token", values:["inline", "list", "both", "none"]}, busy:{defaultValue:"false", type:"state", valueType:"boolean"}, checked:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "mixed", "undefined"]}, controls:{type:"property", valueType:"idref_list"}, 46868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)describedby:{type:"property", valueType:"idref_list"}, disabled:{defaultValue:"false", type:"state", valueType:"boolean"}, dropeffect:{defaultValue:"none", type:"property", valueType:"token_list", values:"copy move link execute popup none".split(" ")}, expanded:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "undefined"]}, flowto:{type:"property", valueType:"idref_list"}, grabbed:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", 46968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)"undefined"]}, haspopup:{defaultValue:"false", type:"property", valueType:"boolean"}, hidden:{defaultValue:"false", type:"state", valueType:"boolean"}, invalid:{defaultValue:"false", type:"state", valueType:"token", values:["grammar", "false", "spelling", "true"]}, label:{type:"property", valueType:"string"}, labelledby:{type:"property", valueType:"idref_list"}, level:{type:"property", valueType:"integer"}, live:{defaultValue:"off", type:"property", valueType:"token", values:["off", "polite", "assertive"]}, 47068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)multiline:{defaultValue:"false", type:"property", valueType:"boolean"}, multiselectable:{defaultValue:"false", type:"property", valueType:"boolean"}, orientation:{defaultValue:"vertical", type:"property", valueType:"token", values:["horizontal", "vertical"]}, owns:{type:"property", valueType:"idref_list"}, posinset:{type:"property", valueType:"integer"}, pressed:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "mixed", "undefined"]}, readonly:{defaultValue:"false", 47168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)type:"property", valueType:"boolean"}, relevant:{defaultValue:"additions text", type:"property", valueType:"token_list", values:["additions", "removals", "text", "all"]}, required:{defaultValue:"false", type:"property", valueType:"boolean"}, selected:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "undefined"]}, setsize:{type:"property", valueType:"integer"}, sort:{defaultValue:"none", type:"property", valueType:"token", values:["ascending", "descending", "none", 47268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)"other"]}, valuemax:{type:"property", valueType:"decimal"}, valuemin:{type:"property", valueType:"decimal"}, valuenow:{type:"property", valueType:"decimal"}, valuetext:{type:"property", valueType:"string"}}; 47368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.GLOBAL_PROPERTIES = "aria-atomic aria-busy aria-controls aria-describedby aria-disabled aria-dropeffect aria-flowto aria-grabbed aria-haspopup aria-hidden aria-invalid aria-label aria-labelledby aria-live aria-owns aria-relevant".split(" "); 47468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.NO_ROLE_NAME = " "; 47568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.WIDGET_ROLE_TO_NAME = {alert:"aria_role_alert", alertdialog:"aria_role_alertdialog", button:"aria_role_button", checkbox:"aria_role_checkbox", columnheader:"aria_role_columnheader", combobox:"aria_role_combobox", dialog:"aria_role_dialog", grid:"aria_role_grid", gridcell:"aria_role_gridcell", link:"aria_role_link", listbox:"aria_role_listbox", log:"aria_role_log", marquee:"aria_role_marquee", menu:"aria_role_menu", menubar:"aria_role_menubar", menuitem:"aria_role_menuitem", menuitemcheckbox:"aria_role_menuitemcheckbox", 47668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)menuitemradio:"aria_role_menuitemradio", option:axs.constants.NO_ROLE_NAME, progressbar:"aria_role_progressbar", radio:"aria_role_radio", radiogroup:"aria_role_radiogroup", rowheader:"aria_role_rowheader", scrollbar:"aria_role_scrollbar", slider:"aria_role_slider", spinbutton:"aria_role_spinbutton", status:"aria_role_status", tab:"aria_role_tab", tabpanel:"aria_role_tabpanel", textbox:"aria_role_textbox", timer:"aria_role_timer", toolbar:"aria_role_toolbar", tooltip:"aria_role_tooltip", treeitem:"aria_role_treeitem"}; 47768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.STRUCTURE_ROLE_TO_NAME = {article:"aria_role_article", application:"aria_role_application", banner:"aria_role_banner", columnheader:"aria_role_columnheader", complementary:"aria_role_complementary", contentinfo:"aria_role_contentinfo", definition:"aria_role_definition", directory:"aria_role_directory", document:"aria_role_document", form:"aria_role_form", group:"aria_role_group", heading:"aria_role_heading", img:"aria_role_img", list:"aria_role_list", listitem:"aria_role_listitem", 47868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)main:"aria_role_main", math:"aria_role_math", navigation:"aria_role_navigation", note:"aria_role_note", region:"aria_role_region", rowheader:"aria_role_rowheader", search:"aria_role_search", separator:"aria_role_separator"}; 47968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.ATTRIBUTE_VALUE_TO_STATUS = [{name:"aria-autocomplete", values:{inline:"aria_autocomplete_inline", list:"aria_autocomplete_list", both:"aria_autocomplete_both"}}, {name:"aria-checked", values:{"true":"aria_checked_true", "false":"aria_checked_false", mixed:"aria_checked_mixed"}}, {name:"aria-disabled", values:{"true":"aria_disabled_true"}}, {name:"aria-expanded", values:{"true":"aria_expanded_true", "false":"aria_expanded_false"}}, {name:"aria-invalid", values:{"true":"aria_invalid_true", 48068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)grammar:"aria_invalid_grammar", spelling:"aria_invalid_spelling"}}, {name:"aria-multiline", values:{"true":"aria_multiline_true"}}, {name:"aria-multiselectable", values:{"true":"aria_multiselectable_true"}}, {name:"aria-pressed", values:{"true":"aria_pressed_true", "false":"aria_pressed_false", mixed:"aria_pressed_mixed"}}, {name:"aria-readonly", values:{"true":"aria_readonly_true"}}, {name:"aria-required", values:{"true":"aria_required_true"}}, {name:"aria-selected", values:{"true":"aria_selected_true", 48168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)"false":"aria_selected_false"}}]; 48268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.INPUT_TYPE_TO_INFORMATION_TABLE_MSG = {button:"input_type_button", checkbox:"input_type_checkbox", color:"input_type_color", datetime:"input_type_datetime", "datetime-local":"input_type_datetime_local", date:"input_type_date", email:"input_type_email", file:"input_type_file", image:"input_type_image", month:"input_type_month", number:"input_type_number", password:"input_type_password", radio:"input_type_radio", range:"input_type_range", reset:"input_type_reset", search:"input_type_search", 48368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)submit:"input_type_submit", tel:"input_type_tel", text:"input_type_text", url:"input_type_url", week:"input_type_week"}; 48468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.TAG_TO_INFORMATION_TABLE_VERBOSE_MSG = {A:"tag_link", BUTTON:"tag_button", H1:"tag_h1", H2:"tag_h2", H3:"tag_h3", H4:"tag_h4", H5:"tag_h5", H6:"tag_h6", LI:"tag_li", OL:"tag_ol", SELECT:"tag_select", TEXTAREA:"tag_textarea", UL:"tag_ul", SECTION:"tag_section", NAV:"tag_nav", ARTICLE:"tag_article", ASIDE:"tag_aside", HGROUP:"tag_hgroup", HEADER:"tag_header", FOOTER:"tag_footer", TIME:"tag_time", MARK:"tag_mark"}; 48568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.TAG_TO_INFORMATION_TABLE_BRIEF_MSG = {BUTTON:"tag_button", SELECT:"tag_select", TEXTAREA:"tag_textarea"}; 48668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.MIXED_VALUES = {"true":!0, "false":!0, mixed:!0}; 48768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)(function() { 48868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var a in axs.constants.ARIA_PROPERTIES) { 48968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = axs.constants.ARIA_PROPERTIES[a]; 49068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(b.values) { 49168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var c = {}, d = 0;d < b.values.length;d++) { 49268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c[b.values[d]] = !0 49368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 49468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.valuesSet = c 49568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 49668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 49768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)})(); 49868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.Severity = {INFO:"Info", WARNING:"Warning", SEVERE:"Severe"}; 49968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.AuditResult = {PASS:"PASS", FAIL:"FAIL", NA:"NA"}; 50068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.constants.InlineElements = {TT:!0, I:!0, B:!0, BIG:!0, SMALL:!0, EM:!0, STRONG:!0, DFN:!0, CODE:!0, SAMP:!0, KBD:!0, VAR:!0, CITE:!0, ABBR:!0, ACRONYM:!0, A:!0, IMG:!0, OBJECT:!0, BR:!0, SCRIPT:!0, MAP:!0, Q:!0, SUB:!0, SUP:!0, SPAN:!0, BDO:!0, INPUT:!0, SELECT:!0, TEXTAREA:!0, LABEL:!0, BUTTON:!0}; 50168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils = {}; 50268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.FOCUSABLE_ELEMENTS_SELECTOR = "input:not([type=hidden]):not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),a[href],iframe,[tabindex]"; 50368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.Color = function(a, b, c, d) { 50468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.red = a; 50568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.green = b; 50668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.blue = c; 50768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.alpha = d 50868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 50968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.calculateContrastRatio = function(a, b) { 51068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!a || !b) { 51168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 51268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 51368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 1 > a.alpha && (a = axs.utils.flattenColors(a, b)); 51468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = axs.utils.calculateLuminance(a), d = axs.utils.calculateLuminance(b); 51568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return(Math.max(c, d) + 0.05) / (Math.min(c, d) + 0.05) 51668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 51768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.luminanceRatio = function(a, b) { 51868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return(Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05) 51968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 52068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.asElement = function(a) { 52168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) switch(a.nodeType) { 52268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case Node.COMMENT_NODE: 52368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null; 52468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case Node.ELEMENT_NODE: 52568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("script" == a.tagName.toLowerCase()) { 52668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 52768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 52868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) break; 52968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case Node.TEXT_NODE: 53068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.parentElement; 53168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) break; 53268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) default: 53368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return console.warn("Unhandled node type: ", a.nodeType), null 53468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 53568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a 53668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 53768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.elementIsTransparent = function(a) { 53868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"0" == a.style.opacity 53968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 54068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.elementHasZeroArea = function(a) { 54168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.getBoundingClientRect(); 54268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = a.top - a.bottom; 54368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.right - a.left && b ? !1 : !0 54468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 54568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.elementIsOutsideScrollArea = function(a) { 54668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.getBoundingClientRect(); 54768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = document.body.scrollWidth, c = document.body.scrollTop, d = document.body.scrollLeft; 54868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.top >= document.body.scrollHeight || a.bottom <= -c || a.left >= b || a.right <= -d ? !0 : !1 54968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 55068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.isAncestor = function(a, b) { 55168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null == b ? !1 : b === a ? !0 : axs.utils.isAncestor(a, b.parentNode) 55268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 5534e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)axs.utils.overlappingElements = function(a) { 55468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(axs.utils.elementHasZeroArea(a)) { 55568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 55668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 5574e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) for(var b = [], c = a.getClientRects(), d = 0;d < c.length;d++) { 5584e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) var e = c[d], e = document.elementFromPoint((e.left + e.right) / 2, (e.top + e.bottom) / 2); 5594e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) if(null != e && e != a && !axs.utils.isAncestor(e, a) && !axs.utils.isAncestor(a, e)) { 5604e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) var f = window.getComputedStyle(e, null); 5614e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) f && (f = axs.utils.getBgColor(f, e)) && 0 < f.alpha && 0 > b.indexOf(e) && b.push(e) 5624e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) } 5634e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) } 5644e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) return b 56568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 56668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.elementIsHtmlControl = function(a) { 56768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = a.ownerDocument.defaultView; 56868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a instanceof b.HTMLButtonElement || a instanceof b.HTMLInputElement || a instanceof b.HTMLSelectElement || a instanceof b.HTMLTextAreaElement ? !0 : !1 56968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 57068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.elementIsAriaWidget = function(a) { 57168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.hasAttribute("role") && (a = a.getAttribute("role")) && (a = axs.constants.ARIA_ROLES[a]) && "widget" in a.allParentRolesSet ? !0 : !1 57268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 57368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.elementIsVisible = function(a) { 5744e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) return axs.utils.elementIsTransparent(a) || axs.utils.elementHasZeroArea(a) || axs.utils.elementIsOutsideScrollArea(a) || axs.utils.overlappingElements(a).length ? !1 : !0 57568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 57668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.isLargeFont = function(a) { 57768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = a.fontSize; 57868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = "bold" == a.fontWeight; 57968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = b.match(/(\d+)px/); 58068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(c) { 58168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b = parseInt(c[1], 10); 58268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(c = window.getComputedStyle(document.body, null).fontSize.match(/(\d+)px/)) { 58368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = parseInt(c[1], 10), c = 1.2 * d, d = 1.5 * d 58468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 58568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = 19.2, d = 24 58668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 58768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a && b >= c || b >= d 58868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 58968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(c = b.match(/(\d+)em/)) { 59068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b = parseInt(c[1], 10), a && 1.2 <= b || 1.5 <= b ? !0 : !1 59168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 59268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(c = b.match(/(\d+)%/)) { 59368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b = parseInt(c[1], 10), a && 120 <= b || 150 <= b ? !0 : !1 59468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 59568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(c = b.match(/(\d+)pt/)) { 5964e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) if(b = parseInt(c[1], 10), a && 14 <= b || 18 <= b) { 59768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0 59868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 59968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 60068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 60168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 60268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.getBgColor = function(a, b) { 60368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = axs.utils.parseColor(a.backgroundColor); 60468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!c) { 60568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 60668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 60768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 1 > a.opacity && (c.alpha *= a.opacity); 60868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(1 > c.alpha) { 60968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = axs.utils.getParentBgColor(b); 61068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(null == d) { 61168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 61268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 61368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = axs.utils.flattenColors(c, d) 61468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 61568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c 61668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 61768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.getParentBgColor = function(a) { 61868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = a; 61968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = []; 62068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var c = null;b = b.parentElement;) { 62168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = window.getComputedStyle(b, null); 62268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(d) { 62368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var e = axs.utils.parseColor(d.backgroundColor); 62468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(e && (1 > d.opacity && (e.alpha *= d.opacity), 0 != e.alpha && (a.push(e), 1 == e.alpha))) { 62568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = !0; 62668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) break 62768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 62868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 62968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 63068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c || a.push(new axs.utils.Color(255, 255, 255, 1)); 63168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(b = a.pop();a.length;) { 63268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = a.pop(), b = axs.utils.flattenColors(c, b) 63368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 63468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b 63568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 63668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.getFgColor = function(a, b, c) { 63768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = axs.utils.parseColor(a.color); 63868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!d) { 63968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 64068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 64168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 1 > d.alpha && (d = axs.utils.flattenColors(d, c)); 64268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 1 > a.opacity && (b = axs.utils.getParentBgColor(b), d.alpha *= a.opacity, d = axs.utils.flattenColors(d, b)); 64368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d 64468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 64568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.parseColor = function(a) { 64668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = a.match(/^rgb\((\d+), (\d+), (\d+)\)$/); 64768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(b) { 64868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = parseInt(b[1], 10); 64968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = parseInt(b[2], 10), b = parseInt(b[3], 10), d; 65068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return new axs.utils.Color(a, c, b, 1) 65168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 65268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return(b = a.match(/^rgba\((\d+), (\d+), (\d+), (\d+(\.\d+)?)\)/)) ? (d = parseInt(b[4], 10), a = parseInt(b[1], 10), c = parseInt(b[2], 10), b = parseInt(b[3], 10), new axs.utils.Color(a, c, b, d)) : null 65368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 65468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.colorChannelToString = function(a) { 65568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = Math.round(a); 65668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return 15 >= a ? "0" + a.toString(16) : a.toString(16) 65768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 65868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.colorToString = function(a) { 65968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return 1 == a.alpha ? "#" + axs.utils.colorChannelToString(a.red) + axs.utils.colorChannelToString(a.green) + axs.utils.colorChannelToString(a.blue) : "rgba(" + [a.red, a.green, a.blue, a.alpha].join() + ")" 66068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 66168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.luminanceFromContrastRatio = function(a, b, c) { 66268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c ? (a + 0.05) * b - 0.05 : (a + 0.05) / b - 0.05 66368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 66468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.translateColor = function(a, b) { 66568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = a[0], c = (b - c) / ((c > b ? 0 : 1) - c); 66668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.utils.fromYCC([b, a[1] - a[1] * c, a[2] - a[2] * c]) 66768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 66868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.suggestColors = function(a, b, c, d) { 66968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!axs.utils.isLowContrast(c, d, !0)) { 67068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 67168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 67268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var e = {}, f = axs.utils.calculateLuminance(a), g = axs.utils.calculateLuminance(b), h = axs.utils.isLargeFont(d) ? 3 : 4.5, k = axs.utils.isLargeFont(d) ? 4.5 : 7, m = g > f, l = axs.utils.luminanceFromContrastRatio(f, h + 0.02, m), n = axs.utils.luminanceFromContrastRatio(f, k + 0.02, m), q = axs.utils.toYCC(b); 67368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(axs.utils.isLowContrast(c, d, !1) && 1 >= l && 0 <= l) { 67468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var p = axs.utils.translateColor(q, l), l = axs.utils.calculateContrastRatio(p, a); 67568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) axs.utils.calculateLuminance(p); 67668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) f = {}; 67768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) f.fg = axs.utils.colorToString(p); 67868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) f.bg = axs.utils.colorToString(a); 67968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) f.contrast = l.toFixed(2); 68068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e.AA = f 68168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 68268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) axs.utils.isLowContrast(c, d, !0) && 1 >= n && 0 <= n && (n = axs.utils.translateColor(q, n), l = axs.utils.calculateContrastRatio(n, a), f = {}, f.fg = axs.utils.colorToString(n), f.bg = axs.utils.colorToString(a), f.contrast = l.toFixed(2), e.AAA = f); 68368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) h = axs.utils.luminanceFromContrastRatio(g, h + 0.02, !m); 68468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) g = axs.utils.luminanceFromContrastRatio(g, k + 0.02, !m); 68568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = axs.utils.toYCC(a); 68668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) !("AA" in e) && axs.utils.isLowContrast(c, d, !1) && 1 >= h && 0 <= h && (k = axs.utils.translateColor(a, h), l = axs.utils.calculateContrastRatio(b, k), f = {}, f.bg = axs.utils.colorToString(k), f.fg = axs.utils.colorToString(b), f.contrast = l.toFixed(2), e.AA = f); 68768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) !("AAA" in e) && axs.utils.isLowContrast(c, d, !0) && 1 >= g && 0 <= g && (c = axs.utils.translateColor(a, g), l = axs.utils.calculateContrastRatio(b, c), f = {}, f.bg = axs.utils.colorToString(c), f.fg = axs.utils.colorToString(b), f.contrast = l.toFixed(2), e.AAA = f); 68868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return e 68968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 69068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.flattenColors = function(a, b) { 69168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = a.alpha; 69268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return new axs.utils.Color((1 - c) * b.red + c * a.red, (1 - c) * b.green + c * a.green, (1 - c) * b.blue + c * a.blue, a.alpha + b.alpha * (1 - a.alpha)) 69368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 69468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.calculateLuminance = function(a) { 69568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.utils.toYCC(a)[0] 69668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 69768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.RGBToYCCMatrix = function(a, b) { 69868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 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)]] 69968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 70068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.invert3x3Matrix = function(a) { 70168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 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]; 70268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a[2][2]; 70368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.utils.scalarMultiplyMatrix([[f * a - g * k, d * k - c * a, c * g - d * f], [g * h - e * a, b * a - d * h, d * e - b * g], [e * k - f * h, h * c - b * k, b * f - c * e]], 1 / (b * (f * a - g * k) - c * (a * e - g * h) + d * (e * k - f * h))) 70468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 70568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.scalarMultiplyMatrix = function(a, b) { 70668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var c = [[], [], []], d = 0;3 > d;d++) { 70768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var e = 0;3 > e;e++) { 70868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c[d][e] = a[d][e] * b 70968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 71068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 71168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c 71268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 71368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.kR = 0.2126; 71468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.kB = 0.0722; 71568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.YCC_MATRIX = axs.utils.RGBToYCCMatrix(axs.utils.kR, axs.utils.kB); 71668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.INVERTED_YCC_MATRIX = axs.utils.invert3x3Matrix(axs.utils.YCC_MATRIX); 71768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.convertColor = function(a, b) { 71868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = b[0], d = b[1], e = b[2]; 71968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 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] 72068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 72168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.multiplyMatrices = function(a, b) { 72268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var c = [[], [], []], d = 0;3 > d;d++) { 72368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var e = 0;3 > e;e++) { 72468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c[d][e] = a[d][0] * b[0][e] + a[d][1] * b[1][e] + a[d][2] * b[2][e] 72568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 72668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 72768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c 72868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 72968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.toYCC = function(a) { 73068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = a.red / 255, c = a.green / 255; 73168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.blue / 255; 73268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b = 0.03928 >= b ? b / 12.92 : Math.pow((b + 0.055) / 1.055, 2.4); 73368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = 0.03928 >= c ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4); 73468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = 0.03928 >= a ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4); 73568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.utils.convertColor(axs.utils.YCC_MATRIX, [b, c, a]) 73668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 73768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.fromYCC = function(a) { 73868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = axs.utils.convertColor(axs.utils.INVERTED_YCC_MATRIX, a), c = b[0]; 73968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = b[1]; 74068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b = b[2]; 74168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = 0.00303949 >= c ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055; 74268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = 0.00303949 >= a ? 12.92 * a : 1.055 * Math.pow(a, 1 / 2.4) - 0.055; 74368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b = 0.00303949 >= b ? 12.92 * b : 1.055 * Math.pow(b, 1 / 2.4) - 0.055; 74468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = Math.min(Math.max(Math.round(255 * c), 0), 255); 74568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = Math.min(Math.max(Math.round(255 * a), 0), 255); 74668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b = Math.min(Math.max(Math.round(255 * b), 0), 255); 74768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return new axs.utils.Color(c, a, b, 1) 74868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 74968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.scalarMultiplyMatrix = function(a, b) { 75068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var c = [[], [], []], d = 0;3 > d;d++) { 75168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var e = 0;3 > e;e++) { 75268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c[d][e] = a[d][e] * b 75368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 75468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 75568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c 75668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 75768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.multiplyMatrices = function(a, b) { 75868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var c = [[], [], []], d = 0;3 > d;d++) { 75968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var e = 0;3 > e;e++) { 76068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c[d][e] = a[d][0] * b[0][e] + a[d][1] * b[1][e] + a[d][2] * b[2][e] 76168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 76268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 76368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c 76468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 76568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.getContrastRatioForElement = function(a) { 76668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = window.getComputedStyle(a, null); 76768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.utils.getContrastRatioForElementWithComputedStyle(b, a) 76868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 76968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.getContrastRatioForElementWithComputedStyle = function(a, b) { 77068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(axs.utils.isElementHidden(b)) { 77168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 77268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 77368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = axs.utils.getBgColor(a, b); 77468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!c) { 77568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 77668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 77768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = axs.utils.getFgColor(a, b, c); 77868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d ? axs.utils.calculateContrastRatio(d, c) : null 77968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 78068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.isNativeTextElement = function(a) { 78168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = a.tagName.toLowerCase(); 78268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.type ? a.type.toLowerCase() : ""; 78368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("textarea" == b) { 78468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0 78568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 78668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("input" != b) { 78768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 78868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 78968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) switch(a) { 79068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "email": 79168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) ; 79268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "number": 79368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) ; 79468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "password": 79568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) ; 79668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "search": 79768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) ; 79868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "text": 79968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) ; 80068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "tel": 80168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) ; 80268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "url": 80368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) ; 80468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "": 80568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0; 80668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) default: 80768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 80868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 80968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 81068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.isLowContrast = function(a, b, c) { 8114e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) a = Math.round(10 * a) / 10; 81268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c ? 4.5 > a || !axs.utils.isLargeFont(b) && 7 > a : 3 > a || !axs.utils.isLargeFont(b) && 4.5 > a 81368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 81468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.hasLabel = function(a) { 81568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = a.tagName.toLowerCase(), c = a.type ? a.type.toLowerCase() : ""; 8164e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) if(a.hasAttribute("aria-label") || a.hasAttribute("title") || "img" == b && a.hasAttribute("alt") || "input" == b && "image" == c && a.hasAttribute("alt") || "input" == b && ("submit" == c || "reset" == c) || a.hasAttribute("aria-labelledby") || axs.utils.isNativeTextElement(a) && a.hasAttribute("placeholder") || a.hasAttribute("id") && 0 < document.querySelectorAll('label[for="' + a.id + '"]').length) { 81768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0 81868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 81968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(b = a.parentElement;b;) { 82068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("label" == b.tagName.toLowerCase() && b.control == a) { 82168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0 82268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 82368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b = b.parentElement 82468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 82568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 82668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 82768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.isElementHidden = function(a) { 82868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!(a instanceof a.ownerDocument.defaultView.HTMLElement)) { 82968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 83068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 83168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.hasAttribute("chromevoxignoreariahidden")) { 83268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = !0 83368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 83468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = window.getComputedStyle(a, null); 83568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"none" == c.display || "hidden" == c.visibility ? !0 : a.hasAttribute("aria-hidden") && "true" == a.getAttribute("aria-hidden").toLowerCase() ? !b : !1 83668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 83768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.isElementOrAncestorHidden = function(a) { 83868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.utils.isElementHidden(a) ? !0 : a.parentElement ? axs.utils.isElementOrAncestorHidden(a.parentElement) : !1 83968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 84068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.isInlineElement = function(a) { 84168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.tagName.toUpperCase(); 84268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.constants.InlineElements[a] 84368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 84468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.getRoles = function(a) { 84568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!a.hasAttribute("role")) { 84668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 84768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 84868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.getAttribute("role").split(" "); 84968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var b = [], c = !0, d = 0;d < a.length;d++) { 85068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var e = a[d]; 85168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) axs.constants.ARIA_ROLES[e] ? b.push({name:e, details:axs.constants.ARIA_ROLES[e], valid:!0}) : (b.push({name:e, valid:!1}), c = !1) 85268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 85368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return{roles:b, valid:c} 85468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 85568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.getAriaPropertyValue = function(a, b, c) { 85668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = a.replace(/^aria-/, ""), e = axs.constants.ARIA_PROPERTIES[d], d = {name:a, rawValue:b}; 85768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!e) { 85868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property', d 85968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 86068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e = e.valueType; 86168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!e) { 86268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property', d 86368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 86468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) switch(e) { 86568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "idref": 86668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = axs.utils.isValidIDRefValue(b, c), d.valid = a.valid, d.reason = a.reason, d.idref = a.idref; 86768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "idref_list": 86868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = b.split(/\s+/); 86968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d.valid = !0; 87068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(b = 0;b < a.length;b++) { 87168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e = axs.utils.isValidIDRefValue(a[b], c), e.valid || (d.valid = !1), d.values ? d.values.push(e) : d.values = [e] 87268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 87368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d; 87468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "integer": 87568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) ; 87668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "decimal": 87768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = axs.utils.isValidNumber(b); 87868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!c.valid) { 87968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d.valid = !1, d.reason = c.reason, d 88068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 88168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) Math.floor(c.value) != c.value ? (d.valid = !1, d.reason = "" + b + " is not a whole integer") : (d.valid = !0, d.value = c.value); 88268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d; 88368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "number": 88468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = axs.utils.isValidNumber(b), c.valid && (d.valid = !0, d.value = c.value); 88568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "string": 88668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d.valid = !0, d.value = b, d; 88768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "token": 88868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c = axs.utils.isValidTokenValue(a, b.toLowerCase()), c.valid ? (d.valid = !0, d.value = c.value) : (d.valid = !1, d.value = b, d.reason = c.reason), d; 88968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "token_list": 89068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e = b.split(/\s+/); 89168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d.valid = !0; 89268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(b = 0;b < e.length;b++) { 89368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = axs.utils.isValidTokenValue(a, e[b].toLowerCase()), c.valid || (d.valid = !1, d.reason ? (d.reason = [d.reason], d.reason.push(c.reason)) : (d.reason = c.reason, d.possibleValues = c.possibleValues)), d.values ? d.values.push(c.value) : d.values = [c.value] 89468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 89568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d; 89668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "tristate": 89768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 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; 89868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) case "boolean": 89968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 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 90068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 90168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d.valid = !1; 90268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d.reason = "Not a valid ARIA property"; 90368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d 90468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 90568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.isValidTokenValue = function(a, b) { 90668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = a.replace(/^aria-/, ""); 90768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.utils.isPossibleValue(b, axs.constants.ARIA_PROPERTIES[c].valuesSet, a) 90868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 90968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.isPossibleValue = function(a, b, c) { 91068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b[a] ? {valid:!0, value:a} : {valid:!1, value:a, reason:'"' + a + '" is not a valid value for ' + c, possibleValues:Object.keys(b)} 91168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 91268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.isValidBoolean = function(a) { 91368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) try { 91468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = JSON.parse(a) 91568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }catch(c) { 91668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b = "" 91768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 91868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"boolean" != typeof b ? {valid:!1, value:a, reason:'"' + a + '" is not a true/false value'} : {valid:!0, value:b} 91968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 92068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.isValidIDRefValue = function(a, b) { 92168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 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 + '"'} 92268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 92368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.isValidNumber = function(a) { 92468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) try { 92568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = JSON.parse(a) 92668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }catch(c) { 92768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return{valid:!1, value:a, reason:'"' + a + '" is not a number'} 92868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 92968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"number" != typeof b ? {valid:!1, value:a, reason:'"' + a + '" is not a number'} : {valid:!0, value:b} 93068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 93168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.isElementImplicitlyFocusable = function(a) { 93268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = a.ownerDocument.defaultView; 93368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a instanceof b.HTMLAnchorElement || a instanceof b.HTMLAreaElement ? a.hasAttribute("href") : a instanceof b.HTMLInputElement || a instanceof b.HTMLSelectElement || a instanceof b.HTMLTextAreaElement || a instanceof b.HTMLButtonElement || a instanceof b.HTMLIFrameElement ? !a.disabled : !1 93468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 93568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.values = function(a) { 93668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = [], c; 93768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(c in a) { 93868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a.hasOwnProperty(c) && "function" != typeof a[c] && b.push(a[c]) 93968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 94068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b 94168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 94268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.namedValues = function(a) { 94368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = {}, c; 94468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(c in a) { 94568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a.hasOwnProperty(c) && "function" != typeof a[c] && (b[c] = a[c]) 94668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 94768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b 94868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 94968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.utils.getQuerySelectorText = function(a) { 95068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(null == a || "HTML" == a.tagName) { 95168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"html" 95268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 95368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("BODY" == a.tagName) { 95468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"body" 95568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 95668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.hasAttribute) { 95768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.id) { 95868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"#" + a.id 95968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 96068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.className) { 96168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var b = "", c = 0;c < a.classList.length;c++) { 96268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b += "." + a.classList[c] 96368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 96468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = 0; 96568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.parentNode) { 96668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(c = 0;c < a.parentNode.children.length;c++) { 96768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var e = a.parentNode.children[c]; 96868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) axs.browserUtils.matchSelector(e, b) && d++; 96968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(e === a) { 97068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) break 97168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 97268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 97368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 97468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d = 1 97568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 97668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return 1 == d ? axs.utils.getQuerySelectorText(a.parentNode) + " > " + b : axs.utils.getQuerySelectorText(a.parentNode) + " > " + b + ":nth-of-type(" + d + ")" 97768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 97868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.parentNode) { 97968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b = a.parentNode.children; 98068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d = 1; 98168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(c = 0;b[c] !== a;) { 98268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b[c].tagName == a.tagName && d++, c++ 98368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 98468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = ""; 98568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) "BODY" != a.parentNode.tagName && (c = axs.utils.getQuerySelectorText(a.parentNode) + " > "); 98668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return 1 == d ? c + a.tagName : c + a.tagName + ":nth-of-type(" + d + ")" 98768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 98868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 98968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.selectorText) { 99068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.selectorText 99168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 99268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 99368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"" 99468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 99568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties = {}; 99668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.TEXT_CONTENT_XPATH = './/text()[normalize-space(.)!=""]/parent::*[name()!="script"]'; 99768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.getFocusProperties = function(a) { 9984e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) var b = {}, c = a.getAttribute("tabindex"); 9994e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) void 0 != c ? b.tabindex = {value:c, valid:!0} : axs.utils.isElementImplicitlyFocusable(a) && (b.implicitlyFocusable = {value:!0, valid:!0}); 10004e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) if(0 == Object.keys(b).length) { 10014e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) return null 10024e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) } 10034e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) var c = axs.utils.elementIsTransparent(a), d = axs.utils.elementHasZeroArea(a), e = axs.utils.elementIsOutsideScrollArea(a), f = axs.utils.overlappingElements(a); 10044e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) if(c || d || e || 0 < f.length) { 10054e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) var g = axs.utils.isElementOrAncestorHidden(a), h = {value:!1, valid:g}; 10064e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) c && (h.transparent = !0); 10074e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) d && (h.zeroArea = !0); 10084e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) e && (h.outsideScrollArea = !0); 10094e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 0 < f.length && (h.overlappingElements = f); 10104e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) h.hidden = {value:g, reason:axs.properties.getHiddenReason(a), valid:g}; 10114e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) b.visible = h 10124e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) }else { 10134e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) b.visible = {value:!0, valid:!0} 10144e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) } 10154e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) return b 10164e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)}; 10174e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)axs.properties.getHiddenReason = function(a) { 10184e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) if(!(a && a instanceof a.ownerDocument.defaultView.HTMLElement)) { 10194e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) return null 10204e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) } 10214e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) if(a.hasAttribute("chromevoxignoreariahidden")) { 10224e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) var b = !0 10234e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) } 10244e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) var c = window.getComputedStyle(a, null); 10254e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) return"none" == c.display ? {property:"display: none", on:a} : "hidden" == c.visibility ? {property:"visibility: hidden", on:a} : a.hasAttribute("aria-hidden") && "true" == a.getAttribute("aria-hidden").toLowerCase() && !b ? {property:"aria-hidden", on:a} : axs.properties.getHiddenReason(a.parentElement) 102668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 102768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.getColorProperties = function(a) { 102868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = {}; 102968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) (a = axs.properties.getContrastRatioProperties(a)) && (b.contrastRatio = a); 103068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return 0 == Object.keys(b).length ? null : b 103168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 103268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.hasDirectTextDescendant = function(a) { 103368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var b = (a.nodeType == Node.DOCUMENT_NODE ? a : a.ownerDocument).evaluate(axs.properties.TEXT_CONTENT_XPATH, a, null, XPathResult.ANY_TYPE, null), c = !1, d = b.iterateNext();null != d;d = b.iterateNext()) { 103468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(d === a) { 103568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = !0; 103668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) break 103768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 103868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 103968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c 104068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 104168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.getContrastRatioProperties = function(a) { 104268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!axs.properties.hasDirectTextDescendant(a)) { 104368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 104468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 104568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = {}, c = window.getComputedStyle(a, null), d = axs.utils.getBgColor(c, a); 104668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!d) { 104768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 104868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 104968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.backgroundColor = axs.utils.colorToString(d); 105068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var e = axs.utils.getFgColor(c, a, d); 105168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.foregroundColor = axs.utils.colorToString(e); 105268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = axs.utils.getContrastRatioForElementWithComputedStyle(c, a); 105368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!a) { 105468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 105568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 105668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.value = a.toFixed(2); 105768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) axs.utils.isLowContrast(a, c) && (b.alert = !0); 105868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) (c = axs.utils.suggestColors(d, e, a, c)) && Object.keys(c).length && (b.suggestedColors = c); 105968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b 106068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 106168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.findTextAlternatives = function(a, b, c) { 106268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = c || !1; 106368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = axs.utils.asElement(a); 106468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!c || !d && axs.utils.isElementOrAncestorHidden(c)) { 106568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 106668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 106768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.nodeType == Node.TEXT_NODE) { 106868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c = {type:"text"}, c.text = a.textContent, c.lastWord = axs.properties.getLastWord(c.text), b.content = c, a.textContent 106968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 107068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = null; 107168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d || (a = axs.properties.getTextFromAriaLabelledby(c, b)); 107268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(c.hasAttribute("aria-label")) { 107368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var e = {type:"text"}; 107468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e.text = c.getAttribute("aria-label"); 107568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e.lastWord = axs.properties.getLastWord(e.text); 107668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a ? e.unused = !0 : d && axs.utils.elementIsHtmlControl(c) || (a = e.text); 107768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.ariaLabel = e 107868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 10794e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) c.hasAttribute("role") && "presentation" == c.getAttribute("role") || (a = axs.properties.getTextFromHostLanguageAttributes(c, b, a)); 108068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(d && axs.utils.elementIsHtmlControl(c)) { 108168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e = c.ownerDocument.defaultView; 108268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(c instanceof e.HTMLInputElement) { 108368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var f = c; 108468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) "text" == f.type && f.value && 0 < f.value.length && (b.controlValue = {text:f.value}); 108568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) "range" == f.type && (b.controlValue = {text:f.value}) 108668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 10874e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) c instanceof e.HTMLSelectElement && (b.controlValue = {text:c.value}); 10884e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) b.controlValue && (e = b.controlValue, a ? e.unused = !0 : a = e.text) 108968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 109068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(d && axs.utils.elementIsAriaWidget(c)) { 109168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d = c.getAttribute("role"); 109268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) "textbox" == d && c.textContent && 0 < c.textContent.length && (b.controlValue = {text:c.textContent}); 109368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("slider" == d || "spinbutton" == d) { 109468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 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")}) 109568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 109668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("menu" == d) { 10974e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) for(var g = c.querySelectorAll("[role=menuitemcheckbox], [role=menuitemradio]"), e = [], f = 0;f < g.length;f++) { 10984e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) "true" == g[f].getAttribute("aria-checked") && e.push(g[f]) 109968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 11004e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) if(0 < e.length) { 110168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) g = ""; 11024e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) for(f = 0;f < e.length;f++) { 11034e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) g += axs.properties.findTextAlternatives(e[f], {}, !0), f < e.length - 1 && (g += ", ") 110468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 110568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.controlValue = {text:g} 110668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 110768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 110868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("combobox" == d || "select" == d) { 110968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.controlValue = {text:"TODO"} 111068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 11114e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) b.controlValue && (e = b.controlValue, a ? e.unused = !0 : a = e.text) 111268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 11134e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) e = !0; 11144e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) c.hasAttribute("role") && (d = c.getAttribute("role"), (d = axs.constants.ARIA_ROLES[d]) && (!d.namefrom || 0 > d.namefrom.indexOf("contents")) && (e = !1)); 11154e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) (d = axs.properties.getTextFromDescendantContent(c)) && e && (e = {type:"text"}, e.text = d, e.lastWord = axs.properties.getLastWord(e.text), a ? e.unused = !0 : a = d, b.content = e); 111668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c.hasAttribute("title") && (d = {type:"string", valid:!0}, d.text = c.getAttribute("title"), d.lastWord = axs.properties.getLastWord(d.lastWord), a ? d.unused = !0 : a = d.text, b.title = d); 111768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return 0 == Object.keys(b).length && null == a ? null : a 111868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 111968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.getTextFromDescendantContent = function(a) { 112068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.childNodes; 112168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var b = [], c = 0;c < a.length;c++) { 112268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = axs.properties.findTextAlternatives(a[c], {}, !0); 112368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d && 0 < d.trim().length && b.push(d.trim()) 112468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 112568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b.length ? b.join(" ") : null 112668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 112768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.getTextFromAriaLabelledby = function(a, b) { 112868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = null; 112968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!a.hasAttribute("aria-labelledby")) { 113068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c 113168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 113268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var d = a.getAttribute("aria-labelledby").split(/\s+/), e = {valid:!0}, f = [], g = [], h = 0;h < d.length;h++) { 113368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var k = {type:"element"}, m = d[h]; 113468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) k.value = m; 113568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var l = document.getElementById(m); 113668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) l ? (k.valid = !0, k.text = axs.properties.findTextAlternatives(l, {}, !0), k.lastWord = axs.properties.getLastWord(k.text), f.push(l.textContent.trim()), k.element = l) : (k.valid = !1, e.valid = !1, k.errorMessage = {messageKey:"noElementWithId", args:[m]}); 113768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) g.push(k) 113868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 113968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 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); 114068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c 114168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 11424e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)axs.properties.getTextFromHostLanguageAttributes = function(a, b, c) { 114368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(axs.browserUtils.matchSelector(a, "img")) { 114468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.hasAttribute("alt")) { 114568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = {type:"string", valid:!0}; 114668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d.text = a.getAttribute("alt"); 114768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c ? d.unused = !0 : c = d.text; 114868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.alt = d 114968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 115068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d = {valid:!1, errorMessage:"No alt value provided"}, b.alt = d, d = a.src, "string" == typeof d && (c = d.split("/").pop(), b.filename = {text:c}) 115168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 115268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 115368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), video:not([disabled])')) { 115468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.hasAttribute("id")) { 11554e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) for(var d = document.querySelectorAll('label[for="' + a.id + '"]'), e = {}, f = [], g = [], h = 0;h < d.length;h++) { 115668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var k = {type:"element"}, m = d[h], l = axs.properties.findTextAlternatives(m, {}, !0); 115768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) l && 0 < l.trim().length && (k.text = l.trim(), g.push(l.trim())); 115868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) k.element = m; 115968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) f.push(k) 116068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 116168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 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) 116268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 116368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d = a.parentElement; 116468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(e = {};d;) { 116568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if("label" == d.tagName.toLowerCase() && (f = d, f.control == a)) { 116668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e.type = "element"; 116768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e.text = axs.properties.findTextAlternatives(f, {}, !0); 116868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e.lastWord = axs.properties.getLastWord(e.text); 116968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e.element = f; 117068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) break 117168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 117268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d = d.parentElement 117368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 117468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e.text && (c ? e.unused = !0 : c = e.text, b.labelWrapped = e); 117568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) Object.keys(b).length || (b.noLabel = !0) 117668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 117768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c 117868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 117968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.getLastWord = function(a) { 118068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!a) { 118168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 118268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 118368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = a.lastIndexOf(" ") + 1, c = a.length - 10; 118468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a.substring(b > c ? b : c) 118568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 118668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.getTextProperties = function(a) { 118768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = {}; 118868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = axs.properties.findTextAlternatives(a, b); 118968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(0 == Object.keys(b).length) { 119068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!a) { 119168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 119268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 119368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.hasProperties = !1 119468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }else { 119568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.hasProperties = !0 119668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 119768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.computedText = a; 119868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.lastWord = axs.properties.getLastWord(a); 119968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b 120068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 120168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.getAriaProperties = function(a) { 120268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = {}, c = axs.properties.getGlobalAriaProperties(a), d; 120368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(d in axs.constants.ARIA_PROPERTIES) { 120468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var e = "aria-" + d; 120568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.hasAttribute(e)) { 120668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var f = a.getAttribute(e); 120768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c[e] = axs.utils.getAriaPropertyValue(e, f, a) 120868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 120968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 121068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 0 < Object.keys(c).length && (b.properties = axs.utils.values(c)); 121168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) f = axs.utils.getRoles(a); 121268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!f) { 121368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return Object.keys(b).length ? b : null 121468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 121568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.roles = f; 121668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!f.valid || !f.roles) { 121768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b 121868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 121968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var e = f.roles, g = 0;g < e.length;g++) { 122068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var h = e[g]; 122168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(h.details && h.details.propertiesSet) { 122268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(d in h.details.propertiesSet) { 122368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d in c || (a.hasAttribute(d) ? (f = a.getAttribute(d), c[d] = axs.utils.getAriaPropertyValue(d, f, a), "values" in c[d] && (f = c[d].values, f[f.length - 1].isLast = !0)) : h.details.requiredPropertiesSet[d] && (c[d] = {name:d, valid:!1, reason:"Required property not set"})) 122468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 122568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 122668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 122768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 0 < Object.keys(c).length && (b.properties = axs.utils.values(c)); 122868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return 0 < Object.keys(b).length ? b : null 122968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 123068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.getGlobalAriaProperties = function(a) { 123168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var b = {}, c = 0;c < axs.constants.GLOBAL_PROPERTIES.length;c++) { 123268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = axs.constants.GLOBAL_PROPERTIES[c]; 123368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.hasAttribute(d)) { 123468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var e = a.getAttribute(d); 123568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b[d] = axs.utils.getAriaPropertyValue(d, e, a) 123668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 123768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 123868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b 123968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 124068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.getVideoProperties = function(a) { 124168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!axs.browserUtils.matchSelector(a, "video")) { 124268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return null 124368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 124468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = {}; 124568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.captionTracks = axs.properties.getTrackElements(a, "captions"); 124668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.descriptionTracks = axs.properties.getTrackElements(a, "descriptions"); 124768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b.chapterTracks = axs.properties.getTrackElements(a, "chapters"); 124868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b 124968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 125068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.getTrackElements = function(a, b) { 125168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = a.querySelectorAll("track[kind=" + b + "]"), d = {}; 125268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!c.length) { 125368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d.valid = !1, d.reason = {messageKey:"noTracksProvided", args:[[b]]}, d 125468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 125568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d.valid = !0; 125668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var e = [], f = 0;f < c.length;f++) { 125768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var g = {}, h = c[f].getAttribute("src"), k = c[f].getAttribute("srcLang"), m = c[f].getAttribute("label"); 125868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) h ? (g.valid = !0, g.src = h) : (g.valid = !1, g.reason = {messageKey:"noSrcProvided"}); 125968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) h = ""; 126068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) m && (h += m, k && (h += " ")); 126168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) k && (h += "(" + k + ")"); 126268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) "" == h && (h = "[[object Object]]"); 126368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) g.name = h; 126468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e.push(g) 126568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 126668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d.values = e; 126768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return d 126868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 126968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.properties.getAllProperties = function(a) { 127068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = axs.utils.asElement(a); 127168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!b) { 127268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return{} 127368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 127468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = {}; 127568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c.ariaProperties = axs.properties.getAriaProperties(b); 127668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c.colorProperties = axs.properties.getColorProperties(b); 127768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c.focusProperties = axs.properties.getFocusProperties(b); 127868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c.textProperties = axs.properties.getTextProperties(a); 127968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c.videoProperties = axs.properties.getVideoProperties(b); 128068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c 128168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 128268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule = function(a) { 128368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var b = !0, c = [], d = 0;d < axs.AuditRule.requiredFields.length;d++) { 128468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var e = axs.AuditRule.requiredFields[d]; 128568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) e in a || (b = !1, c.push(e)) 128668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 128768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!b) { 128868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) throw"Invalid spec; the following fields were not specified: " + c.join(", ") + "\n" + JSON.stringify(a); 128968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 129068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.name = a.name; 129168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.severity = a.severity; 129268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.relevantElementMatcher_ = a.relevantElementMatcher; 129368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.test_ = a.test; 129468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.code = a.code; 129568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.heading = a.heading || ""; 129668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.url = a.url || ""; 129768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.requiresConsoleAPI = !!a.opt_requiresConsoleAPI 129868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 129968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.requiredFields = "name severity relevantElementMatcher test code heading".split(" "); 130068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.NOT_APPLICABLE = {result:axs.constants.AuditResult.NA}; 130168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.prototype.addElement = function(a, b) { 130268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a.push(b) 130368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 130468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.collectMatchingElements = function(a, b, c) { 130568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.nodeType == Node.ELEMENT_NODE) { 130668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = a 130768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 130868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d && b.call(null, d) && c.push(d); 130968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(a = a.firstChild;null != a;) { 131068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) axs.AuditRule.collectMatchingElements(a, b, c), a = a.nextSibling 131168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 131268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 13134e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)axs.AuditRule.prototype.run = function(a) { 13144e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) a = a || {}; 13154e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) var b = "ignoreSelectors" in a ? a.ignoreSelectors : [], c = "maxResults" in a ? a.maxResults : null, d = []; 13164e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) axs.AuditRule.collectMatchingElements("scope" in a ? a.scope : document, this.relevantElementMatcher_, d); 131768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var e = []; 131868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!d.length) { 131968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return{result:axs.constants.AuditResult.NA} 132068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 13214e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) for(a = 0;a < d.length && !(null != c && e.length >= c);a++) { 13224e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) var f = d[a], g; 132368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a: { 13244e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) g = f; 13254e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) for(var h = 0;h < b.length;h++) { 13264e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) if(axs.browserUtils.matchSelector(g, b[h])) { 13274e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) g = !0; 132868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) break a 132968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 133068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 13314e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) g = !1 133268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 13334e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) !g && this.test_(f) && this.addElement(e, f) 133468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 13354e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) b = {result:e.length ? axs.constants.AuditResult.FAIL : axs.constants.AuditResult.PASS, elements:e}; 13364e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) a < d.length && (b.resultsTruncated = !0); 13374e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) return b 133868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 133968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs = {}; 134068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRules = {}; 134168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRules.getRule = function(a) { 134268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!axs.AuditRules.rules) { 134368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) axs.AuditRules.rules = {}; 134468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var b in axs.AuditRule.specs) { 134568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = axs.AuditRule.specs[b], d = new axs.AuditRule(c); 134668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) axs.AuditRules.rules[c.name] = d 134768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 134868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 134968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.AuditRules.rules[a] 135068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 135168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditResults = function() { 135268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.errors_ = []; 135368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.warnings_ = [] 135468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 135568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportSymbol("axs.AuditResults", axs.AuditResults); 135668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditResults.prototype.addError = function(a) { 135768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) "" != a && this.errors_.push(a) 135868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 135968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportProperty(axs.AuditResults.prototype, "addError", axs.AuditResults.prototype.addError); 136068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditResults.prototype.addWarning = function(a) { 136168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) "" != a && this.warnings_.push(a) 136268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 136368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportProperty(axs.AuditResults.prototype, "addWarning", axs.AuditResults.prototype.addWarning); 136468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditResults.prototype.numErrors = function() { 136568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return this.errors_.length 136668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 136768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportProperty(axs.AuditResults.prototype, "numErrors", axs.AuditResults.prototype.numErrors); 136868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditResults.prototype.numWarnings = function() { 136968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return this.warnings_.length 137068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 137168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportProperty(axs.AuditResults.prototype, "numWarnings", axs.AuditResults.prototype.numWarnings); 137268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditResults.prototype.getErrors = function() { 137368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return this.errors_ 137468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 137568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportProperty(axs.AuditResults.prototype, "getErrors", axs.AuditResults.prototype.getErrors); 137668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditResults.prototype.getWarnings = function() { 137768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return this.warnings_ 137868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 137968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportProperty(axs.AuditResults.prototype, "getWarnings", axs.AuditResults.prototype.getWarnings); 138068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditResults.prototype.toString = function() { 138168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var a = "", b = 0;b < this.errors_.length;b++) { 138268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 0 == b && (a += "\nErrors:\n"); 138368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = this.errors_[b], a = a + (c + "\n\n") 138468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 138568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(b = 0;b < this.warnings_.length;b++) { 138668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 0 == b && (a += "\nWarnings:\n"), c = this.warnings_[b], a += c + "\n\n" 138768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 138868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a 138968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 139068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportProperty(axs.AuditResults.prototype, "toString", axs.AuditResults.prototype.toString); 139168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.Audit = {}; 139268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditConfiguration = function() { 139368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.rules_ = {}; 13944e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) this.maxResults = this.auditRulesToIgnore = this.auditRulesToRun = this.scope = null; 139568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) this.withConsoleApi = !1; 139668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.exportProperty(this, "scope", this.scope); 139768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.exportProperty(this, "auditRulesToRun", this.auditRulesToRun); 139868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.exportProperty(this, "auditRulesToIgnore", this.auditRulesToIgnore); 139968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) goog.exportProperty(this, "withConsoleApi", this.withConsoleApi) 140068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 140168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportSymbol("axs.AuditConfiguration", axs.AuditConfiguration); 140268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditConfiguration.prototype = {ignoreSelectors:function(a, b) { 140368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a in this.rules_ || (this.rules_[a] = {}); 140468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) "ignore" in this.rules_[a] || (this.rules_[a].ignore = []); 140568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) Array.prototype.push.call(this.rules_[a].ignore, b) 140668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, getIgnoreSelectors:function(a) { 140768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a in this.rules_ && "ignore" in this.rules_[a] ? this.rules_[a].ignore : [] 14084e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)}, setSeverity:function(a, b) { 14094e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) a in this.rules_ || (this.rules_[a] = {}); 14104e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) this.rules_[a].severity = b 14114e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)}, getSeverity:function(a) { 14124e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) return a in this.rules_ && "severity" in this.rules_[a] ? this.rules_[a].severity : null 141368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}}; 141468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportProperty(axs.AuditConfiguration.prototype, "ignoreSelectors", axs.AuditConfiguration.prototype.ignoreSelectors); 141568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportProperty(axs.AuditConfiguration.prototype, "getIgnoreSelectors", axs.AuditConfiguration.prototype.getIgnoreSelectors); 141668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.Audit.run = function(a) { 141768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a || new axs.AuditConfiguration; 141868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = a.withConsoleApi, c = [], d; 141968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d = a.auditRulesToRun && 0 < a.auditRulesToRun.length ? a.auditRulesToRun : Object.keys(axs.AuditRule.specs); 142068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.auditRulesToIgnore) { 142168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var e = 0;e < a.auditRulesToIgnore.length;e++) { 142268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var f = a.auditRulesToIgnore[e]; 142368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 0 > d.indexOf(f) || d.splice(d.indexOf(f), 1) 142468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 142568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 142668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(e = 0;e < d.length;e++) { 14274e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) var f = d[e], g = axs.AuditRules.getRule(f); 14284e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) if(g && !g.disabled && (b || !g.requiresConsoleAPI)) { 14294e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) var h = {}, k = a.getIgnoreSelectors(g.name); 14304e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) if(0 < k.length || a.scope) { 14314e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) h.ignoreSelectors = k 14324e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) } 14334e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) a.scope && (h.scope = a.scope); 14344e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) a.maxResults && (h.maxResults = a.maxResults); 14354e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) h = g.run.call(g, h); 14364e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) g = axs.utils.namedValues(g); 14374e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) g.severity = a.getSeverity(f) || g.severity; 14384e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) h.rule = g; 14394e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) c.push(h) 144068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 144168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 144268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c 144368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 144468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportSymbol("axs.Audit.run", axs.Audit.run); 144568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.Audit.auditResults = function(a) { 144668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var b = new axs.AuditResults, c = 0;c < a.length;c++) { 144768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = a[c]; 144868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) d.result == axs.constants.AuditResult.FAIL && (d.rule.severity == axs.constants.Severity.SEVERE ? b.addError(axs.Audit.accessibilityErrorMessage(d)) : b.addWarning(axs.Audit.accessibilityErrorMessage(d))) 144968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 145068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b 145168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 145268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportSymbol("axs.Audit.auditResults", axs.Audit.auditResults); 145368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.Audit.createReport = function(a, b) { 145468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c; 145568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) c = "*** Begin accessibility audit results ***\nAn accessibility audit found " + axs.Audit.auditResults(a).toString(); 145668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b && (c += "\nFor more information, please see ", c += b); 145768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return c += "\n*** End accessibility audit results ***" 145868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 145968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportSymbol("axs.Audit.createReport", axs.Audit.createReport); 146068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.Audit.accessibilityErrorMessage = function(a) { 146168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var b = a.rule.severity == axs.constants.Severity.SEVERE ? "Error: " : "Warning: ", b = b + (a.rule.code + " (" + a.rule.heading + ") failed on the following " + (1 == a.elements.length ? "element" : "elements")), b = 1 == a.elements.length ? b + ":" : b + (" (1 - " + Math.min(5, a.elements.length) + " of " + a.elements.length + "):"), c = Math.min(a.elements.length, 5), d = 0;d < c;d++) { 146268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var e = a.elements[d], b = b + "\n"; 146368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) try { 146468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b += axs.utils.getQuerySelectorText(e) 146568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) }catch(f) { 146668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b += " tagName:" + e.tagName, b += " id:" + e.id 146768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 146868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 146968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) "" != a.rule.url && (b += "\nSee " + a.rule.url + " for more information."); 147068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return b 147168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}; 147268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)goog.exportSymbol("axs.Audit.accessibilityErrorMessage", axs.Audit.accessibilityErrorMessage); 147368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.audioWithoutControls = {name:"audioWithoutControls", heading:"Audio elements should have controls", url:"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) { 147468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.browserUtils.matchSelector(a, "audio[autoplay]") 147568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 147668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!a.querySelectorAll("[controls]").length && 3 < a.duration 147768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_AUDIO_01"}; 147868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.badAriaAttributeValue = {name:"badAriaAttributeValue", heading:"ARIA state and property values must be valid", url:"", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) { 147968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = "", c; 148068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(c in axs.constants.ARIA_PROPERTIES) { 148168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b += "[aria-" + c + "]," 148268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 148368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b = b.substring(0, b.length - 1); 148468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.browserUtils.matchSelector(a, b) 148568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 148668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var b in axs.constants.ARIA_PROPERTIES) { 148768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var c = "aria-" + b; 148868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.hasAttribute(c)) { 148968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = a.getAttribute(c); 149068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!axs.utils.getAriaPropertyValue(c, d, a).valid) { 149168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0 149268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 149368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 149468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 149568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 149668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_ARIA_04"}; 149768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.badAriaRole = {name:"badAriaRole", heading:"Elements with ARIA roles must use a valid, non-abstract ARIA role", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_aria_01--elements-with-aria-roles-must-use-a-valid-non-abstract-aria-role", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) { 149868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.browserUtils.matchSelector(a, "[role]") 149968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 150068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!axs.utils.getRoles(a).valid 150168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_ARIA_01"}; 150268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.controlsWithoutLabel = {name:"controlsWithoutLabel", heading:"Controls and media elements should have labels", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_text_01--controls-and-media-elements-should-have-labels", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) { 150368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), video:not([disabled])')) { 150468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 150568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 150668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(0 <= a.tabIndex) { 150768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0 150868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 150968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(a = a.parentElement;null != a;a = a.parentElement) { 151068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(axs.utils.elementIsAriaWidget(a)) { 151168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 151268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 151368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 151468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0 151568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 151668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.utils.isElementOrAncestorHidden(a) || "input" == a.tagName.toLowerCase() && "button" == a.type && a.value.length || "button" == a.tagName.toLowerCase() && a.textContent.replace(/^\s+|\s+$/g, "").length ? !1 : axs.utils.hasLabel(a) ? !1 : !0 151768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_TEXT_01", ruleName:"Controls and media elements should have labels"}; 151868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.focusableElementNotVisibleAndNotAriaHidden = {name:"focusableElementNotVisibleAndNotAriaHidden", heading:"These elements are focusable but either invisible or obscured by another element", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_focus_01--these-elements-are-focusable-but-either-invisible-or-obscured-by-another-element", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) { 151968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!axs.browserUtils.matchSelector(a, axs.utils.FOCUSABLE_ELEMENTS_SELECTOR)) { 152068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 152168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 152268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(0 <= a.tabIndex) { 152368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0 152468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 152568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(a = a.parentElement;null != a;a = a.parentElement) { 152668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(axs.utils.elementIsAriaWidget(a)) { 152768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 152868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 152968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 153068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0 153168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 153268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.utils.isElementOrAncestorHidden(a) ? !1 : !axs.utils.elementIsVisible(a) 153368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_FOCUS_01"}; 153468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.imagesWithoutAltText = {name:"imagesWithoutAltText", heading:"Images should have an alt attribute", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_text_02--images-should-have-an-alt-attribute-unless-they-have-an-aria-role-of-presentation", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) { 153568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.browserUtils.matchSelector(a, "img") && !axs.utils.isElementOrAncestorHidden(a) 153668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 153768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!a.hasAttribute("alt") && "presentation" != a.getAttribute("role") 153868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_TEXT_02"}; 153968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.linkWithUnclearPurpose = {name:"linkWithUnclearPurpose", heading:"The purpose of each link should be clear from the link text", url:"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) { 154068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.browserUtils.matchSelector(a, "a") 154168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 154268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return/^\s*click\s*here\s*[^a-z]?$/i.test(a.textContent) 154368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_TITLE_01"}; 154468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.lowContrastElements = {name:"lowContrastElements", heading:"Text elements should have a reasonable contrast ratio", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_color_01--text-elements-should-have-a-reasonable-contrast-ratio", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) { 154568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.properties.hasDirectTextDescendant(a) 154668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 154768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = window.getComputedStyle(a, null); 154868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return(a = axs.utils.getContrastRatioForElementWithComputedStyle(b, a)) && axs.utils.isLowContrast(a, b) 154968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_COLOR_01"}; 155068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.mainRoleOnInappropriateElement = {name:"mainRoleOnInappropriateElement", heading:"role=main should only appear on significant elements", url:"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) { 155168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.browserUtils.matchSelector(a, "[role~=main]") 155268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 155368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(axs.utils.isInlineElement(a)) { 155468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0 155568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 15564e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) a = axs.properties.getTextFromDescendantContent(a); 155768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!a || 50 > a.length ? !0 : !1 155868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_ARIA_04"}; 155968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.elementsWithMeaningfulBackgroundImage = {name:"elementsWithMeaningfulBackgroundImage", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) { 156068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!axs.utils.isElementOrAncestorHidden(a) 156168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, heading:"Meaningful images should not be used in element backgrounds", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_image_01--meaningful-images-should-not-be-used-in-element-backgrounds", test:function(a) { 156268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(a.textContent && 0 < a.textContent.length) { 156368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 156468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 156568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = window.getComputedStyle(a, null); 156668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = a.backgroundImage; 156768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!b || "undefined" === b || "none" === b || 0 != b.indexOf("url")) { 156868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 156968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 157068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) b = parseInt(a.width, 10); 157168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = parseInt(a.height, 10); 157268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return 150 > b && 150 > a 157368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_IMAGE_01"}; 157468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.nonExistentAriaLabelledbyElement = {name:"nonExistentAriaLabelledbyElement", heading:"aria-labelledby attributes should refer to an element which exists in the DOM", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_aria_02--aria-labelledby-attributes-should-refer-to-an-element-which-exists-in-the-dom", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) { 157568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.browserUtils.matchSelector(a, "[aria-labelledby]") 157668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 157768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.getAttribute("aria-labelledby").split(/\s+/); 157868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var b = 0;b < a.length;b++) { 157968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!document.getElementById(a[b])) { 158068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0 158168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 158268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 158368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 158468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_ARIA_02"}; 158568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.pageWithoutTitle = {name:"pageWithoutTitle", heading:"The web page should have a title that describes topic or purpose", url:"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) { 158668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return"html" == a.tagName.toLowerCase() 158768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 158868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) a = a.querySelector("head"); 158968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return a ? (a = a.querySelector("title")) ? !a.textContent : !0 : !0 159068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_TITLE_01"}; 159168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.requiredAriaAttributeMissing = {name:"requiredAriaAttributeMissing", heading:"Elements with ARIA roles must have all required attributes for that role", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_aria_03--elements-with-aria-roles-must-have-all-required-attributes-for-that-role", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) { 159268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.browserUtils.matchSelector(a, "[role]") 159368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 159468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var b = axs.utils.getRoles(a); 159568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(!b.valid) { 159668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!1 159768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 159868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(var c = 0;c < b.roles.length;c++) { 159968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) var d = b.roles[c].details.requiredPropertiesSet, e; 160068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) for(e in d) { 160168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) if(d = e.replace(/^aria-/, ""), !("defaultValue" in axs.constants.ARIA_PROPERTIES[d] || a.hasAttribute(e))) { 160268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!0 160368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 160468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 160568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) } 160668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_ARIA_03"}; 160768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.unfocusableElementsWithOnClick = {name:"unfocusableElementsWithOnClick", heading:"Elements with onclick handlers must be focusable", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_focus_02--elements-with-onclick-handlers-must-be-focusable", severity:axs.constants.Severity.WARNING, opt_requiresConsoleAPI:!0, relevantElementMatcher:function(a) { 16084e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) return a instanceof a.ownerDocument.defaultView.HTMLBodyElement || axs.utils.isElementOrAncestorHidden(a) ? !1 : "click" in getEventListeners(a) ? !0 : !1 160968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 161068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!a.hasAttribute("tabindex") && !axs.utils.isElementImplicitlyFocusable(a) 161168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_FOCUS_02"}; 161268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)axs.AuditRule.specs.videoWithoutCaptions = {name:"videoWithoutCaptions", heading:"Video elements should use <track> elements to provide captions", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_video_01--video-elements-should-use-track-elements-to-provide-captions", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) { 161368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return axs.browserUtils.matchSelector(a, "video") 161468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, test:function(a) { 161568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) return!a.querySelectorAll("track[kind=captions]").length 161668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)}, code:"AX_VIDEO_01"}; 161768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 161868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 1619