{"functions":{"function":[{"name":"applyFocusVisiblePolyfill","description":"<p>Applies the :focus-visible polyfill at the given scope.\nA scope in this case is either the top-level Document or a Shadow Root.</p>","params":{"param":[{"name":"scope","types":{"type":["Document","ShadowRoot"]},"description":"","optional":"false"}]},"fires":null,"exceptions":null,"returns":null},{"name":"isValidFocusTarget","description":"<p>Helper function for legacy browsers and iframes which sometimes focus\nelements like document, body, and non-interactive SVG.</p>","params":{"param":[{"name":"el","types":{"type":["Element"]},"description":"","optional":"false"}]},"fires":null,"exceptions":null,"returns":null},{"name":"addFocusVisibleClass","description":"<p>Add the <code>focus-visible</code> class to the given element if it was not added by\nthe author.</p>","params":{"param":[{"name":"el","types":{"type":["Element"]},"description":"","optional":"false"}]},"fires":null,"exceptions":null,"returns":null},{"name":"removeFocusVisibleClass","description":"<p>Remove the <code>focus-visible</code> class from the given element if it was not\noriginally added by the author.</p>","params":{"param":[{"name":"el","types":{"type":["Element"]},"description":"","optional":"false"}]},"fires":null,"exceptions":null,"returns":null},{"name":"onKeyDown","description":"<p>If the most recent user interaction was via the keyboard;\nand the key press did not include a meta, alt/option, or control key;\nthen the modality is keyboard. Otherwise, the modality is not keyboard.\nApply <code>focus-visible</code> to any current active element and keep track\nof our keyboard modality state with <code>hadKeyboardEvent</code>.</p>","params":{"param":[{"name":"e","types":{"type":["KeyboardEvent"]},"description":"","optional":"false"}]},"fires":null,"exceptions":null,"returns":null},{"name":"onPointerDown","description":"<p>If at any point a user clicks with a pointing device, ensure that we change\nthe modality away from keyboard.\nThis avoids the situation where a user presses a key on an already focused\nelement, and then clicks on a different element, focusing it with a\npointing device, while we still think we're in keyboard modality.</p>","params":{"param":[{"name":"e","types":{"type":["Event"]},"description":"","optional":"false"}]},"fires":null,"exceptions":null,"returns":null},{"name":"onFocus","description":"<p>On <code>focus</code>, add the <code>focus-visible</code> class to the target if:</p>\n<ul>\n<li>the target received focus as a result of keyboard navigation, or</li>\n<li>the event target is an element that will likely require interaction\nvia the keyboard (e.g. a text box)</li>\n</ul>","params":{"param":[{"name":"e","types":{"type":["Event"]},"description":"","optional":"false"}]},"fires":null,"exceptions":null,"returns":null},{"name":"onBlur","description":"<p>On <code>blur</code>, remove the <code>focus-visible</code> class from the target.</p>","params":{"param":[{"name":"e","types":{"type":["Event"]},"description":"","optional":"false"}]},"fires":null,"exceptions":null,"returns":null},{"name":"onVisibilityChange","description":"<p>If the user changes tabs, keep track of whether or not the previously\nfocused element had .focus-visible.</p>","params":{"param":[{"name":"e","types":{"type":["Event"]},"description":"","optional":"false"}]},"fires":null,"exceptions":null,"returns":null},{"name":"addInitialPointerMoveListeners","description":"<p>Add a group of listeners to detect usage of any pointing devices.\nThese listeners will be added when the polyfill first loads, and anytime\nthe window is blurred, so that they are active when the window regains\nfocus.</p>","params":null,"fires":null,"exceptions":null,"returns":null},{"name":"onInitialPointerMove","description":"<p>When the polfyill first loads, assume the user is in keyboard modality.\nIf any event is received from a pointing device (e.g. mouse, pointer,\ntouch), turn off keyboard modality.\nThis accounts for situations where focus enters the page from the URL bar.</p>","params":{"param":[{"name":"e","types":{"type":["Event"]},"description":"","optional":"false"}]},"fires":null,"exceptions":null,"returns":null}]}}