From 4b6967fee487262d73aca83226647b5d428f5e6d Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 30 Jul 2019 21:55:29 +0100 Subject: [PATCH] Layout: Apply min/max width to replaced elements when width is given. --- content/handlers/html/layout.c | 5 +++++ 1 file changed, 5 insertions(+) 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;