From 94553ec1515b41791125ca2382419e989d54f77f Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 22 Apr 2014 16:39:13 +0200 Subject: Parse xml:lang, required for SVG (CSS uses lang) (bzr r13297) --- src/libcroco/cr-sel-eng.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libcroco') diff --git a/src/libcroco/cr-sel-eng.c b/src/libcroco/cr-sel-eng.c index 0eba2b403..4f501ee05 100644 --- a/src/libcroco/cr-sel-eng.c +++ b/src/libcroco/cr-sel-eng.c @@ -136,8 +136,9 @@ lang_pseudo_class_handler (CRSelEng *const a_this, node_iface = PRIVATE(a_this)->node_iface; - if (strqcmp (a_sel->content.pseudo->name->stryng->str, - "lang", 4) + /* "xml:lang" needed for SVG */ + if ( (strqcmp (a_sel->content.pseudo->name->stryng->str, "lang", 4 ) && + (strqcmp (a_sel->content.pseudo->name->stryng->str, "xml:lang", 8 ) ) ) || !a_sel->content.pseudo->type == FUNCTION_PSEUDO) { cr_utils_trace_info ("This handler is for :lang only"); return FALSE; @@ -149,6 +150,7 @@ lang_pseudo_class_handler (CRSelEng *const a_this, return FALSE; for (; node; node = get_next_parent_element_node (node_iface, node)) { char *val = node_iface->getProp (node, "lang"); + if (!val) val = node_iface->getProp (node, "xml:lang"); if (val) { if (!strcasecmp(val, a_sel->content.pseudo->extra->stryng->str)) { result = TRUE; -- cgit v1.2.3