summaryrefslogtreecommitdiff
path: root/content/handlers/html
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2021-02-09 20:29:55 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2021-02-09 20:36:52 +0000
commit9434fe1ff08cb9e009efa9cd434177d91948d12e (patch)
treeaf9960b780e51e60658e42688de4aa20f4e582e6 /content/handlers/html
parent839fb8570a4fb8a31a76605b4614e7384d60f039 (diff)
downloadnetsurf-9434fe1ff08cb9e009efa9cd434177d91948d12e.tar.gz
netsurf-9434fe1ff08cb9e009efa9cd434177d91948d12e.tar.bz2
layout: Pass content into list layout function.
Diffstat (limited to 'content/handlers/html')
-rw-r--r--content/handlers/html/layout.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index ce3fe18ca..8303d7b35 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -4510,9 +4510,7 @@ layout__ordered_list_count(
* Layout list markers.
*/
static void
-layout_lists(struct box *box,
- const struct gui_layout_table *font_func,
- const nscss_len_ctx *len_ctx)
+layout_lists(const html_content *content, struct box *box)
{
struct box *child;
struct box *marker;
@@ -4529,14 +4527,17 @@ layout_lists(struct box *box,
marker->x = -marker->width;
marker->height =
content_get_height(marker->object);
- marker->y = (line_height(len_ctx,
+ marker->y = (line_height(
+ &content->len_ctx,
marker->style) -
marker->height) / 2;
} else if (marker->text) {
if (marker->width == UNKNOWN_WIDTH) {
- font_plot_style_from_css(len_ctx,
- marker->style, &fstyle);
- font_func->width(&fstyle,
+ font_plot_style_from_css(
+ &content->len_ctx,
+ marker->style,
+ &fstyle);
+ content->font_func->width(&fstyle,
marker->text,
marker->length,
&marker->width);
@@ -4544,7 +4545,8 @@ layout_lists(struct box *box,
}
marker->x = -marker->width;
marker->y = 0;
- marker->height = line_height(len_ctx,
+ marker->height = line_height(
+ &content->len_ctx,
marker->style);
} else {
marker->x = 0;
@@ -4555,7 +4557,7 @@ layout_lists(struct box *box,
/* Gap between marker and content */
marker->x -= 4;
}
- layout_lists(child, font_func, len_ctx);
+ layout_lists(content, child);
}
}
@@ -5533,7 +5535,7 @@ bool layout_document(html_content *content, int width, int height)
doc->children->margin[BOTTOM]);
}
- layout_lists(doc, font_func, &content->len_ctx);
+ layout_lists(content, doc);
layout_position_absolute(doc, doc, 0, 0, content);
layout_position_relative(&content->len_ctx, doc, doc, 0, 0);