From f9afcf29068750c29dff19c25170f4437b45e991 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Tue, 27 Sep 2022 09:32:20 +0200 Subject: [PATCH 1/3] maint(core parser): Optimize regef for splitting multi-configs by enforcing whitespace around &&. --- src/core/parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/parser.js b/src/core/parser.js index 466c88fb2..0af786883 100644 --- a/src/core/parser.js +++ b/src/core/parser.js @@ -443,7 +443,7 @@ class ArgumentParser { } const _parse = this._parse.bind(this); if (data.match(/&&/)) { - frame = data.split(/\s*&&\s*/).map(_parse); + frame = data.split(/\s+&&\s+/).map(_parse); } else { frame = _parse(data); } From 72c393a6567feef977377793b440f8b81f7742eb Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Tue, 27 Sep 2022 09:34:14 +0200 Subject: [PATCH 2/3] breaking: Remove cant-touch-this class for disabling pattern execution. Use disable-patterns instead. --- src/core/registry.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/registry.js b/src/core/registry.js index 49ce90087..49012ab3e 100644 --- a/src/core/registry.js +++ b/src/core/registry.js @@ -172,10 +172,8 @@ const registry = { return ( !el.matches(".disable-patterns") && !el?.parentNode?.closest?.(".disable-patterns") && - !el?.parentNode?.closest?.("pre") && - !el?.parentNode?.closest?.("template") && // NOTE: not strictly necessary. Template is a DocumentFragment and not reachable except for IE. - !el.matches(".cant-touch-this") && // BBB. TODO: Remove with next major version. - !el?.parentNode?.closest?.(".cant-touch-this") // BBB. TODO: Remove with next major version. + !el?.parentNode?.closest?.("pre") + //!el?.parentNode?.closest?.("template") && // NOTE: not strictly necessary. Template is a DocumentFragment and not reachable except for IE. ); }); From 927b3befbdbff80108f99cc4bdea4de5c999660b Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Tue, 27 Sep 2022 09:43:00 +0200 Subject: [PATCH 3/3] breaking: Remove remaining IE support code. --- src/pat/inject/inject.js | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/pat/inject/inject.js b/src/pat/inject/inject.js index ee2d3acb0..0d2651bc0 100644 --- a/src/pat/inject/inject.js +++ b/src/pat/inject/inject.js @@ -416,25 +416,6 @@ const inject = { return $target; }, - stopBubblingFromRemovedElement($el, cfgs, ev) { - /* IE8 fix. Stop event from propagating IF $el will be removed - * from the DOM. With pat-inject, often $el is the target that - * will itself be replaced with injected content. - * - * IE8 cannot handle events bubbling up from an element removed - * from the DOM. - * - * See: http://stackoverflow.com/questions/7114368/why-is-jquery-remove-throwing-attr-exception-in-ie8 - */ - for (const cfg of cfgs) { - const sel = cfg.target; - if ($el.parents(sel).addBack(sel) && !ev.isPropagationStopped()) { - ev.stopPropagation(); - return; - } - } - }, - _performInjection(target, $el, $source, cfg, trigger, title) { /* Called after the XHR has succeeded and we have a new $source * element to inject. @@ -442,13 +423,7 @@ const inject = { if (cfg.sourceMod === "content") { $source = $source.contents(); } - let $src; - // $source.clone() does not work with shived elements in IE8 - if (document.all && document.querySelector && !document.addEventListener) { - $src = $source.map((idx, el) => $(el.outerHTML)[0]); - } else { - $src = $source.safeClone(); - } + const $src = $source.safeClone(); $src.findInclusive("img").on("load", (e) => { $(e.currentTarget).trigger("pat-inject-content-loaded"); @@ -491,7 +466,6 @@ const inject = { */ $injected .filter((idx, el_) => { - // setting data on textnode fails in IE8 return el_.nodeType !== TEXT_NODE; }) .data("pat-injected", { origin: cfg.url }); @@ -591,7 +565,6 @@ const inject = { $.each(cfgs[0].hooks || [], (idx, hook) => $el.trigger("pat-inject-hook-" + hook) ); - this.stopBubblingFromRemovedElement($el, cfgs, ev); const sources$ = await this.callTypeHandler(cfgs[0].dataType, "sources", $el, [ cfgs, data,