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