summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_model.js
diff options
context:
space:
mode:
authorSamuel Degueldre <sad@odoo.com>2020-10-06 08:41:53 +0000
committerSamuel Degueldre <sad@odoo.com>2020-10-14 06:52:51 +0000
commit616c78e00e6d2760e1cf3425fc7247792f2ceb61 (patch)
tree91d314f3977d52920e04329e1aa98d092c07a604 /addons/web/static/src/js/views/basic/basic_model.js
parent182fa38d7f28a92e7171c4ee3a42c8f73217b765 (diff)
[FIX] web_editor: fix dimensionless SVGs in media-dialog on firefox
Previously, dimensionless SVGs (SVGs with no intrinsic width or height) were rendered with a width of 0 in the media-dialog on firefox. This is caused by the fact that firefox reports a naturalWidth and naturalHeight of 0 for dimensionless images, which we were relying on to compute the image's aspect ratio. See: https://github.com/whatwg/html/issues/3510#issuecomment-369982529 for more details on the way browsers handle dimensionless images. This commit fixes that by giving the image a width, letting the browser render the image, and reading the height of the rendered image to compute the aspect ratio in the cases where the naturalHeight of the image is 0. task-2345120 closes odoo/odoo#59785 X-original-commit: b59208db376f738a8773d1ec88838af69fa3ef9d Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
0 files changed, 0 insertions, 0 deletions