attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound; for (var i = 0; i < nodeList.length; i++) { attrs = new Attributes(); ignoreDirective); nodeLinkFn = (directives.length) ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, null, [], [], previousCompileContext) !childNodes.length) ? null : compileNodes(childNodes, var nodeListLength = nodeList.length; stableNodeList = new Array(nodeListLength); for (i = 0; i < linkFns.length; i+=3) { idx = linkFns[i]; stableNodeList[idx] = nodeList[idx]; for (i = 0, ii = linkFns.length; i < ii;) { node = stableNodeList[linkFns[i++]]; nodeLinkFn = linkFns[i++];
/** * Compile a node list and return a childLinkFn. * * @param {NodeList} nodeList * @param {Object} options * @return {Function|undefined} */ function compileNodeList(nodeList, options) { var linkFns = []; var nodeLinkFn, childLinkFn, node; for (var i = 0, l = nodeList.length; i < l; i++) { node = nodeList[i]; nodeLinkFn = compileNode(node, options); childLinkFn = !(nodeLinkFn && nodeLinkFn.terminal) && node.tagName !== 'SCRIPT' && node.hasChildNodes() ? compileNodeList(node.childNodes, options) : null; linkFns.push(nodeLinkFn, childLinkFn); } return linkFns.length ? makeChildLinkFn(linkFns) : null; }
/** * Extract qualified content nodes from a node list. * * @param {NodeList} nodes * @return {DocumentFragment} */ function extractFragment(nodes, parent) { var frag = document.createDocumentFragment(); nodes = toArray(nodes); for (var i = 0, l = nodes.length; i < l; i++) { var node = nodes[i]; if (isTemplate(node) && !node.hasAttribute('v-if') && !node.hasAttribute('v-for')) { parent.removeChild(node); node = parseTemplate(node, true); } frag.appendChild(node); } return frag; }
test("returns the elements this element labels", function() { var label = document.createElement("div"); var labelledCount = 2; label.id = "theLabel"; this.fixture_.appendChild(label); for(var i = 0; i < labelledCount; i++) { var labelled = document.createElement("div"); labelled.setAttribute("aria-labelledby", "theLabel notPresentInDom"); labelled.setAttribute("class", "labelled"); this.fixture_.appendChild(labelled); } var expected = this.fixture_.querySelectorAll(".labelled"); var actual = axs.utils.getIdReferrers("aria-labelledby", label); equal(expected.length, labelledCount); // sanity check the test itself equal(actual.length, labelledCount); var allFound = Array.prototype.every.call(expected, function(element) { return (Array.prototype.indexOf.call(actual, element) >= 0); }); equal(allFound, true); });
/** * An element's ID must not be present in more that one aria-owns attribute at any time. */ 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(element) { /* * While technically we could instead match elements with ID attribute * if there are no [aria-owns] elements then this rule is not relevant. * The fact that the element which will end up having an error is not * one of these elements is OK. */ return axs.browserUtils.matchSelector(element, '[aria-owns]'); }, test: function(element) { var attr = 'aria-owns'; var ownedElements = axs.utils.getIdReferents(attr, element); return ownedElements.some(function(ownedElement) { var owners = axs.utils.getIdReferrers(attr, ownedElement); return (owners.length > 1); }); }, code: 'AX_ARIA_07' });
console.log('_PROFILING_INFO_start function compileNodes from angular.js in 6326_PROFILING_INFO_'); var linkFns = [], attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound; for (var i = 0; i < nodeList.length; i++) { attrs = new Attributes(); nodeLinkFn = directives.length ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, null, [], [], previousCompileContext) : null; if (nodeLinkFn && nodeLinkFn.scope) { compile.$$addScopeClass(attrs.$$element); childLinkFn = nodeLinkFn && nodeLinkFn.terminal || !(childNodes = nodeList[i].childNodes) || !childNodes.length ? null : compileNodes(childNodes, nodeLinkFn ? (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement) && nodeLinkFn.transclude : transcludeFn); if (nodeLinkFn || childLinkFn) { linkFns.push(i, nodeLinkFn, childLinkFn); var nodeListLength = nodeList.length; stableNodeList = new Array(nodeListLength); for (i = 0; i < linkFns.length; i += 3) { idx = linkFns[i]; stableNodeList[idx] = nodeList[idx]; stableNodeList = nodeList; for (i = 0, ii = linkFns.length; i < ii;) { node = stableNodeList[linkFns[i++]]; nodeLinkFn = linkFns[i++];
nodeLinkFn, childLinkFn, directives, attrs, linkFnFound; for(var i = 0; i < nodeList.length; i++) { attrs = new Attributes(); nodeLinkFn = (directives.length) ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement) : null; childLinkFn = (nodeLinkFn && nodeLinkFn.terminal || !nodeList[i].childNodes.length) ? null : compileNodes(nodeList[i].childNodes, for (i = 0, ii = nodeList.length; i < ii; i++) { stableNodeList.push(nodeList[i]); for(i = 0, n = 0, ii = linkFns.length; i < ii; n++) { node = stableNodeList[n]; nodeLinkFn = linkFns[i++];
var ariaRole = appliedRole.details; var requiredScope = ariaRole['scope']; if (!requiredScope || requiredScope.length === 0) { return false; for (var i = 0; i < owners.length; i++) { var ownerRole = axs.utils.getRoles(owners[i], true); if (ownerRole && ownerRole.applied && requiredScope.indexOf(ownerRole.applied.name) >= 0)
attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound; for (var i = 0; i < nodeList.length; i++) { attrs = new Attributes(); ignoreDirective); nodeLinkFn = (directives.length) ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, null, [], [], previousCompileContext) !childNodes.length) ? null : compileNodes(childNodes, var nodeListLength = nodeList.length, stableNodeList = new Array(nodeListLength); for (i = 0; i < nodeListLength; i++) { for(i = 0, n = 0, ii = linkFns.length; i < ii; n++) { node = stableNodeList[n]; nodeLinkFn = linkFns[i++];
attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound; for (var i = 0; i < nodeList.length; i++) { attrs = new Attributes(); ignoreDirective); nodeLinkFn = (directives.length) ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, null, [], [], previousCompileContext) !childNodes.length) ? null : compileNodes(childNodes, var nodeListLength = nodeList.length; stableNodeList = new Array(nodeListLength); for (i = 0; i < linkFns.length; i+=3) { idx = linkFns[i]; stableNodeList[idx] = nodeList[idx]; for (i = 0, ii = linkFns.length; i < ii;) { node = stableNodeList[linkFns[i++]]; nodeLinkFn = linkFns[i++];
test("returns the aria owners for a given element", function() { var owned = document.createElement("div"); var ownerCount = 5; owned.id = "theOwned"; this.fixture_.appendChild(owned); for(var i = 0; i < ownerCount; i++) { var owner = document.createElement("div"); owner.setAttribute("aria-owns", "theOwned"); owner.setAttribute("class", "owner"); this.fixture_.appendChild(owner); } var expected = this.fixture_.querySelectorAll(".owner"); var actual = axs.utils.getIdReferrers("aria-owns", owned); equal(expected.length, ownerCount); // sanity check the test itself equal(actual.length, ownerCount); var allFound = Array.prototype.every.call(expected, function(element) { return (Array.prototype.indexOf.call(actual, element) >= 0); }); equal(allFound, true); });
attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound; for (var i = 0; i < nodeList.length; i++) { attrs = new Attributes(); ignoreDirective); nodeLinkFn = (directives.length) ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, null, [], [], previousCompileContext) !childNodes.length) ? null : compileNodes(childNodes, var nodeListLength = nodeList.length; stableNodeList = new Array(nodeListLength); for (i = 0; i < linkFns.length; i+=3) { idx = linkFns[i]; stableNodeList[idx] = nodeList[idx]; for (i = 0, ii = linkFns.length; i < ii;) { node = stableNodeList[linkFns[i++]]; nodeLinkFn = linkFns[i++];
attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound; for (var i = 0; i < nodeList.length; i++) { attrs = new Attributes(); ignoreDirective); nodeLinkFn = (directives.length) ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, null, [], [], previousCompileContext) !childNodes.length) ? null : compileNodes(childNodes, var nodeListLength = nodeList.length; stableNodeList = new Array(nodeListLength); for (i = 0; i < linkFns.length; i+=3) { idx = linkFns[i]; stableNodeList[idx] = nodeList[idx]; for (i = 0, ii = linkFns.length; i < ii;) { node = stableNodeList[linkFns[i++]]; nodeLinkFn = linkFns[i++];
attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound; for (var i = 0; i < nodeList.length; i++) { attrs = new Attributes(); ignoreDirective); nodeLinkFn = (directives.length) ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, null, [], [], previousCompileContext) !childNodes.length) ? null : compileNodes(childNodes, var nodeListLength = nodeList.length; stableNodeList = new Array(nodeListLength); for (i = 0; i < linkFns.length; i+=3) { idx = linkFns[i]; stableNodeList[idx] = nodeList[idx]; for (i = 0, ii = linkFns.length; i < ii;) { node = stableNodeList[linkFns[i++]]; nodeLinkFn = linkFns[i++];
attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound; for (var i = 0; i < nodeList.length; i++) { attrs = new Attributes(); ignoreDirective); nodeLinkFn = (directives.length) ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, null, [], [], previousCompileContext) !childNodes.length) ? null : compileNodes(childNodes, var nodeListLength = nodeList.length; stableNodeList = new Array(nodeListLength); for (i = 0; i < linkFns.length; i+=3) { idx = linkFns[i]; stableNodeList[idx] = nodeList[idx]; for (i = 0, ii = linkFns.length; i < ii;) { node = stableNodeList[linkFns[i++]]; nodeLinkFn = linkFns[i++];