changeset 1733:f39cfc38ea10

rework nonCssHints API of StyleEngine * Instead of passing the nonCssHints as a CssPropertyList, set the hints separately and create the list in StyleEngine. * The CssPropertyList holding the nonCssHints is now completely managed by StyleEngine and kept on the stack. * Replace the table_cell_props mechanic in html.cc/table.cc with a new method inheritNonCssHints() in StyleEngine.
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Mon, 11 Oct 2010 21:35:53 +0200
parents 3e3630a58627
children 90feb0de4310
files src/css.hh src/form.cc src/html.cc src/html_common.hh src/styleengine.cc src/styleengine.hh src/table.cc
diffstat 7 files changed, 220 insertions(+), 244 deletions(-) [+]
line wrap: on
line diff
--- a/src/css.hh	Mon Oct 11 18:23:33 2010 +0200
+++ b/src/css.hh	Mon Oct 11 21:35:53 2010 +0200
@@ -313,16 +313,6 @@
 
       void set (CssPropertyName name, CssValueType type,
                 CssPropertyValue value);
-      inline void set (CssPropertyName name, CssValueType type, char *value) {
-         CssPropertyValue v;
-         v.strVal = value;
-         set (name, type, v);
-      };
-      inline void set (CssPropertyName name, CssValueType type, int value) {
-         CssPropertyValue v;
-         v.intVal = value;
-         set (name, type, v);
-      };
       void apply (CssPropertyList *props);
       void print ();
       inline void ref () { refCount++; }
--- a/src/form.cc	Mon Oct 11 18:23:33 2010 +0200
+++ b/src/form.cc	Mon Oct 11 21:35:53 2010 +0200
@@ -554,12 +554,9 @@
       }
       if (prefs.show_tooltip &&
           (attrbuf = a_Html_get_attr(html, tag, tagsize, "title"))) {
-         CssPropertyList props;
-         char *tooltip_str = dStrdup(attrbuf);
 
-         props.set (PROPERTY_X_TOOLTIP, CSS_TYPE_STRING, tooltip_str);
-         html->styleEngine->setNonCssHints (&props);
-         dFree(tooltip_str);
+         html->styleEngine->setNonCssHint (PROPERTY_X_TOOLTIP, CSS_TYPE_STRING,
+                                           attrbuf);
       }
       HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle());
    }
--- a/src/html.cc	Mon Oct 11 18:23:33 2010 +0200
+++ b/src/html.cc	Mon Oct 11 21:35:53 2010 +0200
@@ -304,9 +304,7 @@
  * Evaluates the ALIGN attribute (left|center|right|justify) and
  * sets the style at the top of the stack.
  */
-void a_Html_tag_set_align_attr(DilloHtml *html,
-                               CssPropertyList *props,
-                               const char *tag, int tagsize)
+void a_Html_tag_set_align_attr(DilloHtml *html, const char *tag, int tagsize)
 {
    const char *align;
 
@@ -339,7 +337,8 @@
             style_attrs.textAlignChar = '.';
       }
 #endif
-      props->set (CSS_PROPERTY_TEXT_ALIGN, CSS_TYPE_ENUM, textAlignType);
+      html->styleEngine->setNonCssHint(CSS_PROPERTY_TEXT_ALIGN, CSS_TYPE_ENUM,
+                                       textAlignType);
    }
 }
 
@@ -347,8 +346,7 @@
  * Evaluates the VALIGN attribute (top|bottom|middle|baseline) and
  * sets the style in style_attrs. Returns true when set.
  */
-bool a_Html_tag_set_valign_attr(DilloHtml *html, const char *tag,
-                                int tagsize, CssPropertyList *props)
+bool a_Html_tag_set_valign_attr(DilloHtml *html, const char *tag, int tagsize)
 {
    const char *attr;
    VAlignType valign;
@@ -363,7 +361,8 @@
       else
          valign = VALIGN_MIDDLE;
 
-      props->set (CSS_PROPERTY_VERTICAL_ALIGN, CSS_TYPE_ENUM, valign);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_VERTICAL_ALIGN,
+                                        CSS_TYPE_ENUM, valign);
       return true;
    } else
       return false;
@@ -427,7 +426,6 @@
 
    stack = new misc::SimpleVector <DilloHtmlState> (16);
    stack->increase();
-   stack->getRef(0)->table_cell_props = NULL;
    stack->getRef(0)->parse_mode = DILLO_HTML_PARSE_MODE_INIT;
    stack->getRef(0)->table_mode = DILLO_HTML_TABLE_MODE_NONE;
    stack->getRef(0)->cell_text_align_set = false;
@@ -580,9 +578,6 @@
  */
 void DilloHtml::freeParseData()
 {
-   for (int i = stack->size () - 1; i >= 0; i--)
-      if (stack->getRef (i)->table_cell_props)
-         stack->getRef (i)->table_cell_props->unref ();
    delete(stack);
 
    dStr_free(Stash, TRUE);
@@ -1278,8 +1273,6 @@
     * instead of copying all fields except for tag.  --Jcid */
    *html->stack->getRef(n_items) = *html->stack->getRef(n_items - 1);
    html->stack->getRef(n_items)->tag_idx = tag_idx;
-   if (S_TOP(html)->table_cell_props)
-      S_TOP(html)->table_cell_props->ref ();
    html->dw = S_TOP(html)->textblock;
 }
 
@@ -1301,8 +1294,6 @@
    bool hand_over_break;
 
    html->styleEngine->endElement (S_TOP(html)->tag_idx);
-   if (S_TOP(html)->table_cell_props)
-      S_TOP(html)->table_cell_props->unref ();
    hand_over_break = S_TOP(html)->hand_over_break;
    html->stack->setSize (html->stack->size() - 1);
    Html_eventually_pop_dw(html, hand_over_break);
@@ -1722,7 +1713,6 @@
 {
    const char *attrbuf;
    Textblock *textblock;
-   CssPropertyList props;
    int32_t color;
    int tag_index_a = a_Html_tag_index ("a");
 
@@ -1744,13 +1734,15 @@
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "bgcolor"))) {
       color = a_Html_color_parse(html, attrbuf, -1);
       if (color != -1)
-         props.set (CSS_PROPERTY_BACKGROUND_COLOR, CSS_TYPE_COLOR, color);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_BACKGROUND_COLOR,
+                                           CSS_TYPE_COLOR, color);
    }
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "text"))) {
       color = a_Html_color_parse(html, attrbuf, -1);
       if (color != -1)
-         props.set (CSS_PROPERTY_COLOR, CSS_TYPE_COLOR, color);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_COLOR,
+                                           CSS_TYPE_COLOR, color);
    }
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "link")))
@@ -1759,7 +1751,6 @@
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "vlink")))
       html->non_css_visited_color = a_Html_color_parse(html, attrbuf, -1);
 
-   html->styleEngine->setNonCssHints (&props);
    html->dw->setStyle (html->styleEngine->style ());
 
    /* Determine a color for visited links.
@@ -1771,10 +1762,8 @@
    html->styleEngine->startElement (tag_index_a);
    html->styleEngine->setPseudoVisited ();
    if (html->non_css_visited_color != -1) {
-      CssPropertyList vprops;
-      vprops.set (CSS_PROPERTY_COLOR, CSS_TYPE_COLOR,
-                 html->non_css_visited_color);
-      html->styleEngine->setNonCssHints (&vprops);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_COLOR, CSS_TYPE_COLOR,
+                                        html->non_css_visited_color);
    }
    html->visited_color = html->styleEngine->style ()->color->getColor ();
    html->styleEngine->endElement (tag_index_a);
@@ -1811,9 +1800,8 @@
 {
    CssPropertyList props;
 
-   a_Html_tag_set_align_attr (html, &props, tag, tagsize);
+   a_Html_tag_set_align_attr (html, tag, tagsize);
    html->styleEngine->inheritBackgroundColor ();
-   html->styleEngine->setNonCssHints (&props);
    HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
 }
 
@@ -1849,8 +1837,8 @@
       html->styleEngine->setPseudoLink ();
    }
 
-   props.set (PROPERTY_X_LINK, CSS_TYPE_INTEGER, Html_set_new_link(html,&url));
-   html->styleEngine->setNonCssHints (&props);
+   html->styleEngine->setNonCssHint (PROPERTY_X_LINK, CSS_TYPE_INTEGER,
+                                     Html_set_new_link(html,&url));
 
    textblock->addParbreak (5, html->styleEngine->wordStyle ());
 
@@ -1896,12 +1884,8 @@
  */
 static void Html_tag_open_h(DilloHtml *html, const char *tag, int tagsize)
 {
-   CssPropertyList props;
-
-
    html->styleEngine->inheritBackgroundColor ();
-   a_Html_tag_set_align_attr (html, &props, tag, tagsize);
-   html->styleEngine->setNonCssHints (&props);
+   a_Html_tag_set_align_attr (html, tag, tagsize);
 
    HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
 
@@ -1926,7 +1910,6 @@
    const char *attrbuf;
    char *fontFamily = NULL;
    int32_t color;
-   CssPropertyList props;
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "color"))) {
       if (prefs.contrast_visited_color && html->InVisitedLink) {
@@ -1936,15 +1919,16 @@
          color = a_Html_color_parse(html, attrbuf, -1);
       }
       if (color != -1)
-         props.set (CSS_PROPERTY_COLOR, CSS_TYPE_COLOR, color);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_COLOR,
+                                           CSS_TYPE_COLOR, color);
    }
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "face"))) {
       fontFamily = dStrdup(attrbuf);
-      props.set (CSS_PROPERTY_FONT_FAMILY, CSS_TYPE_SYMBOL, fontFamily);
+       html->styleEngine->setNonCssHint (CSS_PROPERTY_FONT_FAMILY,
+                                         CSS_TYPE_SYMBOL, fontFamily);
    }
 
-   html->styleEngine->setNonCssHints (&props);
    dFree(fontFamily);
 }
 
@@ -1959,12 +1943,9 @@
 
    if (prefs.show_tooltip &&
        (attrbuf = a_Html_get_attr(html, tag, tagsize, "title"))) {
-      CssPropertyList props;
-      char *tooltip_str = dStrdup(attrbuf);
-
-      props.set (PROPERTY_X_TOOLTIP, CSS_TYPE_STRING, tooltip_str);
-      html->styleEngine->setNonCssHints (&props);
-      dFree(tooltip_str);
+
+      html->styleEngine->setNonCssHint (PROPERTY_X_TOOLTIP, CSS_TYPE_STRING,
+                                        attrbuf);
    }
 }
 
@@ -2008,13 +1989,11 @@
    CssLength l_h  = CSS_CREATE_LENGTH(0.0, CSS_LENGTH_TYPE_AUTO);
    int space, border, w = 0, h = 0;
    bool load_now;
-   CssPropertyList props;
-   char *tooltip_str = NULL;
 
    if (prefs.show_tooltip &&
        (attrbuf = a_Html_get_attr(html, tag, tagsize, "title"))) {
-      tooltip_str = dStrdup(attrbuf);
-      props.set (PROPERTY_X_TOOLTIP, CSS_TYPE_STRING, tooltip_str);
+      html->styleEngine->setNonCssHint(PROPERTY_X_TOOLTIP, CSS_TYPE_STRING,
+                                       attrbuf);
    }
    alt_ptr = a_Html_get_attr_wdef(html, tag, tagsize, "alt", NULL);
    if ((!alt_ptr || !*alt_ptr) && !prefs.load_images) {
@@ -2053,9 +2032,11 @@
       MSG("a_Html_image_new: suspicious image size request %dx%d\n", w, h);
    } else {
       if (CSS_LENGTH_TYPE(l_w) != CSS_LENGTH_TYPE_AUTO)
-         props.set (CSS_PROPERTY_WIDTH, CSS_TYPE_LENGTH_PERCENTAGE, l_w);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_WIDTH,
+                                           CSS_TYPE_LENGTH_PERCENTAGE, l_w);
       if (CSS_LENGTH_TYPE(l_h) != CSS_LENGTH_TYPE_AUTO)
-         props.set (CSS_PROPERTY_HEIGHT, CSS_TYPE_LENGTH_PERCENTAGE, l_h);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_HEIGHT,
+                                           CSS_TYPE_LENGTH_PERCENTAGE, l_h);
    }
 
    /* TODO: we should scale the image respecting its ratio.
@@ -2070,10 +2051,10 @@
       space = strtol(attrbuf, NULL, 10);
       if (space > 0) {
          space = CSS_CREATE_LENGTH(space, CSS_LENGTH_TYPE_PX);
-         props.set (CSS_PROPERTY_MARGIN_LEFT, CSS_TYPE_LENGTH_PERCENTAGE,
-                    space);
-         props.set (CSS_PROPERTY_MARGIN_RIGHT, CSS_TYPE_LENGTH_PERCENTAGE,
-                    space);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_MARGIN_LEFT,
+                                           CSS_TYPE_LENGTH_PERCENTAGE, space);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_MARGIN_RIGHT,
+                                           CSS_TYPE_LENGTH_PERCENTAGE, space);
       }
    }
 
@@ -2082,10 +2063,10 @@
       space = strtol(attrbuf, NULL, 10);
       if (space > 0) {
          space = CSS_CREATE_LENGTH(space, CSS_LENGTH_TYPE_PX);
-         props.set (CSS_PROPERTY_MARGIN_TOP, CSS_TYPE_LENGTH_PERCENTAGE,
-                    space);
-         props.set (CSS_PROPERTY_MARGIN_BOTTOM, CSS_TYPE_LENGTH_PERCENTAGE,
-                    space);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_MARGIN_TOP,
+                                           CSS_TYPE_LENGTH_PERCENTAGE, space);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_MARGIN_BOTTOM,
+                                           CSS_TYPE_LENGTH_PERCENTAGE, space);
       }
    }
 
@@ -2094,31 +2075,30 @@
       border = strtol(attrbuf, NULL, 10);
       if (border >= 0) {
          border = CSS_CREATE_LENGTH(border, CSS_LENGTH_TYPE_PX);
-         props.set (CSS_PROPERTY_BORDER_TOP_WIDTH, CSS_TYPE_LENGTH_PERCENTAGE,
-                    border);
-         props.set (CSS_PROPERTY_BORDER_BOTTOM_WIDTH,
-                    CSS_TYPE_LENGTH_PERCENTAGE, border);
-         props.set (CSS_PROPERTY_BORDER_LEFT_WIDTH,
-                    CSS_TYPE_LENGTH_PERCENTAGE, border);
-         props.set (CSS_PROPERTY_BORDER_RIGHT_WIDTH,
-                    CSS_TYPE_LENGTH_PERCENTAGE, border);
-
-         props.set (CSS_PROPERTY_BORDER_TOP_STYLE, CSS_TYPE_ENUM,
-                    BORDER_SOLID);
-         props.set (CSS_PROPERTY_BORDER_BOTTOM_STYLE, CSS_TYPE_ENUM,
-                    BORDER_SOLID);
-         props.set (CSS_PROPERTY_BORDER_LEFT_STYLE, CSS_TYPE_ENUM,
-                    BORDER_SOLID);
-         props.set (CSS_PROPERTY_BORDER_RIGHT_STYLE, CSS_TYPE_ENUM,
-                    BORDER_SOLID);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_TOP_WIDTH,
+                                           CSS_TYPE_LENGTH_PERCENTAGE, border);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_BOTTOM_WIDTH,
+                                           CSS_TYPE_LENGTH_PERCENTAGE, border);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_LEFT_WIDTH,
+                                           CSS_TYPE_LENGTH_PERCENTAGE, border);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_RIGHT_WIDTH,
+                                           CSS_TYPE_LENGTH_PERCENTAGE, border);
+
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_TOP_STYLE,
+                                           CSS_TYPE_ENUM, BORDER_SOLID);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_BOTTOM_STYLE,
+                                           CSS_TYPE_ENUM, BORDER_SOLID);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_LEFT_STYLE,
+                                           CSS_TYPE_ENUM, BORDER_SOLID);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_RIGHT_STYLE,
+                                           CSS_TYPE_ENUM, BORDER_SOLID);
       }
    }
 
    /* x_img is an index to a list of {url,image} pairs.
     * We know Html_add_new_htmlimage() will use size() as its next index */
-   props.set (PROPERTY_X_IMG, CSS_TYPE_INTEGER, html->images->size());
-
-   html->styleEngine->setNonCssHints(&props);
+   html->styleEngine->setNonCssHint (PROPERTY_X_IMG, CSS_TYPE_INTEGER,
+                                     html->images->size());
 
    /* Add a new image widget to this page */
    Image = a_Image_new(alt_ptr, 0);
@@ -2133,7 +2113,6 @@
       loading = Html_load_image(html->bw, url, html->page_url, Image);
    Html_add_new_htmlimage(html, &url, loading ? NULL : Image);
 
-   dFree(tooltip_str);
    dFree(width_ptr);
    dFree(height_ptr);
    dFree(alt_ptr);
@@ -2377,7 +2356,6 @@
 {
    DilloUrl *url, *base_url = NULL;
    const char *attrbuf;
-   CssPropertyList props;
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "codebase"))) {
       base_url = a_Html_url_new(html, attrbuf, NULL, 0);
@@ -2394,9 +2372,8 @@
          html->styleEngine->setPseudoLink ();
       }
 
-      props.set(PROPERTY_X_LINK, CSS_TYPE_INTEGER,
-                Html_set_new_link(html, &url));
-      html->styleEngine->setNonCssHints (&props);
+      html->styleEngine->setNonCssHint(PROPERTY_X_LINK, CSS_TYPE_INTEGER,
+                                       Html_set_new_link(html, &url));
 
       HT2TB(html)->addText("[OBJECT]", html->styleEngine->wordStyle ());
    }
@@ -2450,8 +2427,6 @@
 static void Html_tag_open_a(DilloHtml *html, const char *tag, int tagsize)
 {
    DilloUrl *url;
-   char *tooltip_str = NULL;
-   CssPropertyList props;
    const char *attrbuf;
 
    /* TODO: add support for MAP with A HREF */
@@ -2470,25 +2445,23 @@
          html->InVisitedLink = true;
          html->styleEngine->setPseudoVisited ();
          if (html->non_css_visited_color != -1)
-            props.set (CSS_PROPERTY_COLOR, CSS_TYPE_COLOR,
-                       html->non_css_visited_color);
+            html->styleEngine->setNonCssHint(CSS_PROPERTY_COLOR, CSS_TYPE_COLOR,
+                                             html->non_css_visited_color);
       } else {
          html->styleEngine->setPseudoLink ();
          if (html->non_css_link_color != -1)
-            props.set (CSS_PROPERTY_COLOR, CSS_TYPE_COLOR,
-                       html->non_css_link_color);
+            html->styleEngine->setNonCssHint(CSS_PROPERTY_COLOR, CSS_TYPE_COLOR,
+                                             html->non_css_link_color);
       }
 
-      props.set (PROPERTY_X_LINK, CSS_TYPE_INTEGER,
-                 Html_set_new_link(html, &url));
+      html->styleEngine->setNonCssHint (PROPERTY_X_LINK, CSS_TYPE_INTEGER,
+                                        Html_set_new_link(html, &url));
    }
    if (prefs.show_tooltip &&
        (attrbuf = a_Html_get_attr(html, tag, tagsize, "title"))) {
-      tooltip_str = dStrdup(attrbuf);
-      props.set (PROPERTY_X_TOOLTIP, CSS_TYPE_STRING, tooltip_str);
+      html->styleEngine->setNonCssHint (PROPERTY_X_TOOLTIP, CSS_TYPE_STRING,
+                                        attrbuf);
    }
-   html->styleEngine->setNonCssHints (&props);
-   dFree(tooltip_str);
 
    html->styleEngine->inheritBackgroundColor ();
 
@@ -2566,7 +2539,6 @@
    ListStyleType list_style_type;
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "type"))) {
-      CssPropertyList props;
 
       /* list_style_type explicitly defined */
       if (dStrcasecmp(attrbuf, "disc") == 0)
@@ -2579,8 +2551,8 @@
          /* invalid value */
          list_style_type = LIST_STYLE_TYPE_DISC;
 
-      props.set(CSS_PROPERTY_LIST_STYLE_TYPE, CSS_TYPE_ENUM, list_style_type);
-      html->styleEngine->setNonCssHints (&props);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_LIST_STYLE_TYPE,
+                                        CSS_TYPE_ENUM, list_style_type);
    }
 
    Html_add_textblock(html, 9);
@@ -2624,7 +2596,6 @@
    int n = 1;
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "type"))) {
-      CssPropertyList props;
       ListStyleType listStyleType = LIST_STYLE_TYPE_DECIMAL;
 
       if (*attrbuf == '1')
@@ -2638,8 +2609,8 @@
       else if (*attrbuf == 'I')
          listStyleType = LIST_STYLE_TYPE_UPPER_ROMAN;
 
-      props.set (CSS_PROPERTY_LIST_STYLE_TYPE, CSS_TYPE_ENUM, listStyleType);
-      html->styleEngine->setNonCssHints (&props);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_LIST_STYLE_TYPE,
+                                        CSS_TYPE_ENUM, listStyleType);
    }
 
    Html_add_textblock(html, 9);
@@ -2717,29 +2688,33 @@
 static void Html_tag_open_hr(DilloHtml *html, const char *tag, int tagsize)
 {
    Widget *hruler;
-   CssPropertyList props;
    char *width_ptr;
    const char *attrbuf;
    int32_t size = 0;
 
    width_ptr = a_Html_get_attr_wdef(html, tag, tagsize, "width", NULL);
    if (width_ptr) {
-      props.set (CSS_PROPERTY_WIDTH, CSS_TYPE_LENGTH_PERCENTAGE,
-         a_Html_parse_length (html, width_ptr));
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE,
+                                        a_Html_parse_length (html, width_ptr));
       dFree(width_ptr);
    }
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "size")))
       size = strtol(attrbuf, NULL, 10);
 
-   a_Html_tag_set_align_attr(html, &props, tag, tagsize);
+   a_Html_tag_set_align_attr(html, tag, tagsize);
 
    /* TODO: evaluate attribute */
    if (a_Html_get_attr(html, tag, tagsize, "noshade")) {
-      props.set (CSS_PROPERTY_BORDER_TOP_STYLE, CSS_TYPE_ENUM, BORDER_SOLID);
-      props.set (CSS_PROPERTY_BORDER_BOTTOM_STYLE,CSS_TYPE_ENUM,BORDER_SOLID);
-      props.set (CSS_PROPERTY_BORDER_LEFT_STYLE, CSS_TYPE_ENUM, BORDER_SOLID);
-      props.set (CSS_PROPERTY_BORDER_RIGHT_STYLE, CSS_TYPE_ENUM, BORDER_SOLID);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_TOP_STYLE,
+                                        CSS_TYPE_ENUM, BORDER_SOLID);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_BOTTOM_STYLE,
+                                        CSS_TYPE_ENUM, BORDER_SOLID);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_LEFT_STYLE,
+                                        CSS_TYPE_ENUM, BORDER_SOLID);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_RIGHT_STYLE,
+                                        CSS_TYPE_ENUM, BORDER_SOLID);
 
       if (size <= 0)
          size = 1;
@@ -2748,18 +2723,16 @@
    if (size > 0) {
       CssLength size_top = CSS_CREATE_LENGTH ((size+1)/2, CSS_LENGTH_TYPE_PX);
       CssLength size_bottom = CSS_CREATE_LENGTH (size / 2, CSS_LENGTH_TYPE_PX);
-      props.set (CSS_PROPERTY_BORDER_TOP_WIDTH, CSS_TYPE_LENGTH_PERCENTAGE,
-                 size_top);
-      props.set (CSS_PROPERTY_BORDER_LEFT_WIDTH, CSS_TYPE_LENGTH_PERCENTAGE,
-                 size_top);
-      props.set (CSS_PROPERTY_BORDER_BOTTOM_WIDTH, CSS_TYPE_LENGTH_PERCENTAGE,
-                 size_bottom);
-      props.set (CSS_PROPERTY_BORDER_RIGHT_WIDTH, CSS_TYPE_LENGTH_PERCENTAGE,
-                 size_bottom);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_TOP_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, size_top);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_LEFT_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, size_top);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_BOTTOM_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, size_bottom);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_RIGHT_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, size_bottom);
    }
 
-   html->styleEngine->setNonCssHints (&props);
-
    HT2TB(html)->addParbreak (5, html->styleEngine->wordStyle ());
 
    hruler = new Ruler();
@@ -3098,10 +3071,7 @@
  */
 static void Html_tag_open_div(DilloHtml *html, const char *tag, int tagsize)
 {
-   CssPropertyList props;
-
-   a_Html_tag_set_align_attr (html, &props, tag, tagsize);
-   html->styleEngine->setNonCssHints (&props);
+   a_Html_tag_set_align_attr (html, tag, tagsize);
    Html_add_textblock(html, 0);
 }
 
--- a/src/html_common.hh	Mon Oct 11 18:23:33 2010 +0200
+++ b/src/html_common.hh	Mon Oct 11 21:35:53 2010 +0200
@@ -94,7 +94,6 @@
 };
 
 struct _DilloHtmlState {
-   CssPropertyList *table_cell_props;
    DilloHtmlParseMode parse_mode;
    DilloHtmlTableMode table_mode;
    bool cell_text_align_set;
@@ -242,11 +241,9 @@
                            const char *subtag, int32_t default_color);
 dw::core::style::Length a_Html_parse_length (DilloHtml *html,
                                              const char *attr);
-void a_Html_tag_set_align_attr(DilloHtml *html, CssPropertyList *props,
-                               const char *tag, int tagsize);
+void a_Html_tag_set_align_attr(DilloHtml *html, const char *tag, int tagsize);
 bool a_Html_tag_set_valign_attr(DilloHtml *html,
-                                const char *tag, int tagsize,
-                                CssPropertyList *props);
+                                const char *tag, int tagsize);
 
 void a_Html_load_stylesheet(DilloHtml *html, DilloUrl *url);
 
--- a/src/styleengine.cc	Mon Oct 11 18:23:33 2010 +0200
+++ b/src/styleengine.cc	Mon Oct 11 21:35:53 2010 +0200
@@ -137,10 +137,31 @@
  * \brief set properties that were definded using (mostly deprecated) HTML
  *    attributes (e.g. bgColor).
  */
-void StyleEngine::setNonCssHints (CssPropertyList *nonCssHints) {
-   if (stack->getRef (stack->size () - 1)->style)
-      stack->getRef (stack->size () - 1)->style->unref ();
-   style0 (nonCssHints); // evaluate now, so caller can free nonCssHints
+void StyleEngine::setNonCssHint (CssPropertyName name, CssValueType type,
+                                 CssPropertyValue value) {
+   Node *n = stack->getRef (stack->size () - 1);
+
+   if (!n->nonCssProperties)
+      n->nonCssProperties = new CssPropertyList (true);
+  
+   n->nonCssProperties->set(name, type, value); 
+}
+
+void StyleEngine::inheritNonCssHints () {
+   Node *pn = stack->getRef (stack->size () - 2);
+   Node *n = stack->getRef (stack->size () - 1);
+
+   if (pn->nonCssProperties)
+      n->nonCssProperties = new CssPropertyList (*pn->nonCssProperties);
+}
+
+void StyleEngine::clearNonCssHints () {
+   Node *n = stack->getRef (stack->size () - 1);
+
+   if (n->nonCssProperties) {
+      delete n->nonCssProperties;
+      n->nonCssProperties = NULL;
+   }
 }
 
 /**
@@ -645,8 +666,8 @@
  * HTML elements and the nonCssProperties that have been set.
  * This method is private. Call style() to get a current style object.
  */
-Style * StyleEngine::style0 (CssPropertyList *nonCssProperties) {
-   CssPropertyList props, *styleAttrProperties;
+Style * StyleEngine::style0 () {
+   CssPropertyList props, *styleAttrProperties, *nonCssProperties;
    // get previous style from the stack
    StyleAttrs attrs = *stack->getRef (stack->size () - 2)->style;
 
@@ -654,7 +675,7 @@
    // this element.
    // Style computation is expensive so limit it as much as possible.
    // If this assertion is hit, you need to rearrange the code that is
-   // doing styleEngine calls to call setNonCssHints() before calling
+   // doing styleEngine calls to call setNonCssHint() before calling
    // style() or wordStyle() for each new element.
    assert (stack->getRef (stack->size () - 1)->style == NULL);
 
@@ -663,6 +684,7 @@
    preprocessAttrs (&attrs);
 
    styleAttrProperties = stack->getRef(stack->size () - 1)->styleAttrProperties;
+   nonCssProperties = stack->getRef(stack->size () - 1)->nonCssProperties;
 
    // merge style information
    cssContext->apply (&props, doctree, styleAttrProperties, nonCssProperties);
@@ -677,7 +699,7 @@
    return stack->getRef (stack->size () - 1)->style;
 }
 
-Style * StyleEngine::wordStyle0 (CssPropertyList *nonCssProperties) {
+Style * StyleEngine::wordStyle0 () {
    StyleAttrs attrs = *style ();
    attrs.resetValues ();
 
--- a/src/styleengine.hh	Mon Oct 11 18:23:33 2010 +0200
+++ b/src/styleengine.hh	Mon Oct 11 21:35:53 2010 +0200
@@ -33,8 +33,10 @@
       Doctree *doctree;
       int importDepth;
 
-      dw::core::style::Style *style0 (CssPropertyList *nonCssHints = NULL);
-      dw::core::style::Style *wordStyle0 (CssPropertyList *nonCssHints = NULL);
+      dw::core::style::Style *style0 ();
+      dw::core::style::Style *wordStyle0 ();
+      void setNonCssHint(CssPropertyName name, CssValueType type,
+                         CssPropertyValue value);
       void preprocessAttrs (dw::core::style::StyleAttrs *attrs);
       void postprocessAttrs (dw::core::style::StyleAttrs *attrs);
       void apply (dw::core::style::StyleAttrs *attrs, CssPropertyList *props);
@@ -62,8 +64,20 @@
       void endElement (int tag);
       void setPseudoLink ();
       void setPseudoVisited ();
-      void setNonCssHints (CssPropertyList *nonCssHints);
-      void setNonCssHint(CssPropertyName name, CssPropertyValue value);
+      void setNonCssHint(CssPropertyName name, CssValueType type,
+                         int value) {
+         CssPropertyValue v;
+         v.intVal = value;
+         setNonCssHint (name, type, v);
+      }
+      void setNonCssHint(CssPropertyName name, CssValueType type,
+                         const char *value) {
+         CssPropertyValue v;
+         v.strVal = dStrdup(value);
+         setNonCssHint (name, type, v);
+      }
+      void inheritNonCssHints ();
+      void clearNonCssHints ();
       void inheritBackgroundColor (); /* \todo get rid of this somehow */
       dw::core::style::Style *backgroundStyle ();
 
--- a/src/table.cc	Mon Oct 11 18:23:33 2010 +0200
+++ b/src/table.cc	Mon Oct 11 21:35:53 2010 +0200
@@ -38,7 +38,6 @@
 void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
 {
    dw::core::Widget *table;
-   CssPropertyList props, *table_cell_props;
    const char *attrbuf;
    int32_t border = -1, cellspacing = -1, cellpadding = -1, bgcolor = -1;
    CssLength cssLength;
@@ -52,93 +51,90 @@
 
    if (border != -1) {
       cssLength = CSS_CREATE_LENGTH (border, CSS_LENGTH_TYPE_PX);
-      props.set (CSS_PROPERTY_BORDER_TOP_WIDTH, CSS_TYPE_LENGTH_PERCENTAGE,
-                 cssLength);
-      props.set (CSS_PROPERTY_BORDER_BOTTOM_WIDTH, CSS_TYPE_LENGTH_PERCENTAGE,
-                 cssLength);
-      props.set (CSS_PROPERTY_BORDER_LEFT_WIDTH, CSS_TYPE_LENGTH_PERCENTAGE,
-                 cssLength);
-      props.set (CSS_PROPERTY_BORDER_RIGHT_WIDTH, CSS_TYPE_LENGTH_PERCENTAGE,
-                 cssLength);
-      props.set (CSS_PROPERTY_BORDER_TOP_STYLE, CSS_TYPE_ENUM,
-                 BORDER_OUTSET);
-      props.set (CSS_PROPERTY_BORDER_BOTTOM_STYLE, CSS_TYPE_ENUM,
-                 BORDER_OUTSET);
-      props.set (CSS_PROPERTY_BORDER_LEFT_STYLE, CSS_TYPE_ENUM,
-                 BORDER_OUTSET);
-      props.set (CSS_PROPERTY_BORDER_RIGHT_STYLE, CSS_TYPE_ENUM,
-                 BORDER_OUTSET);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_TOP_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_BOTTOM_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_LEFT_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_RIGHT_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_TOP_STYLE,
+                                        CSS_TYPE_ENUM, BORDER_OUTSET);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_BOTTOM_STYLE,
+                                        CSS_TYPE_ENUM, BORDER_OUTSET);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_LEFT_STYLE,
+                                        CSS_TYPE_ENUM, BORDER_OUTSET);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_RIGHT_STYLE,
+                                        CSS_TYPE_ENUM, BORDER_OUTSET);
    }
 
    if (cellspacing != -1) {
       cssLength = CSS_CREATE_LENGTH (cellspacing, CSS_LENGTH_TYPE_PX);
-      props.set (CSS_PROPERTY_BORDER_SPACING, CSS_TYPE_LENGTH_PERCENTAGE,
-                 cssLength);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_SPACING,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
    }
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "width")))
-      props.set (CSS_PROPERTY_WIDTH, CSS_TYPE_LENGTH_PERCENTAGE,
-         a_Html_parse_length (html, attrbuf));
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE,
+                                        a_Html_parse_length (html, attrbuf));
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "align"))) {
       if (dStrcasecmp (attrbuf, "left") == 0)
-         props.set (CSS_PROPERTY_TEXT_ALIGN, CSS_TYPE_ENUM, TEXT_ALIGN_LEFT);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_TEXT_ALIGN,
+                                           CSS_TYPE_ENUM, TEXT_ALIGN_LEFT);
       else if (dStrcasecmp (attrbuf, "right") == 0)
-         props.set (CSS_PROPERTY_TEXT_ALIGN, CSS_TYPE_ENUM, TEXT_ALIGN_RIGHT);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_TEXT_ALIGN,
+                                           CSS_TYPE_ENUM, TEXT_ALIGN_RIGHT);
       else if (dStrcasecmp (attrbuf, "center") == 0)
-         props.set (CSS_PROPERTY_TEXT_ALIGN, CSS_TYPE_ENUM, TEXT_ALIGN_CENTER);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_TEXT_ALIGN,
+                                           CSS_TYPE_ENUM, TEXT_ALIGN_CENTER);
    }
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "bgcolor"))) {
       bgcolor = a_Html_color_parse(html, attrbuf, -1);
       if (bgcolor != -1)
-         props.set (CSS_PROPERTY_BACKGROUND_COLOR, CSS_TYPE_COLOR, bgcolor);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_BACKGROUND_COLOR,
+                                           CSS_TYPE_COLOR, bgcolor);
    }
 
-   html->styleEngine->setNonCssHints (&props);
-
    HT2TB(html)->addParbreak (0, html->styleEngine->wordStyle ());
 
    /* The style for the cells */
-   table_cell_props = new CssPropertyList ();
+   html->styleEngine->clearNonCssHints ();
    if (border > 0) {
       cssLength = CSS_CREATE_LENGTH (1, CSS_LENGTH_TYPE_PX);
-      table_cell_props->set (CSS_PROPERTY_BORDER_TOP_WIDTH,
-                             CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
-      table_cell_props->set (CSS_PROPERTY_BORDER_BOTTOM_WIDTH,
-                             CSS_TYPE_LENGTH_PERCENTAGE,  cssLength);
-      table_cell_props->set (CSS_PROPERTY_BORDER_LEFT_WIDTH,
-                             CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
-      table_cell_props->set (CSS_PROPERTY_BORDER_RIGHT_WIDTH,
-                             CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
-      table_cell_props->set (CSS_PROPERTY_BORDER_TOP_STYLE,
-                             CSS_TYPE_ENUM, BORDER_INSET);
-      table_cell_props->set (CSS_PROPERTY_BORDER_BOTTOM_STYLE,
-                             CSS_TYPE_ENUM, BORDER_INSET);
-      table_cell_props->set (CSS_PROPERTY_BORDER_LEFT_STYLE,
-                             CSS_TYPE_ENUM, BORDER_INSET);
-      table_cell_props->set (CSS_PROPERTY_BORDER_RIGHT_STYLE,
-                             CSS_TYPE_ENUM, BORDER_INSET);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_TOP_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_BOTTOM_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE,  cssLength);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_LEFT_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_RIGHT_WIDTH,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_TOP_STYLE,
+                                        CSS_TYPE_ENUM, BORDER_INSET);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_BOTTOM_STYLE,
+                                        CSS_TYPE_ENUM, BORDER_INSET);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_LEFT_STYLE,
+                                        CSS_TYPE_ENUM, BORDER_INSET);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_RIGHT_STYLE,
+                                        CSS_TYPE_ENUM, BORDER_INSET);
    }
 
    if (cellpadding != -1) {
       cssLength = CSS_CREATE_LENGTH (cellpadding, CSS_LENGTH_TYPE_PX);
-      table_cell_props->set (CSS_PROPERTY_PADDING_TOP,
-                             CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
-      table_cell_props->set (CSS_PROPERTY_PADDING_BOTTOM,
-                             CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
-      table_cell_props->set (CSS_PROPERTY_PADDING_LEFT,
-                             CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
-      table_cell_props->set (CSS_PROPERTY_PADDING_RIGHT,
-                             CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_PADDING_TOP,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_PADDING_BOTTOM,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_PADDING_LEFT,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
+      html->styleEngine->setNonCssHint (CSS_PROPERTY_PADDING_RIGHT,
+                                        CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
    }
 
-   if (S_TOP(html)->table_cell_props)
-      S_TOP(html)->table_cell_props->unref ();
-
-   S_TOP(html)->table_cell_props = table_cell_props;
-   S_TOP(html)->table_cell_props->ref ();
-
    table = new dw::Table(prefs.limit_text_width);
    HT2TB(html)->addWidget (table, html->styleEngine->style ());
 
@@ -155,7 +151,8 @@
    const char *attrbuf;
    int32_t bgcolor = -1;
    bool new_style = false;
-   CssPropertyList props, *table_cell_props;
+
+   html->styleEngine->inheritNonCssHints ();
 
    switch (S_TOP(html)->table_mode) {
    case DILLO_HTML_TABLE_MODE_NONE:
@@ -169,34 +166,26 @@
       if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "bgcolor"))) {
          bgcolor = a_Html_color_parse(html, attrbuf, -1);
          if (bgcolor != -1)
-            props.set (CSS_PROPERTY_BACKGROUND_COLOR, CSS_TYPE_COLOR, bgcolor);
+            html->styleEngine->setNonCssHint (CSS_PROPERTY_BACKGROUND_COLOR,
+                                              CSS_TYPE_COLOR, bgcolor);
       }
 
       if (a_Html_get_attr (html, tag, tagsize, "align")) {
          S_TOP(html)->cell_text_align_set = TRUE;
-         a_Html_tag_set_align_attr (html, &props, tag, tagsize);
+         a_Html_tag_set_align_attr (html, tag, tagsize);
       }
 
       html->styleEngine->inheritBackgroundColor ();
-      html->styleEngine->setNonCssHints (&props);
 
       ((dw::Table*)S_TOP(html)->table)->addRow (html->styleEngine->style ());
 
-      table_cell_props = new CssPropertyList (*S_TOP(html)->table_cell_props);
       if (bgcolor != -1) {
-         table_cell_props->set (CSS_PROPERTY_BACKGROUND_COLOR,
-                                CSS_TYPE_COLOR, bgcolor);
+         html->styleEngine->setNonCssHint(CSS_PROPERTY_BACKGROUND_COLOR,
+                                          CSS_TYPE_COLOR, bgcolor);
          new_style = true;
       }
-      if (a_Html_tag_set_valign_attr (html, tag, tagsize, table_cell_props))
+      if (a_Html_tag_set_valign_attr (html, tag, tagsize))
          new_style = true;
-      if (new_style) {
-         S_TOP(html)->table_cell_props->unref ();
-         S_TOP(html)->table_cell_props = table_cell_props;
-         S_TOP(html)->table_cell_props->ref ();
-      } else {
-         delete table_cell_props;
-      }
       break;
    default:
       break;
@@ -240,6 +229,8 @@
    int32_t bgcolor;
    bool_t new_style;
 
+   html->styleEngine->inheritNonCssHints ();
+
    switch (S_TOP(html)->table_mode) {
    case DILLO_HTML_TABLE_MODE_NONE:
       BUG_MSG("<td> or <th> outside <table>\n");
@@ -261,41 +252,36 @@
       if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "rowspan")))
          rowspan = MAX(1, strtol (attrbuf, NULL, 10));
 
-      CssPropertyList *props;
-      // \todo any shorter way to do this?
-      if (S_TOP(html)->table_cell_props != NULL)
-         props = new CssPropertyList (*S_TOP(html)->table_cell_props);
-      else
-         props = new CssPropertyList ();
-
       /* text style */
       if (!S_TOP(html)->cell_text_align_set) {
-         props->set (CSS_PROPERTY_TEXT_ALIGN, CSS_TYPE_ENUM, text_align);
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_TEXT_ALIGN,
+                                           CSS_TYPE_ENUM, text_align);
       }
       if (a_Html_get_attr(html, tag, tagsize, "nowrap"))
-         props->set(CSS_PROPERTY_WHITE_SPACE,CSS_TYPE_ENUM,WHITE_SPACE_NOWRAP);
+         html->styleEngine->setNonCssHint(CSS_PROPERTY_WHITE_SPACE,
+                                          CSS_TYPE_ENUM, WHITE_SPACE_NOWRAP);
       else
-         props->set(CSS_PROPERTY_WHITE_SPACE,CSS_TYPE_ENUM,WHITE_SPACE_NORMAL);
+         html->styleEngine->setNonCssHint(CSS_PROPERTY_WHITE_SPACE,
+                                          CSS_TYPE_ENUM, WHITE_SPACE_NORMAL);
 
-      a_Html_tag_set_align_attr (html, props, tag, tagsize);
+      a_Html_tag_set_align_attr (html, tag, tagsize);
 
       if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "width"))) {
-         props->set (CSS_PROPERTY_WIDTH, CSS_TYPE_LENGTH_PERCENTAGE,
-            a_Html_parse_length (html, attrbuf));
+         html->styleEngine->setNonCssHint (CSS_PROPERTY_WIDTH,
+                                           CSS_TYPE_LENGTH_PERCENTAGE,
+                                           a_Html_parse_length (html, attrbuf));
       }
 
-      if (a_Html_tag_set_valign_attr (html, tag, tagsize, props))
+      if (a_Html_tag_set_valign_attr (html, tag, tagsize))
          new_style = TRUE;
 
       if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "bgcolor"))) {
          bgcolor = a_Html_color_parse(html, attrbuf, -1);
          if (bgcolor != -1)
-            props->set (CSS_PROPERTY_BACKGROUND_COLOR, CSS_TYPE_COLOR,bgcolor);
+            html->styleEngine->setNonCssHint (CSS_PROPERTY_BACKGROUND_COLOR,
+                                              CSS_TYPE_COLOR, bgcolor);
       }
 
-      html->styleEngine->setNonCssHints (props);
-      delete props;
-
       if (html->styleEngine->style ()->textAlign
           == TEXT_ALIGN_STRING)
          col_tb = new dw::TableCell (