From bca7495bacf9b7a7d3e1fab1cf66dabe8f496bb3 Mon Sep 17 00:00:00 2001 From: desrosj Date: Tue, 7 Feb 2023 16:48:31 +0000 Subject: [PATCH] External Libraries: Update `element-closest`. This updates the `element-closest` polyfill to the latest version, `3.0.2`. Because of changes to how the package is now built and distributed, both files for the library now contain minified code. This library is no longer used by Core itself and maintained as a courtesy. Any projects utilizing it should reevaluate their usage requirements with modern browsers. Props hareesh-pillai, gziolo, mukesh27, costdev. Fixes #52851. Built from https://develop.svn.wordpress.org/trunk@55275 git-svn-id: http://core.svn.wordpress.org/trunk@54808 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../vendor/wp-polyfill-element-closest.js | 34 +------------------ .../vendor/wp-polyfill-element-closest.min.js | 2 +- wp-includes/script-loader.php | 2 +- wp-includes/version.php | 2 +- 4 files changed, 4 insertions(+), 36 deletions(-) diff --git a/wp-includes/js/dist/vendor/wp-polyfill-element-closest.js b/wp-includes/js/dist/vendor/wp-polyfill-element-closest.js index ac49886348..913f9ea194 100644 --- a/wp-includes/js/dist/vendor/wp-polyfill-element-closest.js +++ b/wp-includes/js/dist/vendor/wp-polyfill-element-closest.js @@ -1,33 +1 @@ -// element-closest | CC0-1.0 | github.com/jonathantneal/closest - -(function (ElementProto) { - if (typeof ElementProto.matches !== 'function') { - ElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) { - var element = this; - var elements = (element.document || element.ownerDocument).querySelectorAll(selector); - var index = 0; - - while (elements[index] && elements[index] !== element) { - ++index; - } - - return Boolean(elements[index]); - }; - } - - if (typeof ElementProto.closest !== 'function') { - ElementProto.closest = function closest(selector) { - var element = this; - - while (element && element.nodeType === 1) { - if (element.matches(selector)) { - return element; - } - - element = element.parentNode; - } - - return null; - }; - } -})(window.Element.prototype); +!function(e){var t=e.Element.prototype;"function"!=typeof t.matches&&(t.matches=t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=0;t[o]&&t[o]!==this;)++o;return Boolean(t[o])}),"function"!=typeof t.closest&&(t.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window); diff --git a/wp-includes/js/dist/vendor/wp-polyfill-element-closest.min.js b/wp-includes/js/dist/vendor/wp-polyfill-element-closest.min.js index 4ff4111698..490d8d35cc 100644 --- a/wp-includes/js/dist/vendor/wp-polyfill-element-closest.min.js +++ b/wp-includes/js/dist/vendor/wp-polyfill-element-closest.min.js @@ -1 +1 @@ -!function(e){"function"!=typeof e.matches&&(e.matches=e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=this,o=(t.document||t.ownerDocument).querySelectorAll(e),n=0;o[n]&&o[n]!==t;)++n;return Boolean(o[n])}),"function"!=typeof e.closest&&(e.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window.Element.prototype); \ No newline at end of file +!function(e){var t=window.Element.prototype;"function"!=typeof t.matches&&(t.matches=t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=0;t[o]&&t[o]!==this;)++o;return Boolean(t[o])}),"function"!=typeof t.closest&&(t.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(); \ No newline at end of file diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 359e172a7f..a150dd9474 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -114,7 +114,7 @@ function wp_default_packages_vendor( $scripts ) { 'wp-polyfill-node-contains' => '4.6.0', 'wp-polyfill-url' => '3.6.4', 'wp-polyfill-dom-rect' => '4.6.0', - 'wp-polyfill-element-closest' => '2.0.2', + 'wp-polyfill-element-closest' => '3.0.2', 'wp-polyfill-object-fit' => '2.3.5', 'wp-polyfill-inert' => '3.1.2', 'wp-polyfill' => '3.15.0', diff --git a/wp-includes/version.php b/wp-includes/version.php index 6f23275941..f14cf47193 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-55274'; +$wp_version = '6.2-alpha-55275'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.