This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Updates the passed dialog to retain focus and restore it when the dialog is closed. Won't | |
* upgrade a dialog more than once. Supports IE11+ and is a no-op otherwise. | |
* @param {!HTMLDialogElement} dialog to upgrade | |
*/ | |
window.registerFocusRestoreDialog = (function() { | |
var WeakMap = window.WeakMap; | |
var registered = | |
typeof WeakMap === 'function' | |
? new WeakMap() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @see https://dom.spec.whatwg.org/#interface-element | |
* @see https://developer.mozilla.org/docs/Web/API/Element/matches#Polyfill | |
* @see https://gist.github.com/jonathantneal/3062955 | |
* @see https://github.com/jonathantneal/closest | |
*/ | |
(function(global){ | |
var Element; | |
var ElementPrototype; |