Apply NS_HIDDEN to nsCSSValue, nsRuleNode, and nsStyleContext based on profiling data showing that these functions have very high call counts. Bug 227537, r+sr=dbaron.

This commit is contained in:
bryner%brianryner.com 2004-05-12 21:20:09 +00:00
parent cf4c58af1f
commit 13638907d1
6 changed files with 522 additions and 386 deletions

View File

@ -136,17 +136,17 @@ public:
mValue.mInt = 0;
}
nsCSSValue(PRInt32 aValue, nsCSSUnit aUnit);
nsCSSValue(float aValue, nsCSSUnit aUnit);
nsCSSValue(const nsAString& aValue, nsCSSUnit aUnit);
nsCSSValue(nscolor aValue);
nsCSSValue(URL* aValue);
nsCSSValue(Image* aValue);
nsCSSValue(const nsCSSValue& aCopy);
~nsCSSValue();
nsCSSValue(PRInt32 aValue, nsCSSUnit aUnit) NS_HIDDEN;
nsCSSValue(float aValue, nsCSSUnit aUnit) NS_HIDDEN;
nsCSSValue(const nsAString& aValue, nsCSSUnit aUnit) NS_HIDDEN;
nsCSSValue(nscolor aValue) NS_HIDDEN;
nsCSSValue(URL* aValue) NS_HIDDEN;
nsCSSValue(Image* aValue) NS_HIDDEN;
nsCSSValue(const nsCSSValue& aCopy) NS_HIDDEN;
~nsCSSValue() NS_HIDDEN;
nsCSSValue& operator=(const nsCSSValue& aCopy);
PRBool operator==(const nsCSSValue& aOther) const;
NS_HIDDEN_(nsCSSValue&) operator=(const nsCSSValue& aCopy);
NS_HIDDEN_(PRBool) operator==(const nsCSSValue& aOther) const;
PRBool operator!=(const nsCSSValue& aOther) const
{
@ -229,9 +229,9 @@ public:
// Not making this inline because that would force us to include
// imgIRequest.h, which leads to REQUIRES hell, since this header is included
// all over.
imgIRequest* GetImageValue() const;
NS_HIDDEN_(imgIRequest*) GetImageValue() const;
nscoord GetLengthTwips() const;
NS_HIDDEN_(nscoord) GetLengthTwips() const;
void Reset() // sets to null
{
@ -247,23 +247,27 @@ public:
mValue.mInt = 0;
}
void SetIntValue(PRInt32 aValue, nsCSSUnit aUnit);
void SetPercentValue(float aValue);
void SetFloatValue(float aValue, nsCSSUnit aUnit);
void SetStringValue(const nsAString& aValue, nsCSSUnit aUnit);
void SetColorValue(nscolor aValue);
void SetURLValue(nsCSSValue::URL* aURI);
void SetImageValue(nsCSSValue::Image* aImage);
void SetAutoValue();
void SetInheritValue();
void SetInitialValue();
void SetNoneValue();
void SetNormalValue();
void StartImageLoad(nsIDocument* aDocument) const; // Not really const, but pretending
NS_HIDDEN_(void) SetIntValue(PRInt32 aValue, nsCSSUnit aUnit);
NS_HIDDEN_(void) SetPercentValue(float aValue);
NS_HIDDEN_(void) SetFloatValue(float aValue, nsCSSUnit aUnit);
NS_HIDDEN_(void) SetStringValue(const nsAString& aValue, nsCSSUnit aUnit);
NS_HIDDEN_(void) SetColorValue(nscolor aValue);
NS_HIDDEN_(void) SetURLValue(nsCSSValue::URL* aURI);
NS_HIDDEN_(void) SetImageValue(nsCSSValue::Image* aImage);
NS_HIDDEN_(void) SetAutoValue();
NS_HIDDEN_(void) SetInheritValue();
NS_HIDDEN_(void) SetInitialValue();
NS_HIDDEN_(void) SetNoneValue();
NS_HIDDEN_(void) SetNormalValue();
NS_HIDDEN_(void) StartImageLoad(nsIDocument* aDocument) const; // Not really const, but pretending
#ifdef DEBUG
void AppendToString(nsAString& aBuffer, nsCSSProperty aPropID = eCSSProperty_UNKNOWN) const;
void ToString(nsAString& aBuffer, nsCSSProperty aPropID = eCSSProperty_UNKNOWN) const;
NS_HIDDEN_(void)
AppendToString(nsAString& aBuffer,
nsCSSProperty aPropID = eCSSProperty_UNKNOWN) const;
NS_HIDDEN_(void)
ToString(nsAString& aBuffer,
nsCSSProperty aPropID = eCSSProperty_UNKNOWN) const;
#endif
MOZ_DECL_CTOR_COUNTER(nsCSSValue::URL)
@ -313,8 +317,9 @@ public:
// Not making the constructor and destructor inline because that would
// force us to include imgIRequest.h, which leads to REQUIRES hell, since
// this header is included all over.
Image(nsIURI* aURI, const PRUnichar* aString, nsIDocument* aDocument);
~Image();
Image(nsIURI* aURI, const PRUnichar* aString,
nsIDocument* aDocument) NS_HIDDEN;
~Image() NS_HIDDEN;
// Inherit operator== from nsCSSValue::URL

View File

@ -184,7 +184,7 @@ struct nsCachedStyleData
return 1 << aSID;
};
nsStyleStruct* GetStyleData(const nsStyleStructID& aSID) {
NS_HIDDEN_(nsStyleStruct*) GetStyleData(const nsStyleStructID& aSID) {
// Each struct is stored at this.m##type##Data->m##name##Data where
// |type| is either Inherit or Reset, and |name| is the name of the
// style struct. The |gInfo| stores the offset of the appropriate
@ -215,14 +215,14 @@ struct nsCachedStyleData
return data;
};
void ClearInheritedData(PRUint32 aBits) {
NS_HIDDEN_(void) ClearInheritedData(PRUint32 aBits) {
if (mResetData)
mResetData->ClearInheritedData(aBits);
if (mInheritedData)
mInheritedData->ClearInheritedData(aBits);
}
void Destroy(PRUint32 aBits, nsIPresContext* aContext) {
NS_HIDDEN_(void) Destroy(PRUint32 aBits, nsIPresContext* aContext) {
if (mResetData)
mResetData->Destroy(aBits, aContext);
if (mInheritedData)
@ -388,162 +388,224 @@ friend struct nsRuleList;
public:
// Overloaded new operator. Initializes the memory to 0 and relies on an arena
// (which comes from the presShell) to perform the allocation.
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW;
void Destroy();
static nsILanguageAtomService *gLangService;
NS_HIDDEN_(void*) operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW;
NS_HIDDEN_(void) Destroy();
static NS_HIDDEN_(nsILanguageAtomService*) gLangService;
protected:
void PropagateDependentBit(PRUint32 aBit, nsRuleNode* aHighestNode);
void PropagateNoneBit(PRUint32 aBit, nsRuleNode* aHighestNode);
NS_HIDDEN_(void) PropagateDependentBit(PRUint32 aBit,
nsRuleNode* aHighestNode);
NS_HIDDEN_(void) PropagateNoneBit(PRUint32 aBit, nsRuleNode* aHighestNode);
const nsStyleStruct* SetDefaultOnRoot(const nsStyleStructID aSID, nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) SetDefaultOnRoot(const nsStyleStructID aSID,
nsStyleContext* aContext);
const nsStyleStruct* WalkRuleTree(const nsStyleStructID aSID, nsStyleContext* aContext,
nsRuleData* aRuleData,
nsRuleDataStruct* aSpecificData);
NS_HIDDEN_(const nsStyleStruct*)
WalkRuleTree(const nsStyleStructID aSID, nsStyleContext* aContext,
nsRuleData* aRuleData, nsRuleDataStruct* aSpecificData);
const nsStyleStruct* ComputeDisplayData(nsStyleStruct* aStartDisplay, const nsRuleDataStruct& aDisplayData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeVisibilityData(nsStyleStruct* aStartVisibility, const nsRuleDataStruct& aDisplayData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeFontData(nsStyleStruct* aStartFont, const nsRuleDataStruct& aFontData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeColorData(nsStyleStruct* aStartColor, const nsRuleDataStruct& aColorData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeBackgroundData(nsStyleStruct* aStartBackground, const nsRuleDataStruct& aColorData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeMarginData(nsStyleStruct* aStartMargin, const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeBorderData(nsStyleStruct* aStartBorder, const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputePaddingData(nsStyleStruct* aStartPadding, const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeOutlineData(nsStyleStruct* aStartOutline, const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeListData(nsStyleStruct* aStartList, const nsRuleDataStruct& aListData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputePositionData(nsStyleStruct* aStartPosition, const nsRuleDataStruct& aPositionData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeTableData(nsStyleStruct* aStartTable, const nsRuleDataStruct& aTableData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeTableBorderData(nsStyleStruct* aStartTable, const nsRuleDataStruct& aTableData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeContentData(nsStyleStruct* aStartContent, const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeQuotesData(nsStyleStruct* aStartQuotes, const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeTextData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeTextResetData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeUserInterfaceData(nsStyleStruct* aStartData,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail,
PRBool aInherited);
const nsStyleStruct* ComputeUIResetData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeXULData(nsStyleStruct* aStartXUL, const nsRuleDataStruct& aXULData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeDisplayData(nsStyleStruct* aStartDisplay,
const nsRuleDataStruct& aDisplayData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeVisibilityData(nsStyleStruct* aStartVisibility,
const nsRuleDataStruct& aDisplayData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeFontData(nsStyleStruct* aStartFont,
const nsRuleDataStruct& aFontData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeColorData(nsStyleStruct* aStartColor,
const nsRuleDataStruct& aColorData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeBackgroundData(nsStyleStruct* aStartBackground,
const nsRuleDataStruct& aColorData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeMarginData(nsStyleStruct* aStartMargin,
const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeBorderData(nsStyleStruct* aStartBorder,
const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputePaddingData(nsStyleStruct* aStartPadding,
const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeOutlineData(nsStyleStruct* aStartOutline,
const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeListData(nsStyleStruct* aStartList,
const nsRuleDataStruct& aListData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputePositionData(nsStyleStruct* aStartPosition,
const nsRuleDataStruct& aPositionData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeTableData(nsStyleStruct* aStartTable,
const nsRuleDataStruct& aTableData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeTableBorderData(nsStyleStruct* aStartTable,
const nsRuleDataStruct& aTableData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeContentData(nsStyleStruct* aStartContent,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeQuotesData(nsStyleStruct* aStartQuotes,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeTextData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeTextResetData(nsStyleStruct* aStartData,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeUserInterfaceData(nsStyleStruct* aStartData,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeUIResetData(nsStyleStruct* aStartData,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeXULData(nsStyleStruct* aStartXUL, const nsRuleDataStruct& aXULData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
#ifdef MOZ_SVG
const nsStyleStruct* ComputeSVGData(nsStyleStruct* aStartSVG, const nsRuleDataStruct& aSVGData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeSVGResetData(nsStyleStruct* aStartSVG, const nsRuleDataStruct& aSVGData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeSVGData(nsStyleStruct* aStartSVG, const nsRuleDataStruct& aSVGData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeSVGResetData(nsStyleStruct* aStartSVG,
const nsRuleDataStruct& aSVGData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
#endif
// helpers for |ComputeFontData| that need access to |mNoneBits|:
static void SetFont(nsIPresContext* aPresContext, nsStyleContext* aContext,
nscoord aMinFontSize, PRBool aUseDocumentFonts,
PRBool aIsGeneric, const nsRuleDataFont& aFontData,
const nsFont& aDefaultFont,
const nsStyleFont* aParentFont,
nsStyleFont* aFont, PRBool& aInherited);
static void SetGenericFont(nsIPresContext* aPresContext,
nsStyleContext* aContext,
const nsRuleDataFont& aFontData,
PRUint8 aGenericFontID, nscoord aMinFontSize,
PRBool aUseDocumentFonts, nsStyleFont* aFont);
static NS_HIDDEN_(void) SetFont(nsIPresContext* aPresContext,
nsStyleContext* aContext,
nscoord aMinFontSize,
PRBool aUseDocumentFonts,
PRBool aIsGeneric,
const nsRuleDataFont& aFontData,
const nsFont& aDefaultFont,
const nsStyleFont* aParentFont,
nsStyleFont* aFont, PRBool& aInherited);
void AdjustLogicalBoxProp(nsStyleContext* aContext,
const nsCSSValue& aLTRSource,
const nsCSSValue& aRTLSource,
const nsCSSValue& aLTRLogicalValue,
const nsCSSValue& aRTLLogicalValue,
const nsStyleSides& aParentRect,
nsStyleSides& aRect,
PRUint8 aSide,
PRInt32 aMask,
PRBool& aInherited);
static NS_HIDDEN_(void) SetGenericFont(nsIPresContext* aPresContext,
nsStyleContext* aContext,
const nsRuleDataFont& aFontData,
PRUint8 aGenericFontID,
nscoord aMinFontSize,
PRBool aUseDocumentFonts,
nsStyleFont* aFont);
NS_HIDDEN_(void) AdjustLogicalBoxProp(nsStyleContext* aContext,
const nsCSSValue& aLTRSource,
const nsCSSValue& aRTLSource,
const nsCSSValue& aLTRLogicalValue,
const nsCSSValue& aRTLLogicalValue,
const nsStyleSides& aParentRect,
nsStyleSides& aRect,
PRUint8 aSide,
PRInt32 aMask,
PRBool& aInherited);
inline RuleDetail CheckSpecifiedProperties(const nsStyleStructID aSID, const nsRuleDataStruct& aRuleDataStruct);
const nsStyleStruct* GetParentData(const nsStyleStructID aSID);
const nsStyleStruct* GetDisplayData(nsStyleContext* aContext);
const nsStyleStruct* GetVisibilityData(nsStyleContext* aContext);
const nsStyleStruct* GetFontData(nsStyleContext* aContext);
const nsStyleStruct* GetColorData(nsStyleContext* aContext);
const nsStyleStruct* GetBackgroundData(nsStyleContext* aContext);
const nsStyleStruct* GetMarginData(nsStyleContext* aContext);
const nsStyleStruct* GetBorderData(nsStyleContext* aContext);
const nsStyleStruct* GetPaddingData(nsStyleContext* aContext);
const nsStyleStruct* GetOutlineData(nsStyleContext* aContext);
const nsStyleStruct* GetListData(nsStyleContext* aContext);
const nsStyleStruct* GetPositionData(nsStyleContext* aContext);
const nsStyleStruct* GetTableData(nsStyleContext* aContext);
const nsStyleStruct* GetTableBorderData(nsStyleContext* aContext);
const nsStyleStruct* GetContentData(nsStyleContext* aContext);
const nsStyleStruct* GetQuotesData(nsStyleContext* aContext);
const nsStyleStruct* GetTextData(nsStyleContext* aContext);
const nsStyleStruct* GetTextResetData(nsStyleContext* aContext);
const nsStyleStruct* GetUserInterfaceData(nsStyleContext* aContext);
const nsStyleStruct* GetUIResetData(nsStyleContext* aContext);
const nsStyleStruct* GetXULData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetParentData(const nsStyleStructID aSID);
NS_HIDDEN_(const nsStyleStruct*) GetDisplayData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetVisibilityData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetFontData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetColorData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetBackgroundData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetMarginData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetBorderData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetPaddingData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetOutlineData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetListData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetPositionData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetTableData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*)
GetTableBorderData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetContentData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetQuotesData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetTextData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetTextResetData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*)
GetUserInterfaceData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetUIResetData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetXULData(nsStyleContext* aContext);
#ifdef MOZ_SVG
const nsStyleStruct* GetSVGData(nsStyleContext* aContext);
const nsStyleStruct* GetSVGResetData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetSVGData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetSVGResetData(nsStyleContext* aContext);
#endif
public:
nsRuleNode(nsIPresContext* aPresContext, nsIStyleRule* aRule,
nsRuleNode* aParent);
virtual ~nsRuleNode();
nsRuleNode* aParent) NS_HIDDEN;
virtual ~nsRuleNode() NS_HIDDEN;
static nsRuleNode* CreateRootNode(nsIPresContext* aPresContext);
static NS_HIDDEN_(nsRuleNode*) CreateRootNode(nsIPresContext* aPresContext);
nsresult Transition(nsIStyleRule* aRule, nsRuleNode** aResult);
NS_HIDDEN_(nsresult) Transition(nsIStyleRule* aRule, nsRuleNode** aResult);
nsRuleNode* GetParent() const { return mParent; }
PRBool IsRoot() const { return mParent == nsnull; }
@ -552,10 +614,10 @@ public:
// NOTE: Does not |AddRef|.
nsIPresContext* GetPresContext() const { return mPresContext; }
nsresult ClearStyleData();
const nsStyleStruct* GetStyleData(nsStyleStructID aSID,
nsStyleContext* aContext,
PRBool aComputeData);
NS_HIDDEN_(nsresult) ClearStyleData();
NS_HIDDEN_(const nsStyleStruct*) GetStyleData(nsStyleStructID aSID,
nsStyleContext* aContext,
PRBool aComputeData);
/*
* Garbage collection. Mark walks up the tree, marking any unmarked
@ -563,8 +625,8 @@ public:
* the children, destroys any that are unmarked, and clears marks,
* returning true if the node on which it was called was destroyed.
*/
void Mark();
PRBool Sweep();
NS_HIDDEN_(void) Mark();
NS_HIDDEN_(PRBool) Sweep();
};
#endif

View File

@ -49,11 +49,11 @@ class nsStyleContext
{
public:
nsStyleContext(nsStyleContext* aParent, nsIAtom* aPseudoTag,
nsRuleNode* aRuleNode, nsIPresContext* aPresContext);
~nsStyleContext();
nsRuleNode* aRuleNode, nsIPresContext* aPresContext) NS_HIDDEN;
~nsStyleContext() NS_HIDDEN;
void* operator new(size_t sz, nsIPresContext* aPresContext) CPP_THROW_NEW;
void Destroy();
NS_HIDDEN_(void*) operator new(size_t sz, nsIPresContext* aPresContext) CPP_THROW_NEW;
NS_HIDDEN_(void) Destroy();
nsrefcnt AddRef() {
++mRefCnt;
@ -79,15 +79,15 @@ public:
nsIAtom* GetPseudoType() const { return mPseudoTag; }
already_AddRefed<nsStyleContext>
NS_HIDDEN_(already_AddRefed<nsStyleContext>)
FindChildWithRules(const nsIAtom* aPseudoTag, nsRuleNode* aRules);
PRBool Equals(const nsStyleContext* aOther) const;
NS_HIDDEN_(PRBool) Equals(const nsStyleContext* aOther) const;
PRBool HasTextDecorations() { return mBits & NS_STYLE_HAS_TEXT_DECORATIONS; };
void GetBorderPaddingFor(nsStyleBorderPadding& aBorderPadding);
NS_HIDDEN_(void) GetBorderPaddingFor(nsStyleBorderPadding& aBorderPadding);
void SetStyle(nsStyleStructID aSID, nsStyleStruct* aStruct);
NS_HIDDEN_(void) SetStyle(nsStyleStructID aSID, nsStyleStruct* aStruct);
nsRuleNode* GetRuleNode() { return mRuleNode; }
void AddStyleBit(const PRUint32& aBit) { mBits |= aBit; }
@ -97,7 +97,7 @@ public:
* Mark this style context's rule node (and its ancestors) to prevent
* it from being garbage collected.
*/
void Mark();
NS_HIDDEN_(void) Mark();
/*
* Get the style data for a style struct. This is the most important
@ -117,7 +117,7 @@ public:
* See also |nsIFrame::GetStyleData| and the other global
* |GetStyleData| in nsIFrame.h.
*/
const nsStyleStruct* GetStyleData(nsStyleStructID aSID);
NS_HIDDEN_(const nsStyleStruct*) GetStyleData(nsStyleStructID aSID);
/**
* Define typesafe getter functions for each style struct by
@ -136,25 +136,26 @@ public:
#undef STYLE_STRUCT
const nsStyleStruct* PeekStyleData(nsStyleStructID aSID);
NS_HIDDEN_(const nsStyleStruct*) PeekStyleData(nsStyleStructID aSID);
nsStyleStruct* GetUniqueStyleData(const nsStyleStructID& aSID);
NS_HIDDEN_(nsStyleStruct*) GetUniqueStyleData(const nsStyleStructID& aSID);
void ClearStyleData(nsIPresContext* aPresContext);
NS_HIDDEN_(void) ClearStyleData(nsIPresContext* aPresContext);
nsChangeHint CalcStyleDifference(nsStyleContext* aOther);
NS_HIDDEN_(nsChangeHint) CalcStyleDifference(nsStyleContext* aOther);
#ifdef DEBUG
void DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent);
NS_HIDDEN_(void) DumpRegressionData(nsIPresContext* aPresContext, FILE* out,
PRInt32 aIndent);
void List(FILE* out, PRInt32 aIndent);
NS_HIDDEN_(void) List(FILE* out, PRInt32 aIndent);
#endif
protected:
void AppendChild(nsStyleContext* aChild);
void RemoveChild(nsStyleContext* aChild);
NS_HIDDEN_(void) AppendChild(nsStyleContext* aChild);
NS_HIDDEN_(void) RemoveChild(nsStyleContext* aChild);
void ApplyStyleFixups(nsIPresContext* aPresContext);
NS_HIDDEN_(void) ApplyStyleFixups(nsIPresContext* aPresContext);
nsStyleContext* mParent;
nsStyleContext* mChild;
@ -180,7 +181,7 @@ protected:
PRUint32 mRefCnt;
};
already_AddRefed<nsStyleContext>
NS_HIDDEN_(already_AddRefed<nsStyleContext>)
NS_NewStyleContext(nsStyleContext* aParentContext,
nsIAtom* aPseudoTag,
nsRuleNode* aRuleNode,

View File

@ -136,17 +136,17 @@ public:
mValue.mInt = 0;
}
nsCSSValue(PRInt32 aValue, nsCSSUnit aUnit);
nsCSSValue(float aValue, nsCSSUnit aUnit);
nsCSSValue(const nsAString& aValue, nsCSSUnit aUnit);
nsCSSValue(nscolor aValue);
nsCSSValue(URL* aValue);
nsCSSValue(Image* aValue);
nsCSSValue(const nsCSSValue& aCopy);
~nsCSSValue();
nsCSSValue(PRInt32 aValue, nsCSSUnit aUnit) NS_HIDDEN;
nsCSSValue(float aValue, nsCSSUnit aUnit) NS_HIDDEN;
nsCSSValue(const nsAString& aValue, nsCSSUnit aUnit) NS_HIDDEN;
nsCSSValue(nscolor aValue) NS_HIDDEN;
nsCSSValue(URL* aValue) NS_HIDDEN;
nsCSSValue(Image* aValue) NS_HIDDEN;
nsCSSValue(const nsCSSValue& aCopy) NS_HIDDEN;
~nsCSSValue() NS_HIDDEN;
nsCSSValue& operator=(const nsCSSValue& aCopy);
PRBool operator==(const nsCSSValue& aOther) const;
NS_HIDDEN_(nsCSSValue&) operator=(const nsCSSValue& aCopy);
NS_HIDDEN_(PRBool) operator==(const nsCSSValue& aOther) const;
PRBool operator!=(const nsCSSValue& aOther) const
{
@ -229,9 +229,9 @@ public:
// Not making this inline because that would force us to include
// imgIRequest.h, which leads to REQUIRES hell, since this header is included
// all over.
imgIRequest* GetImageValue() const;
NS_HIDDEN_(imgIRequest*) GetImageValue() const;
nscoord GetLengthTwips() const;
NS_HIDDEN_(nscoord) GetLengthTwips() const;
void Reset() // sets to null
{
@ -247,23 +247,27 @@ public:
mValue.mInt = 0;
}
void SetIntValue(PRInt32 aValue, nsCSSUnit aUnit);
void SetPercentValue(float aValue);
void SetFloatValue(float aValue, nsCSSUnit aUnit);
void SetStringValue(const nsAString& aValue, nsCSSUnit aUnit);
void SetColorValue(nscolor aValue);
void SetURLValue(nsCSSValue::URL* aURI);
void SetImageValue(nsCSSValue::Image* aImage);
void SetAutoValue();
void SetInheritValue();
void SetInitialValue();
void SetNoneValue();
void SetNormalValue();
void StartImageLoad(nsIDocument* aDocument) const; // Not really const, but pretending
NS_HIDDEN_(void) SetIntValue(PRInt32 aValue, nsCSSUnit aUnit);
NS_HIDDEN_(void) SetPercentValue(float aValue);
NS_HIDDEN_(void) SetFloatValue(float aValue, nsCSSUnit aUnit);
NS_HIDDEN_(void) SetStringValue(const nsAString& aValue, nsCSSUnit aUnit);
NS_HIDDEN_(void) SetColorValue(nscolor aValue);
NS_HIDDEN_(void) SetURLValue(nsCSSValue::URL* aURI);
NS_HIDDEN_(void) SetImageValue(nsCSSValue::Image* aImage);
NS_HIDDEN_(void) SetAutoValue();
NS_HIDDEN_(void) SetInheritValue();
NS_HIDDEN_(void) SetInitialValue();
NS_HIDDEN_(void) SetNoneValue();
NS_HIDDEN_(void) SetNormalValue();
NS_HIDDEN_(void) StartImageLoad(nsIDocument* aDocument) const; // Not really const, but pretending
#ifdef DEBUG
void AppendToString(nsAString& aBuffer, nsCSSProperty aPropID = eCSSProperty_UNKNOWN) const;
void ToString(nsAString& aBuffer, nsCSSProperty aPropID = eCSSProperty_UNKNOWN) const;
NS_HIDDEN_(void)
AppendToString(nsAString& aBuffer,
nsCSSProperty aPropID = eCSSProperty_UNKNOWN) const;
NS_HIDDEN_(void)
ToString(nsAString& aBuffer,
nsCSSProperty aPropID = eCSSProperty_UNKNOWN) const;
#endif
MOZ_DECL_CTOR_COUNTER(nsCSSValue::URL)
@ -313,8 +317,9 @@ public:
// Not making the constructor and destructor inline because that would
// force us to include imgIRequest.h, which leads to REQUIRES hell, since
// this header is included all over.
Image(nsIURI* aURI, const PRUnichar* aString, nsIDocument* aDocument);
~Image();
Image(nsIURI* aURI, const PRUnichar* aString,
nsIDocument* aDocument) NS_HIDDEN;
~Image() NS_HIDDEN;
// Inherit operator== from nsCSSValue::URL

View File

@ -184,7 +184,7 @@ struct nsCachedStyleData
return 1 << aSID;
};
nsStyleStruct* GetStyleData(const nsStyleStructID& aSID) {
NS_HIDDEN_(nsStyleStruct*) GetStyleData(const nsStyleStructID& aSID) {
// Each struct is stored at this.m##type##Data->m##name##Data where
// |type| is either Inherit or Reset, and |name| is the name of the
// style struct. The |gInfo| stores the offset of the appropriate
@ -215,14 +215,14 @@ struct nsCachedStyleData
return data;
};
void ClearInheritedData(PRUint32 aBits) {
NS_HIDDEN_(void) ClearInheritedData(PRUint32 aBits) {
if (mResetData)
mResetData->ClearInheritedData(aBits);
if (mInheritedData)
mInheritedData->ClearInheritedData(aBits);
}
void Destroy(PRUint32 aBits, nsIPresContext* aContext) {
NS_HIDDEN_(void) Destroy(PRUint32 aBits, nsIPresContext* aContext) {
if (mResetData)
mResetData->Destroy(aBits, aContext);
if (mInheritedData)
@ -388,162 +388,224 @@ friend struct nsRuleList;
public:
// Overloaded new operator. Initializes the memory to 0 and relies on an arena
// (which comes from the presShell) to perform the allocation.
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW;
void Destroy();
static nsILanguageAtomService *gLangService;
NS_HIDDEN_(void*) operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW;
NS_HIDDEN_(void) Destroy();
static NS_HIDDEN_(nsILanguageAtomService*) gLangService;
protected:
void PropagateDependentBit(PRUint32 aBit, nsRuleNode* aHighestNode);
void PropagateNoneBit(PRUint32 aBit, nsRuleNode* aHighestNode);
NS_HIDDEN_(void) PropagateDependentBit(PRUint32 aBit,
nsRuleNode* aHighestNode);
NS_HIDDEN_(void) PropagateNoneBit(PRUint32 aBit, nsRuleNode* aHighestNode);
const nsStyleStruct* SetDefaultOnRoot(const nsStyleStructID aSID, nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) SetDefaultOnRoot(const nsStyleStructID aSID,
nsStyleContext* aContext);
const nsStyleStruct* WalkRuleTree(const nsStyleStructID aSID, nsStyleContext* aContext,
nsRuleData* aRuleData,
nsRuleDataStruct* aSpecificData);
NS_HIDDEN_(const nsStyleStruct*)
WalkRuleTree(const nsStyleStructID aSID, nsStyleContext* aContext,
nsRuleData* aRuleData, nsRuleDataStruct* aSpecificData);
const nsStyleStruct* ComputeDisplayData(nsStyleStruct* aStartDisplay, const nsRuleDataStruct& aDisplayData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeVisibilityData(nsStyleStruct* aStartVisibility, const nsRuleDataStruct& aDisplayData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeFontData(nsStyleStruct* aStartFont, const nsRuleDataStruct& aFontData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeColorData(nsStyleStruct* aStartColor, const nsRuleDataStruct& aColorData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeBackgroundData(nsStyleStruct* aStartBackground, const nsRuleDataStruct& aColorData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeMarginData(nsStyleStruct* aStartMargin, const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeBorderData(nsStyleStruct* aStartBorder, const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputePaddingData(nsStyleStruct* aStartPadding, const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeOutlineData(nsStyleStruct* aStartOutline, const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeListData(nsStyleStruct* aStartList, const nsRuleDataStruct& aListData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputePositionData(nsStyleStruct* aStartPosition, const nsRuleDataStruct& aPositionData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeTableData(nsStyleStruct* aStartTable, const nsRuleDataStruct& aTableData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeTableBorderData(nsStyleStruct* aStartTable, const nsRuleDataStruct& aTableData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeContentData(nsStyleStruct* aStartContent, const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeQuotesData(nsStyleStruct* aStartQuotes, const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeTextData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeTextResetData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeUserInterfaceData(nsStyleStruct* aStartData,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail,
PRBool aInherited);
const nsStyleStruct* ComputeUIResetData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeXULData(nsStyleStruct* aStartXUL, const nsRuleDataStruct& aXULData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeDisplayData(nsStyleStruct* aStartDisplay,
const nsRuleDataStruct& aDisplayData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeVisibilityData(nsStyleStruct* aStartVisibility,
const nsRuleDataStruct& aDisplayData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeFontData(nsStyleStruct* aStartFont,
const nsRuleDataStruct& aFontData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeColorData(nsStyleStruct* aStartColor,
const nsRuleDataStruct& aColorData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeBackgroundData(nsStyleStruct* aStartBackground,
const nsRuleDataStruct& aColorData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeMarginData(nsStyleStruct* aStartMargin,
const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeBorderData(nsStyleStruct* aStartBorder,
const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputePaddingData(nsStyleStruct* aStartPadding,
const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeOutlineData(nsStyleStruct* aStartOutline,
const nsRuleDataStruct& aMarginData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeListData(nsStyleStruct* aStartList,
const nsRuleDataStruct& aListData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputePositionData(nsStyleStruct* aStartPosition,
const nsRuleDataStruct& aPositionData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeTableData(nsStyleStruct* aStartTable,
const nsRuleDataStruct& aTableData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeTableBorderData(nsStyleStruct* aStartTable,
const nsRuleDataStruct& aTableData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeContentData(nsStyleStruct* aStartContent,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeQuotesData(nsStyleStruct* aStartQuotes,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeTextData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeTextResetData(nsStyleStruct* aStartData,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeUserInterfaceData(nsStyleStruct* aStartData,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeUIResetData(nsStyleStruct* aStartData,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeXULData(nsStyleStruct* aStartXUL, const nsRuleDataStruct& aXULData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
#ifdef MOZ_SVG
const nsStyleStruct* ComputeSVGData(nsStyleStruct* aStartSVG, const nsRuleDataStruct& aSVGData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
const nsStyleStruct* ComputeSVGResetData(nsStyleStruct* aStartSVG, const nsRuleDataStruct& aSVGData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeSVGData(nsStyleStruct* aStartSVG, const nsRuleDataStruct& aSVGData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeSVGResetData(nsStyleStruct* aStartSVG,
const nsRuleDataStruct& aSVGData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
const RuleDetail& aRuleDetail, PRBool aInherited);
#endif
// helpers for |ComputeFontData| that need access to |mNoneBits|:
static void SetFont(nsIPresContext* aPresContext, nsStyleContext* aContext,
nscoord aMinFontSize, PRBool aUseDocumentFonts,
PRBool aIsGeneric, const nsRuleDataFont& aFontData,
const nsFont& aDefaultFont,
const nsStyleFont* aParentFont,
nsStyleFont* aFont, PRBool& aInherited);
static void SetGenericFont(nsIPresContext* aPresContext,
nsStyleContext* aContext,
const nsRuleDataFont& aFontData,
PRUint8 aGenericFontID, nscoord aMinFontSize,
PRBool aUseDocumentFonts, nsStyleFont* aFont);
static NS_HIDDEN_(void) SetFont(nsIPresContext* aPresContext,
nsStyleContext* aContext,
nscoord aMinFontSize,
PRBool aUseDocumentFonts,
PRBool aIsGeneric,
const nsRuleDataFont& aFontData,
const nsFont& aDefaultFont,
const nsStyleFont* aParentFont,
nsStyleFont* aFont, PRBool& aInherited);
void AdjustLogicalBoxProp(nsStyleContext* aContext,
const nsCSSValue& aLTRSource,
const nsCSSValue& aRTLSource,
const nsCSSValue& aLTRLogicalValue,
const nsCSSValue& aRTLLogicalValue,
const nsStyleSides& aParentRect,
nsStyleSides& aRect,
PRUint8 aSide,
PRInt32 aMask,
PRBool& aInherited);
static NS_HIDDEN_(void) SetGenericFont(nsIPresContext* aPresContext,
nsStyleContext* aContext,
const nsRuleDataFont& aFontData,
PRUint8 aGenericFontID,
nscoord aMinFontSize,
PRBool aUseDocumentFonts,
nsStyleFont* aFont);
NS_HIDDEN_(void) AdjustLogicalBoxProp(nsStyleContext* aContext,
const nsCSSValue& aLTRSource,
const nsCSSValue& aRTLSource,
const nsCSSValue& aLTRLogicalValue,
const nsCSSValue& aRTLLogicalValue,
const nsStyleSides& aParentRect,
nsStyleSides& aRect,
PRUint8 aSide,
PRInt32 aMask,
PRBool& aInherited);
inline RuleDetail CheckSpecifiedProperties(const nsStyleStructID aSID, const nsRuleDataStruct& aRuleDataStruct);
const nsStyleStruct* GetParentData(const nsStyleStructID aSID);
const nsStyleStruct* GetDisplayData(nsStyleContext* aContext);
const nsStyleStruct* GetVisibilityData(nsStyleContext* aContext);
const nsStyleStruct* GetFontData(nsStyleContext* aContext);
const nsStyleStruct* GetColorData(nsStyleContext* aContext);
const nsStyleStruct* GetBackgroundData(nsStyleContext* aContext);
const nsStyleStruct* GetMarginData(nsStyleContext* aContext);
const nsStyleStruct* GetBorderData(nsStyleContext* aContext);
const nsStyleStruct* GetPaddingData(nsStyleContext* aContext);
const nsStyleStruct* GetOutlineData(nsStyleContext* aContext);
const nsStyleStruct* GetListData(nsStyleContext* aContext);
const nsStyleStruct* GetPositionData(nsStyleContext* aContext);
const nsStyleStruct* GetTableData(nsStyleContext* aContext);
const nsStyleStruct* GetTableBorderData(nsStyleContext* aContext);
const nsStyleStruct* GetContentData(nsStyleContext* aContext);
const nsStyleStruct* GetQuotesData(nsStyleContext* aContext);
const nsStyleStruct* GetTextData(nsStyleContext* aContext);
const nsStyleStruct* GetTextResetData(nsStyleContext* aContext);
const nsStyleStruct* GetUserInterfaceData(nsStyleContext* aContext);
const nsStyleStruct* GetUIResetData(nsStyleContext* aContext);
const nsStyleStruct* GetXULData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetParentData(const nsStyleStructID aSID);
NS_HIDDEN_(const nsStyleStruct*) GetDisplayData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetVisibilityData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetFontData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetColorData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetBackgroundData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetMarginData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetBorderData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetPaddingData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetOutlineData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetListData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetPositionData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetTableData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*)
GetTableBorderData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetContentData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetQuotesData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetTextData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetTextResetData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*)
GetUserInterfaceData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetUIResetData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetXULData(nsStyleContext* aContext);
#ifdef MOZ_SVG
const nsStyleStruct* GetSVGData(nsStyleContext* aContext);
const nsStyleStruct* GetSVGResetData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetSVGData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetSVGResetData(nsStyleContext* aContext);
#endif
public:
nsRuleNode(nsIPresContext* aPresContext, nsIStyleRule* aRule,
nsRuleNode* aParent);
virtual ~nsRuleNode();
nsRuleNode* aParent) NS_HIDDEN;
virtual ~nsRuleNode() NS_HIDDEN;
static nsRuleNode* CreateRootNode(nsIPresContext* aPresContext);
static NS_HIDDEN_(nsRuleNode*) CreateRootNode(nsIPresContext* aPresContext);
nsresult Transition(nsIStyleRule* aRule, nsRuleNode** aResult);
NS_HIDDEN_(nsresult) Transition(nsIStyleRule* aRule, nsRuleNode** aResult);
nsRuleNode* GetParent() const { return mParent; }
PRBool IsRoot() const { return mParent == nsnull; }
@ -552,10 +614,10 @@ public:
// NOTE: Does not |AddRef|.
nsIPresContext* GetPresContext() const { return mPresContext; }
nsresult ClearStyleData();
const nsStyleStruct* GetStyleData(nsStyleStructID aSID,
nsStyleContext* aContext,
PRBool aComputeData);
NS_HIDDEN_(nsresult) ClearStyleData();
NS_HIDDEN_(const nsStyleStruct*) GetStyleData(nsStyleStructID aSID,
nsStyleContext* aContext,
PRBool aComputeData);
/*
* Garbage collection. Mark walks up the tree, marking any unmarked
@ -563,8 +625,8 @@ public:
* the children, destroys any that are unmarked, and clears marks,
* returning true if the node on which it was called was destroyed.
*/
void Mark();
PRBool Sweep();
NS_HIDDEN_(void) Mark();
NS_HIDDEN_(PRBool) Sweep();
};
#endif

View File

@ -49,11 +49,11 @@ class nsStyleContext
{
public:
nsStyleContext(nsStyleContext* aParent, nsIAtom* aPseudoTag,
nsRuleNode* aRuleNode, nsIPresContext* aPresContext);
~nsStyleContext();
nsRuleNode* aRuleNode, nsIPresContext* aPresContext) NS_HIDDEN;
~nsStyleContext() NS_HIDDEN;
void* operator new(size_t sz, nsIPresContext* aPresContext) CPP_THROW_NEW;
void Destroy();
NS_HIDDEN_(void*) operator new(size_t sz, nsIPresContext* aPresContext) CPP_THROW_NEW;
NS_HIDDEN_(void) Destroy();
nsrefcnt AddRef() {
++mRefCnt;
@ -79,15 +79,15 @@ public:
nsIAtom* GetPseudoType() const { return mPseudoTag; }
already_AddRefed<nsStyleContext>
NS_HIDDEN_(already_AddRefed<nsStyleContext>)
FindChildWithRules(const nsIAtom* aPseudoTag, nsRuleNode* aRules);
PRBool Equals(const nsStyleContext* aOther) const;
NS_HIDDEN_(PRBool) Equals(const nsStyleContext* aOther) const;
PRBool HasTextDecorations() { return mBits & NS_STYLE_HAS_TEXT_DECORATIONS; };
void GetBorderPaddingFor(nsStyleBorderPadding& aBorderPadding);
NS_HIDDEN_(void) GetBorderPaddingFor(nsStyleBorderPadding& aBorderPadding);
void SetStyle(nsStyleStructID aSID, nsStyleStruct* aStruct);
NS_HIDDEN_(void) SetStyle(nsStyleStructID aSID, nsStyleStruct* aStruct);
nsRuleNode* GetRuleNode() { return mRuleNode; }
void AddStyleBit(const PRUint32& aBit) { mBits |= aBit; }
@ -97,7 +97,7 @@ public:
* Mark this style context's rule node (and its ancestors) to prevent
* it from being garbage collected.
*/
void Mark();
NS_HIDDEN_(void) Mark();
/*
* Get the style data for a style struct. This is the most important
@ -117,7 +117,7 @@ public:
* See also |nsIFrame::GetStyleData| and the other global
* |GetStyleData| in nsIFrame.h.
*/
const nsStyleStruct* GetStyleData(nsStyleStructID aSID);
NS_HIDDEN_(const nsStyleStruct*) GetStyleData(nsStyleStructID aSID);
/**
* Define typesafe getter functions for each style struct by
@ -136,25 +136,26 @@ public:
#undef STYLE_STRUCT
const nsStyleStruct* PeekStyleData(nsStyleStructID aSID);
NS_HIDDEN_(const nsStyleStruct*) PeekStyleData(nsStyleStructID aSID);
nsStyleStruct* GetUniqueStyleData(const nsStyleStructID& aSID);
NS_HIDDEN_(nsStyleStruct*) GetUniqueStyleData(const nsStyleStructID& aSID);
void ClearStyleData(nsIPresContext* aPresContext);
NS_HIDDEN_(void) ClearStyleData(nsIPresContext* aPresContext);
nsChangeHint CalcStyleDifference(nsStyleContext* aOther);
NS_HIDDEN_(nsChangeHint) CalcStyleDifference(nsStyleContext* aOther);
#ifdef DEBUG
void DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent);
NS_HIDDEN_(void) DumpRegressionData(nsIPresContext* aPresContext, FILE* out,
PRInt32 aIndent);
void List(FILE* out, PRInt32 aIndent);
NS_HIDDEN_(void) List(FILE* out, PRInt32 aIndent);
#endif
protected:
void AppendChild(nsStyleContext* aChild);
void RemoveChild(nsStyleContext* aChild);
NS_HIDDEN_(void) AppendChild(nsStyleContext* aChild);
NS_HIDDEN_(void) RemoveChild(nsStyleContext* aChild);
void ApplyStyleFixups(nsIPresContext* aPresContext);
NS_HIDDEN_(void) ApplyStyleFixups(nsIPresContext* aPresContext);
nsStyleContext* mParent;
nsStyleContext* mChild;
@ -180,7 +181,7 @@ protected:
PRUint32 mRefCnt;
};
already_AddRefed<nsStyleContext>
NS_HIDDEN_(already_AddRefed<nsStyleContext>)
NS_NewStyleContext(nsStyleContext* aParentContext,
nsIAtom* aPseudoTag,
nsRuleNode* aRuleNode,