[libcroco-list] Bug in cr_simple_sel_compute_specificity.


cr_simple_sel_compute_specificity has a bug that causes it to add a value to the c-term of the specificity for every term instead of just for element names. It looks like a simple typo for | instead of &.

Below is a patch that fixes this issue. It was converted from a git patch, so I apologize if it doesn't apply easily.

-- Jeff

Index: src/cr-simple-sel.c
--- src/cr-simple-sel.c (revision 319)
+++ src/cr-simple-sel.c (working copy)
@@ -254,7 +254,7 @@ cr_simple_sel_compute_specificity (CRSimpleSel * a_this)
         g_return_val_if_fail (a_this, CR_BAD_PARAM_ERROR);

         for (cur_sel = a_this; cur_sel; cur_sel = cur_sel->next) {
-                if (cur_sel->type_mask | TYPE_SELECTOR) {
+                if (cur_sel->type_mask & TYPE_SELECTOR) {
                         c++;    /*hmmh, is this a new language ? */
                 } else if (!cur_sel->name
                            || !cur_sel->name->stryng

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]