]> 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, 9 Jun 2025 01:13:06 +0000 (21:13 -0400)
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 f86e3dac74eaefe29044f591b86888ecc67afae7..0c18534f97e5ffb9f26977e3a87531742bb41c01 100644 (file)
@@ -1933,16 +1933,13 @@ css_error set_libcss_node_data(void *pw, void *node,
        dom_exception err;
 
        /* 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;
 
        err = dom_node_set_user_data((dom_node *)node,
                                        state->interned_userdata_key,
                                        libcss_node_data,
-                                       NULL,
+                                       svgtiny_dom_user_data_handler,
                                        &old_data);
 
        if (err == DOM_NO_MEM_ERR) {