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>
This commit is contained in:
Michael Drake 2019-05-04 12:08:50 +01:00
parent 920d6fa23d
commit a03b4a3c14
1 changed files with 7 additions and 1 deletions

View File

@ -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);