From 0495ca05d5fc23c04cc6d80a9beaaee60d33a56d Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Fri, 23 Sep 2022 10:05:49 +0000 Subject: [PATCH] [IMP] web: set width and height of tiny Odoo logo In order to improve the page speed score and avoid layout shift, set both width and height of the tiny Odoo logo used in the copyright section of the website footers. This was able to be done with no drawback: - Set the width and height attribute of the image being loaded - Leave the CSS rule `height: 1em;` - Add the CSS rule `width: auto;` (which was implicit before) By doing this: - Once the image is loaded, the behavior is exactly the same as before - While the image is loading, the height is still using 1em but the difference is that the "auto width" now know the final aspect ratio of the image thanks to the width and height attribute -> the width is thus the same as it will be once the image will be loaded (while it was 0 before) X-original-commit: a709a10e0b746242a6bca1af2ce92020ec917464 Part-of: odoo/odoo#101149 --- addons/web/views/webclient_templates.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/web/views/webclient_templates.xml b/addons/web/views/webclient_templates.xml index a7ea520098a..1052f322177 100644 --- a/addons/web/views/webclient_templates.xml +++ b/addons/web/views/webclient_templates.xml @@ -82,8 +82,9 @@ t-attf-href="http://www.odoo.com?utm_source=db&utm_medium=#{_utm_medium}" class="badge text-bg-light"> Odoo + src="/web/static/img/odoo_logo_tiny.png" + width="62" height="20" + style="width: auto; height: 1em; vertical-align: baseline;"/> Powered by %s%s