mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 18:27:35 +00:00
Added a scroll frame for print preview
This commit is contained in:
parent
61080e7a03
commit
555b09f7bd
@ -1162,37 +1162,41 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
|
||||
// See if we're paginated
|
||||
if (aPresContext->IsPaginated()) {
|
||||
// nsScrollFrame* scrollFrame;
|
||||
nsIFrame* pageSequenceFrame;
|
||||
nsIFrame* scrollFrame;
|
||||
nsIFrame* pageSequenceFrame;
|
||||
|
||||
// XXX This isn't the correct style context pseudo element to use...
|
||||
nsIStyleContext* pseudoStyle;
|
||||
pseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent,
|
||||
nsHTMLAtoms::columnPseudo, aStyleContext);
|
||||
|
||||
#if 0
|
||||
// Wrap the simple page sequence frame in a scroll frame
|
||||
// XXX Only do this if it's print oreview
|
||||
if NS_SUCCEEDED(NS_NewScrollFrame(aContent, aParentFrame, scrollFrame)) {
|
||||
#endif
|
||||
// XXX Only do this if it's print preview
|
||||
if NS_SUCCEEDED(NS_NewScrollFrame(aContent, aNewFrame, scrollFrame)) {
|
||||
// Set the scroll frame's style context
|
||||
scrollFrame->SetStyleContext(aPresContext, pseudoStyle);
|
||||
|
||||
// Create a simple page sequence frame
|
||||
rv = NS_NewSimplePageSequenceFrame(aContent, aNewFrame, pageSequenceFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIFrame* childList;
|
||||
|
||||
// Set the page sequence frame's style context
|
||||
// XXX This isn't the correct style context to use...
|
||||
nsIStyleContext* pseudoStyle;
|
||||
pseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent,
|
||||
nsHTMLAtoms::columnPseudo,
|
||||
aStyleContext);
|
||||
pageSequenceFrame->SetStyleContext(aPresContext, pseudoStyle);
|
||||
NS_RELEASE(pseudoStyle);
|
||||
|
||||
// Process the child content, and set the page sequence frame's initial
|
||||
// child list
|
||||
rv = ProcessChildren(aPresContext, pageSequenceFrame, aContent, childList);
|
||||
// Create a simple page sequence frame
|
||||
rv = NS_NewSimplePageSequenceFrame(aContent, scrollFrame, pageSequenceFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
pageSequenceFrame->SetInitialChildList(*aPresContext, nsnull, childList);
|
||||
nsIFrame* childList;
|
||||
|
||||
// Set the page sequence frame's style context
|
||||
pageSequenceFrame->SetStyleContext(aPresContext, pseudoStyle);
|
||||
NS_RELEASE(pseudoStyle);
|
||||
|
||||
// Process the child content, and set the page sequence frame's initial
|
||||
// child list
|
||||
rv = ProcessChildren(aPresContext, pageSequenceFrame, aContent, childList);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
pageSequenceFrame->SetInitialChildList(*aPresContext, nsnull, childList);
|
||||
|
||||
// Set the scroll frame's initial child list
|
||||
scrollFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame);
|
||||
}
|
||||
|
||||
// Set the root frame's initial child list
|
||||
aNewFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame);
|
||||
aNewFrame->SetInitialChildList(*aPresContext, nsnull, scrollFrame);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -165,10 +165,10 @@ nsScrollFrame::CreateScrollingView()
|
||||
nsIScrollableView* scrollingView;
|
||||
view->QueryInterface(kScrollViewIID, (void**)&scrollingView);
|
||||
|
||||
//create widgets for scrolling
|
||||
// Create widgets for scrolling
|
||||
scrollingView->CreateScrollControls();
|
||||
|
||||
// Set the scroll prefrence
|
||||
// Set the scroll preference
|
||||
nsScrollPreference scrollPref = (NS_STYLE_OVERFLOW_SCROLL == display->mOverflow)
|
||||
? nsScrollPreference_kAlwaysScroll :
|
||||
nsScrollPreference_kAuto;
|
||||
|
@ -1162,37 +1162,41 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
|
||||
// See if we're paginated
|
||||
if (aPresContext->IsPaginated()) {
|
||||
// nsScrollFrame* scrollFrame;
|
||||
nsIFrame* pageSequenceFrame;
|
||||
nsIFrame* scrollFrame;
|
||||
nsIFrame* pageSequenceFrame;
|
||||
|
||||
// XXX This isn't the correct style context pseudo element to use...
|
||||
nsIStyleContext* pseudoStyle;
|
||||
pseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent,
|
||||
nsHTMLAtoms::columnPseudo, aStyleContext);
|
||||
|
||||
#if 0
|
||||
// Wrap the simple page sequence frame in a scroll frame
|
||||
// XXX Only do this if it's print oreview
|
||||
if NS_SUCCEEDED(NS_NewScrollFrame(aContent, aParentFrame, scrollFrame)) {
|
||||
#endif
|
||||
// XXX Only do this if it's print preview
|
||||
if NS_SUCCEEDED(NS_NewScrollFrame(aContent, aNewFrame, scrollFrame)) {
|
||||
// Set the scroll frame's style context
|
||||
scrollFrame->SetStyleContext(aPresContext, pseudoStyle);
|
||||
|
||||
// Create a simple page sequence frame
|
||||
rv = NS_NewSimplePageSequenceFrame(aContent, aNewFrame, pageSequenceFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIFrame* childList;
|
||||
|
||||
// Set the page sequence frame's style context
|
||||
// XXX This isn't the correct style context to use...
|
||||
nsIStyleContext* pseudoStyle;
|
||||
pseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent,
|
||||
nsHTMLAtoms::columnPseudo,
|
||||
aStyleContext);
|
||||
pageSequenceFrame->SetStyleContext(aPresContext, pseudoStyle);
|
||||
NS_RELEASE(pseudoStyle);
|
||||
|
||||
// Process the child content, and set the page sequence frame's initial
|
||||
// child list
|
||||
rv = ProcessChildren(aPresContext, pageSequenceFrame, aContent, childList);
|
||||
// Create a simple page sequence frame
|
||||
rv = NS_NewSimplePageSequenceFrame(aContent, scrollFrame, pageSequenceFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
pageSequenceFrame->SetInitialChildList(*aPresContext, nsnull, childList);
|
||||
nsIFrame* childList;
|
||||
|
||||
// Set the page sequence frame's style context
|
||||
pageSequenceFrame->SetStyleContext(aPresContext, pseudoStyle);
|
||||
NS_RELEASE(pseudoStyle);
|
||||
|
||||
// Process the child content, and set the page sequence frame's initial
|
||||
// child list
|
||||
rv = ProcessChildren(aPresContext, pageSequenceFrame, aContent, childList);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
pageSequenceFrame->SetInitialChildList(*aPresContext, nsnull, childList);
|
||||
|
||||
// Set the scroll frame's initial child list
|
||||
scrollFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame);
|
||||
}
|
||||
|
||||
// Set the root frame's initial child list
|
||||
aNewFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame);
|
||||
aNewFrame->SetInitialChildList(*aPresContext, nsnull, scrollFrame);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -1162,37 +1162,41 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
|
||||
// See if we're paginated
|
||||
if (aPresContext->IsPaginated()) {
|
||||
// nsScrollFrame* scrollFrame;
|
||||
nsIFrame* pageSequenceFrame;
|
||||
nsIFrame* scrollFrame;
|
||||
nsIFrame* pageSequenceFrame;
|
||||
|
||||
// XXX This isn't the correct style context pseudo element to use...
|
||||
nsIStyleContext* pseudoStyle;
|
||||
pseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent,
|
||||
nsHTMLAtoms::columnPseudo, aStyleContext);
|
||||
|
||||
#if 0
|
||||
// Wrap the simple page sequence frame in a scroll frame
|
||||
// XXX Only do this if it's print oreview
|
||||
if NS_SUCCEEDED(NS_NewScrollFrame(aContent, aParentFrame, scrollFrame)) {
|
||||
#endif
|
||||
// XXX Only do this if it's print preview
|
||||
if NS_SUCCEEDED(NS_NewScrollFrame(aContent, aNewFrame, scrollFrame)) {
|
||||
// Set the scroll frame's style context
|
||||
scrollFrame->SetStyleContext(aPresContext, pseudoStyle);
|
||||
|
||||
// Create a simple page sequence frame
|
||||
rv = NS_NewSimplePageSequenceFrame(aContent, aNewFrame, pageSequenceFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIFrame* childList;
|
||||
|
||||
// Set the page sequence frame's style context
|
||||
// XXX This isn't the correct style context to use...
|
||||
nsIStyleContext* pseudoStyle;
|
||||
pseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent,
|
||||
nsHTMLAtoms::columnPseudo,
|
||||
aStyleContext);
|
||||
pageSequenceFrame->SetStyleContext(aPresContext, pseudoStyle);
|
||||
NS_RELEASE(pseudoStyle);
|
||||
|
||||
// Process the child content, and set the page sequence frame's initial
|
||||
// child list
|
||||
rv = ProcessChildren(aPresContext, pageSequenceFrame, aContent, childList);
|
||||
// Create a simple page sequence frame
|
||||
rv = NS_NewSimplePageSequenceFrame(aContent, scrollFrame, pageSequenceFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
pageSequenceFrame->SetInitialChildList(*aPresContext, nsnull, childList);
|
||||
nsIFrame* childList;
|
||||
|
||||
// Set the page sequence frame's style context
|
||||
pageSequenceFrame->SetStyleContext(aPresContext, pseudoStyle);
|
||||
NS_RELEASE(pseudoStyle);
|
||||
|
||||
// Process the child content, and set the page sequence frame's initial
|
||||
// child list
|
||||
rv = ProcessChildren(aPresContext, pageSequenceFrame, aContent, childList);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
pageSequenceFrame->SetInitialChildList(*aPresContext, nsnull, childList);
|
||||
|
||||
// Set the scroll frame's initial child list
|
||||
scrollFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame);
|
||||
}
|
||||
|
||||
// Set the root frame's initial child list
|
||||
aNewFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame);
|
||||
aNewFrame->SetInitialChildList(*aPresContext, nsnull, scrollFrame);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user