r=troy. Changed block, inline, and text frames to call the parent's ReflowDirtyChild() method instead of generating reflow commands.
git-svn-id: svn://10.0.0.236/trunk@58221 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
e419ca89e5
commit
990dc941ec
@ -1925,8 +1925,7 @@ PresShell::ProcessReflowCommands()
|
||||
|
||||
LL_I2L(maxTime, gMaxRCProcessingTime);
|
||||
if (LL_CMP(totalTime, >, maxTime))
|
||||
break;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
NS_IF_RELEASE(rcx);
|
||||
|
||||
@ -4670,18 +4670,8 @@ nsBlockFrame::AppendFrames(nsIPresContext* aPresContext,
|
||||
#endif
|
||||
nsresult rv = AddFrames(aPresContext, aFrameList, lastKid);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -4715,18 +4705,8 @@ nsBlockFrame::InsertFrames(nsIPresContext* aPresContext,
|
||||
#endif
|
||||
nsresult rv = AddFrames(aPresContext, aFrameList, aPrevFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -4889,18 +4869,8 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -4670,18 +4670,8 @@ nsBlockFrame::AppendFrames(nsIPresContext* aPresContext,
|
||||
#endif
|
||||
nsresult rv = AddFrames(aPresContext, aFrameList, lastKid);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -4715,18 +4705,8 @@ nsBlockFrame::InsertFrames(nsIPresContext* aPresContext,
|
||||
#endif
|
||||
nsresult rv = AddFrames(aPresContext, aFrameList, aPrevFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -4889,18 +4869,8 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -4670,18 +4670,8 @@ nsBlockFrame::AppendFrames(nsIPresContext* aPresContext,
|
||||
#endif
|
||||
nsresult rv = AddFrames(aPresContext, aFrameList, lastKid);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -4715,18 +4705,8 @@ nsBlockFrame::InsertFrames(nsIPresContext* aPresContext,
|
||||
#endif
|
||||
nsresult rv = AddFrames(aPresContext, aFrameList, aPrevFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -4889,18 +4869,8 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -102,12 +102,8 @@ nsInlineFrame::AppendFrames(nsIPresContext* aPresContext,
|
||||
if (aFrameList) {
|
||||
mFrames.AppendFrames(this, aFrameList);
|
||||
|
||||
// generate a reflow command for this frame
|
||||
nsCOMPtr<nsIReflowCommand> reflowCmd;
|
||||
NS_NewHTMLReflowCommand(getter_AddRefs(reflowCmd), this, nsIReflowCommand::ReflowDirty);
|
||||
if (reflowCmd) {
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@ -126,12 +122,8 @@ nsInlineFrame::InsertFrames(nsIPresContext* aPresContext,
|
||||
// Insert frames after aPrevFrame
|
||||
mFrames.InsertFrames(this, aPrevFrame, aFrameList);
|
||||
|
||||
// generate a reflow command for this frame
|
||||
nsCOMPtr<nsIReflowCommand> reflowCmd;
|
||||
NS_NewHTMLReflowCommand(getter_AddRefs(reflowCmd), this, nsIReflowCommand::ReflowDirty);
|
||||
if (reflowCmd) {
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@ -179,12 +171,8 @@ nsInlineFrame::RemoveFrame(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
if (generateReflowCommand) {
|
||||
// generate a reflow command for "this"
|
||||
nsCOMPtr<nsIReflowCommand> reflowCmd;
|
||||
NS_NewHTMLReflowCommand(getter_AddRefs(reflowCmd), this, nsIReflowCommand::ReflowDirty);
|
||||
if (reflowCmd) {
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
}
|
||||
|
||||
@ -209,12 +197,8 @@ nsInlineFrame::ReplaceFrame(nsIPresContext* aPresContext,
|
||||
mFrames.ReplaceFrame(this, aOldFrame, aNewFrame);
|
||||
aOldFrame->Destroy(aPresContext);
|
||||
|
||||
// generate a reflow command for "this"
|
||||
nsCOMPtr<nsIReflowCommand> reflowCmd;
|
||||
NS_NewHTMLReflowCommand(getter_AddRefs(reflowCmd), this, nsIReflowCommand::ReflowDirty);
|
||||
if (reflowCmd) {
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -782,20 +782,14 @@ nsTextFrame::ContentChanged(nsIPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
// Generate a reflow command with this frame as the target frame
|
||||
nsIReflowCommand* cmd;
|
||||
nsresult rv;
|
||||
|
||||
rv = NS_NewHTMLReflowCommand(&cmd, targetTextFrame,
|
||||
nsIReflowCommand::ContentChanged);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
rv = aPresContext->GetShell(getter_AddRefs(shell));
|
||||
if (NS_SUCCEEDED(rv) && shell) {
|
||||
shell->AppendReflowCommand(cmd);
|
||||
NS_RELEASE(cmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
rv = aPresContext->GetShell(getter_AddRefs(shell));
|
||||
if (NS_SUCCEEDED(rv) && shell && mParent) {
|
||||
mParent->ReflowDirtyChild(shell, this);
|
||||
}
|
||||
|
||||
|
||||
return rv;
|
||||
}
|
||||
@ -3278,7 +3272,8 @@ nsTextFrame::Reflow(nsIPresContext* aPresContext,
|
||||
// bounds.
|
||||
// XXX We need a finer granularity than this, but it isn't clear what
|
||||
// has actually changed...
|
||||
if (eReflowReason_Incremental == aReflowState.reason) {
|
||||
if (eReflowReason_Incremental == aReflowState.reason ||
|
||||
eReflowReason_Dirty == aReflowState.reason) {
|
||||
Invalidate(aPresContext, mRect);
|
||||
}
|
||||
|
||||
|
||||
@ -4670,18 +4670,8 @@ nsBlockFrame::AppendFrames(nsIPresContext* aPresContext,
|
||||
#endif
|
||||
nsresult rv = AddFrames(aPresContext, aFrameList, lastKid);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -4715,18 +4705,8 @@ nsBlockFrame::InsertFrames(nsIPresContext* aPresContext,
|
||||
#endif
|
||||
nsresult rv = AddFrames(aPresContext, aFrameList, aPrevFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -4889,18 +4869,8 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -4670,18 +4670,8 @@ nsBlockFrame::AppendFrames(nsIPresContext* aPresContext,
|
||||
#endif
|
||||
nsresult rv = AddFrames(aPresContext, aFrameList, lastKid);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -4715,18 +4705,8 @@ nsBlockFrame::InsertFrames(nsIPresContext* aPresContext,
|
||||
#endif
|
||||
nsresult rv = AddFrames(aPresContext, aFrameList, aPrevFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -4889,18 +4869,8 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -4670,18 +4670,8 @@ nsBlockFrame::AppendFrames(nsIPresContext* aPresContext,
|
||||
#endif
|
||||
nsresult rv = AddFrames(aPresContext, aFrameList, lastKid);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -4715,18 +4705,8 @@ nsBlockFrame::InsertFrames(nsIPresContext* aPresContext,
|
||||
#endif
|
||||
nsresult rv = AddFrames(aPresContext, aFrameList, aPrevFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -4889,18 +4869,8 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Generate reflow command to reflow the dirty lines
|
||||
nsIReflowCommand* reflowCmd = nsnull;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this,
|
||||
nsIReflowCommand::ReflowDirty,
|
||||
nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsnull != aListName) {
|
||||
reflowCmd->SetChildListName(aListName);
|
||||
}
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -102,12 +102,8 @@ nsInlineFrame::AppendFrames(nsIPresContext* aPresContext,
|
||||
if (aFrameList) {
|
||||
mFrames.AppendFrames(this, aFrameList);
|
||||
|
||||
// generate a reflow command for this frame
|
||||
nsCOMPtr<nsIReflowCommand> reflowCmd;
|
||||
NS_NewHTMLReflowCommand(getter_AddRefs(reflowCmd), this, nsIReflowCommand::ReflowDirty);
|
||||
if (reflowCmd) {
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@ -126,12 +122,8 @@ nsInlineFrame::InsertFrames(nsIPresContext* aPresContext,
|
||||
// Insert frames after aPrevFrame
|
||||
mFrames.InsertFrames(this, aPrevFrame, aFrameList);
|
||||
|
||||
// generate a reflow command for this frame
|
||||
nsCOMPtr<nsIReflowCommand> reflowCmd;
|
||||
NS_NewHTMLReflowCommand(getter_AddRefs(reflowCmd), this, nsIReflowCommand::ReflowDirty);
|
||||
if (reflowCmd) {
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@ -179,12 +171,8 @@ nsInlineFrame::RemoveFrame(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
if (generateReflowCommand) {
|
||||
// generate a reflow command for "this"
|
||||
nsCOMPtr<nsIReflowCommand> reflowCmd;
|
||||
NS_NewHTMLReflowCommand(getter_AddRefs(reflowCmd), this, nsIReflowCommand::ReflowDirty);
|
||||
if (reflowCmd) {
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
}
|
||||
}
|
||||
|
||||
@ -209,12 +197,8 @@ nsInlineFrame::ReplaceFrame(nsIPresContext* aPresContext,
|
||||
mFrames.ReplaceFrame(this, aOldFrame, aNewFrame);
|
||||
aOldFrame->Destroy(aPresContext);
|
||||
|
||||
// generate a reflow command for "this"
|
||||
nsCOMPtr<nsIReflowCommand> reflowCmd;
|
||||
NS_NewHTMLReflowCommand(getter_AddRefs(reflowCmd), this, nsIReflowCommand::ReflowDirty);
|
||||
if (reflowCmd) {
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
ReflowDirtyChild(&aPresShell, nsnull);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1925,8 +1925,7 @@ PresShell::ProcessReflowCommands()
|
||||
|
||||
LL_I2L(maxTime, gMaxRCProcessingTime);
|
||||
if (LL_CMP(totalTime, >, maxTime))
|
||||
break;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
NS_IF_RELEASE(rcx);
|
||||
|
||||
@ -782,20 +782,14 @@ nsTextFrame::ContentChanged(nsIPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
// Generate a reflow command with this frame as the target frame
|
||||
nsIReflowCommand* cmd;
|
||||
nsresult rv;
|
||||
|
||||
rv = NS_NewHTMLReflowCommand(&cmd, targetTextFrame,
|
||||
nsIReflowCommand::ContentChanged);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
rv = aPresContext->GetShell(getter_AddRefs(shell));
|
||||
if (NS_SUCCEEDED(rv) && shell) {
|
||||
shell->AppendReflowCommand(cmd);
|
||||
NS_RELEASE(cmd);
|
||||
}
|
||||
// Ask the parent frame to reflow me.
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
rv = aPresContext->GetShell(getter_AddRefs(shell));
|
||||
if (NS_SUCCEEDED(rv) && shell && mParent) {
|
||||
mParent->ReflowDirtyChild(shell, this);
|
||||
}
|
||||
|
||||
|
||||
return rv;
|
||||
}
|
||||
@ -3278,7 +3272,8 @@ nsTextFrame::Reflow(nsIPresContext* aPresContext,
|
||||
// bounds.
|
||||
// XXX We need a finer granularity than this, but it isn't clear what
|
||||
// has actually changed...
|
||||
if (eReflowReason_Incremental == aReflowState.reason) {
|
||||
if (eReflowReason_Incremental == aReflowState.reason ||
|
||||
eReflowReason_Dirty == aReflowState.reason) {
|
||||
Invalidate(aPresContext, mRect);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user