Added pseudo style for 'page' element

This commit is contained in:
troy%netscape.com 1999-02-19 00:53:09 +00:00
parent 5af04a07ba
commit b236facd7f
10 changed files with 38 additions and 4 deletions

View File

@ -61,6 +61,7 @@ public:
static nsIAtom* commentTagName;
static nsIAtom* textTagName;
static nsIAtom* viewportPseudo;
static nsIAtom* pagePseudo;
// Alphabetical list of frame types
static nsIAtom* areaFrame;

View File

@ -47,6 +47,7 @@ nsIAtom* nsLayoutAtoms::floaterList;
nsIAtom* nsLayoutAtoms::commentTagName;
nsIAtom* nsLayoutAtoms::textTagName;
nsIAtom* nsLayoutAtoms::viewportPseudo;
nsIAtom* nsLayoutAtoms::pagePseudo;
// frame types
nsIAtom* nsLayoutAtoms::areaFrame;
@ -84,6 +85,7 @@ void nsLayoutAtoms::AddrefAtoms()
commentTagName = NS_NewAtom("__moz_comment");
textTagName = NS_NewAtom("__moz_text");
viewportPseudo = NS_NewAtom(":-moz-viewport");
pagePseudo = NS_NewAtom(":-moz-page");
areaFrame = NS_NewAtom("AreaFrame");
pageFrame = NS_NewAtom("PageFrame");
@ -122,6 +124,7 @@ void nsLayoutAtoms::ReleaseAtoms()
NS_RELEASE(commentTagName);
NS_RELEASE(textTagName);
NS_RELEASE(viewportPseudo);
NS_RELEASE(pagePseudo);
NS_RELEASE(areaFrame);
NS_RELEASE(pageFrame);

View File

@ -1411,9 +1411,15 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
// Initialize the page and force it to have a view. This makes printing of
// the pages easier and faster.
// XXX Use a PAGE style context...
pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, viewportPseudoStyle);
nsCOMPtr<nsIStyleContext> pagePseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::pagePseudo,
viewportPseudoStyle, PR_FALSE,
getter_AddRefs(pagePseudoStyle));
pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, pagePseudoStyle);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageFrame,
viewportPseudoStyle, PR_TRUE);
pagePseudoStyle, PR_TRUE);
// The eventual parent of the document element frame
mDocElementContainingBlock = pageFrame;

View File

@ -47,6 +47,7 @@ nsIAtom* nsLayoutAtoms::floaterList;
nsIAtom* nsLayoutAtoms::commentTagName;
nsIAtom* nsLayoutAtoms::textTagName;
nsIAtom* nsLayoutAtoms::viewportPseudo;
nsIAtom* nsLayoutAtoms::pagePseudo;
// frame types
nsIAtom* nsLayoutAtoms::areaFrame;
@ -84,6 +85,7 @@ void nsLayoutAtoms::AddrefAtoms()
commentTagName = NS_NewAtom("__moz_comment");
textTagName = NS_NewAtom("__moz_text");
viewportPseudo = NS_NewAtom(":-moz-viewport");
pagePseudo = NS_NewAtom(":-moz-page");
areaFrame = NS_NewAtom("AreaFrame");
pageFrame = NS_NewAtom("PageFrame");
@ -122,6 +124,7 @@ void nsLayoutAtoms::ReleaseAtoms()
NS_RELEASE(commentTagName);
NS_RELEASE(textTagName);
NS_RELEASE(viewportPseudo);
NS_RELEASE(pagePseudo);
NS_RELEASE(areaFrame);
NS_RELEASE(pageFrame);

View File

@ -61,6 +61,7 @@ public:
static nsIAtom* commentTagName;
static nsIAtom* textTagName;
static nsIAtom* viewportPseudo;
static nsIAtom* pagePseudo;
// Alphabetical list of frame types
static nsIAtom* areaFrame;

View File

@ -61,6 +61,7 @@ public:
static nsIAtom* commentTagName;
static nsIAtom* textTagName;
static nsIAtom* viewportPseudo;
static nsIAtom* pagePseudo;
// Alphabetical list of frame types
static nsIAtom* areaFrame;

View File

@ -47,6 +47,7 @@ nsIAtom* nsLayoutAtoms::floaterList;
nsIAtom* nsLayoutAtoms::commentTagName;
nsIAtom* nsLayoutAtoms::textTagName;
nsIAtom* nsLayoutAtoms::viewportPseudo;
nsIAtom* nsLayoutAtoms::pagePseudo;
// frame types
nsIAtom* nsLayoutAtoms::areaFrame;
@ -84,6 +85,7 @@ void nsLayoutAtoms::AddrefAtoms()
commentTagName = NS_NewAtom("__moz_comment");
textTagName = NS_NewAtom("__moz_text");
viewportPseudo = NS_NewAtom(":-moz-viewport");
pagePseudo = NS_NewAtom(":-moz-page");
areaFrame = NS_NewAtom("AreaFrame");
pageFrame = NS_NewAtom("PageFrame");
@ -122,6 +124,7 @@ void nsLayoutAtoms::ReleaseAtoms()
NS_RELEASE(commentTagName);
NS_RELEASE(textTagName);
NS_RELEASE(viewportPseudo);
NS_RELEASE(pagePseudo);
NS_RELEASE(areaFrame);
NS_RELEASE(pageFrame);

View File

@ -682,6 +682,11 @@ param {
background-color: inherit;
}
/* XXX Temporary until @page is supported... */
:-moz-page {
background: none;
}
:root {
display: block;
background-color: inherit;

View File

@ -1411,9 +1411,15 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
// Initialize the page and force it to have a view. This makes printing of
// the pages easier and faster.
// XXX Use a PAGE style context...
pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, viewportPseudoStyle);
nsCOMPtr<nsIStyleContext> pagePseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::pagePseudo,
viewportPseudoStyle, PR_FALSE,
getter_AddRefs(pagePseudoStyle));
pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, pagePseudoStyle);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageFrame,
viewportPseudoStyle, PR_TRUE);
pagePseudoStyle, PR_TRUE);
// The eventual parent of the document element frame
mDocElementContainingBlock = pageFrame;

View File

@ -682,6 +682,11 @@ param {
background-color: inherit;
}
/* XXX Temporary until @page is supported... */
:-moz-page {
background: none;
}
:root {
display: block;
background-color: inherit;