content
\";\n }\n};\n// elements with display:flex are focusable in IE10-11\nvar focusFlexboxContainer = {\n element: \"span\",\n mutate: function mutate(element) {\n element.setAttribute(\"style\", \"display: -webkit-flex; display: -ms-flexbox; display: flex;\");\n element.innerHTML = 'hello';\n }\n};\n// form[tabindex=0][disabled] should be focusable as the\n// specification doesn't know the disabled attribute on the form element\n// @specification https://www.w3.org/TR/html5/forms.html#the-form-element\nvar focusFormDisabled = {\n element: \"form\",\n mutate: function mutate(element) {\n element.setAttribute(\"tabindex\", 0);\n element.setAttribute(\"disabled\", \"disabled\");\n }\n};\n// NOTE: https://github.com/medialize/ally.js/issues/35\n// fixes https://github.com/medialize/ally.js/issues/20\n// https://developer.mozilla.org/docs/Web/HTML/Element/img#attr-ismap\nvar focusImgIsmap = {\n element: \"a\",\n mutate: function mutate(element) {\n element.href = \"#void\";\n element.innerHTML = '';\n return element.querySelector(\"img\");\n }\n};\n// NOTE: https://github.com/medialize/ally.js/issues/35\n// https://developer.mozilla.org/docs/Web/HTML/Element/img#attr-usemap\nvar focusImgUsemapTabindex = {\n element: \"div\",\n mutate: function mutate(element) {\n element.innerHTML = '' + '';\n return element.querySelector(\"img\");\n }\n};\nvar focusInHiddenIframe = {\n element: function element(wrapper, _document) {\n var iframe = _document.createElement(\"iframe\");\n // iframe must be part of the DOM before accessing the contentWindow is possible\n wrapper.appendChild(iframe);\n // create the iframe's default document ()\n var iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.close();\n return iframe;\n },\n mutate: function mutate(iframe) {\n iframe.style.visibility = \"hidden\";\n var iframeDocument = iframe.contentWindow.document;\n var input = iframeDocument.createElement(\"input\");\n iframeDocument.body.appendChild(input);\n return input;\n },\n validate: function validate(iframe) {\n var iframeDocument = iframe.contentWindow.document;\n var focus = iframeDocument.querySelector(\"input\");\n return iframeDocument.activeElement === focus;\n }\n};\nvar result = !platform.is.WEBKIT;\nfunction focusInZeroDimensionObject() {\n return result;\n}\n// Firefox allows *any* value and treats invalid values like tabindex=\"-1\"\n// @browser-issue Gecko https://bugzilla.mozilla.org/show_bug.cgi?id=1128054\nvar focusInvalidTabindex = {\n element: \"div\",\n mutate: function mutate(element) {\n element.setAttribute(\"tabindex\", \"invalid-value\");\n }\n};\nvar focusLabelTabindex = {\n element: \"label\",\n mutate: function mutate(element) {\n element.setAttribute(\"tabindex\", \"-1\");\n },\n validate: function validate(element, focusTarget, _document) {\n // force layout in Chrome 49, otherwise the element won't be focusable\n /* eslint-disable no-unused-vars */ var variableToPreventDeadCodeElimination = element.offsetHeight;\n /* eslint-enable no-unused-vars */ element.focus();\n return _document.activeElement === element;\n }\n};\nvar svg = \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtb\" + \"G5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBpZD0ic3ZnIj48dGV4dCB4PSIxMCIgeT0iMjAiIGlkPSJ\" + \"zdmctbGluay10ZXh0Ij50ZXh0PC90ZXh0Pjwvc3ZnPg==\";\n// Note: IE10 on BrowserStack does not like this test\nvar focusObjectSvgHidden = {\n element: \"object\",\n mutate: function mutate(element) {\n element.setAttribute(\"type\", \"image/svg+xml\");\n element.setAttribute(\"data\", svg);\n element.setAttribute(\"width\", \"200\");\n element.setAttribute(\"height\", \"50\");\n element.style.visibility = \"hidden\";\n }\n};\n// Note: IE10 on BrowserStack does not like this test\nvar focusObjectSvg = {\n name: \"can-focus-object-svg\",\n element: \"object\",\n mutate: function mutate(element) {\n element.setAttribute(\"type\", \"image/svg+xml\");\n element.setAttribute(\"data\", svg);\n element.setAttribute(\"width\", \"200\");\n element.setAttribute(\"height\", \"50\");\n },\n validate: function validate(element, focusTarget, _document) {\n if (platform.is.GECKO) {\n // Firefox seems to be handling the object creation asynchronously and thereby produces a false negative test result.\n // Because we know Firefox is able to focus object elements referencing SVGs, we simply cheat by sniffing the user agent string\n return true;\n }\n return _document.activeElement === element;\n }\n};\n// Every Environment except IE9 considers SWF objects focusable\nvar result$1 = !platform.is.IE9;\nfunction focusObjectSwf() {\n return result$1;\n}\nvar focusRedirectImgUsemap = {\n element: \"div\",\n mutate: function mutate(element) {\n element.innerHTML = '' + '';\n // focus the , not the