mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Added pseudo style for 'page' element
This commit is contained in:
parent
5af04a07ba
commit
b236facd7f
@ -61,6 +61,7 @@ public:
|
|||||||
static nsIAtom* commentTagName;
|
static nsIAtom* commentTagName;
|
||||||
static nsIAtom* textTagName;
|
static nsIAtom* textTagName;
|
||||||
static nsIAtom* viewportPseudo;
|
static nsIAtom* viewportPseudo;
|
||||||
|
static nsIAtom* pagePseudo;
|
||||||
|
|
||||||
// Alphabetical list of frame types
|
// Alphabetical list of frame types
|
||||||
static nsIAtom* areaFrame;
|
static nsIAtom* areaFrame;
|
||||||
|
@ -47,6 +47,7 @@ nsIAtom* nsLayoutAtoms::floaterList;
|
|||||||
nsIAtom* nsLayoutAtoms::commentTagName;
|
nsIAtom* nsLayoutAtoms::commentTagName;
|
||||||
nsIAtom* nsLayoutAtoms::textTagName;
|
nsIAtom* nsLayoutAtoms::textTagName;
|
||||||
nsIAtom* nsLayoutAtoms::viewportPseudo;
|
nsIAtom* nsLayoutAtoms::viewportPseudo;
|
||||||
|
nsIAtom* nsLayoutAtoms::pagePseudo;
|
||||||
|
|
||||||
// frame types
|
// frame types
|
||||||
nsIAtom* nsLayoutAtoms::areaFrame;
|
nsIAtom* nsLayoutAtoms::areaFrame;
|
||||||
@ -84,6 +85,7 @@ void nsLayoutAtoms::AddrefAtoms()
|
|||||||
commentTagName = NS_NewAtom("__moz_comment");
|
commentTagName = NS_NewAtom("__moz_comment");
|
||||||
textTagName = NS_NewAtom("__moz_text");
|
textTagName = NS_NewAtom("__moz_text");
|
||||||
viewportPseudo = NS_NewAtom(":-moz-viewport");
|
viewportPseudo = NS_NewAtom(":-moz-viewport");
|
||||||
|
pagePseudo = NS_NewAtom(":-moz-page");
|
||||||
|
|
||||||
areaFrame = NS_NewAtom("AreaFrame");
|
areaFrame = NS_NewAtom("AreaFrame");
|
||||||
pageFrame = NS_NewAtom("PageFrame");
|
pageFrame = NS_NewAtom("PageFrame");
|
||||||
@ -122,6 +124,7 @@ void nsLayoutAtoms::ReleaseAtoms()
|
|||||||
NS_RELEASE(commentTagName);
|
NS_RELEASE(commentTagName);
|
||||||
NS_RELEASE(textTagName);
|
NS_RELEASE(textTagName);
|
||||||
NS_RELEASE(viewportPseudo);
|
NS_RELEASE(viewportPseudo);
|
||||||
|
NS_RELEASE(pagePseudo);
|
||||||
|
|
||||||
NS_RELEASE(areaFrame);
|
NS_RELEASE(areaFrame);
|
||||||
NS_RELEASE(pageFrame);
|
NS_RELEASE(pageFrame);
|
||||||
|
@ -1411,9 +1411,15 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
|
|||||||
// Initialize the page and force it to have a view. This makes printing of
|
// Initialize the page and force it to have a view. This makes printing of
|
||||||
// the pages easier and faster.
|
// the pages easier and faster.
|
||||||
// XXX Use a PAGE style context...
|
// 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,
|
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageFrame,
|
||||||
viewportPseudoStyle, PR_TRUE);
|
pagePseudoStyle, PR_TRUE);
|
||||||
|
|
||||||
// The eventual parent of the document element frame
|
// The eventual parent of the document element frame
|
||||||
mDocElementContainingBlock = pageFrame;
|
mDocElementContainingBlock = pageFrame;
|
||||||
|
@ -47,6 +47,7 @@ nsIAtom* nsLayoutAtoms::floaterList;
|
|||||||
nsIAtom* nsLayoutAtoms::commentTagName;
|
nsIAtom* nsLayoutAtoms::commentTagName;
|
||||||
nsIAtom* nsLayoutAtoms::textTagName;
|
nsIAtom* nsLayoutAtoms::textTagName;
|
||||||
nsIAtom* nsLayoutAtoms::viewportPseudo;
|
nsIAtom* nsLayoutAtoms::viewportPseudo;
|
||||||
|
nsIAtom* nsLayoutAtoms::pagePseudo;
|
||||||
|
|
||||||
// frame types
|
// frame types
|
||||||
nsIAtom* nsLayoutAtoms::areaFrame;
|
nsIAtom* nsLayoutAtoms::areaFrame;
|
||||||
@ -84,6 +85,7 @@ void nsLayoutAtoms::AddrefAtoms()
|
|||||||
commentTagName = NS_NewAtom("__moz_comment");
|
commentTagName = NS_NewAtom("__moz_comment");
|
||||||
textTagName = NS_NewAtom("__moz_text");
|
textTagName = NS_NewAtom("__moz_text");
|
||||||
viewportPseudo = NS_NewAtom(":-moz-viewport");
|
viewportPseudo = NS_NewAtom(":-moz-viewport");
|
||||||
|
pagePseudo = NS_NewAtom(":-moz-page");
|
||||||
|
|
||||||
areaFrame = NS_NewAtom("AreaFrame");
|
areaFrame = NS_NewAtom("AreaFrame");
|
||||||
pageFrame = NS_NewAtom("PageFrame");
|
pageFrame = NS_NewAtom("PageFrame");
|
||||||
@ -122,6 +124,7 @@ void nsLayoutAtoms::ReleaseAtoms()
|
|||||||
NS_RELEASE(commentTagName);
|
NS_RELEASE(commentTagName);
|
||||||
NS_RELEASE(textTagName);
|
NS_RELEASE(textTagName);
|
||||||
NS_RELEASE(viewportPseudo);
|
NS_RELEASE(viewportPseudo);
|
||||||
|
NS_RELEASE(pagePseudo);
|
||||||
|
|
||||||
NS_RELEASE(areaFrame);
|
NS_RELEASE(areaFrame);
|
||||||
NS_RELEASE(pageFrame);
|
NS_RELEASE(pageFrame);
|
||||||
|
@ -61,6 +61,7 @@ public:
|
|||||||
static nsIAtom* commentTagName;
|
static nsIAtom* commentTagName;
|
||||||
static nsIAtom* textTagName;
|
static nsIAtom* textTagName;
|
||||||
static nsIAtom* viewportPseudo;
|
static nsIAtom* viewportPseudo;
|
||||||
|
static nsIAtom* pagePseudo;
|
||||||
|
|
||||||
// Alphabetical list of frame types
|
// Alphabetical list of frame types
|
||||||
static nsIAtom* areaFrame;
|
static nsIAtom* areaFrame;
|
||||||
|
@ -61,6 +61,7 @@ public:
|
|||||||
static nsIAtom* commentTagName;
|
static nsIAtom* commentTagName;
|
||||||
static nsIAtom* textTagName;
|
static nsIAtom* textTagName;
|
||||||
static nsIAtom* viewportPseudo;
|
static nsIAtom* viewportPseudo;
|
||||||
|
static nsIAtom* pagePseudo;
|
||||||
|
|
||||||
// Alphabetical list of frame types
|
// Alphabetical list of frame types
|
||||||
static nsIAtom* areaFrame;
|
static nsIAtom* areaFrame;
|
||||||
|
@ -47,6 +47,7 @@ nsIAtom* nsLayoutAtoms::floaterList;
|
|||||||
nsIAtom* nsLayoutAtoms::commentTagName;
|
nsIAtom* nsLayoutAtoms::commentTagName;
|
||||||
nsIAtom* nsLayoutAtoms::textTagName;
|
nsIAtom* nsLayoutAtoms::textTagName;
|
||||||
nsIAtom* nsLayoutAtoms::viewportPseudo;
|
nsIAtom* nsLayoutAtoms::viewportPseudo;
|
||||||
|
nsIAtom* nsLayoutAtoms::pagePseudo;
|
||||||
|
|
||||||
// frame types
|
// frame types
|
||||||
nsIAtom* nsLayoutAtoms::areaFrame;
|
nsIAtom* nsLayoutAtoms::areaFrame;
|
||||||
@ -84,6 +85,7 @@ void nsLayoutAtoms::AddrefAtoms()
|
|||||||
commentTagName = NS_NewAtom("__moz_comment");
|
commentTagName = NS_NewAtom("__moz_comment");
|
||||||
textTagName = NS_NewAtom("__moz_text");
|
textTagName = NS_NewAtom("__moz_text");
|
||||||
viewportPseudo = NS_NewAtom(":-moz-viewport");
|
viewportPseudo = NS_NewAtom(":-moz-viewport");
|
||||||
|
pagePseudo = NS_NewAtom(":-moz-page");
|
||||||
|
|
||||||
areaFrame = NS_NewAtom("AreaFrame");
|
areaFrame = NS_NewAtom("AreaFrame");
|
||||||
pageFrame = NS_NewAtom("PageFrame");
|
pageFrame = NS_NewAtom("PageFrame");
|
||||||
@ -122,6 +124,7 @@ void nsLayoutAtoms::ReleaseAtoms()
|
|||||||
NS_RELEASE(commentTagName);
|
NS_RELEASE(commentTagName);
|
||||||
NS_RELEASE(textTagName);
|
NS_RELEASE(textTagName);
|
||||||
NS_RELEASE(viewportPseudo);
|
NS_RELEASE(viewportPseudo);
|
||||||
|
NS_RELEASE(pagePseudo);
|
||||||
|
|
||||||
NS_RELEASE(areaFrame);
|
NS_RELEASE(areaFrame);
|
||||||
NS_RELEASE(pageFrame);
|
NS_RELEASE(pageFrame);
|
||||||
|
@ -682,6 +682,11 @@ param {
|
|||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* XXX Temporary until @page is supported... */
|
||||||
|
:-moz-page {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
display: block;
|
display: block;
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
|
@ -1411,9 +1411,15 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
|
|||||||
// Initialize the page and force it to have a view. This makes printing of
|
// Initialize the page and force it to have a view. This makes printing of
|
||||||
// the pages easier and faster.
|
// the pages easier and faster.
|
||||||
// XXX Use a PAGE style context...
|
// 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,
|
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageFrame,
|
||||||
viewportPseudoStyle, PR_TRUE);
|
pagePseudoStyle, PR_TRUE);
|
||||||
|
|
||||||
// The eventual parent of the document element frame
|
// The eventual parent of the document element frame
|
||||||
mDocElementContainingBlock = pageFrame;
|
mDocElementContainingBlock = pageFrame;
|
||||||
|
@ -682,6 +682,11 @@ param {
|
|||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* XXX Temporary until @page is supported... */
|
||||||
|
:-moz-page {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
display: block;
|
display: block;
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
|
Loading…
Reference in New Issue
Block a user