Bug 1100773 patch 3 - Add an aListDescendants boolean to nsStyleContext::List. r=heycam

This commit is contained in:
L. David Baron 2014-11-26 22:29:45 -08:00
parent 714a5547a4
commit 3003f87cf7
2 changed files with 17 additions and 15 deletions

View File

@ -858,7 +858,7 @@ nsStyleContext::Mark()
}
#ifdef DEBUG
void nsStyleContext::List(FILE* out, int32_t aIndent)
void nsStyleContext::List(FILE* out, int32_t aIndent, bool aListDescendants)
{
nsAutoCString str;
// Indent
@ -895,19 +895,21 @@ void nsStyleContext::List(FILE* out, int32_t aIndent)
fprintf_stderr(out, "%s{}\n", str.get());
}
if (nullptr != mChild) {
nsStyleContext* child = mChild;
do {
child->List(out, aIndent + 1);
child = child->mNextSibling;
} while (mChild != child);
}
if (nullptr != mEmptyChild) {
nsStyleContext* child = mEmptyChild;
do {
child->List(out, aIndent + 1);
child = child->mNextSibling;
} while (mEmptyChild != child);
if (aListDescendants) {
if (nullptr != mChild) {
nsStyleContext* child = mChild;
do {
child->List(out, aIndent + 1, aListDescendants);
child = child->mNextSibling;
} while (mChild != child);
}
if (nullptr != mEmptyChild) {
nsStyleContext* child = mEmptyChild;
do {
child->List(out, aIndent + 1, aListDescendants);
child = child->mNextSibling;
} while (mEmptyChild != child);
}
}
}
#endif

View File

@ -395,7 +395,7 @@ public:
void ClearCachedInheritedStyleDataOnDescendants(uint32_t aStructs);
#ifdef DEBUG
void List(FILE* out, int32_t aIndent);
void List(FILE* out, int32_t aIndent, bool aListDescendants = true);
static void AssertStyleStructMaxDifferenceValid();
static const char* StructName(nsStyleStructID aSID);
static bool LookupStruct(const nsACString& aName, nsStyleStructID& aResult);