From a03b4a3c14768b262547ebc64b12b12f09910eef Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 4 May 2019 12:08:50 +0100 Subject: CSS: Update for change to libcss append sheet API. When appending stylesheets to the selection context, it now takes the media query string associated with the sheet, rather than the type bitfield. TODO: We need to pass all the sheets in, with their full media query string, rather than filtering it ourselves and setting the ones we pass in to "screen". Signed-off-by: Michael Drake --- content/handlers/html/html_css.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'content') diff --git a/content/handlers/html/html_css.c b/content/handlers/html/html_css.c index 7b2d469c4..2a2fde6c6 100644 --- a/content/handlers/html/html_css.c +++ b/content/handlers/html/html_css.c @@ -631,6 +631,9 @@ html_css_new_selection_context(html_content *c, css_select_ctx **ret_select_ctx) css_origin origin = CSS_ORIGIN_AUTHOR; /* Filter out stylesheets for non-screen media. */ + /* TODO: We should probably pass the sheet in anyway, and let + * libcss handle the filtering. + */ if (hsheet->unused) { continue; } @@ -646,10 +649,13 @@ html_css_new_selection_context(html_content *c, css_select_ctx **ret_select_ctx) } if (sheet != NULL) { + /* TODO: Pass the sheet's full media query, instead of + * "screen". + */ css_ret = css_select_ctx_append_sheet(select_ctx, sheet, origin, - CSS_MEDIA_SCREEN); + "screen"); if (css_ret != CSS_OK) { css_select_ctx_destroy(select_ctx); return css_error_to_nserror(css_ret); -- cgit v1.2.3