diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2018-01-03 23:58:18 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2018-01-05 13:49:51 +0000 |
commit | 6be6fa1b2197ffe6e511c5eff9abe14d883f8478 (patch) | |
tree | 6059c45898a74fe06300f73f4cd75b3571fd2c75 /render/html.c | |
parent | a67973f312b7cba8a6d56f9841a542a731a9ddb4 (diff) | |
download | netsurf-6be6fa1b2197ffe6e511c5eff9abe14d883f8478.tar.gz netsurf-6be6fa1b2197ffe6e511c5eff9abe14d883f8478.tar.bz2 |
CSS utils: Handle new units in length conversion routines.
This causes a ripple effect of all the callsites needing
information they didn't have.
Diffstat (limited to 'render/html.c')
-rw-r--r-- | render/html.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/render/html.c b/render/html.c index 3cfc5e236..b7d7aa313 100644 --- a/render/html.c +++ b/render/html.c @@ -1398,6 +1398,10 @@ static void html_reformat(struct content *c, int width, int height) htmlc->reflowing = true; + htmlc->len_ctx.vw = width; + htmlc->len_ctx.vh = height; + htmlc->len_ctx.root_style = htmlc->layout->style; + layout_document(htmlc, width, height); layout = htmlc->layout; @@ -1647,7 +1651,7 @@ html_open(struct content *c, html->drag_owner.no_owner = true; /* text selection */ - selection_init(&html->sel, html->layout); + selection_init(&html->sel, html->layout, &html->len_ctx); html->selection_type = HTML_SELECTION_NONE; html->selection_owner.none = true; @@ -1768,7 +1772,8 @@ html_get_contextual_content(struct content *c, int x, int y, struct box *next; int box_x = 0, box_y = 0; - while ((next = box_at_point(box, x, y, &box_x, &box_y)) != NULL) { + while ((next = box_at_point(&html->len_ctx, box, x, y, + &box_x, &box_y)) != NULL) { box = next; /* hidden boxes are ignored */ @@ -1845,7 +1850,8 @@ html_scroll_at_point(struct content *c, int x, int y, int scrx, int scry) /* TODO: invert order; visit deepest box first */ - while ((next = box_at_point(box, x, y, &box_x, &box_y)) != NULL) { + while ((next = box_at_point(&html->len_ctx, box, x, y, + &box_x, &box_y)) != NULL) { box = next; if (box->style && css_computed_visibility(box->style) == @@ -1987,7 +1993,8 @@ static bool html_drop_file_at_point(struct content *c, int x, int y, char *file) int box_x = 0, box_y = 0; /* Scan box tree for boxes that can handle drop */ - while ((next = box_at_point(box, x, y, &box_x, &box_y)) != NULL) { + while ((next = box_at_point(&html->len_ctx, box, x, y, + &box_x, &box_y)) != NULL) { box = next; if (box->style && css_computed_visibility(box->style) == |