a11y.js 1.83 KB
//>>built
define("dojo/_base/array dojo/dom dojo/dom-attr dojo/dom-style dojo/_base/lang dojo/sniff ./main".split(" "),function(w,e,d,h,t,u,v){var b={_isElementShown:function(a){var c=h.get(a);return"hidden"!=c.visibility&&"collapsed"!=c.visibility&&"none"!=c.display&&"hidden"!=d.get(a,"type")},hasDefaultTabStop:function(a){switch(a.nodeName.toLowerCase()){case "a":return d.has(a,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return!0;case "iframe":var c;try{var b=
a.contentDocument;if("designMode"in b&&"on"==b.designMode)return!0;c=b.body}catch(g){try{c=a.contentWindow.document.body}catch(k){return!1}}return c&&("true"==c.contentEditable||c.firstChild&&"true"==c.firstChild.contentEditable);default:return"true"==a.contentEditable}},effectiveTabIndex:function(a){if(!d.get(a,"disabled"))return d.has(a,"tabIndex")?+d.get(a,"tabIndex"):b.hasDefaultTabStop(a)?0:void 0},isTabNavigable:function(a){return 0<=b.effectiveTabIndex(a)},isFocusable:function(a){return-1<=
b.effectiveTabIndex(a)},_getTabNavigable:function(a){function c(a){return a&&"input"==a.tagName.toLowerCase()&&a.type&&"radio"==a.type.toLowerCase()&&a.name&&a.name.toLowerCase()}function f(a){return n[c(a)]||a}var g,k,l,e,m,p,n={},q=b._isElementShown,h=b.effectiveTabIndex,r=function(a){for(a=a.firstChild;a;a=a.nextSibling)if(!(1!=a.nodeType||9>=u("ie")&&"HTML"!==a.scopeName)&&q(a)){var b=h(a);if(0<=b){if(0==b)g||(g=a),k=a;else if(0<b){if(!l||b<e)e=b,l=a;if(!m||b>=p)p=b,m=a}b=c(a);d.get(a,"checked")&&
b&&(n[b]=a)}"SELECT"!=a.nodeName.toUpperCase()&&r(a)}};q(a)&&r(a);return{first:f(g),last:f(k),lowest:f(l),highest:f(m)}},getFirstInTabbingOrder:function(a,c){a=b._getTabNavigable(e.byId(a,c));return a.lowest?a.lowest:a.first},getLastInTabbingOrder:function(a,c){a=b._getTabNavigable(e.byId(a,c));return a.last?a.last:a.highest}};t.mixin(v,b);return b});