summaryrefslogtreecommitdiff
path: root/content/handlers/html/layout.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2019-07-30 21:55:29 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2019-07-30 21:55:29 +0100
commit4b6967fee487262d73aca83226647b5d428f5e6d (patch)
tree9063a391d1921b7b89c1ac4fbbaec56e18e3be8b /content/handlers/html/layout.c
parent5ee910ffee2763e75805a61c8e9e69841d0932b0 (diff)
downloadnetsurf-4b6967fee487262d73aca83226647b5d428f5e6d.tar.gz
netsurf-4b6967fee487262d73aca83226647b5d428f5e6d.tar.bz2
Layout: Apply min/max width to replaced elements when width is given.
Diffstat (limited to 'content/handlers/html/layout.c')
-rw-r--r--content/handlers/html/layout.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index f4a1a206f..611c77819 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -220,6 +220,11 @@ layout_get_object_dimensions(struct box *box,
int intrinsic_width = content_get_width(box->object);
int intrinsic_height = content_get_height(box->object);
+ if (min_width > 0 && min_width > *width)
+ *width = min_width;
+ if (max_width >= 0 && max_width < *width)
+ *width = max_width;
+
if (intrinsic_width != 0)
*height = (*width * intrinsic_height) /
intrinsic_width;