aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/css.cc3
-rw-r--r--src/css.hh8
-rw-r--r--src/html.cc2
-rw-r--r--src/html_common.hh3
4 files changed, 9 insertions, 7 deletions
diff --git a/src/css.cc b/src/css.cc
index 3aa93c39..af961738 100644
--- a/src/css.cc
+++ b/src/css.cc
@@ -11,8 +11,7 @@
#include "css.hh"
-StyleEngine::StyleEngine (DilloHtml *html) {
- this->html = html;
+StyleEngine::StyleEngine () {
}
StyleEngine::~StyleEngine () {
diff --git a/src/css.hh b/src/css.hh
index 31147db7..02fa06f6 100644
--- a/src/css.hh
+++ b/src/css.hh
@@ -2,19 +2,17 @@
#define __CSS_HH__
#include "dw/core.hh"
-#include "html_common.hh"
class StyleEngine {
private:
- DilloHtml *html;
dw::core::style::Style *currentStyle;
public:
- StyleEngine (DilloHtml *html);
+ StyleEngine ();
~StyleEngine ();
- void startElement (const char *name);
- void endElement (const char *name);
+ void startElement (int tag, const char *id, const char *style);
+ void endElement (int tag);
inline dw::core::style::Style *style () { return currentStyle; };
};
diff --git a/src/html.cc b/src/html.cc
index aaac51d8..e79c7160 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -481,6 +481,8 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url,
stack->getRef(0)->current_bg_color = prefs.bg_color;
stack->getRef(0)->hand_over_break = false;
+ styleEngine = new StyleEngine ();
+
InFlags = IN_NONE;
Stash = dStr_new("");
diff --git a/src/html_common.hh b/src/html_common.hh
index eafbbb2b..b4ecb58d 100644
--- a/src/html_common.hh
+++ b/src/html_common.hh
@@ -13,6 +13,8 @@
#include "form.hh"
+#include "css.hh"
+
/*
* Macros
*/
@@ -174,6 +176,7 @@ public: //BUG: for now everything is public
float DocTypeVersion; /* HTML or XHTML version number */
lout::misc::SimpleVector<DilloHtmlState> *stack;
+ StyleEngine *styleEngine;
int InFlags; /* tracks which elements we are in */