From 2bada305e0fdb5fd5b42867f6c295ec248dbd03e Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Fri, 18 Dec 1998 05:23:40 +0000 Subject: [PATCH] Reverted back to previous revision, because I came up with a cleaner solution git-svn-id: svn://10.0.0.236/trunk@16645 18797224-902f-48f8-a5cc-f745e15eee43 --- .../html/style/src/nsHTMLStyleSheet.cpp | 18 ++++++------------ .../layout/html/style/src/nsHTMLStyleSheet.cpp | 18 ++++++------------ mozilla/layout/style/nsHTMLStyleSheet.cpp | 18 ++++++------------ 3 files changed, 18 insertions(+), 36 deletions(-) diff --git a/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp b/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp index bbc57c26ed8..654d46ae470 100644 --- a/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp @@ -1386,12 +1386,6 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext, nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageSequenceFrame, pseudoStyle, PR_TRUE); - // Add the page sequence frame to the scroll frame. We need to do this - // now BEFORE we process the child content, so the view hierarchy is - // correct (the scrolling view creates a clip view and widget and inserts - // the scrolled frame's view as a child of the clip view) - scrollFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame); - // Create the first page NS_NewPageFrame(pageFrame); @@ -1408,6 +1402,9 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext, if (NS_SUCCEEDED(rv)) { pageFrame->SetInitialChildList(*aPresContext, nsnull, childList); pageSequenceFrame->SetInitialChildList(*aPresContext, nsnull, pageFrame); + + // Set the scroll frame's initial child list + scrollFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame); } // Set the root frame's initial child list @@ -1464,16 +1461,13 @@ HTMLStyleSheetImpl::ConstructXMLRootDescendants(nsIPresContext* aPresContext, nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, wrapperFrame, scrolledPseudoStyle, PR_TRUE); - // Set the scroll frame's initial child list. We need to do this now - // BEFORE we process the child content, so the view hierarchy is correct - // (the scrolling view creates a clip view and widget and inserts the - // scrolled frame's view as a child of the clip view) - scrollFrame->SetInitialChildList(*aPresContext, nsnull, wrapperFrame); - // Construct a frame for the document element and process its children nsIFrame* docElementFrame; ConstructFrame(aPresContext, aContent, wrapperFrame, docElementFrame); wrapperFrame->SetInitialChildList(*aPresContext, nsnull, docElementFrame); + + // Set the scroll frame's initial child list + scrollFrame->SetInitialChildList(*aPresContext, nsnull, wrapperFrame); } aNewFrame = scrollFrame; diff --git a/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp b/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp index bbc57c26ed8..654d46ae470 100644 --- a/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp +++ b/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp @@ -1386,12 +1386,6 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext, nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageSequenceFrame, pseudoStyle, PR_TRUE); - // Add the page sequence frame to the scroll frame. We need to do this - // now BEFORE we process the child content, so the view hierarchy is - // correct (the scrolling view creates a clip view and widget and inserts - // the scrolled frame's view as a child of the clip view) - scrollFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame); - // Create the first page NS_NewPageFrame(pageFrame); @@ -1408,6 +1402,9 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext, if (NS_SUCCEEDED(rv)) { pageFrame->SetInitialChildList(*aPresContext, nsnull, childList); pageSequenceFrame->SetInitialChildList(*aPresContext, nsnull, pageFrame); + + // Set the scroll frame's initial child list + scrollFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame); } // Set the root frame's initial child list @@ -1464,16 +1461,13 @@ HTMLStyleSheetImpl::ConstructXMLRootDescendants(nsIPresContext* aPresContext, nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, wrapperFrame, scrolledPseudoStyle, PR_TRUE); - // Set the scroll frame's initial child list. We need to do this now - // BEFORE we process the child content, so the view hierarchy is correct - // (the scrolling view creates a clip view and widget and inserts the - // scrolled frame's view as a child of the clip view) - scrollFrame->SetInitialChildList(*aPresContext, nsnull, wrapperFrame); - // Construct a frame for the document element and process its children nsIFrame* docElementFrame; ConstructFrame(aPresContext, aContent, wrapperFrame, docElementFrame); wrapperFrame->SetInitialChildList(*aPresContext, nsnull, docElementFrame); + + // Set the scroll frame's initial child list + scrollFrame->SetInitialChildList(*aPresContext, nsnull, wrapperFrame); } aNewFrame = scrollFrame; diff --git a/mozilla/layout/style/nsHTMLStyleSheet.cpp b/mozilla/layout/style/nsHTMLStyleSheet.cpp index bbc57c26ed8..654d46ae470 100644 --- a/mozilla/layout/style/nsHTMLStyleSheet.cpp +++ b/mozilla/layout/style/nsHTMLStyleSheet.cpp @@ -1386,12 +1386,6 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext, nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageSequenceFrame, pseudoStyle, PR_TRUE); - // Add the page sequence frame to the scroll frame. We need to do this - // now BEFORE we process the child content, so the view hierarchy is - // correct (the scrolling view creates a clip view and widget and inserts - // the scrolled frame's view as a child of the clip view) - scrollFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame); - // Create the first page NS_NewPageFrame(pageFrame); @@ -1408,6 +1402,9 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext, if (NS_SUCCEEDED(rv)) { pageFrame->SetInitialChildList(*aPresContext, nsnull, childList); pageSequenceFrame->SetInitialChildList(*aPresContext, nsnull, pageFrame); + + // Set the scroll frame's initial child list + scrollFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame); } // Set the root frame's initial child list @@ -1464,16 +1461,13 @@ HTMLStyleSheetImpl::ConstructXMLRootDescendants(nsIPresContext* aPresContext, nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, wrapperFrame, scrolledPseudoStyle, PR_TRUE); - // Set the scroll frame's initial child list. We need to do this now - // BEFORE we process the child content, so the view hierarchy is correct - // (the scrolling view creates a clip view and widget and inserts the - // scrolled frame's view as a child of the clip view) - scrollFrame->SetInitialChildList(*aPresContext, nsnull, wrapperFrame); - // Construct a frame for the document element and process its children nsIFrame* docElementFrame; ConstructFrame(aPresContext, aContent, wrapperFrame, docElementFrame); wrapperFrame->SetInitialChildList(*aPresContext, nsnull, docElementFrame); + + // Set the scroll frame's initial child list + scrollFrame->SetInitialChildList(*aPresContext, nsnull, wrapperFrame); } aNewFrame = scrollFrame;