diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-11-08 15:59:56 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-11-08 15:59:56 +0100 |
commit | eeef7a21f456f7b3e766e9cb782f29a1f43d64b3 (patch) | |
tree | 8aca653a279cf8ef7db6708e31e3665cc6679ed9 /src | |
parent | 4391a4ec4043ebc417390214cd226a980db9df38 (diff) |
set CSS pseudo class in Html_tag_open_a()
Diffstat (limited to 'src')
-rw-r--r-- | src/doctree.hh | 1 | ||||
-rw-r--r-- | src/html.cc | 7 | ||||
-rw-r--r-- | src/styleengine.hh | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/doctree.hh b/src/doctree.hh index 92960422..5533d136 100644 --- a/src/doctree.hh +++ b/src/doctree.hh @@ -6,6 +6,7 @@ class DoctreeNode { int depth; int tag; const char *klass; + const char *pseudoClass; const char *id; }; diff --git a/src/html.cc b/src/html.cc index e840b46c..fcc769d0 100644 --- a/src/html.cc +++ b/src/html.cc @@ -2470,6 +2470,13 @@ static void Html_tag_open_a(DilloHtml *html, const char *tag, int tagsize) url = a_Html_url_new(html, attrbuf, NULL, 0); dReturn_if_fail ( url != NULL ); + if (a_Capi_get_flags(url) & CAPI_IsCached) { + html->InVisitedLink = true; + html->styleEngine->setPseudoClass ("visited"); + } else { + html->styleEngine->setPseudoClass ("link"); + } + props.set (CssProperty::PROPERTY_X_LINK, Html_set_new_link(html, &url)); html->styleEngine->setNonCssProperties (&props); } diff --git a/src/styleengine.hh b/src/styleengine.hh index 218d874b..76ca226c 100644 --- a/src/styleengine.hh +++ b/src/styleengine.hh @@ -40,6 +40,7 @@ class StyleEngine : public Doctree { const char *style); void endElement (int tag); void setNonCssProperties (CssPropertyList *props); + void setPseudoClass (const char *pseudoClass); inline dw::core::style::Style *style () { dw::core::style::Style *s = stack->getRef (stack->size () - 1)->style; |