diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index bbf93f768e3..f4276986534 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -1925,8 +1925,7 @@ PresShell::ProcessReflowCommands() LL_I2L(maxTime, gMaxRCProcessingTime); if (LL_CMP(totalTime, >, maxTime)) - break; - + break; } } NS_IF_RELEASE(rcx); diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 73a39f43f5a..86e451e617d 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -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; } diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index 73a39f43f5a..86e451e617d 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -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; } diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index 73a39f43f5a..86e451e617d 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -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; } diff --git a/mozilla/layout/generic/nsInlineFrame.cpp b/mozilla/layout/generic/nsInlineFrame.cpp index 6f84a50dc49..261b28679b7 100644 --- a/mozilla/layout/generic/nsInlineFrame.cpp +++ b/mozilla/layout/generic/nsInlineFrame.cpp @@ -102,12 +102,8 @@ nsInlineFrame::AppendFrames(nsIPresContext* aPresContext, if (aFrameList) { mFrames.AppendFrames(this, aFrameList); - // generate a reflow command for this frame - nsCOMPtr 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 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 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 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; } diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index 92bf4a408c1..dbbe0d3399e 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -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 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 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); } diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 73a39f43f5a..86e451e617d 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -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; } diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index 73a39f43f5a..86e451e617d 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -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; } diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index 73a39f43f5a..86e451e617d 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -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; } diff --git a/mozilla/layout/html/base/src/nsInlineFrame.cpp b/mozilla/layout/html/base/src/nsInlineFrame.cpp index 6f84a50dc49..261b28679b7 100644 --- a/mozilla/layout/html/base/src/nsInlineFrame.cpp +++ b/mozilla/layout/html/base/src/nsInlineFrame.cpp @@ -102,12 +102,8 @@ nsInlineFrame::AppendFrames(nsIPresContext* aPresContext, if (aFrameList) { mFrames.AppendFrames(this, aFrameList); - // generate a reflow command for this frame - nsCOMPtr 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 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 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 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; } diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index bbf93f768e3..f4276986534 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -1925,8 +1925,7 @@ PresShell::ProcessReflowCommands() LL_I2L(maxTime, gMaxRCProcessingTime); if (LL_CMP(totalTime, >, maxTime)) - break; - + break; } } NS_IF_RELEASE(rcx); diff --git a/mozilla/layout/html/base/src/nsTextFrame.cpp b/mozilla/layout/html/base/src/nsTextFrame.cpp index 92bf4a408c1..dbbe0d3399e 100644 --- a/mozilla/layout/html/base/src/nsTextFrame.cpp +++ b/mozilla/layout/html/base/src/nsTextFrame.cpp @@ -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 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 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); }