зеркало из https://github.com/mozilla/gecko-dev.git
Elimninate the last known source of bogus "wrong parent style context" warnings, and make these warnings into assertions. Bug 374297, r+sr+a=dbaron
This commit is contained in:
Родитель
cde473408d
Коммит
39356896dd
|
@ -9923,23 +9923,13 @@ nsCSSFrameConstructor::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
|
|||
viewMgr->SynthesizeMouseMove(PR_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
// reget from content since it may have been regenerated...
|
||||
if (content) {
|
||||
nsIFrame* frame = mPresShell->GetPrimaryFrameFor(content);
|
||||
if (frame) {
|
||||
mPresShell->FrameManager()->DebugVerifyStyleTree(frame);
|
||||
}
|
||||
} else {
|
||||
NS_WARNING("Unable to test style tree integrity -- no content node");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
EndUpdate();
|
||||
|
||||
// cleanup references
|
||||
// cleanup references and verify the style tree. Note that the latter needs
|
||||
// to happen once we've processed the whole list, since until then the tree
|
||||
// is not in fact in a consistent state.
|
||||
index = count;
|
||||
while (0 <= --index) {
|
||||
const nsStyleChangeData* changeData;
|
||||
|
@ -9948,6 +9938,18 @@ nsCSSFrameConstructor::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
|
|||
propTable->DeleteProperty(changeData->mFrame,
|
||||
nsGkAtoms::changeListProperty);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
// reget frame from content since it may have been regenerated...
|
||||
if (changeData->mContent) {
|
||||
nsIFrame* frame = mPresShell->GetPrimaryFrameFor(changeData->mContent);
|
||||
if (frame) {
|
||||
mPresShell->FrameManager()->DebugVerifyStyleTree(frame);
|
||||
}
|
||||
} else {
|
||||
NS_WARNING("Unable to test style tree integrity -- no content node");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
aChangeList.Clear();
|
||||
|
|
|
@ -777,8 +777,8 @@ VerifySameTree(nsStyleContext* aContext1, nsStyleContext* aContext2)
|
|||
break;
|
||||
top2 = parent;
|
||||
}
|
||||
if (top1 != top2)
|
||||
printf("Style contexts are not in the same style context tree.\n");
|
||||
NS_ASSERTION(top1 == top2,
|
||||
"Style contexts are not in the same style context tree");
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -812,9 +812,10 @@ VerifyContextParent(nsPresContext* aPresContext, nsIFrame* aFrame,
|
|||
if (aParentContext != actualParentContext) {
|
||||
DumpContext(aFrame, aContext);
|
||||
if (aContext == aParentContext) {
|
||||
fputs("Using parent's style context\n\n", stdout);
|
||||
NS_ERROR("Using parent's style context");
|
||||
}
|
||||
else {
|
||||
NS_ERROR("Wrong parent style context");
|
||||
fputs("Wrong parent style context: ", stdout);
|
||||
DumpContext(nsnull, actualParentContext);
|
||||
fputs("should be using: ", stdout);
|
||||
|
@ -826,6 +827,7 @@ VerifyContextParent(nsPresContext* aPresContext, nsIFrame* aFrame,
|
|||
}
|
||||
else {
|
||||
if (actualParentContext) {
|
||||
NS_ERROR("Have parent context and shouldn't");
|
||||
DumpContext(aFrame, aContext);
|
||||
fputs("Has parent context: ", stdout);
|
||||
DumpContext(nsnull, actualParentContext);
|
||||
|
|
Загрузка…
Ссылка в новой задаче