]> gitweb.michael.orlitzky.com - libsvgtiny.git/commitdiff
src/svgtiny.c: use svgtiny_create_stylesheet() to parse <style>
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 11 Oct 2023 12:41:51 +0000 (08:41 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 20 Nov 2023 01:37:04 +0000 (20:37 -0500)
The new function handles all of the boilerplate parameter creation
that was originally done in svgtiny_parse_style_element().

src/svgtiny.c

index 09adedc66799765c054267ba0c84269fa1e2aa96..a325d9720514cb4e43390ab70484e237c5a40601 100644 (file)
@@ -772,27 +772,10 @@ svgtiny_code svgtiny_parse_style_element(dom_element *style,
                struct svgtiny_parse_state state)
 {
        css_stylesheet *sheet;
-       css_stylesheet_params params;
        css_error code;
        dom_exception exc;
 
-       params.params_version = CSS_STYLESHEET_PARAMS_VERSION_1;
-       params.level = CSS_LEVEL_DEFAULT;
-       params.charset = NULL;
-       params.url = "";
-       params.title = NULL;
-       params.allow_quirks = false;
-       params.inline_style = false;
-       params.resolve = svgtiny_resolve_url;
-       params.resolve_pw = NULL;
-       params.import = NULL;
-       params.import_pw = NULL;
-       params.color = NULL;
-       params.color_pw = NULL;
-       params.font = NULL;
-       params.font_pw = NULL;
-
-       code = css_stylesheet_create(&params, &sheet);
+       code = svgtiny_create_stylesheet(&sheet, false);
        if (code != CSS_OK) {
                return svgtiny_LIBCSS_ERROR;
        }