Attempt to fix topcrash bug 118014 by calling DeletingFrameSubtree in a bunch of places where it should be called to ensure that we don't leave dangling pointers in the undisplayed content map. sr=attinasi r=kin a=brendan
This commit is contained in:
@@ -7271,7 +7271,7 @@ nsCSSFrameConstructor::ReconstructDocElementHierarchy(nsIPresContext* aPresConte
|
|||||||
docElementFrame);
|
docElementFrame);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
// Remove any existing fixed items: they are always on the FixedContainingBlock
|
// Remove any existing fixed items: they are always on the FixedContainingBlock
|
||||||
rv = RemoveFixedItems(*aPresContext, *shell);
|
rv = RemoveFixedItems(aPresContext, shell, state.mFrameManager);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
// Create the new document element hierarchy
|
// Create the new document element hierarchy
|
||||||
nsIFrame* newChild;
|
nsIFrame* newChild;
|
||||||
@@ -8414,6 +8414,13 @@ nsCSSFrameConstructor::AddDummyFrameToSelect(nsIPresContext* aPresContext,
|
|||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// defined below
|
||||||
|
static nsresult
|
||||||
|
DeletingFrameSubtree(nsIPresContext* aPresContext,
|
||||||
|
nsIPresShell* aPresShell,
|
||||||
|
nsIFrameManager* aFrameManager,
|
||||||
|
nsIFrame* aFrame);
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsCSSFrameConstructor::RemoveDummyFrameFromSelect(nsIPresContext* aPresContext,
|
nsCSSFrameConstructor::RemoveDummyFrameFromSelect(nsIPresContext* aPresContext,
|
||||||
nsIPresShell * aPresShell,
|
nsIPresShell * aPresShell,
|
||||||
@@ -8445,6 +8452,8 @@ nsCSSFrameConstructor::RemoveDummyFrameFromSelect(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
nsCOMPtr<nsIFrameManager> frameManager;
|
nsCOMPtr<nsIFrameManager> frameManager;
|
||||||
aPresShell->GetFrameManager(getter_AddRefs(frameManager));
|
aPresShell->GetFrameManager(getter_AddRefs(frameManager));
|
||||||
|
DeletingFrameSubtree(aPresContext, aPresShell, frameManager,
|
||||||
|
dummyFrame);
|
||||||
frameManager->RemoveFrame(aPresContext, *aPresShell,
|
frameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||||
parentFrame, nsnull, dummyFrame);
|
parentFrame, nsnull, dummyFrame);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@@ -9291,6 +9300,9 @@ RemoveGeneratedContentFrameSiblings(nsIPresContext *aPresContext, nsIPresShell *
|
|||||||
|
|
||||||
if (beforeFrame &&
|
if (beforeFrame &&
|
||||||
IsGeneratedContentFor(content, beforeFrame, nsCSSAtoms::beforePseudo)) {
|
IsGeneratedContentFor(content, beforeFrame, nsCSSAtoms::beforePseudo)) {
|
||||||
|
// Do we need to call something like |DeletingFrameSubtree| here?
|
||||||
|
// (Do we create content nodes for images specified in
|
||||||
|
// ::before/::after? Even if they're 'display: none'?)
|
||||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||||
aInsertionPoint, nsnull,
|
aInsertionPoint, nsnull,
|
||||||
beforeFrame);
|
beforeFrame);
|
||||||
@@ -9318,6 +9330,9 @@ RemoveGeneratedContentFrameSiblings(nsIPresContext *aPresContext, nsIPresShell *
|
|||||||
|
|
||||||
if (afterFrame &&
|
if (afterFrame &&
|
||||||
IsGeneratedContentFor(content, afterFrame, nsCSSAtoms::afterPseudo)) {
|
IsGeneratedContentFor(content, afterFrame, nsCSSAtoms::afterPseudo)) {
|
||||||
|
// Do we need to call something like |DeletingFrameSubtree| here?
|
||||||
|
// (Do we create content nodes for images specified in
|
||||||
|
// ::before/::after? Even if they're 'display: none'?)
|
||||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||||
aInsertionPoint, nsnull,
|
aInsertionPoint, nsnull,
|
||||||
afterFrame);
|
afterFrame);
|
||||||
@@ -10986,6 +11001,9 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresShell* aPresShell,
|
|||||||
presShell->GetFrameManager(getter_AddRefs(frameManager));
|
presShell->GetFrameManager(getter_AddRefs(frameManager));
|
||||||
|
|
||||||
// Replace the old frame with the new frame
|
// Replace the old frame with the new frame
|
||||||
|
|
||||||
|
DeletingFrameSubtree(aPresContext, presShell, frameManager, aFrame);
|
||||||
|
|
||||||
// Reset the primary frame mapping
|
// Reset the primary frame mapping
|
||||||
frameManager->SetPrimaryFrameFor(content, newFrame);
|
frameManager->SetPrimaryFrameFor(content, newFrame);
|
||||||
|
|
||||||
@@ -11127,6 +11145,8 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresShell* aPresShell,
|
|||||||
newFrame = state.mFloatedItems.childList;
|
newFrame = state.mFloatedItems.childList;
|
||||||
state.mFloatedItems.childList = nsnull;
|
state.mFloatedItems.childList = nsnull;
|
||||||
}
|
}
|
||||||
|
DeletingFrameSubtree(aPresContext, presShell,
|
||||||
|
state.mFrameManager, aFrame);
|
||||||
state.mFrameManager->ReplaceFrame(aPresContext, *presShell, parentFrame,
|
state.mFrameManager->ReplaceFrame(aPresContext, *presShell, parentFrame,
|
||||||
listName, aFrame, newFrame);
|
listName, aFrame, newFrame);
|
||||||
|
|
||||||
@@ -12750,6 +12770,8 @@ nsCSSFrameConstructor::WrapFramesInFirstLetterFrame(
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Take the old textFrame out of the inline parents child list
|
// Take the old textFrame out of the inline parents child list
|
||||||
|
DeletingFrameSubtree(aPresContext, aState.mPresShell,
|
||||||
|
aState.mFrameManager, textFrame);
|
||||||
parentFrame->RemoveFrame(aPresContext, *aState.mPresShell.get(),
|
parentFrame->RemoveFrame(aPresContext, *aState.mPresShell.get(),
|
||||||
nsnull, textFrame);
|
nsnull, textFrame);
|
||||||
|
|
||||||
@@ -12896,9 +12918,8 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
nsCOMPtr<nsIStyleContext> newSC;
|
nsCOMPtr<nsIStyleContext> newSC;
|
||||||
aPresContext->ResolveStyleContextFor(textContent, parentSC,
|
aPresContext->ResolveStyleContextForNonElement(parentSC, PR_FALSE,
|
||||||
PR_FALSE,
|
getter_AddRefs(newSC));
|
||||||
getter_AddRefs(newSC));
|
|
||||||
if (!newSC) {
|
if (!newSC) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -12918,6 +12939,8 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
|
|||||||
nextTextFrame->GetParent(&nextTextParent);
|
nextTextFrame->GetParent(&nextTextParent);
|
||||||
if (nextTextParent) {
|
if (nextTextParent) {
|
||||||
nsSplittableFrame::BreakFromPrevFlow(nextTextFrame);
|
nsSplittableFrame::BreakFromPrevFlow(nextTextFrame);
|
||||||
|
DeletingFrameSubtree(aPresContext, aPresShell,
|
||||||
|
aFrameManager, nextTextFrame);
|
||||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell, nextTextParent,
|
aFrameManager->RemoveFrame(aPresContext, *aPresShell, nextTextParent,
|
||||||
nsnull, nextTextFrame);
|
nsnull, nextTextFrame);
|
||||||
}
|
}
|
||||||
@@ -12940,10 +12963,12 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
|
|||||||
printf("RemoveFloatingFirstLetterFrames: textContent=%p oldTextFrame=%p newTextFrame=%p\n",
|
printf("RemoveFloatingFirstLetterFrames: textContent=%p oldTextFrame=%p newTextFrame=%p\n",
|
||||||
textContent.get(), textFrame, newTextFrame);
|
textContent.get(), textFrame, newTextFrame);
|
||||||
#endif
|
#endif
|
||||||
|
// Should we call DeletingFrameSubtree on the placeholder instead
|
||||||
|
// and skip this call?
|
||||||
aFrameManager->UnregisterPlaceholderFrame(placeholderFrame);
|
aFrameManager->UnregisterPlaceholderFrame(placeholderFrame);
|
||||||
aFrameManager->SetPrimaryFrameFor(textContent, nsnull);
|
|
||||||
|
|
||||||
// Remove the floater frame
|
// Remove the floater frame
|
||||||
|
DeletingFrameSubtree(aPresContext, aPresShell, aFrameManager, floater);
|
||||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||||
aBlockFrame, nsLayoutAtoms::floaterList,
|
aBlockFrame, nsLayoutAtoms::floaterList,
|
||||||
floater);
|
floater);
|
||||||
@@ -13003,7 +13028,7 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
// Next rip out the kid and replace it with the text frame
|
// Next rip out the kid and replace it with the text frame
|
||||||
nsIFrameManager* frameManager = aFrameManager;
|
nsIFrameManager* frameManager = aFrameManager;
|
||||||
frameManager->SetPrimaryFrameFor(textContent, nsnull);
|
DeletingFrameSubtree(aPresContext, aPresShell, frameManager, kid);
|
||||||
frameManager->RemoveFrame(aPresContext, *aPresShell,
|
frameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||||
aFrame, nsnull, kid);
|
aFrame, nsnull, kid);
|
||||||
|
|
||||||
@@ -13071,6 +13096,8 @@ nsCSSFrameConstructor::RecoverLetterFrames(nsIPresShell* aPresShell, nsIPresCont
|
|||||||
}
|
}
|
||||||
if (parentFrame) {
|
if (parentFrame) {
|
||||||
// Take the old textFrame out of the parents child list
|
// Take the old textFrame out of the parents child list
|
||||||
|
DeletingFrameSubtree(aPresContext, aState.mPresShell,
|
||||||
|
aState.mFrameManager, textFrame);
|
||||||
parentFrame->RemoveFrame(aPresContext, *aState.mPresShell.get(),
|
parentFrame->RemoveFrame(aPresContext, *aState.mPresShell.get(),
|
||||||
nsnull, textFrame);
|
nsnull, textFrame);
|
||||||
|
|
||||||
@@ -13815,6 +13842,10 @@ nsCSSFrameConstructor::WipeContainingBlock(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
// Destroy the frames. As we do make sure any content to frame mappings
|
// Destroy the frames. As we do make sure any content to frame mappings
|
||||||
// or entries in the undisplayed content map are removed
|
// or entries in the undisplayed content map are removed
|
||||||
|
nsCOMPtr<nsIContent> parentContent;
|
||||||
|
aFrame->GetContent(getter_AddRefs(parentContent));
|
||||||
|
frameManager->ClearAllUndisplayedContentIn(parentContent);
|
||||||
|
|
||||||
CleanupFrameReferences(aPresContext, frameManager, aFrameList);
|
CleanupFrameReferences(aPresContext, frameManager, aFrameList);
|
||||||
nsFrameList tmp(aFrameList);
|
nsFrameList tmp(aFrameList);
|
||||||
tmp.DestroyFrames(aPresContext);
|
tmp.DestroyFrames(aPresContext);
|
||||||
@@ -14211,22 +14242,25 @@ nsCSSFrameConstructor::RecreateEntireFrameTree(nsIPresContext* aPresContext)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsCSSFrameConstructor::RemoveFixedItems(nsIPresContext& aPresContext,
|
nsresult nsCSSFrameConstructor::RemoveFixedItems(nsIPresContext* aPresContext,
|
||||||
nsIPresShell& aPresShell)
|
nsIPresShell* aPresShell,
|
||||||
|
nsIFrameManager* aFrameManager)
|
||||||
{
|
{
|
||||||
nsresult rv=NS_OK;
|
nsresult rv=NS_OK;
|
||||||
|
|
||||||
if (mFixedContainingBlock) {
|
if (mFixedContainingBlock) {
|
||||||
nsIFrame *fixedChild = nsnull;
|
nsIFrame *fixedChild = nsnull;
|
||||||
do {
|
do {
|
||||||
mFixedContainingBlock->FirstChild(&aPresContext,
|
mFixedContainingBlock->FirstChild(aPresContext,
|
||||||
nsLayoutAtoms::fixedList,
|
nsLayoutAtoms::fixedList,
|
||||||
&fixedChild);
|
&fixedChild);
|
||||||
if (fixedChild) {
|
if (fixedChild) {
|
||||||
rv = mFixedContainingBlock->RemoveFrame(&aPresContext,
|
DeletingFrameSubtree(aPresContext, aPresShell, aFrameManager,
|
||||||
aPresShell,
|
fixedChild);
|
||||||
nsLayoutAtoms::fixedList,
|
rv = aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||||
fixedChild);
|
mFixedContainingBlock,
|
||||||
|
nsLayoutAtoms::fixedList,
|
||||||
|
fixedChild);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
NS_WARNING("Error removing frame from fixed containing block in RemoveFixedItems");
|
NS_WARNING("Error removing frame from fixed containing block in RemoveFixedItems");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -991,8 +991,9 @@ protected:
|
|||||||
nsIFrame* aPrevSibling,
|
nsIFrame* aPrevSibling,
|
||||||
nsFrameItems& aFrameItems);
|
nsFrameItems& aFrameItems);
|
||||||
|
|
||||||
nsresult RemoveFixedItems(nsIPresContext& aPresContext,
|
nsresult RemoveFixedItems(nsIPresContext* aPresContext,
|
||||||
nsIPresShell& aPresShell);
|
nsIPresShell* aPresShell,
|
||||||
|
nsIFrameManager* aFrameManager);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
nsIDocument* mDocument;
|
nsIDocument* mDocument;
|
||||||
|
|||||||
@@ -7271,7 +7271,7 @@ nsCSSFrameConstructor::ReconstructDocElementHierarchy(nsIPresContext* aPresConte
|
|||||||
docElementFrame);
|
docElementFrame);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
// Remove any existing fixed items: they are always on the FixedContainingBlock
|
// Remove any existing fixed items: they are always on the FixedContainingBlock
|
||||||
rv = RemoveFixedItems(*aPresContext, *shell);
|
rv = RemoveFixedItems(aPresContext, shell, state.mFrameManager);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
// Create the new document element hierarchy
|
// Create the new document element hierarchy
|
||||||
nsIFrame* newChild;
|
nsIFrame* newChild;
|
||||||
@@ -8414,6 +8414,13 @@ nsCSSFrameConstructor::AddDummyFrameToSelect(nsIPresContext* aPresContext,
|
|||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// defined below
|
||||||
|
static nsresult
|
||||||
|
DeletingFrameSubtree(nsIPresContext* aPresContext,
|
||||||
|
nsIPresShell* aPresShell,
|
||||||
|
nsIFrameManager* aFrameManager,
|
||||||
|
nsIFrame* aFrame);
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsCSSFrameConstructor::RemoveDummyFrameFromSelect(nsIPresContext* aPresContext,
|
nsCSSFrameConstructor::RemoveDummyFrameFromSelect(nsIPresContext* aPresContext,
|
||||||
nsIPresShell * aPresShell,
|
nsIPresShell * aPresShell,
|
||||||
@@ -8445,6 +8452,8 @@ nsCSSFrameConstructor::RemoveDummyFrameFromSelect(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
nsCOMPtr<nsIFrameManager> frameManager;
|
nsCOMPtr<nsIFrameManager> frameManager;
|
||||||
aPresShell->GetFrameManager(getter_AddRefs(frameManager));
|
aPresShell->GetFrameManager(getter_AddRefs(frameManager));
|
||||||
|
DeletingFrameSubtree(aPresContext, aPresShell, frameManager,
|
||||||
|
dummyFrame);
|
||||||
frameManager->RemoveFrame(aPresContext, *aPresShell,
|
frameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||||
parentFrame, nsnull, dummyFrame);
|
parentFrame, nsnull, dummyFrame);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@@ -9291,6 +9300,9 @@ RemoveGeneratedContentFrameSiblings(nsIPresContext *aPresContext, nsIPresShell *
|
|||||||
|
|
||||||
if (beforeFrame &&
|
if (beforeFrame &&
|
||||||
IsGeneratedContentFor(content, beforeFrame, nsCSSAtoms::beforePseudo)) {
|
IsGeneratedContentFor(content, beforeFrame, nsCSSAtoms::beforePseudo)) {
|
||||||
|
// Do we need to call something like |DeletingFrameSubtree| here?
|
||||||
|
// (Do we create content nodes for images specified in
|
||||||
|
// ::before/::after? Even if they're 'display: none'?)
|
||||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||||
aInsertionPoint, nsnull,
|
aInsertionPoint, nsnull,
|
||||||
beforeFrame);
|
beforeFrame);
|
||||||
@@ -9318,6 +9330,9 @@ RemoveGeneratedContentFrameSiblings(nsIPresContext *aPresContext, nsIPresShell *
|
|||||||
|
|
||||||
if (afterFrame &&
|
if (afterFrame &&
|
||||||
IsGeneratedContentFor(content, afterFrame, nsCSSAtoms::afterPseudo)) {
|
IsGeneratedContentFor(content, afterFrame, nsCSSAtoms::afterPseudo)) {
|
||||||
|
// Do we need to call something like |DeletingFrameSubtree| here?
|
||||||
|
// (Do we create content nodes for images specified in
|
||||||
|
// ::before/::after? Even if they're 'display: none'?)
|
||||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||||
aInsertionPoint, nsnull,
|
aInsertionPoint, nsnull,
|
||||||
afterFrame);
|
afterFrame);
|
||||||
@@ -10986,6 +11001,9 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresShell* aPresShell,
|
|||||||
presShell->GetFrameManager(getter_AddRefs(frameManager));
|
presShell->GetFrameManager(getter_AddRefs(frameManager));
|
||||||
|
|
||||||
// Replace the old frame with the new frame
|
// Replace the old frame with the new frame
|
||||||
|
|
||||||
|
DeletingFrameSubtree(aPresContext, presShell, frameManager, aFrame);
|
||||||
|
|
||||||
// Reset the primary frame mapping
|
// Reset the primary frame mapping
|
||||||
frameManager->SetPrimaryFrameFor(content, newFrame);
|
frameManager->SetPrimaryFrameFor(content, newFrame);
|
||||||
|
|
||||||
@@ -11127,6 +11145,8 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresShell* aPresShell,
|
|||||||
newFrame = state.mFloatedItems.childList;
|
newFrame = state.mFloatedItems.childList;
|
||||||
state.mFloatedItems.childList = nsnull;
|
state.mFloatedItems.childList = nsnull;
|
||||||
}
|
}
|
||||||
|
DeletingFrameSubtree(aPresContext, presShell,
|
||||||
|
state.mFrameManager, aFrame);
|
||||||
state.mFrameManager->ReplaceFrame(aPresContext, *presShell, parentFrame,
|
state.mFrameManager->ReplaceFrame(aPresContext, *presShell, parentFrame,
|
||||||
listName, aFrame, newFrame);
|
listName, aFrame, newFrame);
|
||||||
|
|
||||||
@@ -12750,6 +12770,8 @@ nsCSSFrameConstructor::WrapFramesInFirstLetterFrame(
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Take the old textFrame out of the inline parents child list
|
// Take the old textFrame out of the inline parents child list
|
||||||
|
DeletingFrameSubtree(aPresContext, aState.mPresShell,
|
||||||
|
aState.mFrameManager, textFrame);
|
||||||
parentFrame->RemoveFrame(aPresContext, *aState.mPresShell.get(),
|
parentFrame->RemoveFrame(aPresContext, *aState.mPresShell.get(),
|
||||||
nsnull, textFrame);
|
nsnull, textFrame);
|
||||||
|
|
||||||
@@ -12896,9 +12918,8 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
nsCOMPtr<nsIStyleContext> newSC;
|
nsCOMPtr<nsIStyleContext> newSC;
|
||||||
aPresContext->ResolveStyleContextFor(textContent, parentSC,
|
aPresContext->ResolveStyleContextForNonElement(parentSC, PR_FALSE,
|
||||||
PR_FALSE,
|
getter_AddRefs(newSC));
|
||||||
getter_AddRefs(newSC));
|
|
||||||
if (!newSC) {
|
if (!newSC) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -12918,6 +12939,8 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
|
|||||||
nextTextFrame->GetParent(&nextTextParent);
|
nextTextFrame->GetParent(&nextTextParent);
|
||||||
if (nextTextParent) {
|
if (nextTextParent) {
|
||||||
nsSplittableFrame::BreakFromPrevFlow(nextTextFrame);
|
nsSplittableFrame::BreakFromPrevFlow(nextTextFrame);
|
||||||
|
DeletingFrameSubtree(aPresContext, aPresShell,
|
||||||
|
aFrameManager, nextTextFrame);
|
||||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell, nextTextParent,
|
aFrameManager->RemoveFrame(aPresContext, *aPresShell, nextTextParent,
|
||||||
nsnull, nextTextFrame);
|
nsnull, nextTextFrame);
|
||||||
}
|
}
|
||||||
@@ -12940,10 +12963,12 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
|
|||||||
printf("RemoveFloatingFirstLetterFrames: textContent=%p oldTextFrame=%p newTextFrame=%p\n",
|
printf("RemoveFloatingFirstLetterFrames: textContent=%p oldTextFrame=%p newTextFrame=%p\n",
|
||||||
textContent.get(), textFrame, newTextFrame);
|
textContent.get(), textFrame, newTextFrame);
|
||||||
#endif
|
#endif
|
||||||
|
// Should we call DeletingFrameSubtree on the placeholder instead
|
||||||
|
// and skip this call?
|
||||||
aFrameManager->UnregisterPlaceholderFrame(placeholderFrame);
|
aFrameManager->UnregisterPlaceholderFrame(placeholderFrame);
|
||||||
aFrameManager->SetPrimaryFrameFor(textContent, nsnull);
|
|
||||||
|
|
||||||
// Remove the floater frame
|
// Remove the floater frame
|
||||||
|
DeletingFrameSubtree(aPresContext, aPresShell, aFrameManager, floater);
|
||||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||||
aBlockFrame, nsLayoutAtoms::floaterList,
|
aBlockFrame, nsLayoutAtoms::floaterList,
|
||||||
floater);
|
floater);
|
||||||
@@ -13003,7 +13028,7 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
// Next rip out the kid and replace it with the text frame
|
// Next rip out the kid and replace it with the text frame
|
||||||
nsIFrameManager* frameManager = aFrameManager;
|
nsIFrameManager* frameManager = aFrameManager;
|
||||||
frameManager->SetPrimaryFrameFor(textContent, nsnull);
|
DeletingFrameSubtree(aPresContext, aPresShell, frameManager, kid);
|
||||||
frameManager->RemoveFrame(aPresContext, *aPresShell,
|
frameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||||
aFrame, nsnull, kid);
|
aFrame, nsnull, kid);
|
||||||
|
|
||||||
@@ -13071,6 +13096,8 @@ nsCSSFrameConstructor::RecoverLetterFrames(nsIPresShell* aPresShell, nsIPresCont
|
|||||||
}
|
}
|
||||||
if (parentFrame) {
|
if (parentFrame) {
|
||||||
// Take the old textFrame out of the parents child list
|
// Take the old textFrame out of the parents child list
|
||||||
|
DeletingFrameSubtree(aPresContext, aState.mPresShell,
|
||||||
|
aState.mFrameManager, textFrame);
|
||||||
parentFrame->RemoveFrame(aPresContext, *aState.mPresShell.get(),
|
parentFrame->RemoveFrame(aPresContext, *aState.mPresShell.get(),
|
||||||
nsnull, textFrame);
|
nsnull, textFrame);
|
||||||
|
|
||||||
@@ -13815,6 +13842,10 @@ nsCSSFrameConstructor::WipeContainingBlock(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
// Destroy the frames. As we do make sure any content to frame mappings
|
// Destroy the frames. As we do make sure any content to frame mappings
|
||||||
// or entries in the undisplayed content map are removed
|
// or entries in the undisplayed content map are removed
|
||||||
|
nsCOMPtr<nsIContent> parentContent;
|
||||||
|
aFrame->GetContent(getter_AddRefs(parentContent));
|
||||||
|
frameManager->ClearAllUndisplayedContentIn(parentContent);
|
||||||
|
|
||||||
CleanupFrameReferences(aPresContext, frameManager, aFrameList);
|
CleanupFrameReferences(aPresContext, frameManager, aFrameList);
|
||||||
nsFrameList tmp(aFrameList);
|
nsFrameList tmp(aFrameList);
|
||||||
tmp.DestroyFrames(aPresContext);
|
tmp.DestroyFrames(aPresContext);
|
||||||
@@ -14211,22 +14242,25 @@ nsCSSFrameConstructor::RecreateEntireFrameTree(nsIPresContext* aPresContext)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsCSSFrameConstructor::RemoveFixedItems(nsIPresContext& aPresContext,
|
nsresult nsCSSFrameConstructor::RemoveFixedItems(nsIPresContext* aPresContext,
|
||||||
nsIPresShell& aPresShell)
|
nsIPresShell* aPresShell,
|
||||||
|
nsIFrameManager* aFrameManager)
|
||||||
{
|
{
|
||||||
nsresult rv=NS_OK;
|
nsresult rv=NS_OK;
|
||||||
|
|
||||||
if (mFixedContainingBlock) {
|
if (mFixedContainingBlock) {
|
||||||
nsIFrame *fixedChild = nsnull;
|
nsIFrame *fixedChild = nsnull;
|
||||||
do {
|
do {
|
||||||
mFixedContainingBlock->FirstChild(&aPresContext,
|
mFixedContainingBlock->FirstChild(aPresContext,
|
||||||
nsLayoutAtoms::fixedList,
|
nsLayoutAtoms::fixedList,
|
||||||
&fixedChild);
|
&fixedChild);
|
||||||
if (fixedChild) {
|
if (fixedChild) {
|
||||||
rv = mFixedContainingBlock->RemoveFrame(&aPresContext,
|
DeletingFrameSubtree(aPresContext, aPresShell, aFrameManager,
|
||||||
aPresShell,
|
fixedChild);
|
||||||
nsLayoutAtoms::fixedList,
|
rv = aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||||
fixedChild);
|
mFixedContainingBlock,
|
||||||
|
nsLayoutAtoms::fixedList,
|
||||||
|
fixedChild);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
NS_WARNING("Error removing frame from fixed containing block in RemoveFixedItems");
|
NS_WARNING("Error removing frame from fixed containing block in RemoveFixedItems");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -991,8 +991,9 @@ protected:
|
|||||||
nsIFrame* aPrevSibling,
|
nsIFrame* aPrevSibling,
|
||||||
nsFrameItems& aFrameItems);
|
nsFrameItems& aFrameItems);
|
||||||
|
|
||||||
nsresult RemoveFixedItems(nsIPresContext& aPresContext,
|
nsresult RemoveFixedItems(nsIPresContext* aPresContext,
|
||||||
nsIPresShell& aPresShell);
|
nsIPresShell* aPresShell,
|
||||||
|
nsIFrameManager* aFrameManager);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
nsIDocument* mDocument;
|
nsIDocument* mDocument;
|
||||||
|
|||||||
Reference in New Issue
Block a user