fixed equal weight rule ordering
git-svn-id: svn://10.0.0.236/trunk@4558 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
75f693e437
commit
dcad152f0b
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user