Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

axs_testing.js 108KB

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