Commit 24e69c2d authored by Dom Lachowicz's avatar Dom Lachowicz

Add support for the CSS @import directive. Probably isn't 100% conformant,

	* rsvg-styles.c: Add support for the CSS @import directive. Probably isn't 100%
	conformant, but probably better than not doing it at all.
parent 202ec63c
......@@ -3,6 +3,9 @@
* rsvg-base.c: Handle system, public, and unparsed entity declarations
better. Probably not 100% conformant, but probably better than not
doing it at all.
* rsvg-styles.c: Add support for the CSS @import directive. Probably isn't 100%
conformant, but probably better than not doing it at all.
2006-04-27 Dom Lachowicz <cinamod@hotmail.com>
......
......@@ -946,12 +946,19 @@ ccss_unrecoverable_error (CRDocHandler *a_handler)
g_warning (_("CSS unrecoverable error\n"));
}
static void
ccss_import_style (CRDocHandler *a_this,
GList *a_media_list,
CRString *a_uri,
CRString *a_uri_default_ns,
CRParsingLocation *a_location);
static void
init_sac_handler (CRDocHandler *a_handler)
{
a_handler->start_document = NULL;
a_handler->end_document = NULL;
a_handler->import_style = NULL;
a_handler->import_style = ccss_import_style;
a_handler->namespace_declaration = NULL;
a_handler->comment = NULL;
a_handler->start_selector = ccss_start_selector;
......@@ -999,6 +1006,28 @@ rsvg_real_parse_cssbuffer (RsvgHandle *ctx, const char * buff, size_t buflen)
cr_parser_destroy (parser);
}
static void
ccss_import_style (CRDocHandler *a_this,
GList *a_media_list,
CRString *a_uri,
CRString *a_uri_default_ns,
CRParsingLocation *a_location)
{
if (a_uri) {
GByteArray * stylesheet_data;
CSSUserData * user_data;
user_data = (CSSUserData *)a_this->app_data;
stylesheet_data = _rsvg_acquire_xlink_href_resource((gchar*) cr_string_peek_raw_str (a_uri),
rsvg_handle_get_base_uri(user_data->ctx), NULL);
if (stylesheet_data) {
rsvg_real_parse_cssbuffer (user_data->ctx, stylesheet_data->data, stylesheet_data->len);
g_byte_array_free (stylesheet_data, TRUE);
}
}
}
#else /* !HAVE_LIBCROCO */
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment