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

View File

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