Added new pseudo class style :SCROLLED-CONTENT

This commit is contained in:
troy%netscape.com 1998-10-22 20:12:34 +00:00
parent 944d65db04
commit 9b9a796719
12 changed files with 33 additions and 10 deletions

View File

@ -183,6 +183,7 @@ nsIAtom* nsHTMLAtoms::rowspan;
nsIAtom* nsHTMLAtoms::rules;
nsIAtom* nsHTMLAtoms::scheme;
nsIAtom* nsHTMLAtoms::scope;
nsIAtom* nsHTMLAtoms::scrolledContentPseudo;
nsIAtom* nsHTMLAtoms::scrolling;
nsIAtom* nsHTMLAtoms::select;
nsIAtom* nsHTMLAtoms::selected;
@ -399,6 +400,7 @@ void nsHTMLAtoms::AddrefAtoms()
rules = NS_NewAtom("RULES");
scheme = NS_NewAtom("SCHEME");
scope = NS_NewAtom("SCOPE");
scrolledContentPseudo = NS_NewAtom(":SCROLLED-CONTENT");
scrolling = NS_NewAtom("SCROLLING");
select = NS_NewAtom("SELECT");
selected = NS_NewAtom("SELECTED");

View File

@ -217,6 +217,7 @@ public:
static nsIAtom* scheme;
static nsIAtom* scope;
static nsIAtom* scrolledContentPseudo;
static nsIAtom* scrolling;
static nsIAtom* select;
static nsIAtom* selected;

View File

@ -1517,12 +1517,11 @@ HTMLStyleSheetImpl::ConstructFrame(nsIPresContext* aPresContext,
if NS_SUCCEEDED(NS_NewScrollFrame(aContent, aParentFrame, scrollFrame)) {
// The scroll frame gets the original style context, and the scrolled
// frame gets a pseudo style context.
// XXX Is this the best way to do this?
// frame gets a SCROLLED-CONTENT pseudo class style context.
scrollFrame->SetStyleContext(aPresContext, styleContext);
nsIStyleContext* pseudoStyle;
pseudoStyle = aPresContext->ResolvePseudoStyleContextFor(nsHTMLAtoms::columnPseudo,
pseudoStyle = aPresContext->ResolvePseudoStyleContextFor(nsHTMLAtoms::scrolledContentPseudo,
scrollFrame);
aFrameSubTree->SetStyleContext(aPresContext, pseudoStyle);
NS_RELEASE(pseudoStyle);

View File

@ -217,6 +217,7 @@ public:
static nsIAtom* scheme;
static nsIAtom* scope;
static nsIAtom* scrolledContentPseudo;
static nsIAtom* scrolling;
static nsIAtom* select;
static nsIAtom* selected;

View File

@ -183,6 +183,7 @@ nsIAtom* nsHTMLAtoms::rowspan;
nsIAtom* nsHTMLAtoms::rules;
nsIAtom* nsHTMLAtoms::scheme;
nsIAtom* nsHTMLAtoms::scope;
nsIAtom* nsHTMLAtoms::scrolledContentPseudo;
nsIAtom* nsHTMLAtoms::scrolling;
nsIAtom* nsHTMLAtoms::select;
nsIAtom* nsHTMLAtoms::selected;
@ -399,6 +400,7 @@ void nsHTMLAtoms::AddrefAtoms()
rules = NS_NewAtom("RULES");
scheme = NS_NewAtom("SCHEME");
scope = NS_NewAtom("SCOPE");
scrolledContentPseudo = NS_NewAtom(":SCROLLED-CONTENT");
scrolling = NS_NewAtom("SCROLLING");
select = NS_NewAtom("SELECT");
selected = NS_NewAtom("SELECTED");

View File

@ -183,6 +183,7 @@ nsIAtom* nsHTMLAtoms::rowspan;
nsIAtom* nsHTMLAtoms::rules;
nsIAtom* nsHTMLAtoms::scheme;
nsIAtom* nsHTMLAtoms::scope;
nsIAtom* nsHTMLAtoms::scrolledContentPseudo;
nsIAtom* nsHTMLAtoms::scrolling;
nsIAtom* nsHTMLAtoms::select;
nsIAtom* nsHTMLAtoms::selected;
@ -399,6 +400,7 @@ void nsHTMLAtoms::AddrefAtoms()
rules = NS_NewAtom("RULES");
scheme = NS_NewAtom("SCHEME");
scope = NS_NewAtom("SCOPE");
scrolledContentPseudo = NS_NewAtom(":SCROLLED-CONTENT");
scrolling = NS_NewAtom("SCROLLING");
select = NS_NewAtom("SELECT");
selected = NS_NewAtom("SELECTED");

View File

@ -217,6 +217,7 @@ public:
static nsIAtom* scheme;
static nsIAtom* scope;
static nsIAtom* scrolledContentPseudo;
static nsIAtom* scrolling;
static nsIAtom* select;
static nsIAtom* selected;

View File

@ -277,7 +277,8 @@ nsScrollFrame::CreateScrollingView()
if (NS_OK == rv) {
// Initialize the scrolling view
// XXX Check for opacity...
view->Init(viewManager, mRect, parentView, &kWidgetCID, nsnull, nsnull);
//view->Init(viewManager, mRect, parentView, &kWidgetCID, nsnull, nsnull);
view->Init(viewManager, mRect, parentView, nsnull, nsnull, nsnull);
// Insert the view into the view hierarchy
viewManager->InsertChild(parentView, view, 0);

View File

@ -470,3 +470,11 @@ NOSCRIPT {
NOFRAMES {
display: none;
}
// Pseudo-classes
:SCROLLED-CONTENT {
background: inherit;
padding: inherit;
}

View File

@ -1517,12 +1517,11 @@ HTMLStyleSheetImpl::ConstructFrame(nsIPresContext* aPresContext,
if NS_SUCCEEDED(NS_NewScrollFrame(aContent, aParentFrame, scrollFrame)) {
// The scroll frame gets the original style context, and the scrolled
// frame gets a pseudo style context.
// XXX Is this the best way to do this?
// frame gets a SCROLLED-CONTENT pseudo class style context.
scrollFrame->SetStyleContext(aPresContext, styleContext);
nsIStyleContext* pseudoStyle;
pseudoStyle = aPresContext->ResolvePseudoStyleContextFor(nsHTMLAtoms::columnPseudo,
pseudoStyle = aPresContext->ResolvePseudoStyleContextFor(nsHTMLAtoms::scrolledContentPseudo,
scrollFrame);
aFrameSubTree->SetStyleContext(aPresContext, pseudoStyle);
NS_RELEASE(pseudoStyle);

View File

@ -1517,12 +1517,11 @@ HTMLStyleSheetImpl::ConstructFrame(nsIPresContext* aPresContext,
if NS_SUCCEEDED(NS_NewScrollFrame(aContent, aParentFrame, scrollFrame)) {
// The scroll frame gets the original style context, and the scrolled
// frame gets a pseudo style context.
// XXX Is this the best way to do this?
// frame gets a SCROLLED-CONTENT pseudo class style context.
scrollFrame->SetStyleContext(aPresContext, styleContext);
nsIStyleContext* pseudoStyle;
pseudoStyle = aPresContext->ResolvePseudoStyleContextFor(nsHTMLAtoms::columnPseudo,
pseudoStyle = aPresContext->ResolvePseudoStyleContextFor(nsHTMLAtoms::scrolledContentPseudo,
scrollFrame);
aFrameSubTree->SetStyleContext(aPresContext, pseudoStyle);
NS_RELEASE(pseudoStyle);

View File

@ -470,3 +470,11 @@ NOSCRIPT {
NOFRAMES {
display: none;
}
// Pseudo-classes
:SCROLLED-CONTENT {
background: inherit;
padding: inherit;
}