diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fadd9b9..78bc391 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,20 +44,3 @@ jobs: - name: Run tox targets for ${{ matrix.python-version }} run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .) - - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.13" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip tox - - name: Run lint - run: tox -e lint diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a9f4c5a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-added-large-files + - id: check-ast + - id: check-builtin-literals + - id: check-case-conflict + - id: check-docstring-first + - id: check-json + - id: check-merge-conflict + - id: check-symlinks + - id: check-toml + - id: check-vcs-permalinks + - id: check-yaml + - id: debug-statements + - id: destroyed-symlinks + - id: end-of-file-fixer + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.9.8 + hooks: + - id: ruff + args: [--fix] + - id: ruff-format diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 7f33e3c..efafb67 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,4 +1,3 @@ # Community Participation Guidelines This repository is governed by Django's code of conduct. See https://www.djangoproject.com/conduct/. - diff --git a/pyproject.toml b/pyproject.toml index c856707..63c08e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ description = "Python library to integrate axe and selenium for web accessibilit dynamic = ["version"] readme = "README.rst" authors = [ - {name="Kimberly Sereduck", email="ksereduck@mozilla.com"} + {name="Kimberly Sereduck", email="ksereduck@mozilla.com"} ] license = {"text" = "Mozilla Public License 2.0 (MPL 2.0)"} keywords = ["axe-core", "selenium", "pytest-selenium", "accessibility" , "automation", "mozilla"] @@ -18,8 +18,42 @@ dependencies = [ "pytest>=3.0", ] +[project.optional-dependencies] +lint = [ + "pre-commit", +] + [project.urls] "Homepage" = "https://github.com/axe-selenium-python/axe-selenium-python" "Issues" = "https://github.com/axe-selenium-python/axe-selenium-python/issues" -[tool.setuptools_scm] \ No newline at end of file +[tool.ruff.lint] +select = [ + "A", + "B", + "BLE", + "C4", + "DTZ", + "E", + "ERA", + "F", + "FA", + "FLY", + "FURB", + "I", + "N", + "PERF", + "PIE", + "PT", + "RSE", + "RUF", + "SIM", + "T10", + "T20", + "W", +] + +[tool.ruff.lint.isort] +force-single-line = true + +[tool.setuptools_scm] diff --git a/tests/requirements/lint.txt b/tests/requirements/lint.txt deleted file mode 100644 index f086aa4..0000000 --- a/tests/requirements/lint.txt +++ /dev/null @@ -1,3 +0,0 @@ -flake8 -isort -black diff --git a/tests/requirements/tests.txt b/tests/requirements/tests.txt index a2c0535..1da178d 100644 --- a/tests/requirements/tests.txt +++ b/tests/requirements/tests.txt @@ -1,4 +1,4 @@ pytest selenium pytest-html -pytest-mock \ No newline at end of file +pytest-mock diff --git a/tests/src/axe.min.js b/tests/src/axe.min.js index bbd7317..338967e 100644 --- a/tests/src/axe.min.js +++ b/tests/src/axe.min.js @@ -15,4 +15,4 @@ imgNode:"Element's background color could not be determined because element cont ;for(c.length&&(c=c.filter(function(a,b){if(0===b&&!axe.commons.dom.isVisible(a,!0)||axe.commons.dom.isVisible(a,!0))return a}));d;)"LABEL"===d.tagName&&-1===c.indexOf(d)&&c.push(d),d=d.parentNode;return this.relatedNodes(c),c.length>1}},{id:"title-only",evaluate:function(a,b){return!(axe.commons.text.label(a)||!a.getAttribute("title")&&!a.getAttribute("aria-describedby"))}},{id:"has-lang",evaluate:function(a,b){return!!(a.getAttribute("lang")||a.getAttribute("xml:lang")||"").trim()}},{id:"valid-lang",evaluate:function(a,b){function c(a){return a.trim().split("-")[0].toLowerCase()}var d,e;return d=(b||axe.commons.utils.validLangs()).map(c),e=["lang","xml:lang"].reduce(function(b,e){var f=a.getAttribute(e);if("string"!=typeof f)return b;var g=c(f);return""!==g&&-1===d.indexOf(g)&&b.push(e+'="'+a.getAttribute(e)+'"'),b},[]),!!e.length&&(this.data(e),!0)}},{id:"dlitem",evaluate:function(a,b){return"DL"===a.parentNode.tagName}},{id:"has-listitem",evaluate:function(a,b){var c=a.children;if(0===c.length)return!0;for(var d=0;dc+1&&(a[d].result=!1),c=a[d].data;return a}},{id:"href-no-hash",evaluate:function(a,b){return"#"!==a.getAttribute("href")}},{id:"internal-link-present",evaluate:function(a,b){return!!a.querySelector('a[href^="#"]')}},{id:"landmark",evaluate:function(a,b){return a.getElementsByTagName("main").length>0||!!a.querySelector('[role="main"]')}},{id:"meta-refresh",evaluate:function(a,b){var c=a.getAttribute("content")||"",d=c.split(/[;,]/);return""===c||"0"===d[0]}},{id:"p-as-heading",evaluate:function(a,b){function c(a){for(var b=a,c=a.textContent.trim(),d=c;d===c&&void 0!==b;){var e=-1;if(a=b,0===a.children.length)return a;do{e++,d=a.children[e].textContent.trim()}while(""===d&&e+1b.fontSize)&&(!d.weight||a.fontWeight-d.weight>b.fontWeight)&&(!d.italic||a.isItalic&&!b.isItalic)},!1)}var g=Array.from(a.parentNode.children),h=g.indexOf(a);b=b||{};var i=b.margins||[],j=g.slice(h+1).find(function(a){return"P"===a.nodeName.toUpperCase()}),k=g.slice(0,h).reverse().find(function(a){return"P"===a.nodeName.toUpperCase()}),l=e(a),m=j?e(j):null,n=k?e(k):null;if(!m||!f(l,m,i))return!0;var o=axe.commons.dom.findUp(a,"blockquote");return!!(o&&"BLOCKQUOTE"===o.nodeName.toUpperCase()||n&&!f(l,n,i))&&void 0},options:{margins:[{weight:150,italic:!0},{weight:150,size:1.15},{italic:!0,size:1.15},{size:1.4}]}},{id:"region",evaluate:function(a,b){function c(a){return h&&axe.commons.dom.isFocusable(axe.commons.dom.getElementByReference(h,"href"))&&h===a}function d(a){var b=a.getAttribute("role");return b&&-1!==g.indexOf(b)}function e(a){return d(a)?null:c(a)?f(a):axe.commons.dom.isVisible(a,!0)&&(axe.commons.text.visible(a,!0,!0)||axe.commons.dom.isVisualContent(a))?a:f(a)}function f(a){var b=axe.commons.utils.toArray(a.children);return 0===b.length?[]:b.map(e).filter(function(a){return null!==a}).reduce(function(a,b){return a.concat(b)},[])}var g=axe.commons.aria.getRolesByType("landmark"),h=a.querySelector("a[href]"),i=f(a);return this.relatedNodes(i),!i.length},after:function(a,b){return[a[0]]}},{id:"skip-link",evaluate:function(a,b){return axe.commons.dom.isFocusable(axe.commons.dom.getElementByReference(a,"href"))},after:function(a,b){return[a[0]]}},{id:"unique-frame-title",evaluate:function(a,b){var c=axe.commons.text.sanitize(a.title).trim().toLowerCase();return this.data(c),!0},after:function(a,b){var c={};return a.forEach(function(a){c[a.data]=void 0!==c[a.data]?++c[a.data]:0}),a.forEach(function(a){a.result=!!c[a.data]}),a}},{id:"aria-label",evaluate:function(a,b){var c=a.getAttribute("aria-label");return!!(c?axe.commons.text.sanitize(c).trim():"")}},{id:"aria-labelledby",evaluate:function(a,b){return(0,axe.commons.dom.idrefs)(a,"aria-labelledby").some(function(a){return a&&axe.commons.text.accessibleText(a,!0)})}},{id:"button-has-visible-text",evaluate:function(a,b){var c=a.nodeName.toUpperCase(),d=a.getAttribute("role"),e=void 0;return("BUTTON"===c||"button"===d&&"INPUT"!==c)&&(e=axe.commons.text.accessibleText(a),this.data(e),!!e)}},{id:"doc-has-title",evaluate:function(a,b){var c=document.title;return!!(c?axe.commons.text.sanitize(c).trim():"")}},{id:"duplicate-id",evaluate:function(a,b){if(!a.id.trim())return!0;for(var c=document.querySelectorAll('[id="'+axe.commons.utils.escapeSelector(a.id)+'"]'),d=[],e=0;e0}},{id:"is-on-screen",evaluate:function(a,b){return axe.commons.dom.isVisible(a,!1)&&!axe.commons.dom.isOffscreen(a)}},{id:"non-empty-alt",evaluate:function(a,b){var c=a.getAttribute("alt");return!!(c?axe.commons.text.sanitize(c).trim():"")}},{id:"non-empty-if-present",evaluate:function(a,b){var c=a.nodeName.toUpperCase(),d=(a.getAttribute("type")||"").toLowerCase(),e=a.getAttribute("value");return this.data(e),"INPUT"===c&&-1!==["submit","reset"].indexOf(d)&&null===e}},{id:"non-empty-title",evaluate:function(a,b){var c=a.getAttribute("title");return!!(c?axe.commons.text.sanitize(c).trim():"")}},{id:"non-empty-value",evaluate:function(a,b){var c=a.getAttribute("value");return!!(c?axe.commons.text.sanitize(c).trim():"")}},{id:"role-none",evaluate:function(a,b){return"none"===a.getAttribute("role")}},{id:"role-presentation",evaluate:function(a,b){return"presentation"===a.getAttribute("role")}},{id:"caption-faked",evaluate:function(a,b){var c=axe.commons.table.toGrid(a),d=c[0];return c.length<=1||d.length<=1||a.rows.length<=1||d.reduce(function(a,b,c){return a||b!==d[c+1]&&void 0!==d[c+1]},!1)}},{id:"has-caption",evaluate:function(a,b){return!!a.caption}},{id:"has-summary",evaluate:function(a,b){return!!a.summary}},{id:"has-th",evaluate:function(a,b){for(var c,d,e=[],f=0,g=a.rows.length;f0)||(this.relatedNodes(j),!1)}},{id:"th-has-data-cells",evaluate:function(a,b){var c=axe.commons.table,d=c.getAllCells(a),e=this,f=[];d.forEach(function(a){var b=a.getAttribute("headers");b&&(f=f.concat(b.split(/\s+/)));var c=a.getAttribute("aria-labelledby");c&&(f=f.concat(c.split(/\s+/)))});var g=d.filter(function(a){return""!==axe.commons.text.sanitize(a.textContent)&&("TH"===a.nodeName.toUpperCase()||-1!==["rowheader","columnheader"].indexOf(a.getAttribute("role")))}),h=c.toGrid(a);return!!g.reduce(function(a,b){if(b.id&&-1!==f.indexOf(b.id))return!!a||a;var d=!1,g=c.getCellPosition(b,h);return c.isColumnHeader(b)&&(d=c.traverse("down",g,h).reduce(function(a,b){return a||axe.commons.dom.hasContent(b)&&!c.isColumnHeader(b)},!1)),!d&&c.isRowHeader(b)&&(d=c.traverse("right",g,h).reduce(function(a,b){return a||axe.commons.dom.hasContent(b)&&!c.isRowHeader(b)},!1)),d||e.relatedNodes(b),a&&d},!0)||void 0}},{id:"hidden-content",evaluate:function(a,b){var c=window.getComputedStyle(a);if(!["SCRIPT","HEAD","TITLE","NOSCRIPT","STYLE","TEMPLATE"].includes(a.tagName.toUpperCase())&&axe.commons.dom.hasContent(a)){if("none"===c.getPropertyValue("display"))return;if("hidden"===c.getPropertyValue("visibility")){if(a.parentNode)var d=window.getComputedStyle(a.parentNode);if(!d||"hidden"!==d.getPropertyValue("visibility"))return}}return!0}}],commons:function(){function a(a){return a.getPropertyValue("font-family").split(/[,;]/g).map(function(a){return a.trim().toLowerCase()})}function b(b,c){var d=window.getComputedStyle(b);if("none"!==d.getPropertyValue("background-image"))return!0;if(["border-bottom","border-top","outline"].reduce(function(a,b){var c=new y.Color;return c.parseRgbString(d.getPropertyValue(b+"-color")),a||"none"!==d.getPropertyValue(b+"-style")&&parseFloat(d.getPropertyValue(b+"-width"))>0&&0!==c.alpha},!1))return!0;var e=window.getComputedStyle(c);if(a(d)[0]!==a(e)[0])return!0;var f=["text-decoration-line","text-decoration-style","font-weight","font-style","font-size"].reduce(function(a,b){return a||d.getPropertyValue(b)!==e.getPropertyValue(b)},!1),g=d.getPropertyValue("text-decoration");return g.split(" ").length<3&&(f=f||g!==e.getPropertyValue("text-decoration")),f}function c(a,b){var c=a.nodeName.toUpperCase();if(C.includes(c))return axe.commons.color.incompleteData.set("bgColor","imgNode"),!0;b=b||window.getComputedStyle(a);var d=b.getPropertyValue("background-image"),e="none"!==d;if(e){var f=/gradient/.test(d);axe.commons.color.incompleteData.set("bgColor",f?"bgGradient":"bgImage")}return e}function d(a,b){b=b||window.getComputedStyle(a);var c=new y.Color;if(c.parseRgbString(b.getPropertyValue("background-color")),0!==c.alpha){var d=b.getPropertyValue("opacity");c.alpha=c.alpha*d}return c}function e(a,b){var c=a.getClientRects()[0],d=document.elementsFromPoint(c.left,c.top);if(d)for(var e=0;e0)for(var g=a-1;g>=0;g--){var h=b[g],i=window.getComputedStyle(h),j=d(h,i);j.alpha&&e(c,h)?f+=j.alpha:b.splice(g,1)}return f}function g(a,b,c){var d=a!==b&&!z.visuallyContains(a,b)&&0!==c.alpha;return d&&axe.commons.color.incompleteData.set("bgColor","elmPartiallyObscured"),d}function h(a,b){var c={TD:"TR",INPUT:"LABEL"},d=a.map(function(a){return a.tagName}),e=a;for(var f in c)if(c.hasOwnProperty(f)){if(b.tagName===f){var g=axe.commons.dom.findUp(b,c[f]);if(g&&-1===a.indexOf(g)){var h=axe.commons.dom.visuallyOverlaps(b.getBoundingClientRect(),g);h&&e.splice(a.indexOf(b)+1,0,g)}}b.tagName===c[f]&&-1===d.indexOf(b.tagName)&&e.splice(d.indexOf(f)+1,0,b)}return e}function i(a){var b=a.indexOf(document.body),e=a;return b>1&&!c(document.documentElement)&&0===d(document.documentElement).alpha&&(e.splice(b,1),e.splice(a.indexOf(document.documentElement),1),e.push(document.body)),e}function j(a,b){"use strict";var c=b(a);for(a=a.firstChild;a;)!1!==c&&j(a,b),a=a.nextSibling}function k(a){"use strict";var b=window.getComputedStyle(a).getPropertyValue("display");return-1!==D.indexOf(b)||"table-"===b.substr(0,6)}function l(a){"use strict";var b=a.match(/rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/);return!(!b||5!==b.length)&&(b[3]-b[1]<=0&&b[2]-b[4]<=0)}function m(a){var b=null;return a.id&&(b=document.querySelector('label[for="'+axe.utils.escapeSelector(a.id)+'"]'))?b:b=z.findUp(a,"label")}function n(a){return-1!==["button","reset","submit"].indexOf(a.type)}function o(a){var b=a.nodeName.toUpperCase();return"TEXTAREA"===b||"SELECT"===b||"INPUT"===b&&"hidden"!==a.type.toLowerCase()}function p(a){return-1!==["BUTTON","SUMMARY","A"].indexOf(a.nodeName.toUpperCase())}function q(a){return-1!==["TABLE","FIGURE"].indexOf(a.nodeName.toUpperCase())}function r(a){var b=a.nodeName.toUpperCase();if("INPUT"===b)return!a.hasAttribute("type")||-1!==G.indexOf(a.getAttribute("type").toLowerCase())&&a.value?a.value:"";if("SELECT"===b){var c=a.options;if(c&&c.length){for(var d="",e=0;e-1?1:0)},0)};return a.map(function(a){return{score:c(a),name:a}}).sort(function(a,b){return b.score-a.score}).map(function(a){return a.name})}(d,f).shift()},y.Color=function(a,b,c,d){this.red=a,this.green=b,this.blue=c,this.alpha=d,this.toHexString=function(){var a=Math.round(this.red).toString(16),b=Math.round(this.green).toString(16),c=Math.round(this.blue).toString(16);return"#"+(this.red>15.5?a:"0"+a)+(this.green>15.5?b:"0"+b)+(this.blue>15.5?c:"0"+c)};this.parseRgbString=function(a){if("transparent"===a)return this.red=0,this.green=0,this.blue=0,void(this.alpha=0);var b=a.match(/^rgb\((\d+), (\d+), (\d+)\)$/);return b?(this.red=parseInt(b[1],10),this.green=parseInt(b[2],10),this.blue=parseInt(b[3],10),void(this.alpha=1)):(b=a.match(/^rgba\((\d+), (\d+), (\d+), (\d*(\.\d+)?)\)/),b?(this.red=parseInt(b[1],10),this.green=parseInt(b[2],10),this.blue=parseInt(b[3],10),void(this.alpha=parseFloat(b[4]))):void 0)},this.getRelativeLuminance=function(){var a=this.red/255,b=this.green/255,c=this.blue/255;return.2126*(a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4))+.7152*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.0722*(c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4))}},y.flattenColors=function(a,b){var c=a.alpha,d=(1-c)*b.red+c*a.red,e=(1-c)*b.green+c*a.green,f=(1-c)*b.blue+c*a.blue,g=a.alpha+b.alpha*(1-a.alpha);return new y.Color(d,e,f,g)},y.getContrast=function(a,b){if(!b||!a)return null;b.alpha<1&&(b=y.flattenColors(b,a));var c=a.getRelativeLuminance(),d=b.getRelativeLuminance();return(Math.max(d,c)+.05)/(Math.min(d,c)+.05)},y.hasValidContrastRatio=function(a,b,c,d){var e=y.getContrast(a,b),f=d&&Math.ceil(72*c)/96<14||!d&&Math.ceil(72*c)/96<18;return{isValid:f&&e>=4.5||!f&&e>=3,contrastRatio:e}},y.elementIsDistinct=b;var C=["IMG","CANVAS","OBJECT","IFRAME","VIDEO","SVG"];y.getBackgroundStack=function(a){var b=a.getBoundingClientRect(),c=void 0,d=void 0;if(!(b.left>window.innerWidth||b.top>window.innerHeight)){c=Math.min(Math.ceil(b.left+b.width/2),window.innerWidth-1),d=Math.min(Math.ceil(b.top+b.height/2),window.innerHeight-1);var e=document.elementsFromPoint(c,d);e=h(e,a),e=z.reduceToElementsBelowFloating(e,a),e=i(e);var g=e.indexOf(a);return f(g,e,a)>=.99?(axe.commons.color.incompleteData.set("bgColor","bgOverlap"),null):-1!==g?e:null}},y.getBackgroundColor=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];!0!==(arguments.length>2&&void 0!==arguments[2]&&arguments[2])&&a.scrollIntoView();var e=[],f=y.getBackgroundStack(a);if((f||[]).some(function(f){var h=window.getComputedStyle(f),i=d(f,h);return g(a,f,i)||c(f,h)?(e=null,b.push(f),!0):0!==i.alpha&&(b.push(f),e.push(i),1===i.alpha)}),null!==e&&null!==f){e.push(new y.Color(255,255,255,1));return e.reduce(y.flattenColors)}return null},z.isOpaque=function(a){var b=window.getComputedStyle(a);return c(a,b)||1===d(a,b).alpha},y.getForegroundColor=function(a,b){var c=window.getComputedStyle(a),d=new y.Color;d.parseRgbString(c.getPropertyValue("color"));var e=c.getPropertyValue("opacity");if(d.alpha=d.alpha*e,1===d.alpha)return d;var f=y.getBackgroundColor(a,[],b);if(null===f){var g=axe.commons.color.incompleteData.get("bgColor");return axe.commons.color.incompleteData.set("fgColor",g),null}return y.flattenColors(d,f)},y.incompleteData=function(){var a={};return{set:function(b,c){if("string"!=typeof b)throw new Error("Incomplete data: key must be a string");return c&&(a[b]=c),a[b]},get:function(b){return a[b]},clear:function(){a={}}}}(),z.reduceToElementsBelowFloating=function(a,b){var c,d,e,f=["fixed","sticky"],g=[],h=!1;for(c=0;c1&&void 0!==arguments[1]?arguments[1]:[];if(a.textContent.trim()||w.label(a))return!0;for(var c=a.querySelectorAll("*"),d=0;dd.length},z.isNode=function(a){"use strict";return a instanceof Node},z.isOffscreen=function(a){"use strict";var b,c=document.documentElement,d=window.getComputedStyle(document.body||c).getPropertyValue("direction"),e=z.getElementCoordinates(a);if(e.bottom<0&&function(a,b){for(a=a.parentNode;"html"!==a.nodeName.toLowerCase();){if(a.scrollTop&&(b+=a.scrollTop)>=0)return!1;a=a.parentNode}return!0}(a,e.bottom))return!0;if(0===e.left&&0===e.right)return!1;if("ltr"===d){if(e.right<=0)return!0}else if(b=Math.max(c.scrollWidth,z.getViewportSize(window).width),e.left>=b)return!0;return!1},z.isVisible=function(a,b,c){"use strict";var d,e=a.nodeName.toUpperCase(),f=a.parentNode;return 9===a.nodeType||null!==(d=window.getComputedStyle(a,null))&&(!("none"===d.getPropertyValue("display")||"STYLE"===e.toUpperCase()||"SCRIPT"===e.toUpperCase()||!b&&l(d.getPropertyValue("clip"))||!c&&("hidden"===d.getPropertyValue("visibility")||!b&&z.isOffscreen(a))||b&&"true"===a.getAttribute("aria-hidden"))&&(!!f&&z.isVisible(f,b,!0)))};var E=["checkbox","img","radio","range","slider","spinbutton","textbox"];z.isVisualContent=function(a){var b=a.getAttribute("role");if(b)return-1!==E.indexOf(b);switch(a.tagName.toUpperCase()){case"IMG":case"IFRAME":case"OBJECT":case"VIDEO":case"AUDIO":case"CANVAS":case"SVG":case"MATH":case"BUTTON":case"SELECT":case"TEXTAREA":case"KEYGEN":case"PROGRESS":case"METER":return!0;case"INPUT":return"hidden"!==a.type;default:return!1}},z.visuallyContains=function(a,b){var c=a.getBoundingClientRect(),d={top:c.top+.01,bottom:c.bottom-.01,left:c.left+.01,right:c.right-.01},e=b.getBoundingClientRect(),f=e.top,g=e.left,h={top:f-b.scrollTop,bottom:f-b.scrollTop+b.scrollHeight,left:g-b.scrollLeft,right:g-b.scrollLeft+b.scrollWidth},i=window.getComputedStyle(b);return"inline"===i.getPropertyValue("display")||!(d.lefth.right&&d.right>e.right||d.bottom>h.bottom&&d.bottom>e.bottom)&&(!(d.right>e.right||d.bottom>e.bottom)||("scroll"===i.overflow||"auto"===i.overflow||"hidden"===i.overflow||b instanceof HTMLBodyElement||b instanceof HTMLHtmlElement))},z.visuallyOverlaps=function(a,b){var c=b.getBoundingClientRect(),d=c.top,e=c.left,f={top:d-b.scrollTop,bottom:d-b.scrollTop+b.scrollHeight,left:e-b.scrollLeft,right:e-b.scrollLeft+b.scrollWidth};if(a.left>f.right&&a.left>c.right||a.top>f.bottom&&a.top>c.bottom||a.rightc.right||a.top>c.bottom)||("scroll"===g.overflow||"auto"===g.overflow||b instanceof HTMLBodyElement||b instanceof HTMLHtmlElement)},A.getAllCells=function(a){var b,c,d,e,f=[];for(b=0,d=a.rows.length;b=5)return!0;if(i)return!0;var n,o;for(j=0;j=20||!(z.getElementCoordinates(a).width>.95*z.getViewportSize(window).width)&&(!(g<10)&&!a.querySelector("object, embed, iframe, applet"))},A.isHeader=function(a){return!(!A.isColumnHeader(a)&&!A.isRowHeader(a))||!!a.id&&!!document.querySelector('[headers~="'+axe.utils.escapeSelector(a.id)+'"]')},A.isRowHeader=function(a){return-1!==["row","auto"].indexOf(A.getScope(a))},A.toGrid=function(a){for(var b=[],c=a.rows,d=0,e=c.length;d