From 796739f0d72d566d3c52b77d00c508c8638f9980 Mon Sep 17 00:00:00 2001 From: peterl Date: Mon, 18 May 1998 21:03:10 +0000 Subject: [PATCH] added pseudo frame style support git-svn-id: svn://10.0.0.236/trunk@1839 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/public/nsIStyleSheet.h | 5 +++++ mozilla/layout/base/nsPresContext.h | 19 ++++++++++++++++++- mozilla/layout/base/public/nsIPresContext.h | 19 ++++++++++++++++++- mozilla/layout/base/public/nsIStyleSet.h | 15 ++++++++++++++- mozilla/layout/base/public/nsIStyleSheet.h | 5 +++++ mozilla/layout/base/public/nsPresContext.h | 19 ++++++++++++++++++- mozilla/layout/style/nsIStyleSheet.h | 5 +++++ 7 files changed, 83 insertions(+), 4 deletions(-) diff --git a/mozilla/content/base/public/nsIStyleSheet.h b/mozilla/content/base/public/nsIStyleSheet.h index bac20159aa0..9d1bd6b46f0 100644 --- a/mozilla/content/base/public/nsIStyleSheet.h +++ b/mozilla/content/base/public/nsIStyleSheet.h @@ -42,6 +42,11 @@ public: nsIFrame* aParentFrame, nsISupportsArray* aResults) = 0; + virtual PRInt32 RulesMatching(nsIPresContext* aPresContext, + nsIAtom* aPseudoTag, + nsIFrame* aParentFrame, + nsISupportsArray* aResults) = 0; + // XXX style rule enumerations virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; diff --git a/mozilla/layout/base/nsPresContext.h b/mozilla/layout/base/nsPresContext.h index d27cc7b133b..09211edf703 100644 --- a/mozilla/layout/base/nsPresContext.h +++ b/mozilla/layout/base/nsPresContext.h @@ -33,6 +33,7 @@ class nsIImageGroup; class nsILinkHandler; class nsIPresShell; class nsIStyleContext; +class nsIAtom; class nsString; #define NS_IPRESCONTEXT_IID \ @@ -57,11 +58,27 @@ public: /** * Resolve style for the given piece of content that will be a child - * of the aParentFrame frame. + * of the aParentFrame frame. Don't use this for pseudo frames. */ virtual nsIStyleContext* ResolveStyleContextFor(nsIContent* aContent, nsIFrame* aParentFrame) = 0; + /** + * Resolve style for a pseudo frame within the given aParentFrame frame. + * The tag should be uppercase and inclue the colon. + * ie: NS_NewAtom(":FIRST-LINE"); + */ + virtual nsIStyleContext* ResolvePseudoStyleContextFor(nsIAtom* aPseudoTag, + nsIFrame* aParentFrame) = 0; + + /** + * Probe style for a pseudo frame within the given aParentFrame frame. + * This will return nsnull id there are no explicit rules for the pseudo element. + * The tag should be uppercase and inclue the colon. + * ie: NS_NewAtom(":FIRST-LINE"); + */ + virtual nsIStyleContext* ProbePseudoStyleContextFor(nsIAtom* aPseudoTag, + nsIFrame* aParentFrame) = 0; /** * Get the font metrics for a given font. */ diff --git a/mozilla/layout/base/public/nsIPresContext.h b/mozilla/layout/base/public/nsIPresContext.h index d27cc7b133b..09211edf703 100644 --- a/mozilla/layout/base/public/nsIPresContext.h +++ b/mozilla/layout/base/public/nsIPresContext.h @@ -33,6 +33,7 @@ class nsIImageGroup; class nsILinkHandler; class nsIPresShell; class nsIStyleContext; +class nsIAtom; class nsString; #define NS_IPRESCONTEXT_IID \ @@ -57,11 +58,27 @@ public: /** * Resolve style for the given piece of content that will be a child - * of the aParentFrame frame. + * of the aParentFrame frame. Don't use this for pseudo frames. */ virtual nsIStyleContext* ResolveStyleContextFor(nsIContent* aContent, nsIFrame* aParentFrame) = 0; + /** + * Resolve style for a pseudo frame within the given aParentFrame frame. + * The tag should be uppercase and inclue the colon. + * ie: NS_NewAtom(":FIRST-LINE"); + */ + virtual nsIStyleContext* ResolvePseudoStyleContextFor(nsIAtom* aPseudoTag, + nsIFrame* aParentFrame) = 0; + + /** + * Probe style for a pseudo frame within the given aParentFrame frame. + * This will return nsnull id there are no explicit rules for the pseudo element. + * The tag should be uppercase and inclue the colon. + * ie: NS_NewAtom(":FIRST-LINE"); + */ + virtual nsIStyleContext* ProbePseudoStyleContextFor(nsIAtom* aPseudoTag, + nsIFrame* aParentFrame) = 0; /** * Get the font metrics for a given font. */ diff --git a/mozilla/layout/base/public/nsIStyleSet.h b/mozilla/layout/base/public/nsIStyleSet.h index c084ed98826..577f9281d1c 100644 --- a/mozilla/layout/base/public/nsIStyleSet.h +++ b/mozilla/layout/base/public/nsIStyleSet.h @@ -65,14 +65,27 @@ public: virtual PRInt32 GetNumberOfBackstopStyleSheets() = 0; virtual nsIStyleSheet* GetBackstopStyleSheetAt(PRInt32 aIndex) = 0; - + // get a style context for a non-pseudo frame virtual nsIStyleContext* ResolveStyleFor(nsIPresContext* aPresContext, nsIContent* aContent, nsIFrame* aParentFrame) = 0; + // get a style context for a pseudo-frame (ie: tag = NS_NewAtom(":FIRST-LINE"); + virtual nsIStyleContext* ResolvePseudoStyleFor(nsIPresContext* aPresContext, + nsIAtom* aPseudoTag, + nsIFrame* aParentFrame) = 0; + + // This funtions just like ResolvePseudoStyleFor except that it will + // return nsnull if there are no explicit style rules for that + // pseudo element + virtual nsIStyleContext* ProbePseudoStyleFor(nsIPresContext* aPresContext, + nsIAtom* aPseudoTag, + nsIFrame* aParentFrame) = 0; + // xxx style rules enumeration virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) = 0; + virtual void ListContexts(FILE* out = stdout, PRInt32 aIndent = 0) = 0; }; extern NS_LAYOUT nsresult diff --git a/mozilla/layout/base/public/nsIStyleSheet.h b/mozilla/layout/base/public/nsIStyleSheet.h index bac20159aa0..9d1bd6b46f0 100644 --- a/mozilla/layout/base/public/nsIStyleSheet.h +++ b/mozilla/layout/base/public/nsIStyleSheet.h @@ -42,6 +42,11 @@ public: nsIFrame* aParentFrame, nsISupportsArray* aResults) = 0; + virtual PRInt32 RulesMatching(nsIPresContext* aPresContext, + nsIAtom* aPseudoTag, + nsIFrame* aParentFrame, + nsISupportsArray* aResults) = 0; + // XXX style rule enumerations virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; diff --git a/mozilla/layout/base/public/nsPresContext.h b/mozilla/layout/base/public/nsPresContext.h index d27cc7b133b..09211edf703 100644 --- a/mozilla/layout/base/public/nsPresContext.h +++ b/mozilla/layout/base/public/nsPresContext.h @@ -33,6 +33,7 @@ class nsIImageGroup; class nsILinkHandler; class nsIPresShell; class nsIStyleContext; +class nsIAtom; class nsString; #define NS_IPRESCONTEXT_IID \ @@ -57,11 +58,27 @@ public: /** * Resolve style for the given piece of content that will be a child - * of the aParentFrame frame. + * of the aParentFrame frame. Don't use this for pseudo frames. */ virtual nsIStyleContext* ResolveStyleContextFor(nsIContent* aContent, nsIFrame* aParentFrame) = 0; + /** + * Resolve style for a pseudo frame within the given aParentFrame frame. + * The tag should be uppercase and inclue the colon. + * ie: NS_NewAtom(":FIRST-LINE"); + */ + virtual nsIStyleContext* ResolvePseudoStyleContextFor(nsIAtom* aPseudoTag, + nsIFrame* aParentFrame) = 0; + + /** + * Probe style for a pseudo frame within the given aParentFrame frame. + * This will return nsnull id there are no explicit rules for the pseudo element. + * The tag should be uppercase and inclue the colon. + * ie: NS_NewAtom(":FIRST-LINE"); + */ + virtual nsIStyleContext* ProbePseudoStyleContextFor(nsIAtom* aPseudoTag, + nsIFrame* aParentFrame) = 0; /** * Get the font metrics for a given font. */ diff --git a/mozilla/layout/style/nsIStyleSheet.h b/mozilla/layout/style/nsIStyleSheet.h index bac20159aa0..9d1bd6b46f0 100644 --- a/mozilla/layout/style/nsIStyleSheet.h +++ b/mozilla/layout/style/nsIStyleSheet.h @@ -42,6 +42,11 @@ public: nsIFrame* aParentFrame, nsISupportsArray* aResults) = 0; + virtual PRInt32 RulesMatching(nsIPresContext* aPresContext, + nsIAtom* aPseudoTag, + nsIFrame* aParentFrame, + nsISupportsArray* aResults) = 0; + // XXX style rule enumerations virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0;