diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index e1c5f82ad7f..510913608b4 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -5256,6 +5256,7 @@ nsCSSFrameConstructor::ContentAppended(nsIPresContext* aPresContext, } #endif // INCLUDE_XUL + // Get the frame associated with the content nsIFrame* parentFrame = GetFrameFor(shell, aPresContext, aContainer); if (nsnull != parentFrame) { // Get the parent frame's last-in-flow @@ -5267,6 +5268,15 @@ nsCSSFrameConstructor::ContentAppended(nsIPresContext* aPresContext, } } + // If we didn't process children when we originally created the frame, + // then don't do any processing now + nsCOMPtr frameType; + parentFrame->GetFrameType(getter_AddRefs(frameType)); + if (frameType.get() == nsLayoutAtoms::objectFrame) { + // This handles APPLET, EMBED, and OBJECT + return NS_OK; + } + // Create some new frames PRInt32 count; nsIFrame* firstAppendedFrame = nsnull; @@ -5714,10 +5724,8 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext, nsLayoutAtoms::fixedList, state.mFixedItems.childList); } - - } - else { + } else { // Find the frame that precedes the insertion point. nsIFrame* prevSibling = FindPreviousSibling(shell, aContainer, aIndexInContainer); nsIFrame* nextSibling = nsnull; @@ -5741,6 +5749,15 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext, // No previous or next sibling so treat this like an appended frame. isAppend = PR_TRUE; shell->GetPrimaryFrameFor(aContainer, &parentFrame); + + // If we didn't process children when we originally created the frame, + // then don't do any processing now + nsCOMPtr frameType; + parentFrame->GetFrameType(getter_AddRefs(frameType)); + if (frameType.get() == nsLayoutAtoms::objectFrame) { + // This handles APPLET, EMBED, and OBJECT + return NS_OK; + } } // Construct a new frame diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index e1c5f82ad7f..510913608b4 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -5256,6 +5256,7 @@ nsCSSFrameConstructor::ContentAppended(nsIPresContext* aPresContext, } #endif // INCLUDE_XUL + // Get the frame associated with the content nsIFrame* parentFrame = GetFrameFor(shell, aPresContext, aContainer); if (nsnull != parentFrame) { // Get the parent frame's last-in-flow @@ -5267,6 +5268,15 @@ nsCSSFrameConstructor::ContentAppended(nsIPresContext* aPresContext, } } + // If we didn't process children when we originally created the frame, + // then don't do any processing now + nsCOMPtr frameType; + parentFrame->GetFrameType(getter_AddRefs(frameType)); + if (frameType.get() == nsLayoutAtoms::objectFrame) { + // This handles APPLET, EMBED, and OBJECT + return NS_OK; + } + // Create some new frames PRInt32 count; nsIFrame* firstAppendedFrame = nsnull; @@ -5714,10 +5724,8 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext, nsLayoutAtoms::fixedList, state.mFixedItems.childList); } - - } - else { + } else { // Find the frame that precedes the insertion point. nsIFrame* prevSibling = FindPreviousSibling(shell, aContainer, aIndexInContainer); nsIFrame* nextSibling = nsnull; @@ -5741,6 +5749,15 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext, // No previous or next sibling so treat this like an appended frame. isAppend = PR_TRUE; shell->GetPrimaryFrameFor(aContainer, &parentFrame); + + // If we didn't process children when we originally created the frame, + // then don't do any processing now + nsCOMPtr frameType; + parentFrame->GetFrameType(getter_AddRefs(frameType)); + if (frameType.get() == nsLayoutAtoms::objectFrame) { + // This handles APPLET, EMBED, and OBJECT + return NS_OK; + } } // Construct a new frame