Bug 746276 - pack style structures more carefully; r=bz

This commit is contained in:
Nathan Froyd 2012-04-17 15:22:49 -04:00
parent 2025eae150
commit 15633b7499
4 changed files with 15 additions and 17 deletions

View File

@ -136,12 +136,12 @@ static const nsStyleSet::sheetType gCSSSheetTypes[] = {
nsStyleSet::nsStyleSet()
: mRuleTree(nsnull),
mUnusedRuleNodeCount(0),
mBatching(0),
mInShutdown(false),
mAuthorStyleDisabled(false),
mInReconstruct(false),
mDirty(0)
mDirty(0),
mUnusedRuleNodeCount(0)
{
}

View File

@ -405,6 +405,13 @@ class nsStyleSet
// lexicographic tree of matched rules that style
// contexts use to look up properties.
PRUint16 mBatching;
unsigned mInShutdown : 1;
unsigned mAuthorStyleDisabled: 1;
unsigned mInReconstruct : 1;
unsigned mDirty : 8; // one dirty bit is used per sheet type
PRUint32 mUnusedRuleNodeCount; // used to batch rule node GC
nsTArray<nsStyleContext*> mRoots; // style contexts with no parent
@ -416,18 +423,10 @@ class nsStyleSet
// determining when context-sensitive values are in use.
nsRefPtr<nsInitialStyleRule> mInitialStyleRule;
PRUint16 mBatching;
// Old rule trees, which should only be non-empty between
// BeginReconstruct and EndReconstruct, but in case of bugs that cause
// style contexts to exist too long, may last longer.
nsTArray<nsRuleNode*> mOldRuleTrees;
unsigned mInShutdown : 1;
unsigned mAuthorStyleDisabled: 1;
unsigned mInReconstruct : 1;
unsigned mDirty : 8; // one dirty bit is used per sheet type
};
#ifdef _IMPL_NS_LAYOUT

View File

@ -457,9 +457,9 @@ nsStyleBorder::nsStyleBorder(const nsStyleBorder& aSrc)
mBorderImageSource(aSrc.mBorderImageSource),
mBorderRadius(aSrc.mBorderRadius),
mBorderImageSlice(aSrc.mBorderImageSlice),
mBorderImageFill(aSrc.mBorderImageFill),
mBorderImageWidth(aSrc.mBorderImageWidth),
mBorderImageOutset(aSrc.mBorderImageOutset),
mBorderImageFill(aSrc.mBorderImageFill),
mBorderImageRepeatH(aSrc.mBorderImageRepeatH),
mBorderImageRepeatV(aSrc.mBorderImageRepeatV),
mFloatEdge(aSrc.mFloatEdge),
@ -2846,10 +2846,10 @@ nsStyleText::nsStyleText(const nsStyleText& aSource)
mHyphens(aSource.mHyphens),
mTextSizeAdjust(aSource.mTextSizeAdjust),
mTabSize(aSource.mTabSize),
mWordSpacing(aSource.mWordSpacing),
mLetterSpacing(aSource.mLetterSpacing),
mLineHeight(aSource.mLineHeight),
mTextIndent(aSource.mTextIndent),
mWordSpacing(aSource.mWordSpacing),
mTextShadow(aSource.mTextShadow)
{
MOZ_COUNT_CTOR(nsStyleText);

View File

@ -939,14 +939,13 @@ protected:
public:
nsStyleCorners mBorderRadius; // [reset] coord, percent
nsStyleSides mBorderImageSlice; // [reset] factor, percent
PRUint8 mBorderImageFill; // [reset]
nsStyleSides mBorderImageWidth; // [reset] length, factor, percent, auto
nsStyleSides mBorderImageOutset; // [reset] length, factor
PRUint8 mBorderImageFill; // [reset]
PRUint8 mBorderImageRepeatH; // [reset] see nsStyleConsts.h
PRUint8 mBorderImageRepeatV; // [reset]
PRUint8 mFloatEdge; // [reset]
// 8 bits free here
protected:
// mComputedBorder holds the CSS2.1 computed border-width values.
@ -1325,10 +1324,10 @@ struct nsStyleText {
PRUint8 mTextSizeAdjust; // [inherited] see nsStyleConsts.h
PRInt32 mTabSize; // [inherited] see nsStyleConsts.h
nscoord mWordSpacing; // [inherited]
nsStyleCoord mLetterSpacing; // [inherited] coord, normal
nsStyleCoord mLineHeight; // [inherited] coord, factor, normal
nsStyleCoord mTextIndent; // [inherited] coord, percent, calc
nscoord mWordSpacing; // [inherited]
nsRefPtr<nsCSSShadowArray> mTextShadow; // [inherited] NULL in case of a zero-length
@ -1601,12 +1600,12 @@ struct nsStyleDisplay {
// specified, or null to indicate there is no transform. (inherit or
// initial are replaced by an actual list of transform functions, or
// null, as appropriate.) (owned by the style rule)
PRUint8 mBackfaceVisibility;
PRUint8 mTransformStyle;
const nsCSSValueList *mSpecifiedTransform; // [reset]
nsStyleCoord mTransformOrigin[3]; // [reset] percent, coord, calc, 3rd param is coord, calc only
nsStyleCoord mChildPerspective; // [reset] coord
nsStyleCoord mPerspectiveOrigin[2]; // [reset] percent, coord, calc
PRUint8 mBackfaceVisibility;
PRUint8 mTransformStyle;
nsAutoTArray<nsTransition, 1> mTransitions; // [reset]
// The number of elements in mTransitions that are not from repeating