зеркало из https://github.com/mozilla/pjs.git
Fixed verify reflow to avoid creating reflow commands during a verify reflow
This commit is contained in:
Родитель
2e79a53493
Коммит
7d4c85eeae
|
@ -247,6 +247,7 @@ protected:
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
void VerifyIncrementalReflow();
|
void VerifyIncrementalReflow();
|
||||||
|
PRBool mInVerifyReflow;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsIDocument* mDocument;
|
nsIDocument* mDocument;
|
||||||
|
@ -717,6 +718,11 @@ PresShell::EndReflow(nsIDocument *aDocument, nsIPresShell* aShell)
|
||||||
void
|
void
|
||||||
PresShell::AppendReflowCommand(nsIReflowCommand* aReflowCommand)
|
PresShell::AppendReflowCommand(nsIReflowCommand* aReflowCommand)
|
||||||
{
|
{
|
||||||
|
#ifdef NS_DEBUG
|
||||||
|
if (mInVerifyReflow) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
mReflowCommands.AppendElement(aReflowCommand);
|
mReflowCommands.AppendElement(aReflowCommand);
|
||||||
NS_ADDREF(aReflowCommand);
|
NS_ADDREF(aReflowCommand);
|
||||||
}
|
}
|
||||||
|
@ -749,18 +755,25 @@ PresShell::ProcessReflowCommands()
|
||||||
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
||||||
("PresShell::ProcessReflowCommands: end reflow command"));
|
("PresShell::ProcessReflowCommands: end reflow command"));
|
||||||
}
|
}
|
||||||
|
NS_IF_RELEASE(rcx);
|
||||||
|
|
||||||
// Place and size the root frame
|
// Place and size the root frame
|
||||||
mRootFrame->SizeTo(desiredSize.width, desiredSize.height);
|
mRootFrame->SizeTo(desiredSize.width, desiredSize.height);
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
if (nsIFrame::GetVerifyTreeEnable()) {
|
if (nsIFrame::GetVerifyTreeEnable()) {
|
||||||
mRootFrame->VerifyTree();
|
mRootFrame->VerifyTree();
|
||||||
}
|
}
|
||||||
if (GetVerifyReflowEnable()) {
|
if (GetVerifyReflowEnable()) {
|
||||||
|
mInVerifyReflow = PR_TRUE;
|
||||||
VerifyIncrementalReflow();
|
VerifyIncrementalReflow();
|
||||||
|
mInVerifyReflow = PR_FALSE;
|
||||||
|
|
||||||
|
if (0 != mReflowCommands.Count()) {
|
||||||
|
printf("XXX yikes!\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
NS_IF_RELEASE(rcx);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -247,6 +247,7 @@ protected:
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
void VerifyIncrementalReflow();
|
void VerifyIncrementalReflow();
|
||||||
|
PRBool mInVerifyReflow;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsIDocument* mDocument;
|
nsIDocument* mDocument;
|
||||||
|
@ -717,6 +718,11 @@ PresShell::EndReflow(nsIDocument *aDocument, nsIPresShell* aShell)
|
||||||
void
|
void
|
||||||
PresShell::AppendReflowCommand(nsIReflowCommand* aReflowCommand)
|
PresShell::AppendReflowCommand(nsIReflowCommand* aReflowCommand)
|
||||||
{
|
{
|
||||||
|
#ifdef NS_DEBUG
|
||||||
|
if (mInVerifyReflow) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
mReflowCommands.AppendElement(aReflowCommand);
|
mReflowCommands.AppendElement(aReflowCommand);
|
||||||
NS_ADDREF(aReflowCommand);
|
NS_ADDREF(aReflowCommand);
|
||||||
}
|
}
|
||||||
|
@ -749,18 +755,25 @@ PresShell::ProcessReflowCommands()
|
||||||
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
||||||
("PresShell::ProcessReflowCommands: end reflow command"));
|
("PresShell::ProcessReflowCommands: end reflow command"));
|
||||||
}
|
}
|
||||||
|
NS_IF_RELEASE(rcx);
|
||||||
|
|
||||||
// Place and size the root frame
|
// Place and size the root frame
|
||||||
mRootFrame->SizeTo(desiredSize.width, desiredSize.height);
|
mRootFrame->SizeTo(desiredSize.width, desiredSize.height);
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
if (nsIFrame::GetVerifyTreeEnable()) {
|
if (nsIFrame::GetVerifyTreeEnable()) {
|
||||||
mRootFrame->VerifyTree();
|
mRootFrame->VerifyTree();
|
||||||
}
|
}
|
||||||
if (GetVerifyReflowEnable()) {
|
if (GetVerifyReflowEnable()) {
|
||||||
|
mInVerifyReflow = PR_TRUE;
|
||||||
VerifyIncrementalReflow();
|
VerifyIncrementalReflow();
|
||||||
|
mInVerifyReflow = PR_FALSE;
|
||||||
|
|
||||||
|
if (0 != mReflowCommands.Count()) {
|
||||||
|
printf("XXX yikes!\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
NS_IF_RELEASE(rcx);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче