1 #include <libcss/libcss.h>
4 #include "svgtiny_internal.h"
7 * Resolve a relative URL to an absolute one by doing nothing. This is
8 * the simplest possible implementation of a URL resolver, needed for
11 css_error
svgtiny_resolve_url(void *pw
,
12 const char *base
, lwc_string
*rel
, lwc_string
**abs
)
17 /* Copy the relative URL to the absolute one (the return
19 *abs
= lwc_string_ref(rel
);
24 * Create a stylesheet with the default set of params.
26 * \param sheet A stylesheet pointer, passed in by reference, that
27 * we use to store the newly-created stylesheet.
28 * \param inline_style True if this stylesheet represents an inline
29 * style, and false otherwise.
31 * \return The return value from css_stylesheet_create() is returned.
33 css_error
svgtiny_create_stylesheet(css_stylesheet
**sheet
,
36 css_stylesheet_params params
;
38 params
.params_version
= CSS_STYLESHEET_PARAMS_VERSION_1
;
39 params
.level
= CSS_LEVEL_DEFAULT
;
40 params
.charset
= NULL
;
43 params
.allow_quirks
= false;
44 params
.inline_style
= inline_style
;
45 params
.resolve
= svgtiny_resolve_url
;
46 params
.resolve_pw
= NULL
;
48 params
.import_pw
= NULL
;
50 params
.color_pw
= NULL
;
52 params
.font_pw
= NULL
;
54 return css_stylesheet_create(¶ms
, sheet
);