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;
}