Bug 922669 - Part 2: Use a different operator to represent the element -> pseudo-element relationship in selectors. r=bz

This commit is contained in:
Cameron McCormack 2013-11-28 17:46:38 +11:00
parent 1e5c47e48c
commit a57586d9a6
3 changed files with 5 additions and 5 deletions

View File

@ -550,7 +550,7 @@ nsCSSSelector::ToString(nsAString& aString, nsCSSStyleSheet* aSheet,
const nsCSSSelector *next = stack.ElementAt(index - 1);
PRUnichar oper = s->mOperator;
if (next->IsPseudoElement()) {
NS_ASSERTION(oper == PRUnichar('>'),
NS_ASSERTION(oper == PRUnichar(':'),
"improperly chained pseudo element");
} else {
NS_ASSERTION(oper != PRUnichar(0),

View File

@ -4218,12 +4218,12 @@ CSSParserImpl::ParseSelector(nsCSSSelectorList* aList,
&pseudoElementType);
if (pseudoElement &&
pseudoElementType != nsCSSPseudoElements::ePseudo_AnonBox) {
// Pseudo-elements other than anonymous boxes are represented as
// direct children ('>' combinator) of the rest of the selector.
// Pseudo-elements other than anonymous boxes are represented with
// a special ':' combinator.
aList->mWeight += selector->CalcWeight();
selector = aList->AddSelector('>');
selector = aList->AddSelector(':');
selector->mLowercaseTag.swap(pseudoElement);
selector->mClassList = pseudoElementArgs.forget();

View File

@ -2990,7 +2990,7 @@ AddRule(RuleSelectorPair* aRuleInfo, RuleCascadeData* aCascade)
}
NS_ASSERTION(aRuleInfo->mSelector->mNext,
"Must have mNext; parser screwed up");
NS_ASSERTION(aRuleInfo->mSelector->mNext->mOperator == '>',
NS_ASSERTION(aRuleInfo->mSelector->mNext->mOperator == ':',
"Unexpected mNext combinator");
aRuleInfo->mSelector = aRuleInfo->mSelector->mNext;
ruleHash->AppendRule(*aRuleInfo);