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
Родитель 417805594e
Коммит 836792bdcf
3 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -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),

Просмотреть файл

@ -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();

Просмотреть файл

@ -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);