зеркало из https://github.com/mozilla/pjs.git
Fix GetSelectorText to truncate the out string. Bug 142648, patch by Daniel
Kraft <domob@daniel-kraft.net>, r+sr=bzbarsky
This commit is contained in:
Родитель
6d5130790d
Коммит
bc85b692c0
|
@ -536,8 +536,12 @@ void nsCSSSelector::AppendNegationToString(nsAString& aString)
|
|||
// StyleRule:selectorText
|
||||
//
|
||||
void
|
||||
nsCSSSelector::ToString(nsAString& aString, nsICSSStyleSheet* aSheet) const
|
||||
nsCSSSelector::ToString(nsAString& aString, nsICSSStyleSheet* aSheet,
|
||||
PRBool aAppend) const
|
||||
{
|
||||
if (!aAppend)
|
||||
aString.Truncate();
|
||||
|
||||
ToStringInternal(aString, aSheet, IsPseudoElement(mTag), 0);
|
||||
}
|
||||
|
||||
|
@ -549,7 +553,7 @@ void nsCSSSelector::ToStringInternal(nsAString& aString,
|
|||
nsAutoString temp;
|
||||
PRBool aIsNegated = PRBool(0 < aNegatedIndex);
|
||||
PRBool isPseudoElement = IsPseudoElement(mTag);
|
||||
|
||||
|
||||
// selectors are linked from right-to-left, so the next selector in the linked list
|
||||
// actually precedes this one in the resulting string
|
||||
if (mNext) {
|
||||
|
@ -777,9 +781,10 @@ void nsCSSSelectorList::AddSelector(const nsCSSSelector& aSelector)
|
|||
void
|
||||
nsCSSSelectorList::ToString(nsAString& aResult, nsICSSStyleSheet* aSheet)
|
||||
{
|
||||
aResult.Truncate();
|
||||
nsCSSSelectorList *p = this;
|
||||
for (;;) {
|
||||
p->mSelectors->ToString(aResult, aSheet);
|
||||
p->mSelectors->ToString(aResult, aSheet, PR_TRUE);
|
||||
p = p->mNext;
|
||||
if (!p)
|
||||
break;
|
||||
|
|
|
@ -123,7 +123,8 @@ public:
|
|||
|
||||
PRInt32 CalcWeight(void) const;
|
||||
|
||||
void ToString(nsAString& aString, nsICSSStyleSheet* aSheet) const;
|
||||
void ToString(nsAString& aString, nsICSSStyleSheet* aSheet,
|
||||
PRBool aAppend = PR_FALSE) const;
|
||||
|
||||
private:
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче