Bug 385354. When appending the first child of an element with :before content, we need to make sure we append after the :before frames for the element. r+sr=dbaron

This commit is contained in:
roc+@cs.cmu.edu 2007-07-18 21:25:17 -07:00
parent 4b46c408b0
commit fd80a49090

View File

@ -9140,11 +9140,6 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
nsIFrame* newFrame = frameItems.childList;
if (NS_SUCCEEDED(rv) && newFrame) {
NS_ASSERTION(!captionItems.childList, "leaking caption frames");
// Notify the parent frame
if (isAppend) {
AppendFrames(state, aContainer, parentFrame, newFrame, appendAfterFrame);
}
else {
if (!prevSibling) {
// We're inserting the new frame as the first child. See if the
// parent has a :before pseudo-element
@ -9162,8 +9157,18 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
newParent);
parentFrame = newParent;
}
// We perhaps could leave this true and take the AppendFrames path
// below, but we'd have to update appendAfterFrame and it seems safer
// to force all insert-after-:before cases to take these to take the
// InsertFrames path
isAppend = PR_FALSE;
}
}
// Notify the parent frame
if (isAppend) {
AppendFrames(state, aContainer, parentFrame, newFrame, appendAfterFrame);
} else {
state.mFrameManager->InsertFrames(parentFrame,
nsnull, prevSibling, newFrame);
}