changeset 895:816f3c5f9286

remove unused order_count parameter It seems that in dillo-0.8.0-css-3 it was used to make sure that later definitions of the same CSS property have more weight than previous ones. If for example a first stylesheet sets background-color to black, and a second stylesheet sets it to green, green should win. But as we currently parese everything in order (throughing away all parsed CSS data when a new CSS stylesheet has arrived), we don't need to remember the original ordering of stylesheets.
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Mon, 02 Feb 2009 07:40:23 +0100
parents 660448deb31a
children 742035273c87
files src/css.cc src/cssparser.cc src/cssparser.hh src/html.cc src/styleengine.cc src/styleengine.hh
diffstat 6 files changed, 8 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/css.cc	Sun Feb 01 20:53:44 2009 -0300
+++ b/src/css.cc	Mon Feb 02 07:40:23 2009 +0100
@@ -467,7 +467,7 @@
      "th {font-weight: bolder; text-align: center}"
      "code, tt, pre, samp, kbd {font-family: monospace}";
 
-   a_Css_parse (this, cssBuf, strlen (cssBuf), 0, CSS_ORIGIN_USER_AGENT);
+   a_Css_parse (this, cssBuf, strlen (cssBuf), CSS_ORIGIN_USER_AGENT);
 }
 
 void CssContext::buildUserStyle () {
@@ -475,7 +475,7 @@
    char *filename = dStrconcat(dGethomedir(), "/.dillo/style.css", NULL);
 
    if ((style = a_Misc_file2dstr(filename))) {
-      a_Css_parse (this, style->str, style->len, 0, CSS_ORIGIN_USER);
+      a_Css_parse (this, style->str, style->len, CSS_ORIGIN_USER);
       dStr_free (style, 1);
    }
    dFree (filename);
--- a/src/cssparser.cc	Sun Feb 01 20:53:44 2009 -0300
+++ b/src/cssparser.cc	Mon Feb 02 07:40:23 2009 +0100
@@ -348,7 +348,6 @@
 
 typedef struct {
    CssContext *context;
-   int order_count;
    CssOrigin origin;
 
    const char *buf;
@@ -1166,7 +1165,7 @@
 
 void a_Css_parse(CssContext * context,
                  const char *buf,
-                 int buflen, int order_count, CssOrigin origin)
+                 int buflen, CssOrigin origin)
 {
    CssParser parser;
 
@@ -1174,7 +1173,6 @@
    parser.buf = buf;
    parser.buflen = buflen;
    parser.bufptr = 0;
-   parser.order_count = 0;
    parser.origin = origin;
    parser.within_block = false;
    parser.space_separated = false;
@@ -1193,7 +1191,6 @@
    parser.buf = buf;
    parser.buflen = buflen;
    parser.bufptr = 0;
-   parser.order_count = 0;
    parser.origin = CSS_ORIGIN_AUTHOR;
    parser.within_block = true;
    parser.space_separated = false;
--- a/src/cssparser.hh	Sun Feb 01 20:53:44 2009 -0300
+++ b/src/cssparser.hh	Mon Feb 02 07:40:23 2009 +0100
@@ -51,7 +51,6 @@
 void        a_Css_parse                       (CssContext *context,
                                                const char *buf,
                                                int buflen,
-                                               int order_count,
                                                CssOrigin origin);
 
 CssPropertyList *a_Css_parse_declaration(const char *buf, int buflen);
--- a/src/html.cc	Sun Feb 01 20:53:44 2009 -0300
+++ b/src/html.cc	Mon Feb 02 07:40:23 2009 +0100
@@ -1650,7 +1650,7 @@
 {
    if (prefs.parse_embedded_css)
       html->styleEngine->parse(html->Stash->str, html->Stash->len,
-                               0, CSS_ORIGIN_AUTHOR);
+                               CSS_ORIGIN_AUTHOR);
 }
 
 /*
@@ -2799,7 +2799,7 @@
    if (a_Capi_get_buf(url, &data, &len)) {
       /* Haven't looked into what origin_count is */
       if (a_Capi_get_flags(url) & CAPI_Completed)
-         html->styleEngine->parse(data, len, 0, CSS_ORIGIN_AUTHOR);
+         html->styleEngine->parse(data, len, CSS_ORIGIN_AUTHOR);
       a_Capi_unref_buf(url);
    } else if (!html->repush_after_head) {
       /* Fill a Web structure for the cache query */
--- a/src/styleengine.cc	Sun Feb 01 20:53:44 2009 -0300
+++ b/src/styleengine.cc	Mon Feb 02 07:40:23 2009 +0100
@@ -451,8 +451,7 @@
    return stack->getRef (stack->size () - 1)->wordStyle;
 }
 
-void StyleEngine::parse (const char *buf, int buflen,
-                         int order_count, CssOrigin origin) {
+void StyleEngine::parse (const char *buf, int buflen, CssOrigin origin) {
 
-   a_Css_parse (cssContext, buf, buflen, order_count, origin);
+   a_Css_parse (cssContext, buf, buflen, origin);
 }
--- a/src/styleengine.hh	Sun Feb 01 20:53:44 2009 -0300
+++ b/src/styleengine.hh	Mon Feb 02 07:40:23 2009 +0100
@@ -45,7 +45,7 @@
             return NULL;
       };
 
-      void parse (const char *buf, int buflen, int order_count, CssOrigin origin);
+      void parse (const char *buf, int buflen, CssOrigin origin);
       void startElement (int tag);
       void setId (const char *id);
       void setClass (const char *klass);