зеркало из https://github.com/mozilla/pjs.git
Bug 602341 part 7. Fix serialization of tree selectors. r=dbaron
This commit is contained in:
Родитель
0f015ac610
Коммит
75c69c02b6
|
@ -684,6 +684,22 @@ nsCSSSelector::AppendToStringWithoutCombinatorsOrNegations
|
|||
|
||||
// Append each class in the linked list
|
||||
if (mClassList) {
|
||||
if (isPseudoElement) {
|
||||
#ifdef MOZ_XUL
|
||||
NS_ABORT_IF_FALSE(nsCSSAnonBoxes::IsTreePseudoElement(mLowercaseTag),
|
||||
"must be tree pseudo-element");
|
||||
|
||||
aString.Append(PRUnichar('('));
|
||||
for (nsAtomList* list = mClassList; list; list = list->mNext) {
|
||||
nsStyleUtil::AppendEscapedCSSIdent(nsDependentAtomString(list->mAtom), aString);
|
||||
aString.Append(PRUnichar(','));
|
||||
}
|
||||
// replace the final comma with a close-paren
|
||||
aString.Replace(aString.Length() - 1, 1, PRUnichar(')'));
|
||||
#else
|
||||
NS_ERROR("Can't happen");
|
||||
#endif
|
||||
} else {
|
||||
nsAtomList* list = mClassList;
|
||||
while (list != nsnull) {
|
||||
list->mAtom->ToString(temp);
|
||||
|
@ -692,6 +708,7 @@ nsCSSSelector::AppendToStringWithoutCombinatorsOrNegations
|
|||
list = list->mNext;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Append each attribute selector in the linked list
|
||||
if (mAttrList) {
|
||||
|
@ -747,26 +764,6 @@ nsCSSSelector::AppendToStringWithoutCombinatorsOrNegations
|
|||
}
|
||||
|
||||
// Append each pseudo-class in the linked list
|
||||
if (isPseudoElement) {
|
||||
#ifdef MOZ_XUL
|
||||
if (mPseudoClassList) {
|
||||
NS_ABORT_IF_FALSE(nsCSSAnonBoxes::IsTreePseudoElement(mLowercaseTag),
|
||||
"must be tree pseudo-element");
|
||||
aString.Append(PRUnichar('('));
|
||||
for (nsPseudoClassList* list = mPseudoClassList; list;
|
||||
list = list->mNext) {
|
||||
nsCSSPseudoClasses::PseudoTypeToString(list->mType, temp);
|
||||
nsStyleUtil::AppendEscapedCSSIdent(temp, aString);
|
||||
NS_ABORT_IF_FALSE(!list->u.mMemory, "data not expected");
|
||||
aString.Append(PRUnichar(','));
|
||||
}
|
||||
// replace the final comma with a close-paren
|
||||
aString.Replace(aString.Length() - 1, 1, PRUnichar(')'));
|
||||
}
|
||||
#else
|
||||
NS_ABORT_IF_FALSE(!mPseudoClassList, "unexpected pseudo-class list");
|
||||
#endif
|
||||
} else {
|
||||
for (nsPseudoClassList* list = mPseudoClassList; list; list = list->mNext) {
|
||||
nsCSSPseudoClasses::PseudoTypeToString(list->mType, temp);
|
||||
// This should not be escaped since (a) the pseudo-class string
|
||||
|
@ -807,7 +804,6 @@ nsCSSSelector::AppendToStringWithoutCombinatorsOrNegations
|
|||
aString.Append(PRUnichar(')'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PRBool
|
||||
|
|
Загрузка…
Ссылка в новой задаче