Fix for 69142. r=attinasi, sr=waterson

This commit is contained in:
hyatt%netscape.com 2001-02-22 09:24:50 +00:00
Родитель 23ba5487c8
Коммит 16521d095b
2 изменённых файлов: 44 добавлений и 58 удалений

Просмотреть файл

@ -8376,36 +8376,32 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
// won't let it have a frame.
} else {
// Find the frame that precedes the insertion point.
nsIFrame* prevSibling = (aIndexInContainer == -1) ?
FindPreviousAnonymousSibling(shell, aContainer, aChild) :
FindPreviousSibling(shell, aContainer, aIndexInContainer);
nsIFrame* nextSibling = nsnull;
PRBool isAppend = PR_FALSE;
// If our container is null, we don't bother fetching previous and next siblings.
nsIFrame* parentFrame = GetFrameFor(shell, aPresContext, aContainer);
if (parentFrame) {
// Find the frame that precedes the insertion point.
nsIFrame* prevSibling = (aIndexInContainer == -1) ?
FindPreviousAnonymousSibling(shell, aContainer, aChild) :
FindPreviousSibling(shell, aContainer, aIndexInContainer);
nsIFrame* nextSibling = nsnull;
PRBool isAppend = PR_FALSE;
// If there is no previous sibling, then find the frame that follows
if (nsnull == prevSibling) {
nextSibling = (aIndexInContainer == -1) ?
FindNextAnonymousSibling(shell, aContainer, aChild) :
FindNextSibling(shell, aContainer, aIndexInContainer);
}
// If there is no previous sibling, then find the frame that follows
if (nsnull == prevSibling) {
nextSibling = (aIndexInContainer == -1) ?
FindNextAnonymousSibling(shell, aContainer, aChild) :
FindNextSibling(shell, aContainer, aIndexInContainer);
}
// Get the geometric parent. Use the prev sibling if we have it;
// otherwise use the next sibling
nsIFrame* parentFrame;
if (nsnull != prevSibling) {
prevSibling->GetParent(&parentFrame);
}
else if (nextSibling) {
nextSibling->GetParent(&parentFrame);
}
else {
// No previous or next sibling so treat this like an appended frame.
isAppend = PR_TRUE;
parentFrame = GetFrameFor(shell, aPresContext, aContainer);
// Get the geometric parent. Use the prev sibling if we have it;
// otherwise use the next sibling
if (!prevSibling && !nextSibling) {
// No previous or next sibling so treat this like an appended frame.
isAppend = PR_TRUE;
if (parentFrame) {
// If we didn't process children when we originally created the frame,
// then don't do any processing now
nsCOMPtr<nsIAtom> frameType;
@ -8415,10 +8411,7 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
return NS_OK;
}
}
}
// Construct a new frame
if (nsnull != parentFrame) {
// If the frame we are manipulating is a special frame then do
// something different instead of just inserting newly created
// frames.

Просмотреть файл

@ -8376,36 +8376,32 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
// won't let it have a frame.
} else {
// Find the frame that precedes the insertion point.
nsIFrame* prevSibling = (aIndexInContainer == -1) ?
FindPreviousAnonymousSibling(shell, aContainer, aChild) :
FindPreviousSibling(shell, aContainer, aIndexInContainer);
nsIFrame* nextSibling = nsnull;
PRBool isAppend = PR_FALSE;
// If our container is null, we don't bother fetching previous and next siblings.
nsIFrame* parentFrame = GetFrameFor(shell, aPresContext, aContainer);
if (parentFrame) {
// Find the frame that precedes the insertion point.
nsIFrame* prevSibling = (aIndexInContainer == -1) ?
FindPreviousAnonymousSibling(shell, aContainer, aChild) :
FindPreviousSibling(shell, aContainer, aIndexInContainer);
nsIFrame* nextSibling = nsnull;
PRBool isAppend = PR_FALSE;
// If there is no previous sibling, then find the frame that follows
if (nsnull == prevSibling) {
nextSibling = (aIndexInContainer == -1) ?
FindNextAnonymousSibling(shell, aContainer, aChild) :
FindNextSibling(shell, aContainer, aIndexInContainer);
}
// If there is no previous sibling, then find the frame that follows
if (nsnull == prevSibling) {
nextSibling = (aIndexInContainer == -1) ?
FindNextAnonymousSibling(shell, aContainer, aChild) :
FindNextSibling(shell, aContainer, aIndexInContainer);
}
// Get the geometric parent. Use the prev sibling if we have it;
// otherwise use the next sibling
nsIFrame* parentFrame;
if (nsnull != prevSibling) {
prevSibling->GetParent(&parentFrame);
}
else if (nextSibling) {
nextSibling->GetParent(&parentFrame);
}
else {
// No previous or next sibling so treat this like an appended frame.
isAppend = PR_TRUE;
parentFrame = GetFrameFor(shell, aPresContext, aContainer);
// Get the geometric parent. Use the prev sibling if we have it;
// otherwise use the next sibling
if (!prevSibling && !nextSibling) {
// No previous or next sibling so treat this like an appended frame.
isAppend = PR_TRUE;
if (parentFrame) {
// If we didn't process children when we originally created the frame,
// then don't do any processing now
nsCOMPtr<nsIAtom> frameType;
@ -8415,10 +8411,7 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
return NS_OK;
}
}
}
// Construct a new frame
if (nsnull != parentFrame) {
// If the frame we are manipulating is a special frame then do
// something different instead of just inserting newly created
// frames.