diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-10-29 18:19:19 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-10-29 18:19:19 +0100 |
commit | 5dced3f80dcb2a89965479bff09fb6c36f05a15e (patch) | |
tree | 3051917da96352955e9e7b4430feb417ed73c8a7 /src/styleengine.hh | |
parent | 722744ea0c466a212debbd86f8faefeace0d1cdb (diff) |
switch to original enum names from dillo-0.8.0-css-3
Diffstat (limited to 'src/styleengine.hh')
-rw-r--r-- | src/styleengine.hh | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/styleengine.hh b/src/styleengine.hh index 94792250..97d6c8ae 100644 --- a/src/styleengine.hh +++ b/src/styleengine.hh @@ -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 (); }; }; |