]> gitweb.michael.orlitzky.com - libsvgtiny.git/commitdiff
src/svgtiny.c: use svgtiny_create_stylesheet() to parse <style>
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 7 Jun 2025 14:28:47 +0000 (10:28 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 8 Jun 2025 02:18:20 +0000 (22:18 -0400)
The new function handles all of the boilerplate parameter creation
that was originally done in svgtiny_parse_style_element().

src/svgtiny.c

index f5c818aaf4376e25058ff05b5c0a8a374c1a0f6d..b566768fedb3823737f1b8445ecfebe5a3675201 100644 (file)
@@ -1078,27 +1078,10 @@ static 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;
        }