[REF] web_editor, mass_mailing: replace use of jQuery in convert_inline

jQuery was used extensively in `convert_inline`, slowing it down by a
factor of more than 2. This replaces all use of jQuery with vanilla
javascript so as to improve performance significantly.

X-original-commit: 8573a4ebbfe951c9ce0d3ef753174f4f0a6c829b
Part-of: odoo/odoo#84513
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
This commit is contained in:
Antoine Guenet
2022-02-14 14:51:26 +00:00
co-authored by Nicolas Bayet
parent 612cd4e092
commit 18fb205c41
2 changed files with 375 additions and 288 deletions
File diff suppressed because it is too large Load Diff
@@ -333,20 +333,18 @@ QUnit.module('convert_inline', {}, function () {
document.body.append($editable[0]);
convertInline.normalizeRem($editable);
assert.strictEqual($editable.html(),
`<div style="font-size: 24px;">` +
`<div class="a" style="color: #000000; padding: 30px" width="100%">` +
`<p style="border: 14.4px #aaaaaa solid; margin: 45.48px;">Test</p>` +
`<div style="font-size: 32px;">` +
`<div class="a" style="color: #000000; padding: 40px" width="100%">` +
`<p style="border: 19.2px #aaaaaa solid; margin: 60.64px;">Test</p>` +
`</div>` +
`</div>`,
"should have converted several rem sizes to px using the default rem size"
);
$editable.remove();
const html = document.createElement('html');
html.style.setProperty('font-size', '20px');
$editable = $(`<div>${testDom}</div>`);
html.append($editable[0]);
convertInline.normalizeRem($editable);
document.body.append($editable[0]);
convertInline.normalizeRem($editable, 20);
assert.strictEqual($editable.html(),
`<div style="font-size: 40px;">` +
`<div class="a" style="color: #000000; padding: 50px" width="100%">` +