summaryrefslogtreecommitdiff
path: root/content/handlers/html/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'content/handlers/html/html.c')
-rw-r--r--content/handlers/html/html.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 6fe45adca..4443d2ee5 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -570,6 +570,25 @@ static bool html_process_img(html_content *c, dom_node *node)
return success;
}
+static void html_get_dimensions(html_content *htmlc)
+{
+ unsigned w;
+ unsigned h;
+ union content_msg_data msg_data = {
+ .getdims = {
+ .viewport_width = &w,
+ .viewport_height = &h,
+ },
+ };
+
+ content_broadcast(&htmlc->base, CONTENT_MSG_GETDIMS, &msg_data);
+
+ htmlc->media.width.value = INTTOFIX(w);
+ htmlc->media.width.unit = CSS_UNIT_PX;
+ htmlc->media.height.value = INTTOFIX(h);
+ htmlc->media.height.unit = CSS_UNIT_PX;
+}
+
/* exported function documented in html/html_internal.h */
void html_finish_conversion(html_content *htmlc)
{
@@ -632,6 +651,8 @@ void html_finish_conversion(html_content *htmlc)
return;
}
+ html_get_dimensions(htmlc);
+
error = dom_to_box(html, htmlc, html_box_convert_done);
if (error != NSERROR_OK) {
NSLOG(netsurf, INFO, "box conversion failed");