changeset 536:c0af24cdb695

set CSS pseudo class in Html_tag_open_a()
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Sat, 08 Nov 2008 15:59:56 +0100
parents 6428b62b5a24
children e4c115c29a99
files src/doctree.hh src/html.cc src/styleengine.hh
diffstat 3 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/doctree.hh	Sat Nov 08 15:56:28 2008 +0100
+++ b/src/doctree.hh	Sat Nov 08 15:59:56 2008 +0100
@@ -6,6 +6,7 @@
       int depth;
       int tag;
       const char *klass;
+      const char *pseudoClass;
       const char *id;
 };
 
--- a/src/html.cc	Sat Nov 08 15:56:28 2008 +0100
+++ b/src/html.cc	Sat Nov 08 15:59:56 2008 +0100
@@ -2470,6 +2470,13 @@
       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);
    }
--- a/src/styleengine.hh	Sat Nov 08 15:56:28 2008 +0100
+++ b/src/styleengine.hh	Sat Nov 08 15:59:56 2008 +0100
@@ -40,6 +40,7 @@
          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;