From 07242c7415bcfb35d3f9f150317b30138664eb2f Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 17 Feb 2019 09:03:19 +0000 Subject: Content: Make the content structure aware of viewport height. It was always aware of viewport width, but since adding support for vh CSS units, the HTML content handler also needs viewport height. Signed-off-by: Michael Drake --- content/content.c | 2 ++ content/content_protected.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'content') diff --git a/content/content.c b/content/content.c index a04051bda..869750100 100644 --- a/content/content.c +++ b/content/content.c @@ -96,6 +96,7 @@ nserror content__init(struct content *c, const content_handler *handler, c->width = 0; c->height = 0; c->available_width = 0; + c->available_height = 0; c->quirks = quirks; c->refresh = 0; nsu_getmonotonic_ms(&c->time); @@ -355,6 +356,7 @@ void content__reformat(struct content *c, bool background, assert(c->locked == false); c->available_width = width; + c->available_height = height; if (c->handler->reformat != NULL) { c->locked = true; diff --git a/content/content_protected.h b/content/content_protected.h index 21b73a662..be277a042 100644 --- a/content/content_protected.h +++ b/content/content_protected.h @@ -113,7 +113,8 @@ struct content { content_status status; /**< Current status. */ int width, height; /**< Dimensions, if applicable. */ - int available_width; /**< Available width (eg window width). */ + int available_width; /**< Viewport width. */ + int available_height; /**< Viewport height. */ bool quirks; /**< Content is in quirks mode */ char *fallback_charset; /**< Fallback charset, or NULL */ -- cgit v1.2.3