From d21fde718a617a566bbd97d4695b51e64650eb99 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..0638376 --- /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. + */ +static 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.49.0