]> gitweb.michael.orlitzky.com - libsvgtiny.git/commitdiff
src/svgtiny_css.c: use our userdata handler in set_libcss_node_data()
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 17 Oct 2023 21:04:07 +0000 (17:04 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 20 Nov 2023 16:42:58 +0000 (11:42 -0500)
This was a missing part of the implementation that had to wait until
our css_select_handler vtable was defined.

src/svgtiny_css.c

index a5a75214a57239d3bbfb150768dc1611531007ae..075d87d139089d19469050808d085a9888265c11 100644 (file)
@@ -1931,15 +1931,12 @@ css_error set_libcss_node_data(void *pw, void *node,
        void *old_data;
 
        /* A unique "userdata key" (a string) is used to identify this
-        * data. The fourth parameter (NULL) is a "user handler
-        * function." We will eventually have one, but for now we set
-        * it to NULL to avoid a circular reference mess that would
-        * break the build temporarily. */
+        * data. */
        state = (struct svgtiny_parse_state *)pw;
        dom_node_set_user_data((dom_node *)node,
                                state->interned_userdata_key,
                                libcss_node_data,
-                               NULL,
+                               svgtiny_dom_user_data_handler,
                                &old_data);
 
        /* dom_node_set_user_data() always returns DOM_NO_ERR */