From 60ff699678e3b76edf579796505b2ade0f97c8a1 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 4 Oct 2023 08:27:28 -0400 Subject: [PATCH] src/svgtiny_css.c: new file with new svgtiny_resolve_url() function Define a stub relative-URL resolver that assumes all URLs are absolute and returns them unmodified. Some method of doing this is required by libcss. At the moment, libcss does not support any SVG properties that take url() values, so not much is lost. --- src/svgtiny_css.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/svgtiny_css.c diff --git a/src/svgtiny_css.c b/src/svgtiny_css.c new file mode 100644 index 0000000..f112ca3 --- /dev/null +++ b/src/svgtiny_css.c @@ -0,0 +1,21 @@ +#include + +#include "svgtiny.h" +#include "svgtiny_internal.h" + +/** + * Resolve a relative URL to an absolute one by doing nothing. This is + * the simplest possible implementation of a URL resolver, needed for + * parsing CSS. + */ +css_error svgtiny_resolve_url(void *pw, + const char *base, lwc_string *rel, lwc_string **abs) +{ + UNUSED(pw); + UNUSED(base); + + /* Copy the relative URL to the absolute one (the return + value) */ + *abs = lwc_string_ref(rel); + return CSS_OK; +} -- 2.43.2