diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index 0eab1ed872f..d5b7a969ffe 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -2131,7 +2131,14 @@ nsHTMLDocument::Close() // handler of the frameset fires before the frames get reflowed // and loaded. That is the long explanation for why we need this // one line of code here! - FlushPendingNotifications(Flush_Layout); + // XXXbz as far as I can tell this may not be needed anymore; all + // the testcases in bug 57636 pass without this line... Leaving + // it be for now, though. In any case, there's no reason to do + // this if we have no presshell, since in that case none of the + // above about reusing frames applies. + if (GetNumberOfShells() != 0) { + FlushPendingNotifications(Flush_Layout); + } // Remove the wyciwyg channel request from the document load group // that we added in OpenCommon(). If all other requests between diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 567593189ca..c21177fd640 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ + /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ // vim:cindent:ts=2:et:sw=2: /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 @@ -8395,6 +8395,11 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer, parentFrame = insertionPoint; + if (parentFrame->GetType() == nsLayoutAtoms::frameSetFrame) { + // Just reframe the parent, since framesets are weird like that. + return RecreateFramesForContent(parentFrame->GetContent()); + } + if (parentFrame->IsLeaf()) { // Nothing to do here; we shouldn't be constructing kids of leaves return NS_OK; @@ -9040,6 +9045,11 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer, aContainer, aIndexInContainer); } + if (parentFrame->GetType() == nsLayoutAtoms::frameSetFrame) { + // Just reframe the parent, since framesets are weird like that. + return RecreateFramesForContent(parentFrame->GetContent()); + } + // Don't construct kids of leaves if (parentFrame->IsLeaf()) { return NS_OK; @@ -9602,6 +9612,11 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer, parentFrame = insertionPoint; + if (parentFrame->GetType() == nsLayoutAtoms::frameSetFrame) { + // Just reframe the parent, since framesets are weird like that. + return RecreateFramesForContent(parentFrame->GetContent()); + } + // Examine the containing-block for the removed content and see if // :first-letter style applies. nsIFrame* containingBlock = GetFloatContainingBlock(parentFrame); diff --git a/mozilla/layout/base/nsLayoutAtomList.h b/mozilla/layout/base/nsLayoutAtomList.h index a145f1df73c..d2e0a7691d9 100644 --- a/mozilla/layout/base/nsLayoutAtomList.h +++ b/mozilla/layout/base/nsLayoutAtomList.h @@ -99,6 +99,7 @@ LAYOUT_ATOM(brFrame, "BRFrame") LAYOUT_ATOM(bulletFrame, "BulletFrame") LAYOUT_ATOM(columnSetFrame, "ColumnSetFrame") LAYOUT_ATOM(fieldSetFrame, "FieldSetFrame") +LAYOUT_ATOM(frameSetFrame, "FrameSetFrame") LAYOUT_ATOM(gfxButtonControlFrame, "gfxButtonControlFrame") LAYOUT_ATOM(HTMLCanvasFrame, "HTMLCanvasFrame") LAYOUT_ATOM(subDocumentFrame, "subDocumentFrame") diff --git a/mozilla/layout/generic/nsFrameSetFrame.cpp b/mozilla/layout/generic/nsFrameSetFrame.cpp index 4609cfee3ad..6da6233f5a2 100644 --- a/mozilla/layout/generic/nsFrameSetFrame.cpp +++ b/mozilla/layout/generic/nsFrameSetFrame.cpp @@ -70,6 +70,7 @@ #include "nsCSSAnonBoxes.h" #include "nsAutoPtr.h" #include "nsStyleSet.h" +#include "nsLayoutAtoms.h" // masks for mEdgeVisibility #define LEFT_VIS 0x0001 @@ -1263,6 +1264,12 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext, return NS_OK; } +nsIAtom* +nsHTMLFramesetFrame::GetType() const +{ + return nsLayoutAtoms::frameSetFrame; +} + PRBool nsHTMLFramesetFrame::IsLeaf() const { diff --git a/mozilla/layout/generic/nsFrameSetFrame.h b/mozilla/layout/generic/nsFrameSetFrame.h index 2ce5942ac36..3ac44cf5e35 100644 --- a/mozilla/layout/generic/nsFrameSetFrame.h +++ b/mozilla/layout/generic/nsFrameSetFrame.h @@ -152,6 +152,8 @@ public: const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); + virtual nsIAtom* GetType() const; + virtual PRBool IsLeaf() const; NS_IMETHOD VerifyTree() const;