From dcad152f0bc534c0e325cdf493cf5193fc668dcc Mon Sep 17 00:00:00 2001 From: peterl Date: Fri, 26 Jun 1998 05:50:10 +0000 Subject: [PATCH] fixed equal weight rule ordering git-svn-id: svn://10.0.0.236/trunk@4558 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/html/style/src/nsCSSStyleSheet.cpp | 4 ++-- mozilla/layout/html/style/src/nsCSSStyleSheet.cpp | 4 ++-- mozilla/layout/style/nsCSSStyleSheet.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp index fa3e51e9a4f..b07e254e8cf 100644 --- a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp @@ -751,7 +751,7 @@ void CSSStyleSheetImpl::PrependStyleRule(nsICSSStyleRule* aRule) PRInt32 index = mWeightedRules->Count(); while (0 <= --index) { nsICSSStyleRule* rule = (nsICSSStyleRule*)mWeightedRules->ElementAt(index); - if (rule->GetWeight() > weight) { // insert before rules with equal or lesser weight + if (rule->GetWeight() >= weight) { // insert before rules with equal or lesser weight NS_RELEASE(rule); break; } @@ -780,7 +780,7 @@ void CSSStyleSheetImpl::AppendStyleRule(nsICSSStyleRule* aRule) PRInt32 index = -1; while (++index < count) { nsICSSStyleRule* rule = (nsICSSStyleRule*)mWeightedRules->ElementAt(index); - if (rule->GetWeight() < weight) { // insert after rules with equal or greater weight (before lower weight) + if (rule->GetWeight() <= weight) { // insert after rules with greater weight (before equal or lower weight) NS_RELEASE(rule); break; } diff --git a/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp b/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp index fa3e51e9a4f..b07e254e8cf 100644 --- a/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp +++ b/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp @@ -751,7 +751,7 @@ void CSSStyleSheetImpl::PrependStyleRule(nsICSSStyleRule* aRule) PRInt32 index = mWeightedRules->Count(); while (0 <= --index) { nsICSSStyleRule* rule = (nsICSSStyleRule*)mWeightedRules->ElementAt(index); - if (rule->GetWeight() > weight) { // insert before rules with equal or lesser weight + if (rule->GetWeight() >= weight) { // insert before rules with equal or lesser weight NS_RELEASE(rule); break; } @@ -780,7 +780,7 @@ void CSSStyleSheetImpl::AppendStyleRule(nsICSSStyleRule* aRule) PRInt32 index = -1; while (++index < count) { nsICSSStyleRule* rule = (nsICSSStyleRule*)mWeightedRules->ElementAt(index); - if (rule->GetWeight() < weight) { // insert after rules with equal or greater weight (before lower weight) + if (rule->GetWeight() <= weight) { // insert after rules with greater weight (before equal or lower weight) NS_RELEASE(rule); break; } diff --git a/mozilla/layout/style/nsCSSStyleSheet.cpp b/mozilla/layout/style/nsCSSStyleSheet.cpp index fa3e51e9a4f..b07e254e8cf 100644 --- a/mozilla/layout/style/nsCSSStyleSheet.cpp +++ b/mozilla/layout/style/nsCSSStyleSheet.cpp @@ -751,7 +751,7 @@ void CSSStyleSheetImpl::PrependStyleRule(nsICSSStyleRule* aRule) PRInt32 index = mWeightedRules->Count(); while (0 <= --index) { nsICSSStyleRule* rule = (nsICSSStyleRule*)mWeightedRules->ElementAt(index); - if (rule->GetWeight() > weight) { // insert before rules with equal or lesser weight + if (rule->GetWeight() >= weight) { // insert before rules with equal or lesser weight NS_RELEASE(rule); break; } @@ -780,7 +780,7 @@ void CSSStyleSheetImpl::AppendStyleRule(nsICSSStyleRule* aRule) PRInt32 index = -1; while (++index < count) { nsICSSStyleRule* rule = (nsICSSStyleRule*)mWeightedRules->ElementAt(index); - if (rule->GetWeight() < weight) { // insert after rules with equal or greater weight (before lower weight) + if (rule->GetWeight() <= weight) { // insert after rules with greater weight (before equal or lower weight) NS_RELEASE(rule); break; }