Antoine Guenet de558e5da0 [REF] mass_mailing, web_editor: speed up class to inline conversion
When saving an email, its contents pass through convert_inline to ensure
wide e-mail client compatibility. One phase of that process is the
conversion of classes to inline styles, which involves parsing through
all the styles in all the stylesheets of the document, and matching them
with each element in the DOM. That is an extremely expensive process and
because of that, saving an e-mail can take a very long time depending on
how large the DOM is.
This refactors it for performance gains. Tested on an exaggeratingly big
DOM, what used to take about 12s now takes about 5s.

- The process of parsing through the document's stylesheets is now done
  on opening the email (about 500ms) rather than on saving it so we
  split the processing time between the two.
- When parsing the stylesheets, we now also preprocess them by grouping
  whatever can be grouped together and precomputing the specificity so
  as to sort them appropriately. This has the benefit of considerably
  reducing the number of rules to iterate over for each element (from
  11k+ to 3k+).
- In the process, some things were re-written for improved readability.

X-original-commit: 10e749537186dfb80aee1f2537f3b5804f66cfe5
Part-of: odoo/odoo#81540
2021-12-16 15:58:23 +00:00
2021-10-21 19:09:48 +00:00
2021-10-21 19:09:48 +00:00
…
…
…
2021-11-04 10:21:58 +00:00
2021-10-07 17:59:53 +00:00
2021-12-09 14:36:58 +00:00
2021-10-21 19:09:48 +00:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%