]> mj.ucw.cz Git - leo.git/blobdiff - css.c
TODO
[leo.git] / css.c
diff --git a/css.c b/css.c
index 38464aaa6fca475145736939c8914060d0730832..c05fae77a2210f12846b917291bb710691e2ebab 100644 (file)
--- a/css.c
+++ b/css.c
@@ -1,12 +1,13 @@
 /*
  *     Hic Est Leo -- MapCSS Stylesheets
  *
- *     (c) 2014 Martin Mares <mj@ucw.cz>
+ *     (c) 2014--2015 Martin Mares <mj@ucw.cz>
  */
 
 #include "leo.h"
 #include "style.h"
 #include "css.h"
+#include "expr.h"
 
 #include <ucw/mempool.h>
 
@@ -44,7 +45,16 @@ void css_dump_selector(struct css_selector *s)
 void css_dump_action(struct css_action *a)
 {
   printf("\tAction: ");
-  style_dump_prop(&a->prop);
+  switch (a->type)
+    {
+    case CSS_ACTION_SET:
+      style_dump_prop(&a->prop);
+      break;
+    case CSS_ACTION_EXPR:
+      printf("<expr>\n");
+    default:
+      ASSERT(0);
+    }
 }
 
 static bool css_match_condition(struct css_condition *c, struct osm_object *o)
@@ -150,7 +160,17 @@ static bool css_match_selector(struct css_selector *s, struct style_results *r)
 
 static void css_apply_action(struct css_action *sa, struct style_results *r, layer_t layer)
 {
-  style_set_by_layer(r, layer, &sa->prop);
+  switch (sa->type)
+    {
+    case CSS_ACTION_SET:
+      style_set_by_layer(r, layer, &sa->prop);
+      break;
+    case CSS_ACTION_EXPR:
+      expr_execute(sa, r, layer);
+      break;
+    default:
+      ASSERT(0);
+    }
 }
 
 void css_apply(struct css_sheet *ss, struct style_results *r)