[librsvg] fix CSS selector order.



commit 97f6a12777e3d6ccf83493a89fcda4c745247993
Author: Hiroyuki Ikezoe <poincare ikezoe net>
Date:   Wed Apr 14 15:48:31 2010 +0900

    fix CSS selector order.
    
    Fix for 592207.

 rsvg-styles.c |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/rsvg-styles.c b/rsvg-styles.c
index d455c30..845f741 100644
--- a/rsvg-styles.c
+++ b/rsvg-styles.c
@@ -1296,6 +1296,11 @@ rsvg_parse_style_attrs (RsvgHandle * ctx,
     /* * */
     rsvg_lookup_apply_css_style (ctx, "*", state);
 
+    /* tag */
+    if (tag != NULL) {
+        rsvg_lookup_apply_css_style (ctx, tag, state);
+    }
+
     if (klazz != NULL) {
         i = strlen (klazz);
         while (j < i) {
@@ -1330,24 +1335,20 @@ rsvg_parse_style_attrs (RsvgHandle * ctx,
         }
     }
 
-    /* tag#id */
-    if (tag != NULL && id != NULL && !found) {
-        target = g_strdup_printf ("%s#%s", tag, id);
+    /* #id */
+    if (id != NULL) {
+        target = g_strdup_printf ("#%s", id);
         rsvg_lookup_apply_css_style (ctx, target, state);
         g_free (target);
     }
 
-    /* #id */
-    if (id != NULL && !found) {
-        target = g_strdup_printf ("#%s", id);
-        found = rsvg_lookup_apply_css_style (ctx, target, state);
+    /* tag#id */
+    if (tag != NULL && id != NULL) {
+        target = g_strdup_printf ("%s#%s", tag, id);
+        rsvg_lookup_apply_css_style (ctx, target, state);
         g_free (target);
     }
 
-    /* tag */
-    if (tag != NULL && !found)
-        found = rsvg_lookup_apply_css_style (ctx, tag, state);
-
     if (rsvg_property_bag_size (atts) > 0) {
         const char *value;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]