]> gitweb.michael.orlitzky.com - libsvgtiny.git/commitdiff
src/svgtiny_css.c: implement node_presentational_hint() select handler
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 17 Oct 2023 15:07:33 +0000 (11:07 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 20 Nov 2023 16:42:26 +0000 (11:42 -0500)
src/svgtiny_css.c

index 67f9fcddb48b38dd05baf0ffe2a592b9dc07d17c..f01c3b40df17ca066611aec5a3458c8d6d104bd2 100644 (file)
@@ -57,6 +57,8 @@ static css_error node_is_checked(void *pw, void *node, bool *is_checked);
 static css_error node_is_target(void *pw, void *node, bool *is_target);
 static css_error node_is_lang(void *pw, void *node,
                lwc_string *lang, bool *is_lang);
+static css_error node_presentational_hint(void *pw, void *node,
+               uint32_t *nhints, css_hint **hints);
 static css_error ua_default_for_property(void *pw, uint32_t property,
        css_hint *hint);
 static css_error set_libcss_node_data(void *pw, void *node,
@@ -1771,6 +1773,31 @@ static css_error node_is_lang(void *pw, void *node,
 }
 
 
+/**
+ * Return presentational hints for the given node
+ *
+ * Unless an SVG is being rendered from within an HTML document,
+ * there are no presentational hints. We always return an empty
+ * array (no hints).
+ *
+ * \param pw        Pointer to the current SVG parser state; unused
+ * \param node      Libdom SVG node whose hints we want; unused
+ * \param nhints    How many hints are returned (return by reference)
+ * \param hints     Array of css_hint structures (return by reference)
+ *
+ * \return Always returns CSS_OK
+ */
+css_error node_presentational_hint(void *pw, void *node,
+               uint32_t *nhints, css_hint **hints)
+{
+       UNUSED(pw);
+       UNUSED(node);
+       *nhints = 0;
+       *hints = NULL;
+       return CSS_OK;
+}
+
+
 /**
  * User-agent defaults for CSS properties
  *