UNPKG

nemo-accessibility

Version:

nemo-accessibility is a nemo plugin aimed to run accessibility scans during nemo tests. nemo-accessibility plugin uses axe-core, htmlcode smiffer and chrome engines to run accessibility scans on a given page or on a given element on a page.

29 lines (28 loc) 134 kB
/*! HTML_CodeSniffer - v2.1.1 - 2017-10-11 */ /** * +--------------------------------------------------------------------+ * | This HTML_CodeSniffer file is Copyright (c) | * | Squiz Pty Ltd (ABN 77 084 670 600) | * +--------------------------------------------------------------------+ * | IMPORTANT: Your use of this Software is subject to the terms of | * | the Licence provided in the file licence.txt. If you cannot find | * | this file please contact Squiz (www.squiz.com.au) so we may | * | provide you a copy. | * +--------------------------------------------------------------------+ * */ (function (root, factory) { if (typeof define === 'function' && define.amd) { define(['htmlcs'], factory); } else if (typeof exports === 'object') { module.exports = factory(); } else { var exports = factory(); for (var prop in exports) { root[prop] = exports[prop]; } } }(this, function () { var _global = {} _global.HTMLCS_Section508={name:"Section508",description:"U.S. Section 508 Standard",sniffs:["A","B","C","D","G","H","I","J","K","L","M","N","O","P"],getMsgInfo:function(a){return[["Section","1194.22 ("+a.split(".",3)[1].toLowerCase()+")"]]}},_global.HTMLCS_Section508_Sniffs_A={register:function(){return["_top","img","object","bgsound","audio"]},process:function(a,b){if(a===b)this.addNullAltTextResults(b),this.addMediaAlternativesResults(b);else{var c=a.nodeName.toLowerCase();"object"!==c&&"bgsound"!==c&&"audio"!==c||HTMLCS.addMessage(HTMLCS.NOTICE,a,"For multimedia containing audio only, ensure an alternative is available, such as a full text transcript.","Audio")}},testNullAltText:function(a){var b={img:{generalAlt:[],missingAlt:[],ignored:[],nullAltWithTitle:[],emptyAltInLink:[]},inputImage:{generalAlt:[],missingAlt:[]},area:{generalAlt:[],missingAlt:[]}};elements=HTMLCS.util.getAllElements(a,'img, area, input[type="image"]');for(var c=0;c<elements.length;c++){var d=elements[c],e=d.nodeName.toLowerCase(),f=!1,g=!1,h=!1;if("a"===d.parentNode.nodeName.toLowerCase()){var i=HTMLCS.util.getPreviousSiblingElement(d,null),j=HTMLCS.util.getNextSiblingElement(d,null);if(null===i&&null===j){var k=d.parentNode.textContent;if(void 0!==d.parentNode.textContent)var k=d.parentNode.textContent;else var k=d.parentNode.innerText;!0===HTMLCS.util.isStringEmpty(k)&&(f=!0)}}switch(!1===d.hasAttribute("alt")?g=!0:d.getAttribute("alt")&&!0!==HTMLCS.util.isStringEmpty(d.getAttribute("alt"))||(h=!0),e){case"img":!0!==f||!0!==g&&!0!==h?!0===g?b.img.missingAlt.push(d):!0===h?!0===d.hasAttribute("title")&&!1===HTMLCS.util.isStringEmpty(d.getAttribute("title"))?b.img.nullAltWithTitle.push(d):b.img.ignored.push(d):b.img.generalAlt.push(d):b.img.emptyAltInLink.push(d.parentNode);break;case"input":!0===g||!0===h?b.inputImage.missingAlt.push(d):b.inputImage.generalAlt.push(d);break;case"area":!0===g||!0===h?b.area.missingAlt.push(d):b.inputImage.generalAlt.push(d)}}return b},addNullAltTextResults:function(a){for(var b=this.testNullAltText(a),c=0;c<b.img.emptyAltInLink.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.img.emptyAltInLink[c],"Img element is the only content of the link, but is missing alt text. The alt text should describe the purpose of the link.","Img.EmptyAltInLink");for(var c=0;c<b.img.nullAltWithTitle.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.img.nullAltWithTitle[c],"Img element with empty alt text must have absent or empty title attribute.","Img.NullAltWithTitle");for(var c=0;c<b.img.ignored.length;c++)HTMLCS.addMessage(HTMLCS.WARNING,b.img.ignored[c],"Img element is marked so that it is ignored by Assistive Technology.","Img.Ignored");for(var c=0;c<b.img.missingAlt.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.img.missingAlt[c],"Img element missing an alt attribute. Use the alt attribute to specify a short text alternative.","Img.MissingAlt");for(var c=0;c<b.img.generalAlt.length;c++)HTMLCS.addMessage(HTMLCS.NOTICE,b.img.generalAlt[c],"Ensure that the img element's alt text serves the same purpose and presents the same information as the image.","Img.GeneralAlt");for(var c=0;c<b.inputImage.missingAlt.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.inputImage.missingAlt[c],"Image submit button missing an alt attribute. Specify a text alternative that describes the button's function, using the alt attribute.","InputImage.MissingAlt");for(var c=0;c<b.inputImage.generalAlt.length;c++)HTMLCS.addMessage(HTMLCS.NOTICE,b.inputImage.generalAlt[c],"Ensure that the image submit button's alt text identifies the purpose of the button.","InputImage.GeneralAlt");for(var c=0;c<b.area.missingAlt.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.area.missingAlt[c],"Area element in an image map missing an alt attribute. Each area element must have a text alternative that describes the function of the image map area.","Area.MissingAlt");for(var c=0;c<b.area.generalAlt.length;c++)HTMLCS.addMessage(HTMLCS.NOTICE,b.area.generalAlt[c],"Ensure that the area element's text alternative serves the same purpose as the part of image map image it references.","Area.GeneralAlt")},testMediaTextAlternatives:function(a){for(var b={object:{missingBody:[],generalAlt:[]},applet:{missingBody:[],missingAlt:[],generalAlt:[]}},c=HTMLCS.util.getAllElements(a,"object"),d=0;d<c.length;d++){var e=c[d],f=(e.nodeName.toLowerCase(),e.querySelector("object"));if(null===f){var g=HTMLCS.util.getElementTextContent(e,!0);""===g?b.object.missingBody.push(e):b.object.generalAlt.push(e)}}for(var c=HTMLCS.util.getAllElements(a,"applet"),d=0;d<c.length;d++){var f=e.querySelector("object"),h=!1;if(null===f){var g=HTMLCS.util.getElementTextContent(e,!0);!0===HTMLCS.util.isStringEmpty(g)&&(b.applet.missingBody.push(e),h=!0)}var i=e.getAttribute("alt")||"";!0===HTMLCS.util.isStringEmpty(i)&&(b.applet.missingAlt.push(e),h=!0),!1===h&&b.applet.generalAlt.push(e)}return b},addMediaAlternativesResults:function(a){for(var b=HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_1_1_1_1.testMediaTextAlternatives(a),c=0;c<b.object.missingBody.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.object.missingBody[c],"Object elements must contain a text alternative after all other alternatives are exhausted.","Object.MissingBody");for(var c=0;c<b.object.generalAlt.length;c++)HTMLCS.addMessage(HTMLCS.NOTICE,b.object.generalAlt[c],"Check that short (and if appropriate, long) text alternatives are available for non-text content that serve the same purpose and present the same information.","Object.GeneralAlt");for(var c=0;c<b.applet.missingBody.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.applet.missingBody[c],"Applet elements must contain a text alternative in the element's body, for browsers without support for the applet element.","Applet.MissingBody");for(var c=0;c<b.applet.missingAlt.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.applet.missingAlt[c],"Applet elements must contain an alt attribute, to provide a text alternative to browsers supporting the element but are unable to load the applet.","Applet.MissingAlt");for(var c=0;c<b.applet.generalAlt.length;c++)HTMLCS.addMessage(HTMLCS.NOTICE,b.applet.generalAlt[c],"Check that short (and if appropriate, long) text alternatives are available for non-text content that serve the same purpose and present the same information.","Applet.GeneralAlt")}},_global.HTMLCS_Section508_Sniffs_B={register:function(){return["object","applet","embed","video"]},process:function(a,b){a.nodeName.toLowerCase();HTMLCS.addMessage(HTMLCS.NOTICE,a,"For multimedia containing video, ensure a synchronised audio description or text alternative for the video portion is provided.","Video"),HTMLCS.addMessage(HTMLCS.NOTICE,a,"For multimedia containing synchronised audio and video, ensure synchronised captions are provided for the audio portion.","Captions")}},_global.HTMLCS_Section508_Sniffs_C={register:function(){return["_top"]},process:function(a,b){HTMLCS.addMessage(HTMLCS.NOTICE,b,"Ensure that any information conveyed using colour alone is also available without colour, such as through context or markup.","Colour")}},_global.HTMLCS_Section508_Sniffs_D={register:function(){return["_top"]},process:function(a,b){if(a===b){HTMLCS.addMessage(HTMLCS.NOTICE,b,"Ensure that content is ordered in a meaningful sequence when linearised, such as when style sheets are disabled.","Linearised"),this.testPresentationMarkup(b),this.testHeadingOrder(b);HTMLCS.util.getAllElements(b,'script, link[rel="stylesheet"]').length>0&&HTMLCS.addMessage(HTMLCS.NOTICE,b,'If content is hidden and made visible using scripting (such as "click to expand" sections), ensure this content is readable when scripts and style sheets are disabled.',"HiddenText")}},testPresentationMarkup:function(a){_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1.testPresentationMarkup(a)},testHeadingOrder:function(a){for(var b=0,c=HTMLCS.util.getAllElements(a,"h1, h2, h3, h4, h5, h6"),d=0;d<c.length;d++){var e=parseInt(c[d].nodeName.substr(1,1));if(e-b>1){var f="should be an h"+(b+1)+" to be properly nested";0===b&&(f="appears to be the primary document heading, so should be an h1 element"),HTMLCS.addMessage(HTMLCS.ERROR,c[d],"The heading structure is not logically nested. This h"+e+" element "+f+".","HeadingOrder")}b=e}}},_global.HTMLCS_Section508_Sniffs_G={register:function(){return["table"]},process:function(a,b){!0===HTMLCS.util.isLayoutTable(a)&&HTMLCS.addMessage(HTMLCS.NOTICE,a,"This table has no headers. If this is a data table, ensure row and column headers are identified using th elements.","TableHeaders")}},_global.HTMLCS_Section508_Sniffs_H={register:function(){return["table"]},process:function(a,b){for(var c=HTMLCS.util.testTableHeaders(a),d=0;d<c.wrongHeaders.length;d++)HTMLCS.addMessage(HTMLCS.ERROR,c.wrongHeaders[d].element,'Incorrect headers attribute on this td element. Expected "'+c.wrongHeaders[d].expected+'" but found "'+c.wrongHeaders[d].actual+'"',"IncorrectHeadersAttr");!0===c.required&&!1===c.allowScope&&(!1===c.used?HTMLCS.addMessage(HTMLCS.ERROR,a,"The relationship between td elements and their associated th elements is not defined. As this table has multiple levels of th elements, you must use the headers attribute on td elements.","MissingHeadersAttrs"):(c.missingThId.length>0&&HTMLCS.addMessage(HTMLCS.ERROR,a,"Not all th elements in this table contain an id attribute. These cells should contain ids so that they may be referenced by td elements' headers attributes.","MissingHeaderIds"),c.missingTd.length>0&&HTMLCS.addMessage(HTMLCS.ERROR,a,"Not all td elements in this table contain a headers attribute. Each headers attribute should list the ids of all th elements associated with that cell.","IncompleteHeadersAttrs")))}},_global.HTMLCS_Section508_Sniffs_I={register:function(){return["frame","iframe","object"]},process:function(a,b){var c=a.nodeName.toLowerCase(),d=a.hasAttribute("title"),e=!0;!0===d&&(e=HTMLCS.util.isStringEmpty(a.getAttribute("title"))),!0===e&&HTMLCS.addMessage(HTMLCS.ERROR,b,"This "+c+" element is missing title text. Frames should be titled with text that facilitates frame identification and navigation.","Frames")}},_global.HTMLCS_Section508_Sniffs_J={register:function(){return["_top"]},process:function(a,b){HTMLCS.addMessage(HTMLCS.NOTICE,b,"Check that no component of the content flickers at a rate of greater than 2 and less than 55 times per second.","Flicker")}},_global.HTMLCS_Section508_Sniffs_K={register:function(){return["_top"]},process:function(a,b){HTMLCS.addMessage(HTMLCS.NOTICE,b,"If this page cannot be made compliant, a text-only page with equivalent information or functionality should be provided. The alternative page needs to be updated in line with this page's content.","AltVersion")}},_global.HTMLCS_Section508_Sniffs_L={register:function(){return["_top"]},process:function(a,b){a===b&&(this.addProcessLinksMessages(b),this.testKeyboard(b))},addProcessLinksMessages:function(a){for(var b=this.processLinks(a),c=0;c<b.emptyNoId.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.emptyNoId[c],"Anchor element found with no link content and no name and/or ID attribute.","EmptyAnchorNoId");for(var c=0;c<b.placeholder.length;c++)HTMLCS.addMessage(HTMLCS.WARNING,b.placeholder[c],"Anchor element found with link content, but no href, ID, or name attribute has been supplied.","PlaceholderAnchor");for(var c=0;c<b.noContent.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.noContent[c],"Anchor element found with a valid href attribute, but no link content has been supplied.","NoContentAnchor")},processLinks:function(a){for(var b={empty:[],emptyWithName:[],emptyNoId:[],noHref:[],placeholder:[],noContent:[]},c=HTMLCS.util.getAllElements(a,"a"),d=0;d<c.length;d++){var e=c[d],f=!1,g=HTMLCS.util.getElementTextContent(e);!0===e.hasAttribute("title")&&!1===/^\s*$/.test(e.getAttribute("title"))?!0:!1===/^\s*$/.test(g)?!0:!0===e.hasAttribute("aria-label")&&!0===HTMLCS.util.hasValidAriaLabel(e)?!0:!0===e.hasAttribute("aria-labelledby")&&!1===HTMLCS.util.hasValidAriaLabel(e)&&!0,!0===e.hasAttribute("href")&&!1===/^\s*$/.test(e.getAttribute("href"))&&(f=!0),!1===f?!0===/^\s*$/.test(g)?!0===e.hasAttribute("id")?b.empty.push(e):!0===e.hasAttribute("name")?b.emptyWithName.push(e):b.emptyNoId.push(e):!0===e.hasAttribute("id")||!0===e.hasAttribute("name")?b.noHref.push(e):b.placeholder.push(e):!0===/^\s*$/.test(g)&&0===e.querySelectorAll("img").length&&b.noContent.push(e)}return b},testKeyboard:function(a){for(var b=HTMLCS.util.getAllElements(a,"*[ondblclick]"),c=0;c<b.length;c++)HTMLCS.addMessage(HTMLCS.WARNING,b[c],"Ensure the functionality provided by double-clicking on this element is available through the keyboard.","DblClick");for(var d=HTMLCS.util.getAllElements(a,"*[onmouseover]"),c=0;c<d.length;c++)HTMLCS.addMessage(HTMLCS.WARNING,d[c],"Ensure the functionality provided by mousing over this element is available through the keyboard; for instance, using the focus event.","MouseOver");for(var e=HTMLCS.util.getAllElements(a,"*[onmouseout]"),c=0;c<e.length;c++)HTMLCS.addMessage(HTMLCS.WARNING,e[c],"Ensure the functionality provided by mousing out of this element is available through the keyboard; for instance, using the blur event.","MouseOut");for(var f=HTMLCS.util.getAllElements(a,"*[onmousemove]"),c=0;c<f.length;c++)HTMLCS.addMessage(HTMLCS.WARNING,f[c],"Ensure the functionality provided by moving the mouse on this element is available through the keyboard.","MouseMove");for(var g=HTMLCS.util.getAllElements(a,"*[onmousedown]"),c=0;c<g.length;c++)HTMLCS.addMessage(HTMLCS.WARNING,g[c],"Ensure the functionality provided by mousing down on this element is available through the keyboard; for instance, using the keydown event.","MouseDown");for(var h=HTMLCS.util.getAllElements(a,"*[onmouseup]"),c=0;c<h.length;c++)HTMLCS.addMessage(HTMLCS.WARNING,h[c],"Ensure the functionality provided by mousing up on this element is available through the keyboard; for instance, using the keyup event.","MouseUp")}},_global.HTMLCS_Section508_Sniffs_M={register:function(){return["object","applet","bgsound","embed","audio","video"]},process:function(a,b){HTMLCS.addMessage(HTMLCS.NOTICE,a,"If external media requires a plugin or application to view, ensure a link is provided to a plugin or application that complies with Section 508 accessibility requirements for applications.","PluginLink")}},_global.HTMLCS_Section508_Sniffs_N={register:function(){return["form"]},process:function(a,b){"form"===a.nodeName.toLowerCase()&&(HTMLCS.addMessage(HTMLCS.NOTICE,a,"If an input error is automatically detected in this form, check that the item(s) in error are identified and the error(s) are described to the user in text.","Errors"),HTMLCS.addMessage(HTMLCS.NOTICE,a,"Check that descriptive labels or instructions (including for required fields) are provided for user input in this form.","Labels"),HTMLCS.addMessage(HTMLCS.NOTICE,a,"Ensure that this form can be navigated using the keyboard and other accessibility tools.","KeyboardNav"))}},_global.HTMLCS_Section508_Sniffs_O={register:function(){return["_top","a","area"]},process:function(a,b){if(a===b)HTMLCS.addMessage(HTMLCS.NOTICE,b,"Ensure that any common navigation elements can be bypassed; for instance, by use of skip links, header elements, or ARIA landmark roles.","SkipLinks");else if(!0===a.hasAttribute("href")){var c=a.getAttribute("href");if(c=HTMLCS.util.trim(c),c.length>1&&"#"===c.charAt(0)){var d=c.substr(1);try{var e=b;e.ownerDocument&&(e=e.ownerDocument);var f=e.getElementById(d);null===f&&(f=e.querySelector('a[name="'+d+'"]')),null!==f&&!1!==HTMLCS.util.contains(b,f)||(!0===HTMLCS.isFullDoc(b)||"body"===b.nodeName.toLowerCase()?HTMLCS.addMessage(HTMLCS.ERROR,a,'This link points to a named anchor "'+d+'" within the document, but no anchor exists with that name.',"NoSuchID"):HTMLCS.addMessage(HTMLCS.WARNING,a,'This link points to a named anchor "'+d+'" within the document, but no anchor exists with that name in the fragment tested.',"NoSuchIDFragment"))}catch(a){}}}}},_global.HTMLCS_Section508_Sniffs_P={register:function(){return["_top","meta"]},process:function(a,b){a===b?HTMLCS.addMessage(HTMLCS.NOTICE,b,"If a timed response is required on this page, alert the user and provide sufficient time to allow them to indicate that more time is required.","TimeLimit"):!0===a.hasAttribute("http-equiv")&&"refresh"===String(a.getAttribute("http-equiv")).toLowerCase()&&!0===/^[1-9]\d*/.test(a.getAttribute("content").toLowerCase())&&(!0===/url=/.test(a.getAttribute("content").toLowerCase())?HTMLCS.addMessage(HTMLCS.ERROR,a,"Meta refresh tag used to redirect to another page, with a time limit that is not zero. Users cannot control this time limit.","MetaRedirect"):HTMLCS.addMessage(HTMLCS.ERROR,a,"Meta refresh tag used to refresh the current page. Users cannot control the time limit for this refresh.","MetaRefresh"))}},_global.HTMLCS_WCAG2A={name:"WCAG2A",description:"Web Content Accessibility Guidelines (WCAG) 2.0 A",sniffs:[{standard:"WCAG2AAA",include:["Principle1.Guideline1_1.1_1_1","Principle1.Guideline1_2.1_2_1","Principle1.Guideline1_2.1_2_2","Principle1.Guideline1_2.1_2_3","Principle1.Guideline1_3.1_3_1","Principle1.Guideline1_3.1_3_1_A","Principle1.Guideline1_3.1_3_2","Principle1.Guideline1_3.1_3_3","Principle1.Guideline1_4.1_4_1","Principle1.Guideline1_4.1_4_2","Principle2.Guideline2_1.2_1_1","Principle2.Guideline2_1.2_1_2","Principle2.Guideline2_2.2_2_1","Principle2.Guideline2_2.2_2_2","Principle2.Guideline2_3.2_3_1","Principle2.Guideline2_4.2_4_1","Principle2.Guideline2_4.2_4_2","Principle2.Guideline2_4.2_4_3","Principle2.Guideline2_4.2_4_4","Principle3.Guideline3_1.3_1_1","Principle3.Guideline3_2.3_2_1","Principle3.Guideline3_2.3_2_2","Principle3.Guideline3_3.3_3_1","Principle3.Guideline3_3.3_3_2","Principle4.Guideline4_1.4_1_1","Principle4.Guideline4_1.4_1_2"]}],getMsgInfo:function(a){return HTMLCS_WCAG2AAA.getMsgInfo(a)}},_global.HTMLCS_WCAG2AA={name:"WCAG2AA",description:"Web Content Accessibility Guidelines (WCAG) 2.0 AA",sniffs:[{standard:"WCAG2AAA",include:["Principle1.Guideline1_1.1_1_1","Principle1.Guideline1_2.1_2_1","Principle1.Guideline1_2.1_2_2","Principle1.Guideline1_2.1_2_4","Principle1.Guideline1_2.1_2_5","Principle1.Guideline1_3.1_3_1","Principle1.Guideline1_3.1_3_1_A","Principle1.Guideline1_3.1_3_2","Principle1.Guideline1_3.1_3_3","Principle1.Guideline1_4.1_4_1","Principle1.Guideline1_4.1_4_2","Principle1.Guideline1_4.1_4_3","Principle1.Guideline1_4.1_4_3_F24","Principle1.Guideline1_4.1_4_3_Contrast","Principle1.Guideline1_4.1_4_4","Principle1.Guideline1_4.1_4_5","Principle2.Guideline2_1.2_1_1","Principle2.Guideline2_1.2_1_2","Principle2.Guideline2_2.2_2_1","Principle2.Guideline2_2.2_2_2","Principle2.Guideline2_3.2_3_1","Principle2.Guideline2_4.2_4_1","Principle2.Guideline2_4.2_4_2","Principle2.Guideline2_4.2_4_3","Principle2.Guideline2_4.2_4_4","Principle2.Guideline2_4.2_4_5","Principle2.Guideline2_4.2_4_6","Principle2.Guideline2_4.2_4_7","Principle3.Guideline3_1.3_1_1","Principle3.Guideline3_1.3_1_2","Principle3.Guideline3_2.3_2_1","Principle3.Guideline3_2.3_2_2","Principle3.Guideline3_2.3_2_3","Principle3.Guideline3_2.3_2_4","Principle3.Guideline3_3.3_3_1","Principle3.Guideline3_3.3_3_2","Principle3.Guideline3_3.3_3_3","Principle3.Guideline3_3.3_3_4","Principle4.Guideline4_1.4_1_1","Principle4.Guideline4_1.4_1_2"]}],getMsgInfo:function(a){return HTMLCS_WCAG2AAA.getMsgInfo(a)}},_global.HTMLCS_WCAG2AAA={name:"WCAG2AAA",description:"Web Content Accessibility Guidelines (WCAG) 2.0 AAA",sniffs:["Principle1.Guideline1_1.1_1_1","Principle1.Guideline1_2.1_2_1","Principle1.Guideline1_2.1_2_2","Principle1.Guideline1_2.1_2_4","Principle1.Guideline1_2.1_2_5","Principle1.Guideline1_2.1_2_6","Principle1.Guideline1_2.1_2_7","Principle1.Guideline1_2.1_2_8","Principle1.Guideline1_2.1_2_9","Principle1.Guideline1_3.1_3_1","Principle1.Guideline1_3.1_3_1_AAA","Principle1.Guideline1_3.1_3_2","Principle1.Guideline1_3.1_3_3","Principle1.Guideline1_4.1_4_1","Principle1.Guideline1_4.1_4_2","Principle1.Guideline1_4.1_4_3_F24","Principle1.Guideline1_4.1_4_3_Contrast","Principle1.Guideline1_4.1_4_6","Principle1.Guideline1_4.1_4_7","Principle1.Guideline1_4.1_4_8","Principle1.Guideline1_4.1_4_9","Principle2.Guideline2_1.2_1_1","Principle2.Guideline2_1.2_1_2","Principle2.Guideline2_2.2_2_2","Principle2.Guideline2_2.2_2_3","Principle2.Guideline2_2.2_2_4","Principle2.Guideline2_2.2_2_5","Principle2.Guideline2_3.2_3_2","Principle2.Guideline2_4.2_4_1","Principle2.Guideline2_4.2_4_2","Principle2.Guideline2_4.2_4_3","Principle2.Guideline2_4.2_4_5","Principle2.Guideline2_4.2_4_6","Principle2.Guideline2_4.2_4_7","Principle2.Guideline2_4.2_4_8","Principle2.Guideline2_4.2_4_9","Principle3.Guideline3_1.3_1_1","Principle3.Guideline3_1.3_1_2","Principle3.Guideline3_1.3_1_3","Principle3.Guideline3_1.3_1_4","Principle3.Guideline3_1.3_1_5","Principle3.Guideline3_1.3_1_6","Principle3.Guideline3_2.3_2_1","Principle3.Guideline3_2.3_2_2","Principle3.Guideline3_2.3_2_3","Principle3.Guideline3_2.3_2_4","Principle3.Guideline3_2.3_2_5","Principle3.Guideline3_3.3_3_1","Principle3.Guideline3_3.3_3_2","Principle3.Guideline3_3.3_3_3","Principle3.Guideline3_3.3_3_5","Principle3.Guideline3_3.3_3_6","Principle4.Guideline4_1.4_1_1","Principle4.Guideline4_1.4_1_2"],getMsgInfo:function(a){for(var b={Principle1:{name:"Perceivable",link:"http://www.w3.org/TR/WCAG20/#perceivable"},Principle2:{name:"Operable",link:"http://www.w3.org/TR/WCAG20/#operable"},Principle3:{name:"Understandable",link:"http://www.w3.org/TR/WCAG20/#understandable"},Principle4:{name:"Robust",link:"http://www.w3.org/TR/WCAG20/#robust"}},c={CR2:{name:"Full pages",landmark:"cc2",priority:0},CR3:{name:"Complete processes",landmark:"cc3",priority:0},CR4:{name:"Only Accessibility-Supported Ways of Using Technologies",landmark:"cc4",priority:0},CR5:{name:"Non-Interference",landmark:"cc5",priority:0},"1.1.1":{name:"Non-Text Content",landmark:"text-equiv-all",priority:1},"1.2.1":{name:"Audio-only and Video-only (Prerecorded)",landmark:"media-equiv-av-only-alt",priority:1},"1.2.2":{name:"Captions (Prerecorded)",landmark:"media-equiv-captions",priority:1},"1.2.3":{name:"Audio Description or Media Alternative (Prerecorded)",landmark:"media-equiv-audio-desc",priority:1},"1.2.4":{name:"Captions (Live)",landmark:"media-equiv-captions",priority:2},"1.2.5":{name:"Audio Description (Prerecorded)",landmark:"media-equiv-audio-desc",priority:2},"1.2.6":{name:"Sign Language (Prerecorded)",landmark:"media-equiv-sign",priority:3},"1.2.7":{name:"Extended Audio Description (Prerecorded)",landmark:"media-equiv-extended-ad",priority:3},"1.2.8":{name:"Media Alternative (Prerecorded)",landmark:"media-equiv-text-doc",priority:3},"1.2.9":{name:"Audio-only (Live)",landmark:"media-equiv-live-audio-only",priority:3},"1.3.1":{name:"Info and Relationships",landmark:"content-structure-separation-programmatic",priority:1},"1.3.2":{name:"Meaningful Sequence",landmark:"content-structure-separation-sequence",priority:1},"1.3.3":{name:"Sensory Characteristics",landmark:"content-structure-separation-understanding",priority:1},"1.4.1":{name:"Use of Colour",landmark:"visual-audio-contrast-without-color",priority:1},"1.4.2":{name:"Audio Control",landmark:"visual-audio-contrast-dis-audio",priority:1},"1.4.3":{name:"Contrast (Minimum)",landmark:"visual-audio-contrast-contrast",priority:1},"1.4.4":{name:"Resize Text",landmark:"visual-audio-contrast-scale",priority:1},"1.4.5":{name:"Images of Text",landmark:"visual-audio-contrast-text-presentation",priority:1},"1.4.6":{name:"Contrast (Enhanced)",landmark:"visual-audio-contrast7",priority:3},"1.4.7":{name:"Low or No Background Audio",landmark:"visual-audio-contrast-noaudio",priority:3},"1.4.8":{name:"Visual Presentation",landmark:"visual-audio-contrast-visual-presentation",priority:3},"1.4.9":{name:"Images of Text (No Exception)",landmark:"visual-audio-contrast-text-images",priority:3},"2.1.1":{name:"Keyboard",landmark:"keyboard-operation-keyboard-operable",priority:1},"2.1.2":{name:"No Keyboard Trap",landmark:"keyboard-operation-trapping",priority:1},"2.1.3":{name:"Keyboard (No Exception)",landmark:"keyboard-operation-all-funcs",priority:3},"2.2.1":{name:"Timing Adjustable",landmark:"time-limits-required-behaviors",priority:1},"2.2.2":{name:"Pause, Stop, Hide",landmark:"time-limits-pause",priority:1},"2.2.3":{name:"No Timing",landmark:"time-limits-no-exceptions",priority:3},"2.2.4":{name:"Interruptions",landmark:"time-limits-postponed",priority:3},"2.2.5":{name:"Re-authenticating",landmark:"time-limits-server-timeout",priority:3},"2.3.1":{name:"Three Flashes or Below Threshold",landmark:"seizure-does-not-violate",priority:1},"2.3.2":{name:"Three Flashes",landmark:"seizure-three-times",priority:3},"2.4.1":{name:"Bypass Blocks",landmark:"navigation-mechanisms-skip",priority:1},"2.4.2":{name:"Page Titled",landmark:"navigation-mechanisms-title",priority:1},"2.4.3":{name:"Focus Order",landmark:"navigation-mechanisms-focus-order",priority:1},"2.4.4":{name:"Link Purpose (In Context)",landmark:"navigation-mechanisms-refs",priority:1},"2.4.5":{name:"Multiple Ways",landmark:"navigation-mechanisms-mult-loc",priority:2},"2.4.6":{name:"Headings and Labels",landmark:"navigation-mechanisms-descriptive",priority:2},"2.4.7":{name:"Focus Visible",landmark:"navigation-mechanisms-focus-visible",priority:2},"2.4.8":{name:"Location",landmark:"navigation-mechanisms-location",priority:3},"2.4.9":{name:"Link Purpose (Link Only)",landmark:"navigation-mechanisms-link",priority:3},"2.4.10":{name:"Section Headings",landmark:"navigation-mechanisms-headings",priority:3},"3.1.1":{name:"Language of Page",landmark:"meaning-doc-lang-id",priority:1},"3.1.2":{name:"Language of Parts",landmark:"meaning-other-lang-id",priority:2},"3.1.3":{name:"Unusual Words",landmark:"meaning-idioms",priority:3},"3.1.4":{name:"Abbreviations",landmark:"meaning-located",priority:3},"3.1.5":{name:"Reading Level",landmark:"meaning-supplements",priority:3},"3.1.6":{name:"Pronunciation",landmark:"meaning-pronunciation",priority:3},"3.2.1":{name:"On Focus",landmark:"consistent-behavior-receive-focus",priority:1},"3.2.2":{name:"On Input",landmark:"consistent-behavior-unpredictable-change",priority:1},"3.2.3":{name:"Consistent Navigation",landmark:"consistent-behavior-consistent-locations",priority:2},"3.2.4":{name:"Consistent Navigation",landmark:"consistent-behavior-consistent-functionality",priority:2},"3.2.5":{name:"Change on Request",landmark:"consistent-behavior-no-extreme-changes-context",priority:3},"3.3.1":{name:"Error Identification",landmark:"minimize-error-identified",priority:1},"3.3.2":{name:"Labels or Instructions",landmark:"minimize-error-cues",priority:1},"3.3.3":{name:"Error Suggestion",landmark:"minimize-error-suggestions",priority:2},"3.3.4":{name:"Error Prevention (Legal, Financial, Data)",landmark:"minimize-error-reversible",priority:2},"3.3.5":{name:"Help",landmark:"minimize-error-context-help",priority:3},"3.3.6":{name:"Error Prevention (All)",landmark:"minimize-error-reversible-all",priority:3},"4.1.1":{name:"Parsing",landmark:"ensure-compat-parses",priority:1},"4.1.2":{name:"Name, Role, Value",landmark:"ensure-compat-rsv",priority:1}},d=a.split(".",5),e=d[1],f=d[3].split("_").slice(0,3).join("."),g=d[4].split(","),h=[],i=0;i<g.length;i++)g[i]=g[i].split("."),h.push('<a href="http://www.w3.org/TR/WCAG20-TECHS/'+g[i][0]+'" target="_blank">'+g[i][0]+"</a>");var j=['<a href="http://www.w3.org/TR/WCAG20/#'+c[f].landmark,'" target="_blank">',f,": ",c[f].name,"</a>"].join("");['<a href="',b[e].link,'" target="_blank">',b[e].name,"</a>"].join("");return[["Success Criterion",j],["Suggested Techniques",h.join(" ")]]}},_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_1_1_1_1={register:function(){return["_top","img"]},process:function(a,b){if(a===b)this.addNullAltTextResults(b),this.addMediaAlternativesResults(b);else{switch(a.nodeName.toLowerCase()){case"img":this.testLinkStutter(a),this.testLongdesc(a)}}},addNullAltTextResults:function(a){for(var b=this.testNullAltText(a),c=0;c<b.img.emptyAltInLink.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.img.emptyAltInLink[c],"Img element is the only content of the link, but is missing alt text. The alt text should describe the purpose of the link.","H30.2");for(var c=0;c<b.img.nullAltWithTitle.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.img.nullAltWithTitle[c],"Img element with empty alt text must have absent or empty title attribute.","H67.1");for(var c=0;c<b.img.ignored.length;c++)HTMLCS.addMessage(HTMLCS.WARNING,b.img.ignored[c],"Img element is marked so that it is ignored by Assistive Technology.","H67.2");for(var c=0;c<b.img.missingAlt.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.img.missingAlt[c],"Img element missing an alt attribute. Use the alt attribute to specify a short text alternative.","H37");for(var c=0;c<b.img.generalAlt.length;c++)HTMLCS.addMessage(HTMLCS.NOTICE,b.img.generalAlt[c],"Ensure that the img element's alt text serves the same purpose and presents the same information as the image.","G94.Image");for(var c=0;c<b.inputImage.missingAlt.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.inputImage.missingAlt[c],"Image submit button missing an alt attribute. Specify a text alternative that describes the button's function, using the alt attribute.","H36");for(var c=0;c<b.inputImage.generalAlt.length;c++)HTMLCS.addMessage(HTMLCS.NOTICE,b.inputImage.generalAlt[c],"Ensure that the image submit button's alt text identifies the purpose of the button.","G94.Button");for(var c=0;c<b.area.missingAlt.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.area.missingAlt[c],"Area element in an image map missing an alt attribute. Each area element must have a text alternative that describes the function of the image map area.","H24");for(var c=0;c<b.area.generalAlt.length;c++)HTMLCS.addMessage(HTMLCS.NOTICE,b.area.generalAlt[c],"Ensure that the area element's text alternative serves the same purpose as the part of image map image it references.","H24.2")},testNullAltText:function(a){var b={img:{generalAlt:[],missingAlt:[],ignored:[],nullAltWithTitle:[],emptyAltInLink:[]},inputImage:{generalAlt:[],missingAlt:[]},area:{generalAlt:[],missingAlt:[]}};elements=HTMLCS.util.getAllElements(a,'img, area, input[type="image"]');for(var c=0;c<elements.length;c++){var d=elements[c],e=d.nodeName.toLowerCase(),f=!1,g=!1,h=!1;if("a"===d.parentNode.nodeName.toLowerCase()){var i=HTMLCS.util.getPreviousSiblingElement(d,null),j=HTMLCS.util.getNextSiblingElement(d,null);if(null===i&&null===j){var k=d.parentNode.textContent;if(void 0!==d.parentNode.textContent)var k=d.parentNode.textContent;else var k=d.parentNode.innerText;!0===HTMLCS.util.isStringEmpty(k)&&(f=!0)}}switch(!1===d.hasAttribute("alt")?g=!0:d.getAttribute("alt")&&!0!==HTMLCS.util.isStringEmpty(d.getAttribute("alt"))||(h=!0),e){case"img":!0!==f||!0!==g&&!0!==h?!0===g?b.img.missingAlt.push(d):!0===h?!0===d.hasAttribute("title")&&!1===HTMLCS.util.isStringEmpty(d.getAttribute("title"))?b.img.nullAltWithTitle.push(d):b.img.ignored.push(d):b.img.generalAlt.push(d):b.img.emptyAltInLink.push(d.parentNode);break;case"input":!0===g||!0===h?b.inputImage.missingAlt.push(d):b.inputImage.generalAlt.push(d);break;case"area":!0===g||!0===h?b.area.missingAlt.push(d):b.inputImage.generalAlt.push(d)}}return b},testLongdesc:function(a){HTMLCS.addMessage(HTMLCS.NOTICE,a,"If this image cannot be fully described in a short text alternative, ensure a long text alternative is also available, such as in the body text or through a link.","G73,G74")},testLinkStutter:function(a){if("a"===a.parentNode.nodeName.toLowerCase()){var b=a.parentNode,c={anchor:{href:b.getAttribute("href"),text:HTMLCS.util.getElementTextContent(b,!1),alt:this._getLinkAltText(b)}};if(null===c.anchor.alt&&(c.anchor.alt=""), null!==c.anchor.alt&&""!==c.anchor.alt&&HTMLCS.util.trim(c.anchor.alt).toLowerCase()===HTMLCS.util.trim(c.anchor.text).toLowerCase()&&HTMLCS.addMessage(HTMLCS.ERROR,a,"Img element inside a link must not use alt text that duplicates the text content of the link.","H2.EG5"),""===c.anchor.text){var d=HTMLCS.util.getPreviousSiblingElement(b,"a",!0),e=HTMLCS.util.getNextSiblingElement(b,"a",!0);null!==d&&(c.previous={href:d.getAttribute("href"),text:HTMLCS.util.getElementTextContent(d,!1),alt:this._getLinkAltText(d)},null===c.previous.alt&&(c.previous.alt="")),null!==e&&(c.next={href:e.getAttribute("href"),text:HTMLCS.util.getElementTextContent(e,!1),alt:this._getLinkAltText(e)},null===c.next.alt&&(c.next.alt="")),c.next&&""!==c.next.href&&null!==c.next.href&&c.anchor.href===c.next.href&&(""!==c.next.text&&""===c.anchor.alt?HTMLCS.addMessage(HTMLCS.ERROR,a,"Img element inside a link has empty or missing alt text when a link beside it contains link text. Consider combining the links.","H2.EG4"):c.next.text.toLowerCase()===c.anchor.alt.toLowerCase()&&HTMLCS.addMessage(HTMLCS.ERROR,a,"Img element inside a link must not use alt text that duplicates the content of a text link beside it.","H2.EG3")),c.previous&&""!==c.previous.href&&null!==c.previous.href&&c.anchor.href===c.previous.href&&(""!==c.previous.text&&""===c.anchor.alt?HTMLCS.addMessage(HTMLCS.ERROR,a,"Img element inside a link has empty or missing alt text when a link beside it contains link text. Consider combining the links.","H2.EG4"):c.previous.text.toLowerCase()===c.anchor.alt.toLowerCase()&&HTMLCS.addMessage(HTMLCS.ERROR,a,"Img element inside a link must not use alt text that duplicates the content of a text link beside it.","H2.EG3"))}}},addMediaAlternativesResults:function(a){for(var b=this.testMediaTextAlternatives(a),c=0;c<b.object.missingBody.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.object.missingBody[c],"Object elements must contain a text alternative after all other alternatives are exhausted.","H53,ARIA6");for(var c=0;c<b.object.generalAlt.length;c++)HTMLCS.addMessage(HTMLCS.NOTICE,b.object.generalAlt[c],"Check that short (and if appropriate, long) text alternatives are available for non-text content that serve the same purpose and present the same information.","G94,G92.Object,ARIA6");for(var c=0;c<b.applet.missingBody.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.applet.missingBody[c],"Applet elements must contain a text alternative in the element's body, for browsers without support for the applet element.","H35.3");for(var c=0;c<b.applet.missingAlt.length;c++)HTMLCS.addMessage(HTMLCS.ERROR,b.applet.missingAlt[c],"Applet elements must contain an alt attribute, to provide a text alternative to browsers supporting the element but are unable to load the applet.","H35.2");for(var c=0;c<b.applet.generalAlt.length;c++)HTMLCS.addMessage(HTMLCS.NOTICE,b.applet.generalAlt[c],"Check that short (and if appropriate, long) text alternatives are available for non-text content that serve the same purpose and present the same information.","G94,G92.Applet")},testMediaTextAlternatives:function(a){for(var b={object:{missingBody:[],generalAlt:[]},applet:{missingBody:[],missingAlt:[],generalAlt:[]}},c=HTMLCS.util.getAllElements(a,"object"),d=0;d<c.length;d++){var e=c[d],f=(e.nodeName.toLowerCase(),e.querySelector("object"));null===f&&(!0===HTMLCS.util.isStringEmpty(HTMLCS.util.getElementTextContent(e,!0))?!1===HTMLCS.util.hasValidAriaLabel(e)&&b.object.missingBody.push(e):!1===HTMLCS.util.hasValidAriaLabel(e)&&b.object.generalAlt.push(e))}for(var c=HTMLCS.util.getAllElements(a,"applet"),d=0;d<c.length;d++){var f=e.querySelector("object"),g=!1;if(null===f){var h=HTMLCS.util.getElementTextContent(e,!0);!0===HTMLCS.util.isStringEmpty(h)&&(b.applet.missingBody.push(e),g=!0)}var i=e.getAttribute("alt")||"";!0===HTMLCS.util.isStringEmpty(i)&&(b.applet.missingAlt.push(e),g=!0),!0===HTMLCS.util.hasValidAriaLabel(e)&&(g=!1),!1===g&&b.applet.generalAlt.push(e)}return b},_getLinkAltText:function(a){for(var a=a.cloneNode(!0),b=[],c=0;c<a.childNodes.length;c++)b.push(a.childNodes[c]);for(var d=null;b.length>0;){var e=b.shift();if(1===e.nodeType&&"img"===e.nodeName.toLowerCase()&&!0===e.hasAttribute("alt")){d=e.getAttribute("alt"),d=d?d.replace(/^\s+|\s+$/g,""):"";break}}return d}},_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_1={register:function(){return["object","embed","applet","bgsound","audio","video"]},process:function(a,b){var c=a.nodeName.toLowerCase();"video"!==c&&HTMLCS.addMessage(HTMLCS.NOTICE,a,"If this embedded object contains pre-recorded audio only, and is not provided as an alternative for text content, check that an alternative text version is available.","G158"),"bgsound"!==c&&"audio"!==c&&HTMLCS.addMessage(HTMLCS.NOTICE,a,"If this embedded object contains pre-recorded video only, and is not provided as an alternative for text content, check that an alternative text version is available, or an audio track is provided that presents equivalent information.","G159,G166")}},_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_2={register:function(){return["object","embed","applet","video"]},process:function(a,b){HTMLCS.addMessage(HTMLCS.NOTICE,a,"If this embedded object contains pre-recorded synchronised media and is not provided as an alternative for text content, check that captions are provided for audio content.","G87,G93")}},_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_3={register:function(){return["object","embed","applet","video"]},process:function(a,b){HTMLCS.addMessage(HTMLCS.NOTICE,a,"If this embedded object contains pre-recorded synchronised media and is not provided as an alternative for text content, check that an audio description of its video, and/or an alternative text version of the content is provided.","G69,G78,G173,G8")}},_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_4={register:function(){return["object","embed","applet","video"]},process:function(a,b){HTMLCS.addMessage(HTMLCS.NOTICE,a,"If this embedded object contains synchronised media, check that captions are provided for live audio content.","G9,G87,G93")}},_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_5={register:function(){return["object","embed","applet","video"]},process:function(a,b){HTMLCS.addMessage(HTMLCS.NOTICE,a,"If this embedded object contains pre-recorded synchronised media, check that an audio description is provided for its video content.","G78,G173,G8")}},_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_6={register:function(){return["object","embed","applet","video"]},process:function(a,b){HTMLCS.addMessage(HTMLCS.NOTICE,a,"If this embedded object contains pre-recorded synchronised media, check that a sign language interpretation is provided for its audio.","G54,G81")}},_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_7={register:function(){return["object","embed","applet","video"]},process:function(a,b){HTMLCS.addMessage(HTMLCS.NOTICE,a,"If this embedded object contains synchronised media, and where pauses in foreground audio is not sufficient to allow audio descriptions to convey the sense of pre-recorded video, check that an extended audio description is provided, either through scripting or an alternate version.","G8")}},_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_8={register:function(){return["object","embed","applet","video"]},process:function(a,b){HTMLCS.addMessage(HTMLCS.NOTICE,a,"If this embedded object contains pre-recorded synchronised media or video-only content, check that an alternative text version of the content is provided.","G69,G159")}},_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_9={register:function(){return["object","embed","applet","bgsound","audio"]},process:function(a,b){HTMLCS.addMessage(HTMLCS.NOTICE,a,"If this embedded object contains live audio-only content, check that an alternative text version of the content is provided.","G150,G151,G157")}},_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1_A={_labelNames:null,register:function(){return["_top"]},process:function(a,b){var c=HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1;a===b&&c.testHeadingOrder(b,HTMLCS.WARNING)}},_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1_AAA={_labelNames:null,register:function(){return["_top"]},process:function(a,b){var c=HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1;a===b&&c.testHeadingOrder(b,HTMLCS.ERROR)}},_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1={_labelNames:null,register:function(){return["_top","p","div","input","select","textarea","button","table","fieldset","form","h1","h2","h3","h4","h5","h6"]},process:function(a,b){var c=a.nodeName.toLowerCase();if(a===b)this.testPresentationMarkup(b),this.testEmptyDupeLabelForAttrs(b);else switch(c){case"input":case"textarea":case"button":this.testLabelsOnInputs(a,b);break;case"form":this.testRequiredFieldsets(a);break;case"select":this.testLabelsOnInputs(a,b),this.testOptgroup(a);break;case"p":case"div":this.testNonSemanticHeading(a),this.testListsWithBreaks(a),this.testUnstructuredNavLinks(a);break;case"table":this.testGeneralTable(a),this.testTableHeaders(a),this.testTableCaptionSummary(a);break;case"fieldset":this.testFieldsetLegend(a);break;case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":this.testEmptyHeading(a)}},testSemanticPresentationRole:function(a){if(a.hasAttribute("role")&&"presentation"===a.getAttribute("role")){var b=["div","span","b","i"],c=a.querySelectorAll("*:not("+b.join("):not(")+")");c=[].filter.call(c,function(a){return!1===a.hasAttribute("role")}),c.length&&HTMLCS.addMessage(HTMLCS.ERROR,a,'This element\'s role is "presentation" but contains child elements with semantic meaning.',"F92,ARIA4")}},testEmptyDupeLabelForAttrs:function(a){this._labelNames={};for(var b=a.getElementsByTagName("label"),c=0;c<b.length;c++)if(null!==b[c].getAttribute("for")&&""!==b[c].getAttribute("for")){var d=b[c].getAttribute("for");if(this._labelNames[d]&&null!==this._labelNames[d])this._labelNames[d]=null;else{if(this._labelNames[d]=b[c],a.ownerDocument)var e=a.ownerDocument.getElementById(d);else var e=a.getElementById(d);if(null===e){var f=HTMLCS.ERROR,g='This label\'s "for" attribute contains an ID that does not exist in the document.',h="H44.NonExistent";if(!0===HTMLCS.isFullDoc(a)||"body"===a.nodeName.toLowerCase()){f=HTMLCS.WARNING,g='This label\'s "for" attribute contains an ID that does not exist in the document fragment.';var h="H44.NonExistentFragment"}HTMLCS.addMessage(f,b[c],g,h)}else{var i=e.nodeName.toLowerCase();-1==="input|select|textarea|button|keygen|meter|output|progress".indexOf(i)&&HTMLCS.addMessage(HTMLCS.WARNING,b[c],'This label\'s "for" attribute contains an ID for an element that is not a form control. Ensure that you have entered the correct ID for the intended element.',"H44.NotFormControl")}}}},testLabelsOnInputs:function(a,b,c){var d=a.nodeName.toLowerCase(),e=d;"input"===e&&(e=!0===a.hasAttribute("type")?a.getAttribute("type"):"text");var f=!1,g=function(a){f||(f={}),f[a]=!0},h=!1,e=e.toLowerCase();"select"===e||"textarea"===e?h=!0:!0===/^(radio|checkbox|text|file|password)$/.test(e)&&(h=!0),null!==a.getAttribute("hidden")&&(h=!1),a.ownerDocument.querySelector('label[for="'+a.id+'"]')&&g("explicit");var i=a.parentNode;i&&"label"===i.nodeName.toLowerCase()&&g("implicit");var j=a.getAttribute("title");return null!==j&&(!0===/^\s*$/.test(j)&&!0===h?HTMLCS.addMessage(HTMLCS.WARNING,a,'This form control has a "title" attribute that is empty or contains only spaces. It will be ignored for labelling test purposes.',"H65"):g("title")),!0===a.hasAttribute("aria-label")&&(!1===HTMLCS.util.hasValidAriaLabel(a)?HTMLCS.addMessage(HTMLCS.WARNING,a,'This form control has an "aria-label" attribute that is empty or contains only spaces. It will be ignored for labelling test purposes.',"ARIA6"):g("aria-label")),!0===a.hasAttribute("aria-labelledby")&&(!1===HTMLCS.util.hasValidAriaLabel(a)?HTMLCS.addMessage(HTMLCS.WARNING,a,'This form control contains an aria-labelledby attribute, however it includes an ID "'+a.getAttribute("aria-labelledby")+'" that does not exist on an element. The aria-labelledby attribute will be ignored for labelling test purposes.',"ARIA16,ARIA9"):g("aria-labelledby")),!0!==c&&(!1!==f&&!1===h?"hidden"===e?HTMLCS.addMessage(HTMLCS.WARNING,a,"This hidden form field is labelled in some way. There should be no need to label a hidden form field.","F68.Hidden"):null!==a.getAttribute("hidden")&&HTMLCS.addMessage(HTMLCS.WARNING,a,'This form field is intended to be hidden (using the "hidden" attribute), but is also labelled in some way. There should be no need to label a hidden form field.',"F68.HiddenAttr"):!1===f&&!0===h&&HTMLCS.addMessage(HTMLCS.ERROR,a,'This form field should be labelled in some way. Use the label element (either with a "for" attribute or wrapped around the form field), or "title", "aria-label" or "aria-labelledby" attributes as appropriate.',"F68")),f},testPresentationMarkup:function(a){var b=HTMLCS.util.getElementWindow(a).document,c=HTMLCS.util.getDocumentType(b);if(!c||"html5"!==c&&"xhtml5"!==c){for(var d=HTMLCS.util.getAllElements(a,"b, i, u, s, strike, tt, big, small, center, font"),e=0;e<d.length;e++){var f="H49."+d[e].nodeName.substr(0,1).toUpperCase()+d[e].nodeName.substr(1).toLowerCase();HTMLCS.addMessage(HTMLCS.WARNING,d[e],"Semantic markup should be used to mark emphasised or special text so that it can be programmatically determined.",f)}for(var d=HTMLCS.util.getAllElements(a,"*[align]"),e=0;e<d.length;e++){var f="H49.AlignAttr";HTMLCS.addMessage(HTMLCS.WARNING,d[e],"Semantic markup should be used to mark emphasised or special text so that it can be programmatically determined.",f)}}else{for(var d=HTMLCS.util.getAllElements(a,"strike, tt, big, center, font"),e=0;e<d.length;e++){var f="H49."+d[e].nodeName.substr(0,1).toUpperCase()+d[e].nodeName.substr(1).toLowerCase();HTMLCS.addMessage(HTMLCS.ERROR,d[e],"Presentational markup used that has become obsolete in HTML5.",f)}for(var d=HTMLCS.util.getAllElements(a,"*[align]"),e=0;e<d.length;e++){var f="H49.AlignAttr";HTMLCS.addMessage(HTMLCS.ERROR,d[e],"Align attributes .",f)}}},testNonSemanticHeading:function(a){var b=a.nodeName.toLowerCase();if("p"===b||"div"===b){var c=a.childNodes;if(1===c.length&&1===c[0].nodeType){!0===/^(strong|em|b|i|u)$/.test(c[0].nodeName.toLowerCase())&&HTMLCS.addMessage(HTMLCS.WARNING,a,"Heading markup should be used if this content is intended as a heading.","H42")}}},testTableHeaders:function(a){for(var b=HTMLCS.util.testTableHeaders(a),c=this._testTableScopeAttrs(a),d=0;d<c.invalid.length;d++)HTMLCS.addMessage(HTMLCS.ERROR,c.invalid[d],"Table cell has an invalid scope attribute. Valid values are row, col, rowgroup, or colgroup.","H63.3");for(var d=0;d<c.obsoleteTd.length;d++)HTMLCS.addMessage(HTMLCS.WARNING,c.obsoleteTd[d],"Scope attributes on td elements that act as headings for other elements are obsolete in HTML5. Use a th element instead.","H63.2");!0===b.allowScope?0===c.missing.length&&b.required:!0===c.used&&(HTMLCS.addMessage(HTMLCS.WARNING,a,"Scope attributes on th elements are ambiguous in a table with multiple levels of headings. Use the headers attribute on td elements instead.","H43.ScopeAmbiguous"),c=null);for(var d=0;d<b.wrongHeaders.length;d++)HTMLCS.addMessage(HTMLCS.ERROR,b.wrongHeaders[d].element,'Incorrect headers attribute on this td element. Expected "'+b.wrongHeaders[d].expected+'" but found "'+b.wrongHeaders[d].actual+'"',"H43.IncorrectAttr");!0===b.required&&!1===b.allowScope&&(!1===b.used?HTMLCS.addMessage(HTMLCS.ERROR,a,"The relationship between td elements and their associated th elements is not defined. As this table has multiple levels of th elements, you must use the headers attribute on td elements.","H43.HeadersRequired"):(b.missingThId.length>0&&HTMLCS.addMessage(HTMLCS.ERROR,a,"Not all th elements in this table contain an id attribute. These cells should contain ids so that they may be referenced by td elements' headers attributes.","H43.MissingHeaderIds"),b.missingTd.length>0&&HTMLCS.addMessage(HTMLCS.ERROR,a,"Not all td elements in this table contain a headers attribute. Each headers attribute should list the ids of all th elements associated with that cell.","H43.MissingHeadersAttrs"))),!0===b.required&&!0===b.allowScope&&!1===b.correct&&!1===c.correct&&(!1===c.used&&!1===b.used?HTMLCS.addMessage(HTMLCS.ERROR,a,"The relationship between td elements and their associated th elements is not defined. Use either the scope attribute on th elements, or the headers attribute on td elements.","H43,H63"):!1===c.used&&(b.missingThId.length>0||b.missingTd.length>0)?(b.missingThId.length>0&&HTMLCS.addMessage(HTMLCS.ERROR,a,"Not all th elements in this table contain an id attribute. These cells should contain ids so that they may be referenced by td elements' headers attributes.","H43.MissingHeaderIds"),b.missingTd.length>0&&HTMLCS.addMessage(HTMLCS.ERROR,a,"Not all td elements in this table contain a headers attribute. Each headers attribute should list the ids of all th elements associated with that cell.","H4