changeset 518:52394e6577ba

add link support
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Thu, 30 Oct 2008 18:24:26 +0100
parents e7f61bc1108c
children ca0b92b40dfc
files src/html.cc src/styleengine.cc
diffstat 2 files changed, 12 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/src/html.cc	Thu Oct 30 18:16:02 2008 +0100
+++ b/src/html.cc	Thu Oct 30 18:24:26 2008 +0100
@@ -2463,9 +2463,9 @@
  */
 static void Html_tag_open_a(DilloHtml *html, const char *tag, int tagsize)
 {
-   StyleAttrs style_attrs;
-   Style *old_style;
    DilloUrl *url;
+   CssPropertyList *props;
+   CssProperty::Value propValue;
    const char *attrbuf;
 
    /* TODO: add support for MAP with A HREF */
@@ -2480,28 +2480,10 @@
       url = a_Html_url_new(html, attrbuf, NULL, 0);
       dReturn_if_fail ( url != NULL );
 
-      old_style = html->styleEngine->style ();
-      style_attrs = *old_style;
-
-      if (a_Capi_get_flags(url) & CAPI_IsCached) {
-         html->InVisitedLink = true;
-         style_attrs.color = Color::createSimple (
-            HT2LT(html),
-            html->visited_color
-/*
-            a_Color_vc(html->visited_color,
-                       html->styleEngine->style ()->color->getColor(),
-                       html->link_color,
-                       S_TOP(html)->current_bg_color),
-*/
-            );
-      }
-
-      style_attrs.x_link = Html_set_new_link(html, &url);
-
-//      html->styleEngine->style () =
-//         Style::create (HT2LT(html), &style_attrs);
-//      old_style->unref ();
+      props = new CssPropertyList ();
+      propValue.x_link = Html_set_new_link(html, &url);
+      props->set (CssProperty::PROPERTY_X_LINK, propValue);
+      html->styleEngine->setNonCssProperties (props);
    }
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "name"))) {
--- a/src/styleengine.cc	Thu Oct 30 18:16:02 2008 +0100
+++ b/src/styleengine.cc	Thu Oct 30 18:24:26 2008 +0100
@@ -113,6 +113,12 @@
          case CssProperty::CSS_PROPERTY_TEXT_DECORATION:
             attrs->textDecoration |= p->value.textDecoration;
             break;
+         case CssProperty::PROPERTY_X_LINK:
+            attrs->x_link = p->value.x_link;
+            break;
+         case CssProperty::PROPERTY_X_IMG:
+            attrs->x_img = p->value.x_img;
+            break;
 
          default:
             break;