diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-12-14 22:21:18 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-12-14 22:21:18 +0100 |
commit | c0c441dc39e215f94c1cc04b2a20eabb141bbce4 (patch) | |
tree | 423a1dd3c4e636b5d5798880e2069e68502d132a /src/styleengine.cc | |
parent | bdd5c393602dd2f49fb71e33f5e643175a000727 (diff) |
inherit pseudo classes "link" and "visited"
Diffstat (limited to 'src/styleengine.cc')
-rw-r--r-- | src/styleengine.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc index 3f1df608..a4a59173 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -39,6 +39,7 @@ StyleEngine::StyleEngine (dw::core::Layout *layout) { style_attrs.backgroundColor = Color::create (layout, 0xffffff); n->style = Style::create (layout, &style_attrs); + n->pseudo = NULL; } StyleEngine::~StyleEngine () { @@ -64,7 +65,7 @@ void StyleEngine::startElement (int element) { n->element = element; n->id = NULL; n->klass = NULL; - n->pseudo = NULL; + n->pseudo = stack->getRef (stack->size () - 2)->pseudo; // inherit pseudo n->styleAttribute = NULL; n->inheritBackgroundColor = false; } @@ -108,12 +109,19 @@ void StyleEngine::inheritBackgroundColor () { } /** - * \brief set the CSS pseudo class (e.g. "link", "visited"). + * \brief set the CSS pseudo class :link. + */ +void StyleEngine::setPseudoLink () { + Node *n = stack->getRef (stack->size () - 1); + n->pseudo = "link"; +} + +/** + * \brief set the CSS pseudo class :visited. */ -void StyleEngine::setPseudo (const char *pseudo) { +void StyleEngine::setPseudoVisited () { Node *n = stack->getRef (stack->size () - 1); - assert (n->pseudo == NULL); - n->pseudo = dStrdup (pseudo); + n->pseudo = "visited"; } /** |