mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
fixed equal weight rule ordering
This commit is contained in:
parent
b3f9eec797
commit
d1e43f5eac
@ -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…
Reference in New Issue
Block a user