From cdd3b2bc542bad3ec6e7c36e3733360fb38ff555 Mon Sep 17 00:00:00 2001 From: Alice Boxhall Date: Wed, 26 Oct 2016 13:41:06 -0700 Subject: [PATCH 1/2] Add `overflow: hidden` and `user-modify: none` to inert style --- dist/inert.js | 116 ++++++++++++++++++++++++++++++---------------- dist/inert.min.js | 2 +- inert.js | 2 + 3 files changed, 80 insertions(+), 40 deletions(-) diff --git a/dist/inert.js b/dist/inert.js index bc37e95..d693104 100644 --- a/dist/inert.js +++ b/dist/inert.js @@ -88,10 +88,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons key: 'destructor', value: function destructor() { this._observer.disconnect(); - delete this._observer; + this._observer = null; if (this._rootElement) this._rootElement.removeAttribute('aria-hidden'); - delete this._rootElement; + this._rootElement = null; var _iteratorNormalCompletion = true; var _didIteratorError = false; @@ -118,9 +118,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons } } - delete this._managedNodes; + this._managedNodes = null; - delete this._inertManager; + this._inertManager = null; } /** @@ -140,6 +140,22 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons composedTreeWalk(startNode, function (node) { _this._visitNode(node); }); + + var activeElement = document.activeElement; + if (!document.contains(startNode)) { + // startNode may be in shadow DOM, so find its nearest shadowRoot to get the activeElement. + var node = startNode; + var root = undefined; + while (node) { + if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { + root = node; + break; + } + node = node.parentNode; + } + if (root) activeElement = root.activeElement; + } + if (startNode.contains(activeElement)) activeElement.blur(); } /** @@ -427,10 +443,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons if (this._node) { if (this.hasSavedTabIndex) this._node.setAttribute('tabindex', this.savedTabIndex);else this._node.removeAttribute('tabindex'); + // Use `delete` to restore native focus method. if (this._overrodeFocusMethod) delete this._node.focus; } - delete this._node; - delete this._inertRoots; + this._node = null; + this._inertRoots = null; this._destroyed = true; } @@ -455,7 +472,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons /** Save the existing tabindex value and make the node untabbable and unfocusable */ value: function ensureUntabbable() { var node = this.node; - node.blur(); // TODO(alice): is this right? if (node.matches(_focusableElementsString)) { if (node.tabIndex === -1 && this.hasSavedTabIndex) return; @@ -572,35 +588,21 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons */ this._inertRoots = new Map(); - // Find all inert roots in document and make them actually inert. - var inertElements = Array.from(document.querySelectorAll('[inert]')); - var _iteratorNormalCompletion7 = true; - var _didIteratorError7 = false; - var _iteratorError7 = undefined; - - try { - for (var _iterator7 = inertElements[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { - var inertElement = _step7.value; - - this.setInert(inertElement, true); - } // Comment these two lines out to use programmatic API only - } catch (err) { - _didIteratorError7 = true; - _iteratorError7 = err; - } finally { - try { - if (!_iteratorNormalCompletion7 && _iterator7.return) { - _iterator7.return(); - } - } finally { - if (_didIteratorError7) { - throw _iteratorError7; - } - } - } - + /** + * Observer for mutations on `document.body`. + * @type {MutationObserver} + */ this._observer = new MutationObserver(this._watchForInert.bind(this)); - this._observer.observe(document.body, { attributes: true, subtree: true, childList: true }); + + // Add inert style. + addInertStyle(document.head || document.body || document.documentElement); + + // Wait for document to be loaded. + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', this._onDocumentLoaded.bind(this)); + } else { + this._onDocumentLoaded(); + } } /** @@ -703,6 +705,43 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons return inertNode; } + /** + * Callback used when document has finished loading. + */ + + }, { + key: '_onDocumentLoaded', + value: function _onDocumentLoaded() { + // Find all inert roots in document and make them actually inert. + var inertElements = Array.from(this._document.querySelectorAll('[inert]')); + var _iteratorNormalCompletion7 = true; + var _didIteratorError7 = false; + var _iteratorError7 = undefined; + + try { + for (var _iterator7 = inertElements[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { + var inertElement = _step7.value; + + this.setInert(inertElement, true); + } // Comment this out to use programmatic API only. + } catch (err) { + _didIteratorError7 = true; + _iteratorError7 = err; + } finally { + try { + if (!_iteratorNormalCompletion7 && _iterator7.return) { + _iterator7.return(); + } + } finally { + if (_didIteratorError7) { + throw _iteratorError7; + } + } + } + + this._observer.observe(this._document.body, { attributes: true, subtree: true, childList: true }); + } + /** * Callback used when mutation observer detects attribute changes. * @param {MutationRecord} records @@ -872,11 +911,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons } var style = document.createElement('style'); style.setAttribute('id', 'inert-style'); - style.textContent = "\n" + "[inert] {\n" + " pointer-events: none;\n" + " cursor: default;\n" + "}\n" + "\n" + "[inert], [inert] * {\n" + " user-select: none;\n" + " -webkit-user-select: none;\n" + " -moz-user-select: none;\n" + " -ms-user-select: none;\n" + "}\n"; + style.textContent = "\n" + "[inert] {\n" + " pointer-events: none;\n" + " cursor: default;\n" + "}\n" + "\n" + "[inert], [inert] * {\n" + " user-select: none;\n" + " -webkit-user-select: none;\n" + " -moz-user-select: none;\n" + " -ms-user-select: none;\n" + " overflow: hidden !important;\n" + " user-modify: none !important;\n" + "}\n"; node.appendChild(style); } var inertManager = new InertManager(document); + Object.defineProperty(Element.prototype, 'inert', { enumerable: true, get: function get() { @@ -886,7 +926,5 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons inertManager.setInert(this, inert); } }); - - addInertStyle(document.body); })(document); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZXJ0LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBOzs7Ozs7Ozs7Ozs7Ozs7OztBQWlCQSxDQUFDLFVBQVMsUUFBVCxFQUFtQjs7QUFFcEI7QUFDQSxNQUFNLDJCQUEyQixDQUFDLFNBQUQsRUFDQyxZQURELEVBRUMsdUJBRkQsRUFHQyx3Qk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Zm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kXG4gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS5cbiAqL1xuXG4oZnVuY3Rpb24oZG9jdW1lbnQpIHtcblxuLyoqIEB0eXBlIHtzdHJpbmd9ICovXG5jb25zdCBfZm9jdXNhYmxlRWxlbWVudHNTdHJpbmcgPSBbJ2FbaHJlZl0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdhcmVhW2hyZWZdJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnaW5wdXQ6bm90KFtkaXNhYmxlZF0pJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnc2VsZWN0Om5vdChbZGlzYWJsZWRdKScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3RleHRhcmVhOm5vdChbZGlzYWJsZWRdKScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2J1dHRvbjpub3QoW2Rpc2FibGVkXSknLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdpZnJhbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdvYmplY3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdlbWJlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1tjb250ZW50ZWRpdGFibGVdJ10uam9pbignLCcpO1xuXG4vKipcbiAqIGBJbmVydFJvb3RgIG1hbmFnZXMgYSBzaW5nbGUgaW5lcnQgc3VidHJlZSwgaS5lLiBhIERPTSBzdWJ0cmVlIHdob3NlIHJvb3QgZWxlbWVudCBoYXMgYW4gYGluZXJ0YFxuICogYXR0cmlidXRlLlxuICpcbiAqIEl0cyBtYWluIGZ1bmN0aW9ucyBhcmU6XG4gKlxuICogLSB0byBjcmVhdGUgYW5kIG1haW50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5lcnQgc3BlY2lmaWMgc3R5bGVzXG4gKiBAcGFyYW0ge05vZGV9IG5vZGVcbiAqL1xuZnVuY3Rpb24gYWRkSW5lcnRTdHlsZShub2RlKSB7XG4gIGlmIChub2RlLnF1ZXJ5U2VsZWN0b3IoJ3N0eWxlI2luZXJ0LXN0eWxlJykpIHtcbiAgICByZXR1cm47XG4gIH1cbiAgbGV0IHN0eWxlID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc3R5bGUnKTtcbiAgc3R5bGUuc2V0QXR0cmlidXRlKCdpZCcsICdpbmVydC1zdHlsZScpO1xuICBzdHlsZS50ZXh0Q29udGVudCA9IFwiXFxuXCIrXG4gICAgICAgICAgICAgICAgICAgICAgXCJbaW5lcnRdIHtcXG5cIiArXG4gICAgICAgICAgICAgICAgICAgICAgXCIgIHBvaW50ZXItZXZlbnRzOiBub25lO1xcblwiICtcbiAgICAgICAgICAgICAgICAgICAgICBcIiAgY3Vyc29yOiBkZWZhdWx0O1xcblwiICtcbiAgICAgICAgICAgICAgICAgICAgICBcIn1cXG5cIiArXG4gICAgICAgICAgICAgICAgICAgICAgXCJcXG5cIiArXG4gICAgICAgICAgICAgICAgICAgICAgXCJbaW5lcnRdLCBbaW5lcnRdICoge1xcblwiICtcbiAgICAgICAgICAgICAgICAgICAgICBcIiAgdXNlci1zZWxlY3Q6IG5vbmU7XFxuXCIgK1xuICAgICAgICAgICAgICAgICAgICAgIFwiICAtd2Via2l0LXVzZXItc2VsZWN0OiBub25lO1xcblwiICtcbiAgICAgICAgICAgICAgICAgICAgICBcIiAgLW1vei11c2VyLXNlbGVjdDogbm9uZTtcXG5cIiArXG4gICAgICAgICAgICAgICAgICAgICAgXCIgIC1tcy11c2VyLXNlbGVjdDogbm9uZTtcXG5cIiArXG4gICAgICAgICAgICAgICAgICAgICAgXCJ9XFxuXCI7XG4gIG5vZGUuYXBwZW5kQ2hpbGQoc3R5bGUpO1xufVxuXG5cbmxldCBpbmVydE1hbmFnZXIgPSB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zYWJsZWRdKScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGVjdDpub3QoW2Rpc2FibGVkXSknLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICd0ZXh0YXJlYTpub3QoW2Rpc2FibGVkXSknLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdidXR0b246bm90KFtkaXNhYmxlZF0pJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnaWZyYW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnb2JqZWN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnZW1iZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdbY29udGVudGVkaXRhYmxlXSddLmpvaW4oJywnKTtcblxuLyoqXG4gKiBgSW5lcnRSb290YCBtYW5hZ2VzIGEgc2luZ2xlIGluZXJ0IHN1YnRyZWUsIGkuZS4gYSBET00gc3VidHJlZSB3aG9zZSByb290IGVsZW1lbnQgaGFzIGFuIGBpbmVydGBcbiAqIGF0dHJpYnV0ZS5cbiAqXG4gKiBJdHMgbWFpbiBmdW5jdGlvbnMgYXJlOlxuICpcbiAqIC0gdG8gY3JlYXRlIGFuZCBtYWludGFpbiBhIHNldCBvZiBtYW5hZ2VkIGBJbmVydE5vZGVgcywgaW5jbHVkaW5nIHdoZW4gbXV0YXRpb25zIG9jY3VyIGluIHRoZVxuICogICBzdWJ0cmVlLiBUaGUgYG1ha2VTdWJ0cmVlVW5mb2N1c2FibGUoKWAgbWV0aG9kIGhhbmRsZXMgY29sbGVjdGluZyBgSW5lcnROb2RlYHMgdmlhIHJlZ2lzdGVyaW5nXG4gKiAgIGVhY2ggZm9jdXNhYmxlIG5vZGUgaW4gdGhlIHN1YnRyZWUgd2l0aCB0aGUgc2luZ2xldG9uIGBJbmVydE1hbmFnZXJgIHdoaWNoIG1hbmFnZXMgYWxsIGtub3duXG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IGVsZW1lbnQgaXMgYWxyZWFkeSBpbmVydFxuICAgICAgICByZXR1cm47XG5cbiAgICAgIGNvbnN0IGluZXJ0Um9vdCA9IG5ldyBJbmVydFJvb3Qocm9vdCwgdGhpcyk7XG4gICAgICByb290LnNldEF0dHJpYnV0ZSgnaW5lcnQnLCAnJyk7XG4gICAgICB0aGlzLl9pbmVydFJvb3RzLnNldChyb290LCBpbmVydFJvb3QpO1xuICAgICAgLy8gSWYgbm90IGNvbnRhaW5lZCBpbiB0aGUgZG9jdW1lbnQsIGl0IG11c3QgYmUgaW4gYSBzaGFkb3dSb290LlxuICAgICAgLy8gRW5zdXJlIGluZXJ0IHN0eWxlcyBhcmUgYWRkZWQgdGhlcmUuXG4gICAgICBpZiAoIXRoaXMuX2RvY3VtZW50LmJvZHkuY29udGFpbnMocm9vdCkpIHtcbiAgICAgICAgbGV0IHBhcmVudCA9IHJvb3QucGFyZW50Tm9kZTtcbiAgICAgICAgd2hpbGUgKHBhcmVudCkge1xuICAgICAgICAgIGlmIChwYXJlbnQubm9kZVR5cGUgPT09IDExKSB7XG4gICAgICAgICAgICBhZGRJbmVydFN0eWxlKHBhcmVudCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHBhcmVudCA9IHBhcmVudC5wYXJlbnROb2RlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmICghdGhpcy5faW5lcnRSb290cy5oYXMocm9vdCkpICAvLyBlbGVtZW50IGlzIGFscmVhZHkgbm9uLWluZXJ0XG4gICAgICAgIHJldHVybjtcblxuICAgICAgY29uc3QgaW5lcnRSb290ID0gdGhpcy5faW5lcnRSb290cy5nZXQocm9vdCk7XG4gICAgICBpbmVydFJvb3QuZGVzdHJ1Y3RvcigpO1xuICAgICAgdGhpcy5faW5lcnRSb290cy5kZWxldGUocm9vdCk7XG4gICAgICByb290LnJlbW92ZUF0dHJpYnV0ZSgnaW5lcnQnKTtcbiAgICB9XG4gIH1cblxuICAvKipc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5bGVzXG4gKiBAcGFyYW0ge05vZGV9IG5vZGVcbiAqL1xuZnVuY3Rpb24gYWRkSW5lcnRTdHlsZShub2RlKSB7XG4gIGlmIChub2RlLnF1ZXJ5U2VsZWN0b3IoJ3N0eWxlI2luZXJ0LXN0eWxlJykpIHtcbiAgICByZXR1cm47XG4gIH1cbiAgY29uc3Qgc3R5bGUgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdzdHlsZScpO1xuICBzdHlsZS5zZXRBdHRyaWJ1dGUoJ2lkJywgJ2luZXJ0LXN0eWxlJyk7XG4gIHN0eWxlLnRleHRDb250ZW50ID0gXCJcXG5cIitcbiAgICAgICAgICAgICAgICAgICAgICBcIltpbmVydF0ge1xcblwiICtcbiAgICAgICAgICAgICAgICAgICAgICBcIiAgcG9pbnRlci1ldmVudHM6IG5vbmU7XFxuXCIgK1xuICAgICAgICAgICAgICAgICAgICAgIFwiICBjdXJzb3I6IGRlZmF1bHQ7XFxuXCIgK1xuICAgICAgICAgICAgICAgICAgICAgIFwifVxcblwiICtcbiAgICAgICAgICAgICAgICAgICAgICBcIlxcblwiICtcbiAgICAgICAgICAgICAgICAgICAgICBcIltpbmVydF0sIFtpbmVydF0gKiB7XFxuXCIgK1xuICAgICAgICAgICAgICAgICAgICAgIFwiICB1c2VyLXNlbGVjdDogbm9uZTtcXG5cIiArXG4gICAgICAgICAgICAgICAgICAgICAgXCIgIC13ZWJraXQtdXNlci1zZWxlY3Q6IG5vbmU7XFxuXCIgK1xuICAgICAgICAgICAgICAgICAgICAgIFwiICAtbW96LXVzZXItc2VsZWN0OiBub25lO1xcblwiICtcbiAgICAgICAgICAgICAgICAgICAgICBcIiAgLW1zLXVzZXItc2VsZWN0OiBub25lO1xcblwiICtcbiAgICAgICAgICAgICAgICAgICAgICBcIiAgb3ZlcmZsb3c6IGhpZGRlbiAhaW1wb3J0YW50O1xcblwiICtcbiAgICAgICAgICAgICAgICAgICAgICBcIiAgdXNlci1tb2RpZnk6IG5vbmUgIWltcG9ydGFudDtcXG5cIiArXG4gICAgICAgICAgICAgICAgICAgICAgXCJ9XFxuXCI7XG4gIG5vZGUuYXBwZW5kQ2hpbGQoc3R5bGUpO1xufVxuXG5jb25zdCBpbmVydE1hbmFnZXIgPSBuZXcgSW5lcnRNYW5hZ2VyKGRvY3VtZW50KTtcblxuT2JqZWN0LmRlZmluZVByb3BlcnR5KEVsZW1lbnQucHJvdG90eXBlLCAnaW5lcnQnLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbigpIHsgcmV0dXJuIHRoaXMuaGFzQXR0cmlidXRlKCdpbmVydCcpOyB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0OiBmdW5jdGlvbihpbmVydCkgeyBpbmVydE1hbmFnZXIuc2V0SW5lcnQodGhpcywgaW5lcnQpIH1cbiAgICAgICAgICAgICAgICAgICAgICB9KTtcblxufSkoZG9jdW1lbnQpO1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 diff --git a/dist/inert.min.js b/dist/inert.min.js index 87bed8a..adb3c82 100644 --- a/dist/inert.min.js +++ b/dist/inert.min.js @@ -1 +1 @@ -"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var r=0;r