From f532648308ced867938d4546aa56e4303c5476f9 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Sat, 5 Apr 2025 01:06:45 +0200 Subject: [PATCH 1/2] fix: Remove also the previously removed polyfills-loader from the webpack config. --- webpack/webpack.config.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/webpack/webpack.config.js b/webpack/webpack.config.js index cd6ce4479..38a0f46f9 100644 --- a/webpack/webpack.config.js +++ b/webpack/webpack.config.js @@ -46,10 +46,6 @@ module.exports = () => { config.plugins.push( new CopyPlugin({ patterns: [ - // Copy polyfills loader to the output path. - // TODO: Polyfills not used anymore, remove for next major version. - { from: path.resolve(__dirname, "../src/polyfills-loader.js") }, - // Build and copy Modernizr. // We're abusing the CopyPlugin transform method here to build // a Modernizr bundle using the modernizr config. The input From 93841bae6ec23f0c2b6eebbe1e0d5444791f699d Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Sat, 5 Apr 2025 01:07:54 +0200 Subject: [PATCH 2/2] maint: Early exit the SubmitEvent.submitter polyfill, if it is already available. --- src/core/polyfills.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/polyfills.js b/src/core/polyfills.js index f1de8a1fa..2ef0afce6 100644 --- a/src/core/polyfills.js +++ b/src/core/polyfills.js @@ -3,8 +3,13 @@ // SubmitEvent.submitter polyfill for Safari < 15.4 and jsDOM // Original code: https://stackoverflow.com/a/61110260/1337474 // Also see: https://caniuse.com/?search=submitter -// +// NOTE: the `submitter` property is now widely available except for ancient browsers and jsDOM. !(function () { + if (window.SubmitEvent && "submitter" in window.SubmitEvent.prototype) { + // `submitter` attribute is already supported. + return; + } + let last_btn = null; const submitable_buttons = `button, input[type="button"], input[type="submit"], input[type="image"]`; document.addEventListener(