diff --git a/core/themes/olivero/js/polyfills.es6.js b/core/themes/olivero/js/polyfills.es6.js deleted file mode 100644 index 4e828889138..00000000000 --- a/core/themes/olivero/js/polyfills.es6.js +++ /dev/null @@ -1,29 +0,0 @@ -/* eslint-disable */ -/** - * From https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Polyfill - * Licensed public domain (CC0). - * @see https://creativecommons.org/publicdomain/zero/1.0/ - * @see https://developer.mozilla.org/en-US/docs/MDN/About - * - * @todo Remove when https://www.drupal.org/node/3143465 is fixed. - */ -if (window.NodeList && !NodeList.prototype.forEach) { - NodeList.prototype.forEach = function (callback, thisArg) { - thisArg = thisArg || window; - for (var i = 0; i < this.length; i++) { - callback.call(thisArg, this[i], i, this); - } - }; -} - -/** - * From https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill - * Licensed public domain (CC0). - * @see https://creativecommons.org/publicdomain/zero/1.0/ - * @see https://developer.mozilla.org/en-US/docs/MDN/About - */ -if (!Element.prototype.matches) { - Element.prototype.matches = - Element.prototype.msMatchesSelector || - Element.prototype.webkitMatchesSelector; -} diff --git a/core/themes/olivero/js/polyfills.js b/core/themes/olivero/js/polyfills.js deleted file mode 100644 index 7b9214c3e9c..00000000000 --- a/core/themes/olivero/js/polyfills.js +++ /dev/null @@ -1,20 +0,0 @@ -/** -* DO NOT EDIT THIS FILE. -* See the following change record for more information, -* https://www.drupal.org/node/2815083 -* @preserve -**/ - -if (window.NodeList && !NodeList.prototype.forEach) { - NodeList.prototype.forEach = function (callback, thisArg) { - thisArg = thisArg || window; - - for (var i = 0; i < this.length; i++) { - callback.call(thisArg, this[i], i, this); - } - }; -} - -if (!Element.prototype.matches) { - Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; -} \ No newline at end of file diff --git a/core/themes/olivero/olivero.libraries.yml b/core/themes/olivero/olivero.libraries.yml index 679f9e2caf7..1dcf8a8dbd4 100644 --- a/core/themes/olivero/olivero.libraries.yml +++ b/core/themes/olivero/olivero.libraries.yml @@ -57,11 +57,12 @@ global-styling: js: js/checkbox.js: {} - js/polyfills.js: {} js/scripts.js: {} js/navigation.js: {} js/second-level-navigation.js: {} dependencies: + - core/drupal.element.matches + - core/drupal.nodelist.foreach - core/drupal book: