summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2019-05-04 12:08:50 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2019-05-04 14:51:42 +0100
commita03b4a3c14768b262547ebc64b12b12f09910eef (patch)
treec49199a15421f2f0117b220ef194a709fe57766d
parent920d6fa23dcf954a280812feeae4baf02fcaeb57 (diff)
downloadnetsurf-a03b4a3c14768b262547ebc64b12b12f09910eef.tar.gz
netsurf-a03b4a3c14768b262547ebc64b12b12f09910eef.tar.bz2
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 <michael.drake@codethink.co.uk>
-rw-r--r--content/handlers/html/html_css.c8
1 files changed, 7 insertions, 1 deletions
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);