mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 14:45:29 +00:00
Bug 506602. fix "warning: recurring into frame construction" when there isn't anything wrong. r=bzbarsky
This commit is contained in:
parent
2b632b3f74
commit
ed66e633d9
@ -5589,7 +5589,6 @@ IsRootBoxFrame(nsIFrame *aFrame)
|
||||
nsresult
|
||||
nsCSSFrameConstructor::ReconstructDocElementHierarchy()
|
||||
{
|
||||
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
|
||||
return RecreateFramesForContent(mPresShell->GetDocument()->GetRootContent());
|
||||
}
|
||||
|
||||
@ -6298,7 +6297,10 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
|
||||
for (PRUint32 i = aNewIndexInContainer; i < count; ++i) {
|
||||
if (IsSpecialFramesetChild(aContainer->GetChildAt(i))) {
|
||||
// Just reframe the parent, since framesets are weird like that.
|
||||
return RecreateFramesForContent(parentFrame->GetContent());
|
||||
LAYOUT_PHASE_TEMP_EXIT();
|
||||
nsresult rv = RecreateFramesForContent(parentFrame->GetContent());
|
||||
LAYOUT_PHASE_TEMP_REENTER();
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6309,8 +6311,12 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
|
||||
}
|
||||
|
||||
#ifdef MOZ_MATHML
|
||||
if (parentFrame->IsFrameOfType(nsIFrame::eMathML))
|
||||
return RecreateFramesForContent(parentFrame->GetContent());
|
||||
if (parentFrame->IsFrameOfType(nsIFrame::eMathML)) {
|
||||
LAYOUT_PHASE_TEMP_EXIT();
|
||||
nsresult rv = RecreateFramesForContent(parentFrame->GetContent());
|
||||
LAYOUT_PHASE_TEMP_REENTER();
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
// If the frame we are manipulating is a ``special'' frame (that is, one
|
||||
@ -6638,7 +6644,10 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
|
||||
if (frameType == nsGkAtoms::frameSetFrame &&
|
||||
IsSpecialFramesetChild(aChild)) {
|
||||
// Just reframe the parent, since framesets are weird like that.
|
||||
return RecreateFramesForContent(parentFrame->GetContent());
|
||||
LAYOUT_PHASE_TEMP_EXIT();
|
||||
nsresult rv = RecreateFramesForContent(parentFrame->GetContent());
|
||||
LAYOUT_PHASE_TEMP_REENTER();
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (frameType == nsGkAtoms::fieldSetFrame &&
|
||||
@ -6649,7 +6658,10 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
|
||||
// has a legend which occurs earlier in its child list than this node,
|
||||
// and if so, proceed. But we'd have to extend nsFieldSetFrame
|
||||
// to locate this legend in the inserted frames and extract it.
|
||||
return RecreateFramesForContent(parentFrame->GetContent());
|
||||
LAYOUT_PHASE_TEMP_EXIT();
|
||||
nsresult rv = RecreateFramesForContent(parentFrame->GetContent());
|
||||
LAYOUT_PHASE_TEMP_REENTER();
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Don't construct kids of leaves
|
||||
@ -6658,8 +6670,12 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
|
||||
}
|
||||
|
||||
#ifdef MOZ_MATHML
|
||||
if (parentFrame->IsFrameOfType(nsIFrame::eMathML))
|
||||
return RecreateFramesForContent(parentFrame->GetContent());
|
||||
if (parentFrame->IsFrameOfType(nsIFrame::eMathML)) {
|
||||
LAYOUT_PHASE_TEMP_EXIT();
|
||||
nsresult rv = RecreateFramesForContent(parentFrame->GetContent());
|
||||
LAYOUT_PHASE_TEMP_REENTER();
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
nsFrameConstructorState state(mPresShell, mFixedContainingBlock,
|
||||
@ -7200,10 +7216,13 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
|
||||
InvalidateCanvasIfNeeded(mPresShell, aChild);
|
||||
|
||||
// See whether we need to remove more than just childFrame
|
||||
LAYOUT_PHASE_TEMP_EXIT();
|
||||
if (MaybeRecreateContainerForFrameRemoval(childFrame, &rv)) {
|
||||
LAYOUT_PHASE_TEMP_REENTER();
|
||||
*aDidReconstruct = PR_TRUE;
|
||||
return rv;
|
||||
}
|
||||
LAYOUT_PHASE_TEMP_REENTER();
|
||||
|
||||
// Get the childFrame's parent frame
|
||||
nsIFrame* parentFrame = childFrame->GetParent();
|
||||
@ -7213,7 +7232,10 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
|
||||
IsSpecialFramesetChild(aChild)) {
|
||||
// Just reframe the parent, since framesets are weird like that.
|
||||
*aDidReconstruct = PR_TRUE;
|
||||
return RecreateFramesForContent(parentFrame->GetContent());
|
||||
LAYOUT_PHASE_TEMP_EXIT();
|
||||
nsresult rv = RecreateFramesForContent(parentFrame->GetContent());
|
||||
LAYOUT_PHASE_TEMP_REENTER();
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifdef MOZ_MATHML
|
||||
@ -7224,7 +7246,10 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
|
||||
parentFrame->GetParent() : parentFrame;
|
||||
if (possibleMathMLAncestor->IsFrameOfType(nsIFrame::eMathML)) {
|
||||
*aDidReconstruct = PR_TRUE;
|
||||
return RecreateFramesForContent(possibleMathMLAncestor->GetContent());
|
||||
LAYOUT_PHASE_TEMP_EXIT();
|
||||
nsresult rv = RecreateFramesForContent(possibleMathMLAncestor->GetContent());
|
||||
LAYOUT_PHASE_TEMP_REENTER();
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -7238,7 +7263,10 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
|
||||
aChild == AnyKidsNeedBlockParent(parentFrame->GetFirstChild(nsnull)) &&
|
||||
!AnyKidsNeedBlockParent(childFrame->GetNextSibling())) {
|
||||
*aDidReconstruct = PR_TRUE;
|
||||
return RecreateFramesForContent(grandparentFrame->GetContent());
|
||||
LAYOUT_PHASE_TEMP_EXIT();
|
||||
nsresult rv = RecreateFramesForContent(grandparentFrame->GetContent());
|
||||
LAYOUT_PHASE_TEMP_REENTER();
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Examine the containing-block for the removed content and see if
|
||||
@ -7375,12 +7403,16 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
|
||||
// and hence it's adjacent to a block end.
|
||||
PRInt32 prevSiblingIndex = aIndexInContainer - 1;
|
||||
if (prevSiblingIndex > 0 && prevSiblingIndex < childCount - 1) {
|
||||
LAYOUT_PHASE_TEMP_EXIT();
|
||||
ReframeTextIfNeeded(aContainer, prevSiblingIndex);
|
||||
LAYOUT_PHASE_TEMP_REENTER();
|
||||
}
|
||||
// Reframe any text node just after the node being removed, if there is
|
||||
// one, and if it's not the last child or the first child.
|
||||
if (aIndexInContainer > 0 && aIndexInContainer < childCount - 1) {
|
||||
LAYOUT_PHASE_TEMP_EXIT();
|
||||
ReframeTextIfNeeded(aContainer, aIndexInContainer);
|
||||
LAYOUT_PHASE_TEMP_REENTER();
|
||||
}
|
||||
}
|
||||
|
||||
@ -7644,7 +7676,10 @@ nsCSSFrameConstructor::CharacterDataChanged(nsIContent* aContent,
|
||||
NS_ASSERTION(!frame || !frame->IsGeneratedContentFrame(),
|
||||
"Bit should never be set on generated content");
|
||||
#endif
|
||||
return RecreateFramesForContent(aContent);
|
||||
LAYOUT_PHASE_TEMP_EXIT();
|
||||
nsresult rv = RecreateFramesForContent(aContent);
|
||||
LAYOUT_PHASE_TEMP_REENTER();
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Find the child frame
|
||||
|
Loading…
Reference in New Issue
Block a user