diff options
| author | qsm-odoo <qsm@odoo.com> | 2019-08-28 12:01:37 +0000 |
|---|---|---|
| committer | fw-bot <otis@odoo.com> | 2019-09-23 13:00:38 +0000 |
| commit | c987515c9fd192d365bffb3bc3c3e8bdfe466645 (patch) | |
| tree | 53e9d22ea9d3c0d62f5eedae1504cd6ee970856c /odoo | |
| parent | 4ec267bf79cd0fe1d88169bb892852410d0ab236 (diff) | |
[FIX] base: support flex-wrap in wkhtmltopdf
As explained here:
https://github.com/odoo/odoo/commit/770aec399c4e6e29cfc5854318cbda19a605315d#diff-3d7991d8bc534e0372f0bd9b4f9165a7R424
we have to post-process the generated css to add some vendor prefixes.
The flex-wrap property was not post-processed yet.
Related to opw-2045424
closes odoo/odoo#37283
X-original-commit: 8c251ec835edb04821cd45087f92756be3d5731f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'odoo')
| -rw-r--r-- | odoo/addons/base/models/assetsbundle.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/odoo/addons/base/models/assetsbundle.py b/odoo/addons/base/models/assetsbundle.py index 4b0cae5d189..5da435ef01c 100644 --- a/odoo/addons/base/models/assetsbundle.py +++ b/odoo/addons/base/models/assetsbundle.py @@ -489,13 +489,15 @@ class AssetsBundle(object): compiled = compiled.strip() # Post process the produced css to add required vendor prefixes here - compiled = re.sub(r'(appearance: (\w+);)', r'-webkit-appearance: \2; -moz-appearance: \2; \1', compiled); - - compiled = re.sub(r'(display: ((?:inline-)?)flex((?: ?!important)?);)', r'display: -webkit-\2box\3; display: -webkit-\2flex\3; \1', compiled) # For PhantomJS tests and wkhtmltopdf - compiled = re.sub(r'(justify-content: flex-(\w+)((?: ?!important)?);)', r'-webkit-box-pack: \2\3; \1', compiled) # For wkhtmltopdf - compiled = re.sub(r'(flex-flow: (\w+ \w+);)', r'-webkit-flex-flow: \2; \1', compiled) # For PhantomJS tests - compiled = re.sub(r'(flex-direction: (column);)', r'-webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: \2; \1', compiled) # For wkhtmltopdf - compiled = re.sub(r'(flex: ((\d)+ \d+ (?:\d+|auto));)', r'-webkit-box-flex: \3; -webkit-flex: \2; \1', compiled) # For PhantomJS tests and wkhtmltopdf + compiled = re.sub(r'(appearance: (\w+);)', r'-webkit-appearance: \2; -moz-appearance: \2; \1', compiled) + + # Most of those are only useful for wkhtmltopdf (some for old PhantomJS) + compiled = re.sub(r'(display: ((?:inline-)?)flex((?: ?!important)?);)', r'display: -webkit-\2box\3; display: -webkit-\2flex\3; \1', compiled) + compiled = re.sub(r'(justify-content: flex-(\w+)((?: ?!important)?);)', r'-webkit-box-pack: \2\3; \1', compiled) + compiled = re.sub(r'(flex-flow: (\w+ \w+);)', r'-webkit-flex-flow: \2; \1', compiled) + compiled = re.sub(r'(flex-direction: (column);)', r'-webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: \2; \1', compiled) + compiled = re.sub(r'(flex-wrap: (\w+);)', r'-webkit-flex-wrap: \2; \1', compiled) + compiled = re.sub(r'(flex: ((\d)+ \d+ (?:\d+|auto));)', r'-webkit-box-flex: \3; -webkit-flex: \2; \1', compiled) return compiled |
