diff src/styleengine.hh @ 506:03de2284bfa6

switch to original enum names from dillo-0.8.0-css-3
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Wed, 29 Oct 2008 18:19:19 +0100
parents 00b31843839b
children fd2454cd0120
line wrap: on
line diff
--- a/src/styleengine.hh	Wed Oct 29 17:54:18 2008 +0100
+++ b/src/styleengine.hh	Wed Oct 29 18:19:19 2008 +0100
@@ -3,38 +3,46 @@
 
 #include "dw/core.hh"
 #include "doctree.hh"
+#include "css.hh"
 
 class StyleEngine : public Doctree {
    private:
       class Node : public DoctreeNode {
          public:
             dw::core::style::Style *style;
-
-
       };
 
       lout::misc::SimpleVector <Node> *stack;
 
+      dw::core::style::Style *style0 ();
+
    public:
       StyleEngine ();
       ~StyleEngine ();
    
       /* Doctree interface */
-      const DoctreeNode *top () {
+      inline const DoctreeNode *top () {
          return stack->getRef (stack->size () - 1);
       };
-      const DoctreeNode *parent (const DoctreeNode *n) {
+
+      inline const DoctreeNode *parent (const DoctreeNode *n) {
          if (n->depth > 0)
             return stack->getRef (n->depth - 1);
          else
             return NULL;
       };
 
-      void startElement (int tag, const char *id, const char *klass, const char *style);
+      void startElement (int tag, const char *id, const char *klass,
+         const char *style);
       void endElement (int tag);
+      void setNonCssProperties (CssPropertyList *props);
 
       inline dw::core::style::Style *style () {
-         return stack->getRef (stack->size () - 1)->style;
+         dw::core::style::Style *s = stack->getRef (stack->size () - 1)->style;
+         if (s)
+            return s;
+         else
+            return style0 ();
       };
 };