diff --git a/content/base/src/nsRuleNode.cpp b/content/base/src/nsRuleNode.cpp index 5a858fd8063..c15d2886eb3 100644 --- a/content/base/src/nsRuleNode.cpp +++ b/content/base/src/nsRuleNode.cpp @@ -708,7 +708,7 @@ struct PropertyCheckData { /* the information for all the properties in a style struct */ typedef nsRuleNode::RuleDetail - (* PR_CALLBACK CheckCallbackFn)(const nsCSSStruct& aData); + (* PR_CALLBACK CheckCallbackFn)(const nsRuleDataStruct& aData); struct StructCheckData { const PropertyCheckData* props; @@ -791,9 +791,10 @@ ExamineRectCoordProperties(const nsCSSRect* aRect, } PR_STATIC_CALLBACK(nsRuleNode::RuleDetail) -CheckFontCallback(const nsCSSStruct& aData) +CheckFontCallback(const nsRuleDataStruct& aData) { - const nsCSSFont& fontData = NS_STATIC_CAST(const nsCSSFont&, aData); + const nsRuleDataFont& fontData = + NS_STATIC_CAST(const nsRuleDataFont&, aData); if (eCSSUnit_Enumerated == fontData.mFamily.GetUnit()) { // A special case. We treat this as a fully specified font, // since no other font props are legal with a system font. @@ -822,173 +823,173 @@ CheckFontCallback(const nsCSSStruct& aData) } static const PropertyCheckData FontCheckProperties[] = { - CHECKDATA_PROP(nsCSSFont, mFamily, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSFont, mStyle, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSFont, mVariant, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSFont, mWeight, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSFont, mSize, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSFont, mSizeAdjust, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataFont, mFamily, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataFont, mStyle, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataFont, mVariant, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataFont, mWeight, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataFont, mSize, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataFont, mSizeAdjust, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData DisplayCheckProperties[] = { - CHECKDATA_PROP(nsCSSDisplay, mAppearance, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mClip, CHECKDATA_RECT, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mDisplay, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mBinding, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mPosition, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mFloat, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mClear, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mOverflow, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mBreakBefore, CHECKDATA_VALUE, PR_FALSE), // temp fix for bug 2400 - CHECKDATA_PROP(nsCSSDisplay, mBreakAfter, CHECKDATA_VALUE, PR_FALSE) // temp fix for bug 2400 + CHECKDATA_PROP(nsRuleDataDisplay, mAppearance, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mClip, CHECKDATA_RECT, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mDisplay, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mBinding, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mPosition, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mFloat, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mClear, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mOverflow, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mBreakBefore, CHECKDATA_VALUE, PR_FALSE), // temp fix for bug 2400 + CHECKDATA_PROP(nsRuleDataDisplay, mBreakAfter, CHECKDATA_VALUE, PR_FALSE) // temp fix for bug 2400 }; static const PropertyCheckData VisibilityCheckProperties[] = { - CHECKDATA_PROP(nsCSSDisplay, mVisibility, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mDirection, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mLang, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mOpacity, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataDisplay, mVisibility, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mDirection, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mLang, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mOpacity, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData MarginCheckProperties[] = { - CHECKDATA_PROP(nsCSSMargin, mMargin, CHECKDATA_RECT, PR_TRUE) + CHECKDATA_PROP(nsRuleDataMargin, mMargin, CHECKDATA_RECT, PR_TRUE) }; static const PropertyCheckData BorderCheckProperties[] = { - CHECKDATA_PROP(nsCSSMargin, mBorderWidth, CHECKDATA_RECT, PR_FALSE), - CHECKDATA_PROP(nsCSSMargin, mBorderStyle, CHECKDATA_RECT, PR_FALSE), - CHECKDATA_PROP(nsCSSMargin, mBorderColor, CHECKDATA_RECT, PR_FALSE), - CHECKDATA_PROP(nsCSSMargin, mBorderRadius, CHECKDATA_RECT, PR_TRUE), - CHECKDATA_PROP(nsCSSMargin, mFloatEdge, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSMargin, mBorderColors, CHECKDATA_VALUELIST_ARRAY, PR_FALSE) + CHECKDATA_PROP(nsRuleDataMargin, mBorderWidth, CHECKDATA_RECT, PR_FALSE), + CHECKDATA_PROP(nsRuleDataMargin, mBorderStyle, CHECKDATA_RECT, PR_FALSE), + CHECKDATA_PROP(nsRuleDataMargin, mBorderColor, CHECKDATA_RECT, PR_FALSE), + CHECKDATA_PROP(nsRuleDataMargin, mBorderRadius, CHECKDATA_RECT, PR_TRUE), + CHECKDATA_PROP(nsRuleDataMargin, mFloatEdge, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataMargin, mBorderColors, CHECKDATA_VALUELIST_ARRAY, PR_FALSE) }; static const PropertyCheckData PaddingCheckProperties[] = { - CHECKDATA_PROP(nsCSSMargin, mPadding, CHECKDATA_RECT, PR_TRUE) + CHECKDATA_PROP(nsRuleDataMargin, mPadding, CHECKDATA_RECT, PR_TRUE) }; static const PropertyCheckData OutlineCheckProperties[] = { - CHECKDATA_PROP(nsCSSMargin, mOutlineColor, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSMargin, mOutlineWidth, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSMargin, mOutlineStyle, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSMargin, mOutlineRadius, CHECKDATA_RECT, PR_TRUE) + CHECKDATA_PROP(nsRuleDataMargin, mOutlineColor, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataMargin, mOutlineWidth, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataMargin, mOutlineStyle, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataMargin, mOutlineRadius, CHECKDATA_RECT, PR_TRUE) }; static const PropertyCheckData ListCheckProperties[] = { - CHECKDATA_PROP(nsCSSList, mType, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSList, mImage, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSList, mPosition, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSList, mImageRegion, CHECKDATA_RECT, PR_TRUE) + CHECKDATA_PROP(nsRuleDataList, mType, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataList, mImage, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataList, mPosition, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataList, mImageRegion, CHECKDATA_RECT, PR_TRUE) }; static const PropertyCheckData ColorCheckProperties[] = { - CHECKDATA_PROP(nsCSSColor, mColor, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataColor, mColor, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData BackgroundCheckProperties[] = { - CHECKDATA_PROP(nsCSSColor, mBackAttachment, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackRepeat, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackClip, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackColor, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackImage, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackOrigin, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackPositionX, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackPositionY, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataColor, mBackAttachment, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackRepeat, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackClip, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackColor, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackImage, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackOrigin, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackPositionX, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackPositionY, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData PositionCheckProperties[] = { - CHECKDATA_PROP(nsCSSPosition, mOffset, CHECKDATA_RECT, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mWidth, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mMinWidth, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mMaxWidth, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mHeight, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mMinHeight, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mMaxHeight, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mBoxSizing, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSPosition, mZIndex, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataPosition, mOffset, CHECKDATA_RECT, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mWidth, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mMinWidth, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mMaxWidth, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mHeight, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mMinHeight, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mMaxHeight, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mBoxSizing, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataPosition, mZIndex, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData TableCheckProperties[] = { - CHECKDATA_PROP(nsCSSTable, mLayout, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mFrame, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mRules, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mCols, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mSpan, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataTable, mLayout, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mFrame, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mRules, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mCols, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mSpan, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData TableBorderCheckProperties[] = { - CHECKDATA_PROP(nsCSSTable, mBorderCollapse, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mBorderSpacingX, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mBorderSpacingY, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mCaptionSide, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mEmptyCells, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataTable, mBorderCollapse, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mBorderSpacingX, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mBorderSpacingY, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mCaptionSide, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mEmptyCells, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData ContentCheckProperties[] = { - CHECKDATA_PROP(nsCSSContent, mContent, CHECKDATA_VALUELIST, PR_FALSE), - CHECKDATA_PROP(nsCSSContent, mMarkerOffset, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSContent, mCounterIncrement, CHECKDATA_COUNTERDATA, PR_FALSE), - CHECKDATA_PROP(nsCSSContent, mCounterReset, CHECKDATA_COUNTERDATA, PR_FALSE) + CHECKDATA_PROP(nsRuleDataContent, mContent, CHECKDATA_VALUELIST, PR_FALSE), + CHECKDATA_PROP(nsRuleDataContent, mMarkerOffset, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataContent, mCounterIncrement, CHECKDATA_COUNTERDATA, PR_FALSE), + CHECKDATA_PROP(nsRuleDataContent, mCounterReset, CHECKDATA_COUNTERDATA, PR_FALSE) }; static const PropertyCheckData QuotesCheckProperties[] = { - CHECKDATA_PROP(nsCSSContent, mQuotes, CHECKDATA_QUOTES, PR_FALSE) + CHECKDATA_PROP(nsRuleDataContent, mQuotes, CHECKDATA_QUOTES, PR_FALSE) }; static const PropertyCheckData TextCheckProperties[] = { - CHECKDATA_PROP(nsCSSText, mLineHeight, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSText, mTextIndent, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSText, mWordSpacing, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSText, mLetterSpacing, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSText, mTextAlign, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSText, mTextTransform, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSText, mWhiteSpace, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataText, mLineHeight, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataText, mTextIndent, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataText, mWordSpacing, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataText, mLetterSpacing, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataText, mTextAlign, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataText, mTextTransform, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataText, mWhiteSpace, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData TextResetCheckProperties[] = { - CHECKDATA_PROP(nsCSSText, mDecoration, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSText, mVerticalAlign, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSText, mUnicodeBidi, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataText, mDecoration, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataText, mVerticalAlign, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataText, mUnicodeBidi, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData UserInterfaceCheckProperties[] = { - CHECKDATA_PROP(nsCSSUserInterface, mUserInput, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSUserInterface, mUserModify, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSUserInterface, mUserFocus, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSUserInterface, mCursor, CHECKDATA_VALUELIST, PR_FALSE) + CHECKDATA_PROP(nsRuleDataUserInterface, mUserInput, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataUserInterface, mUserModify, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataUserInterface, mUserFocus, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataUserInterface, mCursor, CHECKDATA_VALUELIST, PR_FALSE) }; static const PropertyCheckData UIResetCheckProperties[] = { - CHECKDATA_PROP(nsCSSUserInterface, mUserSelect, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSUserInterface, mResizer, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSUserInterface, mKeyEquivalent, CHECKDATA_VALUELIST, PR_FALSE), - CHECKDATA_PROP(nsCSSUserInterface, mForceBrokenImageIcon, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataUserInterface, mUserSelect, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataUserInterface, mResizer, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataUserInterface, mKeyEquivalent, CHECKDATA_VALUELIST, PR_FALSE), + CHECKDATA_PROP(nsRuleDataUserInterface, mForceBrokenImageIcon, CHECKDATA_VALUE, PR_FALSE) }; #ifdef INCLUDE_XUL static const PropertyCheckData XULCheckProperties[] = { - CHECKDATA_PROP(nsCSSXUL, mBoxAlign, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSXUL, mBoxDirection, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSXUL, mBoxFlex, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSXUL, mBoxOrient, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSXUL, mBoxPack, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSXUL, mBoxOrdinal, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataXUL, mBoxAlign, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataXUL, mBoxDirection, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataXUL, mBoxFlex, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataXUL, mBoxOrient, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataXUL, mBoxPack, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataXUL, mBoxOrdinal, CHECKDATA_VALUE, PR_FALSE) }; #endif #ifdef MOZ_SVG static const PropertyCheckData SVGCheckProperties[] = { - CHECKDATA_PROP(nsCSSSVG, mFill, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mFillOpacity, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mFillRule, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStroke, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeDasharray, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeDashoffset, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeLinecap, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeLinejoin, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeMiterlimit, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeOpacity, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeWidth, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataSVG, mFill, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mFillOpacity, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mFillRule, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStroke, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeDasharray, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeDashoffset, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeLinecap, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeLinejoin, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeMiterlimit, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeOpacity, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeWidth, CHECKDATA_VALUE, PR_FALSE) }; #endif @@ -1009,54 +1010,54 @@ static const StructCheckData gCheckProperties[] = { // XXXldb Taking the address of a reference is evil. inline const nsCSSValue& -ValueAtOffset(const nsCSSStruct& aCSSStruct, size_t aOffset) +ValueAtOffset(const nsRuleDataStruct& aRuleDataStruct, size_t aOffset) { return * NS_REINTERPRET_CAST(const nsCSSValue*, - NS_REINTERPRET_CAST(const char*, &aCSSStruct) + aOffset); + NS_REINTERPRET_CAST(const char*, &aRuleDataStruct) + aOffset); } inline const nsCSSRect* -RectAtOffset(const nsCSSStruct& aCSSStruct, size_t aOffset) +RectAtOffset(const nsRuleDataStruct& aRuleDataStruct, size_t aOffset) { return * NS_REINTERPRET_CAST(const nsCSSRect*const*, - NS_REINTERPRET_CAST(const char*, &aCSSStruct) + aOffset); + NS_REINTERPRET_CAST(const char*, &aRuleDataStruct) + aOffset); } inline const nsCSSValueList* -ValueListAtOffset(const nsCSSStruct& aCSSStruct, size_t aOffset) +ValueListAtOffset(const nsRuleDataStruct& aRuleDataStruct, size_t aOffset) { return * NS_REINTERPRET_CAST(const nsCSSValueList*const*, - NS_REINTERPRET_CAST(const char*, &aCSSStruct) + aOffset); + NS_REINTERPRET_CAST(const char*, &aRuleDataStruct) + aOffset); } inline const nsCSSValueList** -ValueListArrayAtOffset(const nsCSSStruct& aCSSStruct, size_t aOffset) +ValueListArrayAtOffset(const nsRuleDataStruct& aRuleDataStruct, size_t aOffset) { return * NS_REINTERPRET_CAST(const nsCSSValueList**const*, - NS_REINTERPRET_CAST(const char*, &aCSSStruct) + aOffset); + NS_REINTERPRET_CAST(const char*, &aRuleDataStruct) + aOffset); } inline const nsCSSCounterData* -CounterDataAtOffset(const nsCSSStruct& aCSSStruct, size_t aOffset) +CounterDataAtOffset(const nsRuleDataStruct& aRuleDataStruct, size_t aOffset) { return * NS_REINTERPRET_CAST(const nsCSSCounterData*const*, - NS_REINTERPRET_CAST(const char*, &aCSSStruct) + aOffset); + NS_REINTERPRET_CAST(const char*, &aRuleDataStruct) + aOffset); } inline const nsCSSQuotes* -QuotesAtOffset(const nsCSSStruct& aCSSStruct, size_t aOffset) +QuotesAtOffset(const nsRuleDataStruct& aRuleDataStruct, size_t aOffset) { return * NS_REINTERPRET_CAST(const nsCSSQuotes*const*, - NS_REINTERPRET_CAST(const char*, &aCSSStruct) + aOffset); + NS_REINTERPRET_CAST(const char*, &aRuleDataStruct) + aOffset); } inline nsRuleNode::RuleDetail nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, - const nsCSSStruct& aCSSStruct) + const nsRuleDataStruct& aRuleDataStruct) { const StructCheckData *structData = gCheckProperties + aSID; if (structData->callback) { - nsRuleNode::RuleDetail res = (*structData->callback)(aCSSStruct); + nsRuleNode::RuleDetail res = (*structData->callback)(aRuleDataStruct); if (res != eRuleUnknown) return res; } @@ -1077,7 +1078,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, case CHECKDATA_VALUE: { ++total; - const nsCSSValue& value = ValueAtOffset(aCSSStruct, prop->offset); + const nsCSSValue& value = ValueAtOffset(aRuleDataStruct, prop->offset); if (eCSSUnit_Null != value.GetUnit()) { ++specified; if (eCSSUnit_Inherit == value.GetUnit()) { @@ -1092,11 +1093,11 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, case CHECKDATA_RECT: total += 4; if (prop->mayHaveExplicitInherit) - ExamineRectCoordProperties(RectAtOffset(aCSSStruct, prop->offset), + ExamineRectCoordProperties(RectAtOffset(aRuleDataStruct, prop->offset), specified, inherited, canHaveExplicitInherit); else - ExamineRectProperties(RectAtOffset(aCSSStruct, prop->offset), + ExamineRectProperties(RectAtOffset(aRuleDataStruct, prop->offset), specified, inherited); break; @@ -1104,7 +1105,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, { ++total; const nsCSSValueList* valueList = - ValueListAtOffset(aCSSStruct, prop->offset); + ValueListAtOffset(aRuleDataStruct, prop->offset); if (valueList) { ++specified; if (eCSSUnit_Inherit == valueList->mValue.GetUnit()) { @@ -1122,7 +1123,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, NS_ASSERTION(!prop->mayHaveExplicitInherit, "counters can't be coordinates"); const nsCSSCounterData* counterData = - CounterDataAtOffset(aCSSStruct, prop->offset); + CounterDataAtOffset(aRuleDataStruct, prop->offset); if (counterData) { ++specified; if (eCSSUnit_Inherit == counterData->mCounter.GetUnit()) { @@ -1138,7 +1139,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, NS_ASSERTION(!prop->mayHaveExplicitInherit, "quotes can't be coordinates"); const nsCSSQuotes* quotes = - QuotesAtOffset(aCSSStruct, prop->offset); + QuotesAtOffset(aRuleDataStruct, prop->offset); if (quotes) { ++specified; if (eCSSUnit_Inherit == quotes->mOpen.GetUnit()) { @@ -1152,7 +1153,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, { total += 4; const nsCSSValueList** valueArray = - ValueListArrayAtOffset(aCSSStruct, prop->offset); + ValueListArrayAtOffset(aRuleDataStruct, prop->offset); if (valueArray) { for (PRInt32 i = 0; i < 4; i++) { const nsCSSValueList* valList = valueArray[i]; @@ -1207,7 +1208,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, const nsStyleStruct* nsRuleNode::GetDisplayData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSDisplay displayData; // Declare a struct with null CSS values. + nsRuleDataDisplay displayData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Display, mPresContext, aContext); ruleData.mDisplayData = &displayData; @@ -1221,7 +1222,7 @@ nsRuleNode::GetDisplayData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetVisibilityData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSDisplay displayData; // Declare a struct with null CSS values. + nsRuleDataDisplay displayData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Visibility, mPresContext, aContext); ruleData.mDisplayData = &displayData; @@ -1231,7 +1232,7 @@ nsRuleNode::GetVisibilityData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetTextData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSText textData; // Declare a struct with null CSS values. + nsRuleDataText textData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Text, mPresContext, aContext); ruleData.mTextData = &textData; @@ -1241,7 +1242,7 @@ nsRuleNode::GetTextData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetTextResetData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSText textData; // Declare a struct with null CSS values. + nsRuleDataText textData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_TextReset, mPresContext, aContext); ruleData.mTextData = &textData; @@ -1251,7 +1252,7 @@ nsRuleNode::GetTextResetData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetUserInterfaceData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSUserInterface uiData; // Declare a struct with null CSS values. + nsRuleDataUserInterface uiData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_UserInterface, mPresContext, aContext); ruleData.mUIData = &uiData; @@ -1263,7 +1264,7 @@ nsRuleNode::GetUserInterfaceData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetUIResetData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSUserInterface uiData; // Declare a struct with null CSS values. + nsRuleDataUserInterface uiData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_UIReset, mPresContext, aContext); ruleData.mUIData = &uiData; @@ -1275,7 +1276,7 @@ nsRuleNode::GetUIResetData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetFontData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSFont fontData; // Declare a struct with null CSS values. + nsRuleDataFont fontData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Font, mPresContext, aContext); ruleData.mFontData = &fontData; @@ -1285,7 +1286,7 @@ nsRuleNode::GetFontData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetColorData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSColor colorData; // Declare a struct with null CSS values. + nsRuleDataColor colorData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Color, mPresContext, aContext); ruleData.mColorData = &colorData; @@ -1295,7 +1296,7 @@ nsRuleNode::GetColorData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetBackgroundData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSColor colorData; // Declare a struct with null CSS values. + nsRuleDataColor colorData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Background, mPresContext, aContext); ruleData.mColorData = &colorData; @@ -1305,7 +1306,7 @@ nsRuleNode::GetBackgroundData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetMarginData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSMargin marginData; // Declare a struct with null CSS values. + nsRuleDataMargin marginData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Margin, mPresContext, aContext); ruleData.mMarginData = &marginData; @@ -1321,7 +1322,7 @@ nsRuleNode::GetMarginData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetBorderData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSMargin marginData; // Declare a struct with null CSS values. + nsRuleDataMargin marginData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Border, mPresContext, aContext); ruleData.mMarginData = &marginData; @@ -1351,7 +1352,7 @@ nsRuleNode::GetBorderData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetPaddingData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSMargin marginData; // Declare a struct with null CSS values. + nsRuleDataMargin marginData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Padding, mPresContext, aContext); ruleData.mMarginData = &marginData; @@ -1367,7 +1368,7 @@ nsRuleNode::GetPaddingData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetOutlineData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSMargin marginData; // Declare a struct with null CSS values. + nsRuleDataMargin marginData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Outline, mPresContext, aContext); ruleData.mMarginData = &marginData; @@ -1383,7 +1384,7 @@ nsRuleNode::GetOutlineData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetListData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSList listData; // Declare a struct with null CSS values. + nsRuleDataList listData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_List, mPresContext, aContext); ruleData.mListData = &listData; @@ -1398,7 +1399,7 @@ nsRuleNode::GetListData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetPositionData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSPosition posData; // Declare a struct with null CSS values. + nsRuleDataPosition posData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Position, mPresContext, aContext); ruleData.mPositionData = &posData; @@ -1413,7 +1414,7 @@ nsRuleNode::GetPositionData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetTableData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSTable tableData; // Declare a struct with null CSS values. + nsRuleDataTable tableData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Table, mPresContext, aContext); ruleData.mTableData = &tableData; @@ -1423,7 +1424,7 @@ nsRuleNode::GetTableData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetTableBorderData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSTable tableData; // Declare a struct with null CSS values. + nsRuleDataTable tableData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_TableBorder, mPresContext, aContext); ruleData.mTableData = &tableData; @@ -1433,7 +1434,7 @@ nsRuleNode::GetTableBorderData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetContentData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSContent contentData; // Declare a struct with null CSS values. + nsRuleDataContent contentData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Content, mPresContext, aContext); ruleData.mContentData = &contentData; @@ -1446,7 +1447,7 @@ nsRuleNode::GetContentData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetQuotesData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSContent contentData; // Declare a struct with null CSS values. + nsRuleDataContent contentData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Quotes, mPresContext, aContext); ruleData.mContentData = &contentData; @@ -1459,7 +1460,7 @@ nsRuleNode::GetQuotesData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetXULData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSXUL xulData; // Declare a struct with null CSS values. + nsRuleDataXUL xulData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_XUL, mPresContext, aContext); ruleData.mXULData = &xulData; @@ -1471,7 +1472,7 @@ nsRuleNode::GetXULData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetSVGData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSSVG svgData; // Declare a struct with null CSS values. + nsRuleDataSVG svgData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_SVG, mPresContext, aContext); ruleData.mSVGData = &svgData; @@ -1483,7 +1484,7 @@ const nsStyleStruct* nsRuleNode::WalkRuleTree(const nsStyleStructID aSID, nsIStyleContext* aContext, nsRuleData* aRuleData, - nsCSSStruct* aSpecificData, + nsRuleDataStruct* aSpecificData, PRBool aComputeData) { // We start at the most specific rule in the tree. @@ -1817,7 +1818,7 @@ nsRuleNode::gComputeStyleDataFn[] = { static void SetFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, nscoord aMinFontSize, PRBool aUseDocumentFonts, PRBool aChromeOverride, - PRBool aIsGeneric, const nsCSSFont& aFontData, + PRBool aIsGeneric, const nsRuleDataFont& aFontData, const nsFont& aDefaultFont, const nsStyleFont* aParentFont, nsStyleFont* aFont, PRBool aZoom, PRBool& aInherited) { @@ -1841,6 +1842,10 @@ SetFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, // now set to defaults aFont->mFont.name = aDefaultFont.name; } + nsCompatibility compat; + aPresContext->GetCompatibilityMode(&compat); + aFont->mFont.familyNameQuirks = + compat == eCompatibility_NavQuirks && aFontData.mFamilyFromHTML; } else if (eCSSUnit_Enumerated == aFontData.mFamily.GetUnit()) { nsSystemFontID sysID; @@ -1876,6 +1881,8 @@ SetFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, aFont->mSize = aFont->mFont.size; // this becomes our cascading size } + aFont->mFont.familyNameQuirks = PR_FALSE; + // XXXldb All of this platform-specific stuff should be in the // nsIDeviceContext implementations, not here. @@ -1905,9 +1912,11 @@ SetFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, else if (eCSSUnit_Inherit == aFontData.mFamily.GetUnit()) { aInherited = PR_TRUE; aFont->mFont.name = aParentFont->mFont.name; + aFont->mFont.familyNameQuirks = aParentFont->mFont.familyNameQuirks; } else if (eCSSUnit_Initial == aFontData.mFamily.GetUnit()) { aFont->mFont.name = aDefaultFont.name; + aFont->mFont.familyNameQuirks = PR_FALSE; } // font-style: enum, normal, inherit @@ -2069,7 +2078,7 @@ SetFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, // - re-apply cascading rules from there without caching intermediate values static void SetGenericFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, - const nsCSSFont& aFontData, PRUint8 aGenericFontID, + const nsRuleDataFont& aFontData, PRUint8 aGenericFontID, nscoord aMinFontSize, PRBool aUseDocumentFonts, PRBool aChromeOverride, nsStyleFont* aFont) { @@ -2118,7 +2127,7 @@ SetGenericFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, for (; i >= 0; --i) { nsIStyleContext* context = (nsIStyleContext*)contextPath[i]; - nsCSSFont fontData; // Declare a struct with null CSS values. + nsRuleDataFont fontData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Font, aPresContext, context); ruleData.mFontData = &fontData; @@ -2163,14 +2172,15 @@ SetGenericFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, } const nsStyleStruct* -nsRuleNode::ComputeFontData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeFontData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSFont& fontData = NS_STATIC_CAST(const nsCSSFont&, aData); + const nsRuleDataFont& fontData = NS_STATIC_CAST(const nsRuleDataFont&, aData); nsStyleFont* font = nsnull; const nsStyleFont* parentFont = nsnull; PRBool inherited = aInherited; @@ -2292,14 +2302,15 @@ nsRuleNode::ComputeFontData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDat } const nsStyleStruct* -nsRuleNode::ComputeTextData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeTextData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSText& textData = NS_STATIC_CAST(const nsCSSText&, aData); + const nsRuleDataText& textData = NS_STATIC_CAST(const nsRuleDataText&, aData); nsStyleText* text = nsnull; const nsStyleText* parentText = nsnull; PRBool inherited = aInherited; @@ -2412,14 +2423,15 @@ nsRuleNode::ComputeTextData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDat } const nsStyleStruct* -nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData, const nsCSSStruct& aData, +nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSText& textData = NS_STATIC_CAST(const nsCSSText&, aData); + const nsRuleDataText& textData = NS_STATIC_CAST(const nsRuleDataText&, aData); nsStyleTextReset* text; if (aStartData) // We only need to compute the delta between this computed data and our @@ -2497,7 +2509,7 @@ nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData, const nsCSSStruct& a const nsStyleStruct* nsRuleNode::ComputeUserInterfaceData(nsStyleStruct* aStartData, - const nsCSSStruct& aData, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, @@ -2505,7 +2517,7 @@ nsRuleNode::ComputeUserInterfaceData(nsStyleStruct* aStartData, { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSUserInterface& uiData = NS_STATIC_CAST(const nsCSSUserInterface&, aData); + const nsRuleDataUserInterface& uiData = NS_STATIC_CAST(const nsRuleDataUserInterface&, aData); nsStyleUserInterface* ui = nsnull; const nsStyleUserInterface* parentUI = nsnull; PRBool inherited = aInherited; @@ -2608,14 +2620,15 @@ nsRuleNode::ComputeUserInterfaceData(nsStyleStruct* aStartData, } const nsStyleStruct* -nsRuleNode::ComputeUIResetData(nsStyleStruct* aStartData, const nsCSSStruct& aData, +nsRuleNode::ComputeUIResetData(nsStyleStruct* aStartData, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSUserInterface& uiData = NS_STATIC_CAST(const nsCSSUserInterface&, aData); + const nsRuleDataUserInterface& uiData = NS_STATIC_CAST(const nsRuleDataUserInterface&, aData); nsStyleUIReset* ui; if (aStartData) // We only need to compute the delta between this computed data and our @@ -2697,14 +2710,15 @@ nsRuleNode::ComputeUIResetData(nsStyleStruct* aStartData, const nsCSSStruct& aDa } const nsStyleStruct* -nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSDisplay& displayData = NS_STATIC_CAST(const nsCSSDisplay&, aData); + const nsRuleDataDisplay& displayData = NS_STATIC_CAST(const nsRuleDataDisplay&, aData); nsStyleDisplay* display; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -2950,14 +2964,15 @@ nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct, const nsCSSStruct& a } const nsStyleStruct* -nsRuleNode::ComputeVisibilityData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeVisibilityData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSDisplay& displayData = NS_STATIC_CAST(const nsCSSDisplay&, aData); + const nsRuleDataDisplay& displayData = NS_STATIC_CAST(const nsRuleDataDisplay&, aData); nsStyleVisibility* visibility = nsnull; const nsStyleVisibility* parentVisibility = nsnull; PRBool inherited = aInherited; @@ -3060,14 +3075,15 @@ nsRuleNode::ComputeVisibilityData(nsStyleStruct* aStartStruct, const nsCSSStruct } const nsStyleStruct* -nsRuleNode::ComputeColorData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeColorData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSColor& colorData = NS_STATIC_CAST(const nsCSSColor&, aData); + const nsRuleDataColor& colorData = NS_STATIC_CAST(const nsRuleDataColor&, aData); nsStyleColor* color = nsnull; const nsStyleColor* parentColor = nsnull; PRBool inherited = aInherited; @@ -3116,14 +3132,15 @@ nsRuleNode::ComputeColorData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDa } const nsStyleStruct* -nsRuleNode::ComputeBackgroundData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeBackgroundData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSColor& colorData = NS_STATIC_CAST(const nsCSSColor&, aData); + const nsRuleDataColor& colorData = NS_STATIC_CAST(const nsRuleDataColor&, aData); nsStyleBackground* bg; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -3279,14 +3296,15 @@ nsRuleNode::ComputeBackgroundData(nsStyleStruct* aStartStruct, const nsCSSStruct } const nsStyleStruct* -nsRuleNode::ComputeMarginData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeMarginData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSMargin& marginData = NS_STATIC_CAST(const nsCSSMargin&, aData); + const nsRuleDataMargin& marginData = NS_STATIC_CAST(const nsRuleDataMargin&, aData); nsStyleMargin* margin; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -3344,14 +3362,15 @@ nsRuleNode::ComputeMarginData(nsStyleStruct* aStartStruct, const nsCSSStruct& aD } const nsStyleStruct* -nsRuleNode::ComputeBorderData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeBorderData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSMargin& marginData = NS_STATIC_CAST(const nsCSSMargin&, aData); + const nsRuleDataMargin& marginData = NS_STATIC_CAST(const nsRuleDataMargin&, aData); nsStyleBorder* border; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -3624,14 +3643,15 @@ nsRuleNode::ComputeBorderData(nsStyleStruct* aStartStruct, const nsCSSStruct& aD } const nsStyleStruct* -nsRuleNode::ComputePaddingData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputePaddingData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSMargin& marginData = NS_STATIC_CAST(const nsCSSMargin&, aData); + const nsRuleDataMargin& marginData = NS_STATIC_CAST(const nsRuleDataMargin&, aData); nsStylePadding* padding; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -3689,14 +3709,15 @@ nsRuleNode::ComputePaddingData(nsStyleStruct* aStartStruct, const nsCSSStruct& a } const nsStyleStruct* -nsRuleNode::ComputeOutlineData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeOutlineData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSMargin& marginData = NS_STATIC_CAST(const nsCSSMargin&, aData); + const nsRuleDataMargin& marginData = NS_STATIC_CAST(const nsRuleDataMargin&, aData); nsStyleOutline* outline; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -3761,14 +3782,15 @@ nsRuleNode::ComputeOutlineData(nsStyleStruct* aStartStruct, const nsCSSStruct& a } const nsStyleStruct* -nsRuleNode::ComputeListData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeListData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSList& listData = NS_STATIC_CAST(const nsCSSList&, aData); + const nsRuleDataList& listData = NS_STATIC_CAST(const nsRuleDataList&, aData); nsStyleList* list = nsnull; const nsStyleList* parentList = nsnull; PRBool inherited = aInherited; @@ -3877,14 +3899,15 @@ nsRuleNode::ComputeListData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDat } const nsStyleStruct* -nsRuleNode::ComputePositionData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputePositionData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSPosition& posData = NS_STATIC_CAST(const nsCSSPosition&, aData); + const nsRuleDataPosition& posData = NS_STATIC_CAST(const nsRuleDataPosition&, aData); nsStylePosition* pos; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -3985,14 +4008,15 @@ nsRuleNode::ComputePositionData(nsStyleStruct* aStartStruct, const nsCSSStruct& } const nsStyleStruct* -nsRuleNode::ComputeTableData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeTableData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSTable& tableData = NS_STATIC_CAST(const nsCSSTable&, aData); + const nsRuleDataTable& tableData = NS_STATIC_CAST(const nsRuleDataTable&, aData); nsStyleTable* table; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -4055,14 +4079,15 @@ nsRuleNode::ComputeTableData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDa } const nsStyleStruct* -nsRuleNode::ComputeTableBorderData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeTableBorderData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSTable& tableData = NS_STATIC_CAST(const nsCSSTable&, aData); + const nsRuleDataTable& tableData = NS_STATIC_CAST(const nsRuleDataTable&, aData); nsStyleTableBorder* table = nsnull; const nsStyleTableBorder* parentTable = nsnull; PRBool inherited = aInherited; @@ -4153,14 +4178,15 @@ nsRuleNode::ComputeTableBorderData(nsStyleStruct* aStartStruct, const nsCSSStruc } const nsStyleStruct* -nsRuleNode::ComputeContentData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeContentData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSContent& contentData = NS_STATIC_CAST(const nsCSSContent&, aData); + const nsRuleDataContent& contentData = NS_STATIC_CAST(const nsRuleDataContent&, aData); nsStyleContent* content; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -4348,14 +4374,15 @@ nsRuleNode::ComputeContentData(nsStyleStruct* aStartStruct, const nsCSSStruct& a } const nsStyleStruct* -nsRuleNode::ComputeQuotesData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, - nsIStyleContext* aContext, - nsRuleNode* aHighestNode, - const RuleDetail& aRuleDetail, PRBool aInherited) +nsRuleNode::ComputeQuotesData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, + nsIStyleContext* aContext, + nsRuleNode* aHighestNode, + const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSContent& contentData = NS_STATIC_CAST(const nsCSSContent&, aData); + const nsRuleDataContent& contentData = NS_STATIC_CAST(const nsRuleDataContent&, aData); nsStyleQuotes* quotes = nsnull; const nsStyleQuotes* parentQuotes = nsnull; PRBool inherited = aInherited; @@ -4441,14 +4468,15 @@ nsRuleNode::ComputeQuotesData(nsStyleStruct* aStartStruct, const nsCSSStruct& aD #ifdef INCLUDE_XUL const nsStyleStruct* -nsRuleNode::ComputeXULData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeXULData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSXUL& xulData = NS_STATIC_CAST(const nsCSSXUL&, aData); + const nsRuleDataXUL& xulData = NS_STATIC_CAST(const nsRuleDataXUL&, aData); nsStyleXUL* xul = nsnull; if (aStartStruct) @@ -4590,7 +4618,8 @@ SetSVGLength(const nsCSSValue& aValue, float parentLength, float& length, } const nsStyleStruct* -nsRuleNode::ComputeSVGData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeSVGData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) @@ -4600,7 +4629,7 @@ nsRuleNode::ComputeSVGData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData nsStyleSVG* svg = nsnull; nsStyleSVG* parentSVG = svg; PRBool inherited = aInherited; - const nsCSSSVG& SVGData = NS_STATIC_CAST(const nsCSSSVG&, aData); + const nsRuleDataSVG& SVGData = NS_STATIC_CAST(const nsRuleDataSVG&, aData); if (aStartStruct) // We only need to compute the delta between this computed data and our diff --git a/content/html/content/src/nsHTMLFontElement.cpp b/content/html/content/src/nsHTMLFontElement.cpp index ff0a866c229..ea41bf9efe3 100644 --- a/content/html/content/src/nsHTMLFontElement.cpp +++ b/content/html/content/src/nsHTMLFontElement.cpp @@ -234,7 +234,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, return; if (aData->mFontData) { - nsCSSFont& font = *(aData->mFontData); + nsRuleDataFont& font = *(aData->mFontData); nsHTMLValue value; // face: string list @@ -243,8 +243,10 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, if (value.GetUnit() == eHTMLUnit_String) { nsAutoString familyList; value.GetStringValue(familyList); - if (!familyList.IsEmpty()) + if (!familyList.IsEmpty()) { font.mFamily.SetStringValue(familyList, eCSSUnit_String); + font.mFamilyFromHTML = PR_TRUE; + } } } diff --git a/content/html/content/src/nsHTMLPreElement.cpp b/content/html/content/src/nsHTMLPreElement.cpp index c2c148f03e7..d41a88f0e44 100644 --- a/content/html/content/src/nsHTMLPreElement.cpp +++ b/content/html/content/src/nsHTMLPreElement.cpp @@ -203,7 +203,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, return; if (aData->mFontData) { - nsCSSFont& font = *(aData->mFontData); + nsRuleDataFont& font = *(aData->mFontData); if (nsnull != aAttributes) { nsHTMLValue value; diff --git a/content/html/style/src/nsCSSDeclaration.cpp b/content/html/style/src/nsCSSDeclaration.cpp index 71338985ee2..aabcf6cd106 100644 --- a/content/html/style/src/nsCSSDeclaration.cpp +++ b/content/html/style/src/nsCSSDeclaration.cpp @@ -390,7 +390,6 @@ nsCSSDisplay::nsCSSDisplay(const nsCSSDisplay& aCopy) mOverflow(aCopy.mOverflow), mVisibility(aCopy.mVisibility), mOpacity(aCopy.mOpacity), - mLang(aCopy.mLang), // temp fix for bug 24000 mBreakBefore(aCopy.mBreakBefore), mBreakAfter(aCopy.mBreakAfter) diff --git a/content/html/style/src/nsCSSDeclaration.h b/content/html/style/src/nsCSSDeclaration.h index 94f109babf4..915aa6c7fd1 100644 --- a/content/html/style/src/nsCSSDeclaration.h +++ b/content/html/style/src/nsCSSDeclaration.h @@ -56,6 +56,13 @@ struct nsCSSStruct { // EMPTY on purpose. ABSTRACT with no virtuals (typedef void nsCSSStruct?) }; +// Eventually we should stop using the nsCSS* structures for storing +// nsCSSDeclaration's data, because they're extremely bloated. However, +// we'll still want to use them for nsRuleData. So, for now, use +// typedefs and inheritance (forwards, when the rule data needs extra +// data) to make the rule data structs from the declaration structs. +typedef nsCSSStruct nsRuleDataStruct; + // SID for the nsCSSFont struct {f645dbf8-b48a-11d1-9ca5-0060088f9ff7} #define NS_CSS_FONT_SID \ @@ -139,6 +146,10 @@ struct nsCSSFont : public nsCSSStruct { nsCSSValue mStretch; // NEW }; +struct nsRuleDataFont : public nsCSSFont { + PRBool mFamilyFromHTML; // Is the family from an HTML FONT element +}; + struct nsCSSValueList { nsCSSValueList(void); nsCSSValueList(const nsCSSValueList& aCopy); @@ -168,6 +179,9 @@ struct nsCSSColor : public nsCSSStruct { nsCSSValue mBackOrigin; }; +struct nsRuleDataColor : public nsCSSColor { +}; + struct nsCSSShadow { nsCSSShadow(void); nsCSSShadow(const nsCSSShadow& aCopy); @@ -203,6 +217,9 @@ struct nsCSSText : public nsCSSStruct { nsCSSValue mWhiteSpace; }; +struct nsRuleDataText : public nsCSSText { +}; + struct nsCSSRect { nsCSSRect(void); nsCSSRect(const nsCSSRect& aCopy); @@ -239,10 +256,6 @@ struct nsCSSDisplay : public nsCSSStruct { nsCSSValue mOverflow; nsCSSValue mVisibility; nsCSSValue mOpacity; - // mLang member variable is here not because in needs to be stored - // in nsCSSDeclaration objects but because it's needed on the - // stack when the struct is used in WalkRuleTree. - nsCSSValue mLang; // temp fix for bug 24000 nsCSSValue mBreakBefore; @@ -250,6 +263,10 @@ struct nsCSSDisplay : public nsCSSStruct { // end temp fix }; +struct nsRuleDataDisplay : public nsCSSDisplay { + nsCSSValue mLang; +}; + struct nsCSSMargin : public nsCSSStruct { nsCSSMargin(void); nsCSSMargin(const nsCSSMargin& aCopy); @@ -276,6 +293,9 @@ struct nsCSSMargin : public nsCSSStruct { nsCSSValue mFloatEdge; // NEW }; +struct nsRuleDataMargin : public nsCSSMargin { +}; + struct nsCSSPosition : public nsCSSStruct { nsCSSPosition(void); nsCSSPosition(const nsCSSPosition& aCopy); @@ -297,6 +317,9 @@ struct nsCSSPosition : public nsCSSStruct { nsCSSValue mZIndex; }; +struct nsRuleDataPosition : public nsCSSPosition { +}; + struct nsCSSList : public nsCSSStruct { nsCSSList(void); nsCSSList(const nsCSSList& aCopy); @@ -313,6 +336,9 @@ struct nsCSSList : public nsCSSStruct { nsCSSRect* mImageRegion; }; +struct nsRuleDataList : public nsCSSList { +}; + struct nsCSSTable : public nsCSSStruct { // NEW nsCSSTable(void); nsCSSTable(const nsCSSTable& aCopy); @@ -336,6 +362,9 @@ struct nsCSSTable : public nsCSSStruct { // NEW nsCSSValue mCols; // Not mappable via CSS, only using HTML4 table attrs. }; +struct nsRuleDataTable : public nsCSSTable { +}; + struct nsCSSBreaks : public nsCSSStruct { // NEW nsCSSBreaks(void); nsCSSBreaks(const nsCSSBreaks& aCopy); @@ -354,6 +383,9 @@ struct nsCSSBreaks : public nsCSSStruct { // NEW nsCSSValue mPageBreakInside; }; +struct nsRuleDataBreaks : public nsCSSBreaks { +}; + struct nsCSSPage : public nsCSSStruct { // NEW nsCSSPage(void); nsCSSPage(const nsCSSPage& aCopy); @@ -369,6 +401,9 @@ struct nsCSSPage : public nsCSSStruct { // NEW nsCSSValue mSizeHeight; }; +struct nsRuleDataPage : public nsCSSPage { +}; + struct nsCSSCounterData { nsCSSCounterData(void); nsCSSCounterData(const nsCSSCounterData& aCopy); @@ -406,6 +441,9 @@ struct nsCSSContent : public nsCSSStruct { nsCSSQuotes* mQuotes; }; +struct nsRuleDataContent : public nsCSSContent { +}; + struct nsCSSUserInterface : public nsCSSStruct { // NEW nsCSSUserInterface(void); nsCSSUserInterface(const nsCSSUserInterface& aCopy); @@ -427,6 +465,9 @@ struct nsCSSUserInterface : public nsCSSStruct { // NEW nsCSSValue mForceBrokenImageIcon; }; +struct nsRuleDataUserInterface : public nsCSSUserInterface { +}; + struct nsCSSAural : public nsCSSStruct { // NEW nsCSSAural(void); nsCSSAural(const nsCSSAural& aCopy); @@ -458,6 +499,9 @@ struct nsCSSAural : public nsCSSStruct { // NEW nsCSSValue mVolume; }; +struct nsRuleDataAural : public nsCSSAural { +}; + #ifdef INCLUDE_XUL struct nsCSSXUL : public nsCSSStruct { nsCSSXUL(void); @@ -476,6 +520,9 @@ struct nsCSSXUL : public nsCSSStruct { nsCSSValue mBoxPack; nsCSSValue mBoxOrdinal; }; + +struct nsRuleDataXUL : public nsCSSXUL { +}; #endif #ifdef MOZ_SVG @@ -501,6 +548,9 @@ struct nsCSSSVG : public nsCSSStruct { nsCSSValue mStrokeOpacity; nsCSSValue mStrokeWidth; }; + +struct nsRuleDataSVG : public nsCSSSVG { +}; #endif // diff --git a/content/html/style/src/nsCSSStruct.cpp b/content/html/style/src/nsCSSStruct.cpp index 71338985ee2..aabcf6cd106 100644 --- a/content/html/style/src/nsCSSStruct.cpp +++ b/content/html/style/src/nsCSSStruct.cpp @@ -390,7 +390,6 @@ nsCSSDisplay::nsCSSDisplay(const nsCSSDisplay& aCopy) mOverflow(aCopy.mOverflow), mVisibility(aCopy.mVisibility), mOpacity(aCopy.mOpacity), - mLang(aCopy.mLang), // temp fix for bug 24000 mBreakBefore(aCopy.mBreakBefore), mBreakAfter(aCopy.mBreakAfter) diff --git a/content/html/style/src/nsCSSStruct.h b/content/html/style/src/nsCSSStruct.h index 94f109babf4..915aa6c7fd1 100644 --- a/content/html/style/src/nsCSSStruct.h +++ b/content/html/style/src/nsCSSStruct.h @@ -56,6 +56,13 @@ struct nsCSSStruct { // EMPTY on purpose. ABSTRACT with no virtuals (typedef void nsCSSStruct?) }; +// Eventually we should stop using the nsCSS* structures for storing +// nsCSSDeclaration's data, because they're extremely bloated. However, +// we'll still want to use them for nsRuleData. So, for now, use +// typedefs and inheritance (forwards, when the rule data needs extra +// data) to make the rule data structs from the declaration structs. +typedef nsCSSStruct nsRuleDataStruct; + // SID for the nsCSSFont struct {f645dbf8-b48a-11d1-9ca5-0060088f9ff7} #define NS_CSS_FONT_SID \ @@ -139,6 +146,10 @@ struct nsCSSFont : public nsCSSStruct { nsCSSValue mStretch; // NEW }; +struct nsRuleDataFont : public nsCSSFont { + PRBool mFamilyFromHTML; // Is the family from an HTML FONT element +}; + struct nsCSSValueList { nsCSSValueList(void); nsCSSValueList(const nsCSSValueList& aCopy); @@ -168,6 +179,9 @@ struct nsCSSColor : public nsCSSStruct { nsCSSValue mBackOrigin; }; +struct nsRuleDataColor : public nsCSSColor { +}; + struct nsCSSShadow { nsCSSShadow(void); nsCSSShadow(const nsCSSShadow& aCopy); @@ -203,6 +217,9 @@ struct nsCSSText : public nsCSSStruct { nsCSSValue mWhiteSpace; }; +struct nsRuleDataText : public nsCSSText { +}; + struct nsCSSRect { nsCSSRect(void); nsCSSRect(const nsCSSRect& aCopy); @@ -239,10 +256,6 @@ struct nsCSSDisplay : public nsCSSStruct { nsCSSValue mOverflow; nsCSSValue mVisibility; nsCSSValue mOpacity; - // mLang member variable is here not because in needs to be stored - // in nsCSSDeclaration objects but because it's needed on the - // stack when the struct is used in WalkRuleTree. - nsCSSValue mLang; // temp fix for bug 24000 nsCSSValue mBreakBefore; @@ -250,6 +263,10 @@ struct nsCSSDisplay : public nsCSSStruct { // end temp fix }; +struct nsRuleDataDisplay : public nsCSSDisplay { + nsCSSValue mLang; +}; + struct nsCSSMargin : public nsCSSStruct { nsCSSMargin(void); nsCSSMargin(const nsCSSMargin& aCopy); @@ -276,6 +293,9 @@ struct nsCSSMargin : public nsCSSStruct { nsCSSValue mFloatEdge; // NEW }; +struct nsRuleDataMargin : public nsCSSMargin { +}; + struct nsCSSPosition : public nsCSSStruct { nsCSSPosition(void); nsCSSPosition(const nsCSSPosition& aCopy); @@ -297,6 +317,9 @@ struct nsCSSPosition : public nsCSSStruct { nsCSSValue mZIndex; }; +struct nsRuleDataPosition : public nsCSSPosition { +}; + struct nsCSSList : public nsCSSStruct { nsCSSList(void); nsCSSList(const nsCSSList& aCopy); @@ -313,6 +336,9 @@ struct nsCSSList : public nsCSSStruct { nsCSSRect* mImageRegion; }; +struct nsRuleDataList : public nsCSSList { +}; + struct nsCSSTable : public nsCSSStruct { // NEW nsCSSTable(void); nsCSSTable(const nsCSSTable& aCopy); @@ -336,6 +362,9 @@ struct nsCSSTable : public nsCSSStruct { // NEW nsCSSValue mCols; // Not mappable via CSS, only using HTML4 table attrs. }; +struct nsRuleDataTable : public nsCSSTable { +}; + struct nsCSSBreaks : public nsCSSStruct { // NEW nsCSSBreaks(void); nsCSSBreaks(const nsCSSBreaks& aCopy); @@ -354,6 +383,9 @@ struct nsCSSBreaks : public nsCSSStruct { // NEW nsCSSValue mPageBreakInside; }; +struct nsRuleDataBreaks : public nsCSSBreaks { +}; + struct nsCSSPage : public nsCSSStruct { // NEW nsCSSPage(void); nsCSSPage(const nsCSSPage& aCopy); @@ -369,6 +401,9 @@ struct nsCSSPage : public nsCSSStruct { // NEW nsCSSValue mSizeHeight; }; +struct nsRuleDataPage : public nsCSSPage { +}; + struct nsCSSCounterData { nsCSSCounterData(void); nsCSSCounterData(const nsCSSCounterData& aCopy); @@ -406,6 +441,9 @@ struct nsCSSContent : public nsCSSStruct { nsCSSQuotes* mQuotes; }; +struct nsRuleDataContent : public nsCSSContent { +}; + struct nsCSSUserInterface : public nsCSSStruct { // NEW nsCSSUserInterface(void); nsCSSUserInterface(const nsCSSUserInterface& aCopy); @@ -427,6 +465,9 @@ struct nsCSSUserInterface : public nsCSSStruct { // NEW nsCSSValue mForceBrokenImageIcon; }; +struct nsRuleDataUserInterface : public nsCSSUserInterface { +}; + struct nsCSSAural : public nsCSSStruct { // NEW nsCSSAural(void); nsCSSAural(const nsCSSAural& aCopy); @@ -458,6 +499,9 @@ struct nsCSSAural : public nsCSSStruct { // NEW nsCSSValue mVolume; }; +struct nsRuleDataAural : public nsCSSAural { +}; + #ifdef INCLUDE_XUL struct nsCSSXUL : public nsCSSStruct { nsCSSXUL(void); @@ -476,6 +520,9 @@ struct nsCSSXUL : public nsCSSStruct { nsCSSValue mBoxPack; nsCSSValue mBoxOrdinal; }; + +struct nsRuleDataXUL : public nsCSSXUL { +}; #endif #ifdef MOZ_SVG @@ -501,6 +548,9 @@ struct nsCSSSVG : public nsCSSStruct { nsCSSValue mStrokeOpacity; nsCSSValue mStrokeWidth; }; + +struct nsRuleDataSVG : public nsCSSSVG { +}; #endif // diff --git a/content/html/style/src/nsCSSStyleRule.cpp b/content/html/style/src/nsCSSStyleRule.cpp index f2b8171c5ef..5f327617254 100644 --- a/content/html/style/src/nsCSSStyleRule.cpp +++ b/content/html/style/src/nsCSSStyleRule.cpp @@ -918,23 +918,23 @@ nsresult nsCSSSelector::ToString( nsAString& aString, nsICSSStyleSheet* aSheet, // -- CSSImportantRule ------------------------------- // New map helpers shared by both important and regular rules. -static nsresult MapFontForDeclaration(nsCSSDeclaration* aDecl, nsCSSFont& aFont); -static nsresult MapDisplayForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSDisplay& aDisplay); -static nsresult MapColorForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSColor& aColor); -static nsresult MapMarginForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSMargin& aMargin); -static nsresult MapListForDeclaration(nsCSSDeclaration* aDecl, nsCSSList& aList); -static nsresult MapPositionForDeclaration(nsCSSDeclaration* aDecl, nsCSSPosition& aPosition); -static nsresult MapTableForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSTable& aTable); -static nsresult MapContentForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSContent& aContent); -static nsresult MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSText& aContent); -static nsresult MapUIForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSUserInterface& aContent); +static nsresult MapFontForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataFont& aFont); +static nsresult MapDisplayForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataDisplay& aDisplay); +static nsresult MapColorForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataColor& aColor); +static nsresult MapMarginForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataMargin& aMargin); +static nsresult MapListForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataList& aList); +static nsresult MapPositionForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataPosition& aPosition); +static nsresult MapTableForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataTable& aTable); +static nsresult MapContentForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataContent& aContent); +static nsresult MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataText& aContent); +static nsresult MapUIForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataUserInterface& aContent); #ifdef INCLUDE_XUL -static nsresult MapXULForDeclaration(nsCSSDeclaration* aDecl, nsCSSXUL& aXUL); +static nsresult MapXULForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataXUL& aXUL); #endif #ifdef MOZ_SVG -static nsresult MapSVGForDeclaration(nsCSSDeclaration* aDecl, nsCSSSVG& aSVG); +static nsresult MapSVGForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataSVG& aSVG); #endif class CSSStyleRuleImpl; @@ -1743,7 +1743,7 @@ CSSStyleRuleImpl::MapRuleInfoInto(nsRuleData* aRuleData) } static nsresult -MapFontForDeclaration(nsCSSDeclaration* aDecl, nsCSSFont& aFont) +MapFontForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataFont& aFont) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -1752,8 +1752,10 @@ MapFontForDeclaration(nsCSSDeclaration* aDecl, nsCSSFont& aFont) if (!ourFont) return NS_OK; // We don't have any rules for fonts. - if (eCSSUnit_Null == aFont.mFamily.GetUnit() && eCSSUnit_Null != ourFont->mFamily.GetUnit()) + if (eCSSUnit_Null == aFont.mFamily.GetUnit() && eCSSUnit_Null != ourFont->mFamily.GetUnit()) { aFont.mFamily = ourFont->mFamily; + aFont.mFamilyFromHTML = PR_FALSE; + } if (eCSSUnit_Null == aFont.mStyle.GetUnit() && eCSSUnit_Null != ourFont->mStyle.GetUnit()) aFont.mStyle = ourFont->mStyle; @@ -1775,7 +1777,7 @@ MapFontForDeclaration(nsCSSDeclaration* aDecl, nsCSSFont& aFont) #ifdef INCLUDE_XUL static nsresult -MapXULForDeclaration(nsCSSDeclaration* aDecl, nsCSSXUL& aXUL) +MapXULForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataXUL& aXUL) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -1814,7 +1816,7 @@ MapXULForDeclaration(nsCSSDeclaration* aDecl, nsCSSXUL& aXUL) #ifdef MOZ_SVG static nsresult -MapSVGForDeclaration(nsCSSDeclaration* aDecl, nsCSSSVG& aSVG) +MapSVGForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataSVG& aSVG) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -1863,7 +1865,7 @@ MapSVGForDeclaration(nsCSSDeclaration* aDecl, nsCSSSVG& aSVG) static nsresult -MapPositionForDeclaration(nsCSSDeclaration* aDecl, nsCSSPosition& aPosition) +MapPositionForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataPosition& aPosition) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -1915,7 +1917,7 @@ MapPositionForDeclaration(nsCSSDeclaration* aDecl, nsCSSPosition& aPosition) } static nsresult -MapListForDeclaration(nsCSSDeclaration* aDecl, nsCSSList& aList) +MapListForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataList& aList) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -1959,7 +1961,7 @@ MapListForDeclaration(nsCSSDeclaration* aDecl, nsCSSList& aList) } static nsresult -MapMarginForDeclaration(nsCSSDeclaration* aDeclaration, const nsStyleStructID& aSID, nsCSSMargin& aMargin) +MapMarginForDeclaration(nsCSSDeclaration* aDeclaration, const nsStyleStructID& aSID, nsRuleDataMargin& aMargin) { nsCSSMargin* ourMargin = (nsCSSMargin*)aDeclaration->GetData(kCSSMarginSID); if (!ourMargin) @@ -2103,7 +2105,7 @@ MapMarginForDeclaration(nsCSSDeclaration* aDeclaration, const nsStyleStructID& a } static nsresult -MapColorForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSColor& aColor) +MapColorForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataColor& aColor) { if (!aDecl) return NS_OK; @@ -2153,7 +2155,7 @@ MapColorForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCS } static nsresult -MapTableForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSTable& aTable) +MapTableForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataTable& aTable) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -2193,7 +2195,7 @@ MapTableForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCS } static nsresult -MapContentForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSContent& aContent) +MapContentForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataContent& aContent) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -2224,7 +2226,7 @@ MapContentForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, ns } static nsresult -MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSText& aText) +MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataText& aText) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -2273,7 +2275,7 @@ MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSS } static nsresult -MapDisplayForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSDisplay& aDisplay) +MapDisplayForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataDisplay& aDisplay) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -2349,7 +2351,7 @@ MapDisplayForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, ns } static nsresult -MapUIForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSUserInterface& aUI) +MapUIForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataUserInterface& aUI) { if (!aDecl) return NS_OK; // The rule must have a declaration. diff --git a/content/shared/public/nsRuleNode.h b/content/shared/public/nsRuleNode.h index e982be56e7f..746e6dd01df 100644 --- a/content/shared/public/nsRuleNode.h +++ b/content/shared/public/nsRuleNode.h @@ -247,23 +247,23 @@ struct nsRuleData nsIPresContext* mPresContext; nsIStyleContext* mStyleContext; nsPostResolveFunc mPostResolveCallback; - nsCSSFont* mFontData; // Should always be stack-allocated! We don't own these structures! - nsCSSDisplay* mDisplayData; - nsCSSMargin* mMarginData; - nsCSSList* mListData; - nsCSSPosition* mPositionData; - nsCSSTable* mTableData; - nsCSSColor* mColorData; - nsCSSContent* mContentData; - nsCSSText* mTextData; - nsCSSUserInterface* mUIData; + nsRuleDataFont* mFontData; // Should always be stack-allocated! We don't own these structures! + nsRuleDataDisplay* mDisplayData; + nsRuleDataMargin* mMarginData; + nsRuleDataList* mListData; + nsRuleDataPosition* mPositionData; + nsRuleDataTable* mTableData; + nsRuleDataColor* mColorData; + nsRuleDataContent* mContentData; + nsRuleDataText* mTextData; + nsRuleDataUserInterface* mUIData; #ifdef INCLUDE_XUL - nsCSSXUL* mXULData; + nsRuleDataXUL* mXULData; #endif #ifdef MOZ_SVG - nsCSSSVG* mSVGData; + nsRuleDataSVG* mSVGData; #endif nsRuleData(const nsStyleStructID& aSID, nsIPresContext* aContext, nsIStyleContext* aStyleContext) @@ -413,84 +413,84 @@ protected: const nsStyleStruct* WalkRuleTree(const nsStyleStructID aSID, nsIStyleContext* aContext, nsRuleData* aRuleData, - nsCSSStruct* aSpecificData, + nsRuleDataStruct* aSpecificData, PRBool aComputeData); - const nsStyleStruct* ComputeDisplayData(nsStyleStruct* aStartDisplay, const nsCSSStruct& aDisplayData, + const nsStyleStruct* ComputeDisplayData(nsStyleStruct* aStartDisplay, const nsRuleDataStruct& aDisplayData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeVisibilityData(nsStyleStruct* aStartVisibility, const nsCSSStruct& aDisplayData, + const nsStyleStruct* ComputeVisibilityData(nsStyleStruct* aStartVisibility, const nsRuleDataStruct& aDisplayData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeFontData(nsStyleStruct* aStartFont, const nsCSSStruct& aFontData, + const nsStyleStruct* ComputeFontData(nsStyleStruct* aStartFont, const nsRuleDataStruct& aFontData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeColorData(nsStyleStruct* aStartColor, const nsCSSStruct& aColorData, + const nsStyleStruct* ComputeColorData(nsStyleStruct* aStartColor, const nsRuleDataStruct& aColorData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeBackgroundData(nsStyleStruct* aStartBackground, const nsCSSStruct& aColorData, + const nsStyleStruct* ComputeBackgroundData(nsStyleStruct* aStartBackground, const nsRuleDataStruct& aColorData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeMarginData(nsStyleStruct* aStartMargin, const nsCSSStruct& aMarginData, + const nsStyleStruct* ComputeMarginData(nsStyleStruct* aStartMargin, const nsRuleDataStruct& aMarginData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeBorderData(nsStyleStruct* aStartBorder, const nsCSSStruct& aMarginData, + const nsStyleStruct* ComputeBorderData(nsStyleStruct* aStartBorder, const nsRuleDataStruct& aMarginData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputePaddingData(nsStyleStruct* aStartPadding, const nsCSSStruct& aMarginData, + const nsStyleStruct* ComputePaddingData(nsStyleStruct* aStartPadding, const nsRuleDataStruct& aMarginData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeOutlineData(nsStyleStruct* aStartOutline, const nsCSSStruct& aMarginData, + const nsStyleStruct* ComputeOutlineData(nsStyleStruct* aStartOutline, const nsRuleDataStruct& aMarginData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeListData(nsStyleStruct* aStartList, const nsCSSStruct& aListData, + const nsStyleStruct* ComputeListData(nsStyleStruct* aStartList, const nsRuleDataStruct& aListData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputePositionData(nsStyleStruct* aStartPosition, const nsCSSStruct& aPositionData, + const nsStyleStruct* ComputePositionData(nsStyleStruct* aStartPosition, const nsRuleDataStruct& aPositionData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeTableData(nsStyleStruct* aStartTable, const nsCSSStruct& aTableData, + const nsStyleStruct* ComputeTableData(nsStyleStruct* aStartTable, const nsRuleDataStruct& aTableData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeTableBorderData(nsStyleStruct* aStartTable, const nsCSSStruct& aTableData, + const nsStyleStruct* ComputeTableBorderData(nsStyleStruct* aStartTable, const nsRuleDataStruct& aTableData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeContentData(nsStyleStruct* aStartContent, const nsCSSStruct& aData, + const nsStyleStruct* ComputeContentData(nsStyleStruct* aStartContent, const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeQuotesData(nsStyleStruct* aStartQuotes, const nsCSSStruct& aData, + const nsStyleStruct* ComputeQuotesData(nsStyleStruct* aStartQuotes, const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeTextData(nsStyleStruct* aStartData, const nsCSSStruct& aData, + const nsStyleStruct* ComputeTextData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeTextResetData(nsStyleStruct* aStartData, const nsCSSStruct& aData, + const nsStyleStruct* ComputeTextResetData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); const nsStyleStruct* ComputeUserInterfaceData(nsStyleStruct* aStartData, - const nsCSSStruct& aData, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeUIResetData(nsStyleStruct* aStartData, const nsCSSStruct& aData, + const nsStyleStruct* ComputeUIResetData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); #ifdef INCLUDE_XUL - const nsStyleStruct* ComputeXULData(nsStyleStruct* aStartXUL, const nsCSSStruct& aXULData, + const nsStyleStruct* ComputeXULData(nsStyleStruct* aStartXUL, const nsRuleDataStruct& aXULData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); #endif #ifdef MOZ_SVG - const nsStyleStruct* ComputeSVGData(nsStyleStruct* aStartSVG, const nsCSSStruct& aSVGData, + const nsStyleStruct* ComputeSVGData(nsStyleStruct* aStartSVG, const nsRuleDataStruct& aSVGData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); @@ -498,7 +498,7 @@ protected: typedef const nsStyleStruct* (nsRuleNode::*ComputeStyleDataFn)(nsStyleStruct* aStartStruct, - const nsCSSStruct& aStartData, + const nsRuleDataStruct& aStartData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, @@ -506,7 +506,7 @@ protected: static ComputeStyleDataFn gComputeStyleDataFn[]; - inline RuleDetail CheckSpecifiedProperties(const nsStyleStructID aSID, const nsCSSStruct& aCSSStruct); + inline RuleDetail CheckSpecifiedProperties(const nsStyleStructID aSID, const nsRuleDataStruct& aRuleDataStruct); const nsStyleStruct* GetParentData(const nsStyleStructID aSID); const nsStyleStruct* GetDisplayData(nsIStyleContext* aContext, PRBool aComputeData); diff --git a/content/shared/src/nsStyleStruct.cpp b/content/shared/src/nsStyleStruct.cpp index dee1196d0ef..6bbf26a5e9d 100644 --- a/content/shared/src/nsStyleStruct.cpp +++ b/content/shared/src/nsStyleStruct.cpp @@ -263,6 +263,7 @@ nsChangeHint nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont& (aFont1.sizeAdjust == aFont2.sizeAdjust) && (aFont1.style == aFont2.style) && (aFont1.variant == aFont2.variant) && + (aFont1.familyNameQuirks == aFont2.familyNameQuirks) && (aFont1.weight == aFont2.weight) && (aFont1.name == aFont2.name)) { if ((aFont1.decorations == aFont2.decorations)) { diff --git a/gfx/public/nsFont.h b/gfx/public/nsFont.h index 9fae96d526a..d06e280a780 100644 --- a/gfx/public/nsFont.h +++ b/gfx/public/nsFont.h @@ -73,7 +73,11 @@ struct NS_GFX nsFont { PRUint8 style; // The variant of the font (normal, small-caps) - PRUint8 variant; + PRUint8 variant : 7; + + // True if the character set quirks (for treatment of "Symbol", + // "Wingdings", etc.) should be applied. + PRPackedBool familyNameQuirks : 1; // The weight of the font (0-999) PRUint16 weight; diff --git a/gfx/src/nsFont.cpp b/gfx/src/nsFont.cpp index f1eba39754b..5923ad16799 100644 --- a/gfx/src/nsFont.cpp +++ b/gfx/src/nsFont.cpp @@ -48,6 +48,7 @@ nsFont::nsFont(const char* aName, PRUint8 aStyle, PRUint8 aVariant, name.AssignWithConversion(aName); style = aStyle; variant = aVariant; + familyNameQuirks = PR_FALSE; weight = aWeight; decorations = aDecoration; size = aSize; @@ -61,6 +62,7 @@ nsFont::nsFont(const nsString& aName, PRUint8 aStyle, PRUint8 aVariant, { style = aStyle; variant = aVariant; + familyNameQuirks = PR_FALSE; weight = aWeight; decorations = aDecoration; size = aSize; @@ -72,6 +74,7 @@ nsFont::nsFont(const nsFont& aOther) { style = aOther.style; variant = aOther.variant; + familyNameQuirks = aOther.familyNameQuirks; weight = aOther.weight; decorations = aOther.decorations; size = aOther.size; @@ -90,6 +93,7 @@ PRBool nsFont::Equals(const nsFont& aOther) const { if ((style == aOther.style) && (variant == aOther.variant) && + (familyNameQuirks == aOther.familyNameQuirks) && (weight == aOther.weight) && (decorations == aOther.decorations) && (size == aOther.size) && @@ -105,6 +109,7 @@ nsFont& nsFont::operator=(const nsFont& aOther) name = aOther.name; style = aOther.style; variant = aOther.variant; + familyNameQuirks = aOther.familyNameQuirks; weight = aOther.weight; decorations = aOther.decorations; size = aOther.size; diff --git a/layout/style/nsCSSDeclaration.cpp b/layout/style/nsCSSDeclaration.cpp index 71338985ee2..aabcf6cd106 100644 --- a/layout/style/nsCSSDeclaration.cpp +++ b/layout/style/nsCSSDeclaration.cpp @@ -390,7 +390,6 @@ nsCSSDisplay::nsCSSDisplay(const nsCSSDisplay& aCopy) mOverflow(aCopy.mOverflow), mVisibility(aCopy.mVisibility), mOpacity(aCopy.mOpacity), - mLang(aCopy.mLang), // temp fix for bug 24000 mBreakBefore(aCopy.mBreakBefore), mBreakAfter(aCopy.mBreakAfter) diff --git a/layout/style/nsCSSDeclaration.h b/layout/style/nsCSSDeclaration.h index 94f109babf4..915aa6c7fd1 100644 --- a/layout/style/nsCSSDeclaration.h +++ b/layout/style/nsCSSDeclaration.h @@ -56,6 +56,13 @@ struct nsCSSStruct { // EMPTY on purpose. ABSTRACT with no virtuals (typedef void nsCSSStruct?) }; +// Eventually we should stop using the nsCSS* structures for storing +// nsCSSDeclaration's data, because they're extremely bloated. However, +// we'll still want to use them for nsRuleData. So, for now, use +// typedefs and inheritance (forwards, when the rule data needs extra +// data) to make the rule data structs from the declaration structs. +typedef nsCSSStruct nsRuleDataStruct; + // SID for the nsCSSFont struct {f645dbf8-b48a-11d1-9ca5-0060088f9ff7} #define NS_CSS_FONT_SID \ @@ -139,6 +146,10 @@ struct nsCSSFont : public nsCSSStruct { nsCSSValue mStretch; // NEW }; +struct nsRuleDataFont : public nsCSSFont { + PRBool mFamilyFromHTML; // Is the family from an HTML FONT element +}; + struct nsCSSValueList { nsCSSValueList(void); nsCSSValueList(const nsCSSValueList& aCopy); @@ -168,6 +179,9 @@ struct nsCSSColor : public nsCSSStruct { nsCSSValue mBackOrigin; }; +struct nsRuleDataColor : public nsCSSColor { +}; + struct nsCSSShadow { nsCSSShadow(void); nsCSSShadow(const nsCSSShadow& aCopy); @@ -203,6 +217,9 @@ struct nsCSSText : public nsCSSStruct { nsCSSValue mWhiteSpace; }; +struct nsRuleDataText : public nsCSSText { +}; + struct nsCSSRect { nsCSSRect(void); nsCSSRect(const nsCSSRect& aCopy); @@ -239,10 +256,6 @@ struct nsCSSDisplay : public nsCSSStruct { nsCSSValue mOverflow; nsCSSValue mVisibility; nsCSSValue mOpacity; - // mLang member variable is here not because in needs to be stored - // in nsCSSDeclaration objects but because it's needed on the - // stack when the struct is used in WalkRuleTree. - nsCSSValue mLang; // temp fix for bug 24000 nsCSSValue mBreakBefore; @@ -250,6 +263,10 @@ struct nsCSSDisplay : public nsCSSStruct { // end temp fix }; +struct nsRuleDataDisplay : public nsCSSDisplay { + nsCSSValue mLang; +}; + struct nsCSSMargin : public nsCSSStruct { nsCSSMargin(void); nsCSSMargin(const nsCSSMargin& aCopy); @@ -276,6 +293,9 @@ struct nsCSSMargin : public nsCSSStruct { nsCSSValue mFloatEdge; // NEW }; +struct nsRuleDataMargin : public nsCSSMargin { +}; + struct nsCSSPosition : public nsCSSStruct { nsCSSPosition(void); nsCSSPosition(const nsCSSPosition& aCopy); @@ -297,6 +317,9 @@ struct nsCSSPosition : public nsCSSStruct { nsCSSValue mZIndex; }; +struct nsRuleDataPosition : public nsCSSPosition { +}; + struct nsCSSList : public nsCSSStruct { nsCSSList(void); nsCSSList(const nsCSSList& aCopy); @@ -313,6 +336,9 @@ struct nsCSSList : public nsCSSStruct { nsCSSRect* mImageRegion; }; +struct nsRuleDataList : public nsCSSList { +}; + struct nsCSSTable : public nsCSSStruct { // NEW nsCSSTable(void); nsCSSTable(const nsCSSTable& aCopy); @@ -336,6 +362,9 @@ struct nsCSSTable : public nsCSSStruct { // NEW nsCSSValue mCols; // Not mappable via CSS, only using HTML4 table attrs. }; +struct nsRuleDataTable : public nsCSSTable { +}; + struct nsCSSBreaks : public nsCSSStruct { // NEW nsCSSBreaks(void); nsCSSBreaks(const nsCSSBreaks& aCopy); @@ -354,6 +383,9 @@ struct nsCSSBreaks : public nsCSSStruct { // NEW nsCSSValue mPageBreakInside; }; +struct nsRuleDataBreaks : public nsCSSBreaks { +}; + struct nsCSSPage : public nsCSSStruct { // NEW nsCSSPage(void); nsCSSPage(const nsCSSPage& aCopy); @@ -369,6 +401,9 @@ struct nsCSSPage : public nsCSSStruct { // NEW nsCSSValue mSizeHeight; }; +struct nsRuleDataPage : public nsCSSPage { +}; + struct nsCSSCounterData { nsCSSCounterData(void); nsCSSCounterData(const nsCSSCounterData& aCopy); @@ -406,6 +441,9 @@ struct nsCSSContent : public nsCSSStruct { nsCSSQuotes* mQuotes; }; +struct nsRuleDataContent : public nsCSSContent { +}; + struct nsCSSUserInterface : public nsCSSStruct { // NEW nsCSSUserInterface(void); nsCSSUserInterface(const nsCSSUserInterface& aCopy); @@ -427,6 +465,9 @@ struct nsCSSUserInterface : public nsCSSStruct { // NEW nsCSSValue mForceBrokenImageIcon; }; +struct nsRuleDataUserInterface : public nsCSSUserInterface { +}; + struct nsCSSAural : public nsCSSStruct { // NEW nsCSSAural(void); nsCSSAural(const nsCSSAural& aCopy); @@ -458,6 +499,9 @@ struct nsCSSAural : public nsCSSStruct { // NEW nsCSSValue mVolume; }; +struct nsRuleDataAural : public nsCSSAural { +}; + #ifdef INCLUDE_XUL struct nsCSSXUL : public nsCSSStruct { nsCSSXUL(void); @@ -476,6 +520,9 @@ struct nsCSSXUL : public nsCSSStruct { nsCSSValue mBoxPack; nsCSSValue mBoxOrdinal; }; + +struct nsRuleDataXUL : public nsCSSXUL { +}; #endif #ifdef MOZ_SVG @@ -501,6 +548,9 @@ struct nsCSSSVG : public nsCSSStruct { nsCSSValue mStrokeOpacity; nsCSSValue mStrokeWidth; }; + +struct nsRuleDataSVG : public nsCSSSVG { +}; #endif // diff --git a/layout/style/nsCSSStruct.cpp b/layout/style/nsCSSStruct.cpp index 71338985ee2..aabcf6cd106 100644 --- a/layout/style/nsCSSStruct.cpp +++ b/layout/style/nsCSSStruct.cpp @@ -390,7 +390,6 @@ nsCSSDisplay::nsCSSDisplay(const nsCSSDisplay& aCopy) mOverflow(aCopy.mOverflow), mVisibility(aCopy.mVisibility), mOpacity(aCopy.mOpacity), - mLang(aCopy.mLang), // temp fix for bug 24000 mBreakBefore(aCopy.mBreakBefore), mBreakAfter(aCopy.mBreakAfter) diff --git a/layout/style/nsCSSStruct.h b/layout/style/nsCSSStruct.h index 94f109babf4..915aa6c7fd1 100644 --- a/layout/style/nsCSSStruct.h +++ b/layout/style/nsCSSStruct.h @@ -56,6 +56,13 @@ struct nsCSSStruct { // EMPTY on purpose. ABSTRACT with no virtuals (typedef void nsCSSStruct?) }; +// Eventually we should stop using the nsCSS* structures for storing +// nsCSSDeclaration's data, because they're extremely bloated. However, +// we'll still want to use them for nsRuleData. So, for now, use +// typedefs and inheritance (forwards, when the rule data needs extra +// data) to make the rule data structs from the declaration structs. +typedef nsCSSStruct nsRuleDataStruct; + // SID for the nsCSSFont struct {f645dbf8-b48a-11d1-9ca5-0060088f9ff7} #define NS_CSS_FONT_SID \ @@ -139,6 +146,10 @@ struct nsCSSFont : public nsCSSStruct { nsCSSValue mStretch; // NEW }; +struct nsRuleDataFont : public nsCSSFont { + PRBool mFamilyFromHTML; // Is the family from an HTML FONT element +}; + struct nsCSSValueList { nsCSSValueList(void); nsCSSValueList(const nsCSSValueList& aCopy); @@ -168,6 +179,9 @@ struct nsCSSColor : public nsCSSStruct { nsCSSValue mBackOrigin; }; +struct nsRuleDataColor : public nsCSSColor { +}; + struct nsCSSShadow { nsCSSShadow(void); nsCSSShadow(const nsCSSShadow& aCopy); @@ -203,6 +217,9 @@ struct nsCSSText : public nsCSSStruct { nsCSSValue mWhiteSpace; }; +struct nsRuleDataText : public nsCSSText { +}; + struct nsCSSRect { nsCSSRect(void); nsCSSRect(const nsCSSRect& aCopy); @@ -239,10 +256,6 @@ struct nsCSSDisplay : public nsCSSStruct { nsCSSValue mOverflow; nsCSSValue mVisibility; nsCSSValue mOpacity; - // mLang member variable is here not because in needs to be stored - // in nsCSSDeclaration objects but because it's needed on the - // stack when the struct is used in WalkRuleTree. - nsCSSValue mLang; // temp fix for bug 24000 nsCSSValue mBreakBefore; @@ -250,6 +263,10 @@ struct nsCSSDisplay : public nsCSSStruct { // end temp fix }; +struct nsRuleDataDisplay : public nsCSSDisplay { + nsCSSValue mLang; +}; + struct nsCSSMargin : public nsCSSStruct { nsCSSMargin(void); nsCSSMargin(const nsCSSMargin& aCopy); @@ -276,6 +293,9 @@ struct nsCSSMargin : public nsCSSStruct { nsCSSValue mFloatEdge; // NEW }; +struct nsRuleDataMargin : public nsCSSMargin { +}; + struct nsCSSPosition : public nsCSSStruct { nsCSSPosition(void); nsCSSPosition(const nsCSSPosition& aCopy); @@ -297,6 +317,9 @@ struct nsCSSPosition : public nsCSSStruct { nsCSSValue mZIndex; }; +struct nsRuleDataPosition : public nsCSSPosition { +}; + struct nsCSSList : public nsCSSStruct { nsCSSList(void); nsCSSList(const nsCSSList& aCopy); @@ -313,6 +336,9 @@ struct nsCSSList : public nsCSSStruct { nsCSSRect* mImageRegion; }; +struct nsRuleDataList : public nsCSSList { +}; + struct nsCSSTable : public nsCSSStruct { // NEW nsCSSTable(void); nsCSSTable(const nsCSSTable& aCopy); @@ -336,6 +362,9 @@ struct nsCSSTable : public nsCSSStruct { // NEW nsCSSValue mCols; // Not mappable via CSS, only using HTML4 table attrs. }; +struct nsRuleDataTable : public nsCSSTable { +}; + struct nsCSSBreaks : public nsCSSStruct { // NEW nsCSSBreaks(void); nsCSSBreaks(const nsCSSBreaks& aCopy); @@ -354,6 +383,9 @@ struct nsCSSBreaks : public nsCSSStruct { // NEW nsCSSValue mPageBreakInside; }; +struct nsRuleDataBreaks : public nsCSSBreaks { +}; + struct nsCSSPage : public nsCSSStruct { // NEW nsCSSPage(void); nsCSSPage(const nsCSSPage& aCopy); @@ -369,6 +401,9 @@ struct nsCSSPage : public nsCSSStruct { // NEW nsCSSValue mSizeHeight; }; +struct nsRuleDataPage : public nsCSSPage { +}; + struct nsCSSCounterData { nsCSSCounterData(void); nsCSSCounterData(const nsCSSCounterData& aCopy); @@ -406,6 +441,9 @@ struct nsCSSContent : public nsCSSStruct { nsCSSQuotes* mQuotes; }; +struct nsRuleDataContent : public nsCSSContent { +}; + struct nsCSSUserInterface : public nsCSSStruct { // NEW nsCSSUserInterface(void); nsCSSUserInterface(const nsCSSUserInterface& aCopy); @@ -427,6 +465,9 @@ struct nsCSSUserInterface : public nsCSSStruct { // NEW nsCSSValue mForceBrokenImageIcon; }; +struct nsRuleDataUserInterface : public nsCSSUserInterface { +}; + struct nsCSSAural : public nsCSSStruct { // NEW nsCSSAural(void); nsCSSAural(const nsCSSAural& aCopy); @@ -458,6 +499,9 @@ struct nsCSSAural : public nsCSSStruct { // NEW nsCSSValue mVolume; }; +struct nsRuleDataAural : public nsCSSAural { +}; + #ifdef INCLUDE_XUL struct nsCSSXUL : public nsCSSStruct { nsCSSXUL(void); @@ -476,6 +520,9 @@ struct nsCSSXUL : public nsCSSStruct { nsCSSValue mBoxPack; nsCSSValue mBoxOrdinal; }; + +struct nsRuleDataXUL : public nsCSSXUL { +}; #endif #ifdef MOZ_SVG @@ -501,6 +548,9 @@ struct nsCSSSVG : public nsCSSStruct { nsCSSValue mStrokeOpacity; nsCSSValue mStrokeWidth; }; + +struct nsRuleDataSVG : public nsCSSSVG { +}; #endif // diff --git a/layout/style/nsCSSStyleRule.cpp b/layout/style/nsCSSStyleRule.cpp index f2b8171c5ef..5f327617254 100644 --- a/layout/style/nsCSSStyleRule.cpp +++ b/layout/style/nsCSSStyleRule.cpp @@ -918,23 +918,23 @@ nsresult nsCSSSelector::ToString( nsAString& aString, nsICSSStyleSheet* aSheet, // -- CSSImportantRule ------------------------------- // New map helpers shared by both important and regular rules. -static nsresult MapFontForDeclaration(nsCSSDeclaration* aDecl, nsCSSFont& aFont); -static nsresult MapDisplayForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSDisplay& aDisplay); -static nsresult MapColorForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSColor& aColor); -static nsresult MapMarginForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSMargin& aMargin); -static nsresult MapListForDeclaration(nsCSSDeclaration* aDecl, nsCSSList& aList); -static nsresult MapPositionForDeclaration(nsCSSDeclaration* aDecl, nsCSSPosition& aPosition); -static nsresult MapTableForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSTable& aTable); -static nsresult MapContentForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSContent& aContent); -static nsresult MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSText& aContent); -static nsresult MapUIForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSUserInterface& aContent); +static nsresult MapFontForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataFont& aFont); +static nsresult MapDisplayForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataDisplay& aDisplay); +static nsresult MapColorForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataColor& aColor); +static nsresult MapMarginForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataMargin& aMargin); +static nsresult MapListForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataList& aList); +static nsresult MapPositionForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataPosition& aPosition); +static nsresult MapTableForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataTable& aTable); +static nsresult MapContentForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataContent& aContent); +static nsresult MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataText& aContent); +static nsresult MapUIForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataUserInterface& aContent); #ifdef INCLUDE_XUL -static nsresult MapXULForDeclaration(nsCSSDeclaration* aDecl, nsCSSXUL& aXUL); +static nsresult MapXULForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataXUL& aXUL); #endif #ifdef MOZ_SVG -static nsresult MapSVGForDeclaration(nsCSSDeclaration* aDecl, nsCSSSVG& aSVG); +static nsresult MapSVGForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataSVG& aSVG); #endif class CSSStyleRuleImpl; @@ -1743,7 +1743,7 @@ CSSStyleRuleImpl::MapRuleInfoInto(nsRuleData* aRuleData) } static nsresult -MapFontForDeclaration(nsCSSDeclaration* aDecl, nsCSSFont& aFont) +MapFontForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataFont& aFont) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -1752,8 +1752,10 @@ MapFontForDeclaration(nsCSSDeclaration* aDecl, nsCSSFont& aFont) if (!ourFont) return NS_OK; // We don't have any rules for fonts. - if (eCSSUnit_Null == aFont.mFamily.GetUnit() && eCSSUnit_Null != ourFont->mFamily.GetUnit()) + if (eCSSUnit_Null == aFont.mFamily.GetUnit() && eCSSUnit_Null != ourFont->mFamily.GetUnit()) { aFont.mFamily = ourFont->mFamily; + aFont.mFamilyFromHTML = PR_FALSE; + } if (eCSSUnit_Null == aFont.mStyle.GetUnit() && eCSSUnit_Null != ourFont->mStyle.GetUnit()) aFont.mStyle = ourFont->mStyle; @@ -1775,7 +1777,7 @@ MapFontForDeclaration(nsCSSDeclaration* aDecl, nsCSSFont& aFont) #ifdef INCLUDE_XUL static nsresult -MapXULForDeclaration(nsCSSDeclaration* aDecl, nsCSSXUL& aXUL) +MapXULForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataXUL& aXUL) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -1814,7 +1816,7 @@ MapXULForDeclaration(nsCSSDeclaration* aDecl, nsCSSXUL& aXUL) #ifdef MOZ_SVG static nsresult -MapSVGForDeclaration(nsCSSDeclaration* aDecl, nsCSSSVG& aSVG) +MapSVGForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataSVG& aSVG) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -1863,7 +1865,7 @@ MapSVGForDeclaration(nsCSSDeclaration* aDecl, nsCSSSVG& aSVG) static nsresult -MapPositionForDeclaration(nsCSSDeclaration* aDecl, nsCSSPosition& aPosition) +MapPositionForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataPosition& aPosition) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -1915,7 +1917,7 @@ MapPositionForDeclaration(nsCSSDeclaration* aDecl, nsCSSPosition& aPosition) } static nsresult -MapListForDeclaration(nsCSSDeclaration* aDecl, nsCSSList& aList) +MapListForDeclaration(nsCSSDeclaration* aDecl, nsRuleDataList& aList) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -1959,7 +1961,7 @@ MapListForDeclaration(nsCSSDeclaration* aDecl, nsCSSList& aList) } static nsresult -MapMarginForDeclaration(nsCSSDeclaration* aDeclaration, const nsStyleStructID& aSID, nsCSSMargin& aMargin) +MapMarginForDeclaration(nsCSSDeclaration* aDeclaration, const nsStyleStructID& aSID, nsRuleDataMargin& aMargin) { nsCSSMargin* ourMargin = (nsCSSMargin*)aDeclaration->GetData(kCSSMarginSID); if (!ourMargin) @@ -2103,7 +2105,7 @@ MapMarginForDeclaration(nsCSSDeclaration* aDeclaration, const nsStyleStructID& a } static nsresult -MapColorForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSColor& aColor) +MapColorForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataColor& aColor) { if (!aDecl) return NS_OK; @@ -2153,7 +2155,7 @@ MapColorForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCS } static nsresult -MapTableForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSTable& aTable) +MapTableForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataTable& aTable) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -2193,7 +2195,7 @@ MapTableForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCS } static nsresult -MapContentForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSContent& aContent) +MapContentForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataContent& aContent) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -2224,7 +2226,7 @@ MapContentForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, ns } static nsresult -MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSText& aText) +MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataText& aText) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -2273,7 +2275,7 @@ MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSS } static nsresult -MapDisplayForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSDisplay& aDisplay) +MapDisplayForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataDisplay& aDisplay) { if (!aDecl) return NS_OK; // The rule must have a declaration. @@ -2349,7 +2351,7 @@ MapDisplayForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, ns } static nsresult -MapUIForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsCSSUserInterface& aUI) +MapUIForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRuleDataUserInterface& aUI) { if (!aDecl) return NS_OK; // The rule must have a declaration. diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 5a858fd8063..c15d2886eb3 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -708,7 +708,7 @@ struct PropertyCheckData { /* the information for all the properties in a style struct */ typedef nsRuleNode::RuleDetail - (* PR_CALLBACK CheckCallbackFn)(const nsCSSStruct& aData); + (* PR_CALLBACK CheckCallbackFn)(const nsRuleDataStruct& aData); struct StructCheckData { const PropertyCheckData* props; @@ -791,9 +791,10 @@ ExamineRectCoordProperties(const nsCSSRect* aRect, } PR_STATIC_CALLBACK(nsRuleNode::RuleDetail) -CheckFontCallback(const nsCSSStruct& aData) +CheckFontCallback(const nsRuleDataStruct& aData) { - const nsCSSFont& fontData = NS_STATIC_CAST(const nsCSSFont&, aData); + const nsRuleDataFont& fontData = + NS_STATIC_CAST(const nsRuleDataFont&, aData); if (eCSSUnit_Enumerated == fontData.mFamily.GetUnit()) { // A special case. We treat this as a fully specified font, // since no other font props are legal with a system font. @@ -822,173 +823,173 @@ CheckFontCallback(const nsCSSStruct& aData) } static const PropertyCheckData FontCheckProperties[] = { - CHECKDATA_PROP(nsCSSFont, mFamily, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSFont, mStyle, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSFont, mVariant, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSFont, mWeight, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSFont, mSize, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSFont, mSizeAdjust, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataFont, mFamily, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataFont, mStyle, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataFont, mVariant, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataFont, mWeight, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataFont, mSize, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataFont, mSizeAdjust, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData DisplayCheckProperties[] = { - CHECKDATA_PROP(nsCSSDisplay, mAppearance, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mClip, CHECKDATA_RECT, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mDisplay, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mBinding, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mPosition, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mFloat, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mClear, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mOverflow, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mBreakBefore, CHECKDATA_VALUE, PR_FALSE), // temp fix for bug 2400 - CHECKDATA_PROP(nsCSSDisplay, mBreakAfter, CHECKDATA_VALUE, PR_FALSE) // temp fix for bug 2400 + CHECKDATA_PROP(nsRuleDataDisplay, mAppearance, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mClip, CHECKDATA_RECT, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mDisplay, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mBinding, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mPosition, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mFloat, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mClear, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mOverflow, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mBreakBefore, CHECKDATA_VALUE, PR_FALSE), // temp fix for bug 2400 + CHECKDATA_PROP(nsRuleDataDisplay, mBreakAfter, CHECKDATA_VALUE, PR_FALSE) // temp fix for bug 2400 }; static const PropertyCheckData VisibilityCheckProperties[] = { - CHECKDATA_PROP(nsCSSDisplay, mVisibility, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mDirection, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mLang, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSDisplay, mOpacity, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataDisplay, mVisibility, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mDirection, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mLang, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataDisplay, mOpacity, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData MarginCheckProperties[] = { - CHECKDATA_PROP(nsCSSMargin, mMargin, CHECKDATA_RECT, PR_TRUE) + CHECKDATA_PROP(nsRuleDataMargin, mMargin, CHECKDATA_RECT, PR_TRUE) }; static const PropertyCheckData BorderCheckProperties[] = { - CHECKDATA_PROP(nsCSSMargin, mBorderWidth, CHECKDATA_RECT, PR_FALSE), - CHECKDATA_PROP(nsCSSMargin, mBorderStyle, CHECKDATA_RECT, PR_FALSE), - CHECKDATA_PROP(nsCSSMargin, mBorderColor, CHECKDATA_RECT, PR_FALSE), - CHECKDATA_PROP(nsCSSMargin, mBorderRadius, CHECKDATA_RECT, PR_TRUE), - CHECKDATA_PROP(nsCSSMargin, mFloatEdge, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSMargin, mBorderColors, CHECKDATA_VALUELIST_ARRAY, PR_FALSE) + CHECKDATA_PROP(nsRuleDataMargin, mBorderWidth, CHECKDATA_RECT, PR_FALSE), + CHECKDATA_PROP(nsRuleDataMargin, mBorderStyle, CHECKDATA_RECT, PR_FALSE), + CHECKDATA_PROP(nsRuleDataMargin, mBorderColor, CHECKDATA_RECT, PR_FALSE), + CHECKDATA_PROP(nsRuleDataMargin, mBorderRadius, CHECKDATA_RECT, PR_TRUE), + CHECKDATA_PROP(nsRuleDataMargin, mFloatEdge, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataMargin, mBorderColors, CHECKDATA_VALUELIST_ARRAY, PR_FALSE) }; static const PropertyCheckData PaddingCheckProperties[] = { - CHECKDATA_PROP(nsCSSMargin, mPadding, CHECKDATA_RECT, PR_TRUE) + CHECKDATA_PROP(nsRuleDataMargin, mPadding, CHECKDATA_RECT, PR_TRUE) }; static const PropertyCheckData OutlineCheckProperties[] = { - CHECKDATA_PROP(nsCSSMargin, mOutlineColor, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSMargin, mOutlineWidth, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSMargin, mOutlineStyle, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSMargin, mOutlineRadius, CHECKDATA_RECT, PR_TRUE) + CHECKDATA_PROP(nsRuleDataMargin, mOutlineColor, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataMargin, mOutlineWidth, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataMargin, mOutlineStyle, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataMargin, mOutlineRadius, CHECKDATA_RECT, PR_TRUE) }; static const PropertyCheckData ListCheckProperties[] = { - CHECKDATA_PROP(nsCSSList, mType, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSList, mImage, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSList, mPosition, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSList, mImageRegion, CHECKDATA_RECT, PR_TRUE) + CHECKDATA_PROP(nsRuleDataList, mType, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataList, mImage, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataList, mPosition, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataList, mImageRegion, CHECKDATA_RECT, PR_TRUE) }; static const PropertyCheckData ColorCheckProperties[] = { - CHECKDATA_PROP(nsCSSColor, mColor, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataColor, mColor, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData BackgroundCheckProperties[] = { - CHECKDATA_PROP(nsCSSColor, mBackAttachment, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackRepeat, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackClip, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackColor, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackImage, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackOrigin, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackPositionX, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSColor, mBackPositionY, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataColor, mBackAttachment, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackRepeat, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackClip, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackColor, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackImage, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackOrigin, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackPositionX, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataColor, mBackPositionY, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData PositionCheckProperties[] = { - CHECKDATA_PROP(nsCSSPosition, mOffset, CHECKDATA_RECT, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mWidth, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mMinWidth, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mMaxWidth, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mHeight, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mMinHeight, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mMaxHeight, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSPosition, mBoxSizing, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSPosition, mZIndex, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataPosition, mOffset, CHECKDATA_RECT, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mWidth, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mMinWidth, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mMaxWidth, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mHeight, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mMinHeight, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mMaxHeight, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataPosition, mBoxSizing, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataPosition, mZIndex, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData TableCheckProperties[] = { - CHECKDATA_PROP(nsCSSTable, mLayout, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mFrame, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mRules, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mCols, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mSpan, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataTable, mLayout, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mFrame, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mRules, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mCols, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mSpan, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData TableBorderCheckProperties[] = { - CHECKDATA_PROP(nsCSSTable, mBorderCollapse, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mBorderSpacingX, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mBorderSpacingY, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mCaptionSide, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSTable, mEmptyCells, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataTable, mBorderCollapse, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mBorderSpacingX, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mBorderSpacingY, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mCaptionSide, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataTable, mEmptyCells, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData ContentCheckProperties[] = { - CHECKDATA_PROP(nsCSSContent, mContent, CHECKDATA_VALUELIST, PR_FALSE), - CHECKDATA_PROP(nsCSSContent, mMarkerOffset, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSContent, mCounterIncrement, CHECKDATA_COUNTERDATA, PR_FALSE), - CHECKDATA_PROP(nsCSSContent, mCounterReset, CHECKDATA_COUNTERDATA, PR_FALSE) + CHECKDATA_PROP(nsRuleDataContent, mContent, CHECKDATA_VALUELIST, PR_FALSE), + CHECKDATA_PROP(nsRuleDataContent, mMarkerOffset, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataContent, mCounterIncrement, CHECKDATA_COUNTERDATA, PR_FALSE), + CHECKDATA_PROP(nsRuleDataContent, mCounterReset, CHECKDATA_COUNTERDATA, PR_FALSE) }; static const PropertyCheckData QuotesCheckProperties[] = { - CHECKDATA_PROP(nsCSSContent, mQuotes, CHECKDATA_QUOTES, PR_FALSE) + CHECKDATA_PROP(nsRuleDataContent, mQuotes, CHECKDATA_QUOTES, PR_FALSE) }; static const PropertyCheckData TextCheckProperties[] = { - CHECKDATA_PROP(nsCSSText, mLineHeight, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSText, mTextIndent, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSText, mWordSpacing, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSText, mLetterSpacing, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSText, mTextAlign, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSText, mTextTransform, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSText, mWhiteSpace, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataText, mLineHeight, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataText, mTextIndent, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataText, mWordSpacing, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataText, mLetterSpacing, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataText, mTextAlign, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataText, mTextTransform, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataText, mWhiteSpace, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData TextResetCheckProperties[] = { - CHECKDATA_PROP(nsCSSText, mDecoration, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSText, mVerticalAlign, CHECKDATA_VALUE, PR_TRUE), - CHECKDATA_PROP(nsCSSText, mUnicodeBidi, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataText, mDecoration, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataText, mVerticalAlign, CHECKDATA_VALUE, PR_TRUE), + CHECKDATA_PROP(nsRuleDataText, mUnicodeBidi, CHECKDATA_VALUE, PR_FALSE) }; static const PropertyCheckData UserInterfaceCheckProperties[] = { - CHECKDATA_PROP(nsCSSUserInterface, mUserInput, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSUserInterface, mUserModify, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSUserInterface, mUserFocus, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSUserInterface, mCursor, CHECKDATA_VALUELIST, PR_FALSE) + CHECKDATA_PROP(nsRuleDataUserInterface, mUserInput, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataUserInterface, mUserModify, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataUserInterface, mUserFocus, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataUserInterface, mCursor, CHECKDATA_VALUELIST, PR_FALSE) }; static const PropertyCheckData UIResetCheckProperties[] = { - CHECKDATA_PROP(nsCSSUserInterface, mUserSelect, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSUserInterface, mResizer, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSUserInterface, mKeyEquivalent, CHECKDATA_VALUELIST, PR_FALSE), - CHECKDATA_PROP(nsCSSUserInterface, mForceBrokenImageIcon, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataUserInterface, mUserSelect, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataUserInterface, mResizer, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataUserInterface, mKeyEquivalent, CHECKDATA_VALUELIST, PR_FALSE), + CHECKDATA_PROP(nsRuleDataUserInterface, mForceBrokenImageIcon, CHECKDATA_VALUE, PR_FALSE) }; #ifdef INCLUDE_XUL static const PropertyCheckData XULCheckProperties[] = { - CHECKDATA_PROP(nsCSSXUL, mBoxAlign, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSXUL, mBoxDirection, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSXUL, mBoxFlex, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSXUL, mBoxOrient, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSXUL, mBoxPack, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSXUL, mBoxOrdinal, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataXUL, mBoxAlign, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataXUL, mBoxDirection, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataXUL, mBoxFlex, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataXUL, mBoxOrient, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataXUL, mBoxPack, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataXUL, mBoxOrdinal, CHECKDATA_VALUE, PR_FALSE) }; #endif #ifdef MOZ_SVG static const PropertyCheckData SVGCheckProperties[] = { - CHECKDATA_PROP(nsCSSSVG, mFill, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mFillOpacity, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mFillRule, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStroke, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeDasharray, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeDashoffset, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeLinecap, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeLinejoin, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeMiterlimit, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeOpacity, CHECKDATA_VALUE, PR_FALSE), - CHECKDATA_PROP(nsCSSSVG, mStrokeWidth, CHECKDATA_VALUE, PR_FALSE) + CHECKDATA_PROP(nsRuleDataSVG, mFill, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mFillOpacity, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mFillRule, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStroke, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeDasharray, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeDashoffset, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeLinecap, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeLinejoin, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeMiterlimit, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeOpacity, CHECKDATA_VALUE, PR_FALSE), + CHECKDATA_PROP(nsRuleDataSVG, mStrokeWidth, CHECKDATA_VALUE, PR_FALSE) }; #endif @@ -1009,54 +1010,54 @@ static const StructCheckData gCheckProperties[] = { // XXXldb Taking the address of a reference is evil. inline const nsCSSValue& -ValueAtOffset(const nsCSSStruct& aCSSStruct, size_t aOffset) +ValueAtOffset(const nsRuleDataStruct& aRuleDataStruct, size_t aOffset) { return * NS_REINTERPRET_CAST(const nsCSSValue*, - NS_REINTERPRET_CAST(const char*, &aCSSStruct) + aOffset); + NS_REINTERPRET_CAST(const char*, &aRuleDataStruct) + aOffset); } inline const nsCSSRect* -RectAtOffset(const nsCSSStruct& aCSSStruct, size_t aOffset) +RectAtOffset(const nsRuleDataStruct& aRuleDataStruct, size_t aOffset) { return * NS_REINTERPRET_CAST(const nsCSSRect*const*, - NS_REINTERPRET_CAST(const char*, &aCSSStruct) + aOffset); + NS_REINTERPRET_CAST(const char*, &aRuleDataStruct) + aOffset); } inline const nsCSSValueList* -ValueListAtOffset(const nsCSSStruct& aCSSStruct, size_t aOffset) +ValueListAtOffset(const nsRuleDataStruct& aRuleDataStruct, size_t aOffset) { return * NS_REINTERPRET_CAST(const nsCSSValueList*const*, - NS_REINTERPRET_CAST(const char*, &aCSSStruct) + aOffset); + NS_REINTERPRET_CAST(const char*, &aRuleDataStruct) + aOffset); } inline const nsCSSValueList** -ValueListArrayAtOffset(const nsCSSStruct& aCSSStruct, size_t aOffset) +ValueListArrayAtOffset(const nsRuleDataStruct& aRuleDataStruct, size_t aOffset) { return * NS_REINTERPRET_CAST(const nsCSSValueList**const*, - NS_REINTERPRET_CAST(const char*, &aCSSStruct) + aOffset); + NS_REINTERPRET_CAST(const char*, &aRuleDataStruct) + aOffset); } inline const nsCSSCounterData* -CounterDataAtOffset(const nsCSSStruct& aCSSStruct, size_t aOffset) +CounterDataAtOffset(const nsRuleDataStruct& aRuleDataStruct, size_t aOffset) { return * NS_REINTERPRET_CAST(const nsCSSCounterData*const*, - NS_REINTERPRET_CAST(const char*, &aCSSStruct) + aOffset); + NS_REINTERPRET_CAST(const char*, &aRuleDataStruct) + aOffset); } inline const nsCSSQuotes* -QuotesAtOffset(const nsCSSStruct& aCSSStruct, size_t aOffset) +QuotesAtOffset(const nsRuleDataStruct& aRuleDataStruct, size_t aOffset) { return * NS_REINTERPRET_CAST(const nsCSSQuotes*const*, - NS_REINTERPRET_CAST(const char*, &aCSSStruct) + aOffset); + NS_REINTERPRET_CAST(const char*, &aRuleDataStruct) + aOffset); } inline nsRuleNode::RuleDetail nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, - const nsCSSStruct& aCSSStruct) + const nsRuleDataStruct& aRuleDataStruct) { const StructCheckData *structData = gCheckProperties + aSID; if (structData->callback) { - nsRuleNode::RuleDetail res = (*structData->callback)(aCSSStruct); + nsRuleNode::RuleDetail res = (*structData->callback)(aRuleDataStruct); if (res != eRuleUnknown) return res; } @@ -1077,7 +1078,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, case CHECKDATA_VALUE: { ++total; - const nsCSSValue& value = ValueAtOffset(aCSSStruct, prop->offset); + const nsCSSValue& value = ValueAtOffset(aRuleDataStruct, prop->offset); if (eCSSUnit_Null != value.GetUnit()) { ++specified; if (eCSSUnit_Inherit == value.GetUnit()) { @@ -1092,11 +1093,11 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, case CHECKDATA_RECT: total += 4; if (prop->mayHaveExplicitInherit) - ExamineRectCoordProperties(RectAtOffset(aCSSStruct, prop->offset), + ExamineRectCoordProperties(RectAtOffset(aRuleDataStruct, prop->offset), specified, inherited, canHaveExplicitInherit); else - ExamineRectProperties(RectAtOffset(aCSSStruct, prop->offset), + ExamineRectProperties(RectAtOffset(aRuleDataStruct, prop->offset), specified, inherited); break; @@ -1104,7 +1105,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, { ++total; const nsCSSValueList* valueList = - ValueListAtOffset(aCSSStruct, prop->offset); + ValueListAtOffset(aRuleDataStruct, prop->offset); if (valueList) { ++specified; if (eCSSUnit_Inherit == valueList->mValue.GetUnit()) { @@ -1122,7 +1123,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, NS_ASSERTION(!prop->mayHaveExplicitInherit, "counters can't be coordinates"); const nsCSSCounterData* counterData = - CounterDataAtOffset(aCSSStruct, prop->offset); + CounterDataAtOffset(aRuleDataStruct, prop->offset); if (counterData) { ++specified; if (eCSSUnit_Inherit == counterData->mCounter.GetUnit()) { @@ -1138,7 +1139,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, NS_ASSERTION(!prop->mayHaveExplicitInherit, "quotes can't be coordinates"); const nsCSSQuotes* quotes = - QuotesAtOffset(aCSSStruct, prop->offset); + QuotesAtOffset(aRuleDataStruct, prop->offset); if (quotes) { ++specified; if (eCSSUnit_Inherit == quotes->mOpen.GetUnit()) { @@ -1152,7 +1153,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, { total += 4; const nsCSSValueList** valueArray = - ValueListArrayAtOffset(aCSSStruct, prop->offset); + ValueListArrayAtOffset(aRuleDataStruct, prop->offset); if (valueArray) { for (PRInt32 i = 0; i < 4; i++) { const nsCSSValueList* valList = valueArray[i]; @@ -1207,7 +1208,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, const nsStyleStruct* nsRuleNode::GetDisplayData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSDisplay displayData; // Declare a struct with null CSS values. + nsRuleDataDisplay displayData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Display, mPresContext, aContext); ruleData.mDisplayData = &displayData; @@ -1221,7 +1222,7 @@ nsRuleNode::GetDisplayData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetVisibilityData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSDisplay displayData; // Declare a struct with null CSS values. + nsRuleDataDisplay displayData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Visibility, mPresContext, aContext); ruleData.mDisplayData = &displayData; @@ -1231,7 +1232,7 @@ nsRuleNode::GetVisibilityData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetTextData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSText textData; // Declare a struct with null CSS values. + nsRuleDataText textData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Text, mPresContext, aContext); ruleData.mTextData = &textData; @@ -1241,7 +1242,7 @@ nsRuleNode::GetTextData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetTextResetData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSText textData; // Declare a struct with null CSS values. + nsRuleDataText textData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_TextReset, mPresContext, aContext); ruleData.mTextData = &textData; @@ -1251,7 +1252,7 @@ nsRuleNode::GetTextResetData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetUserInterfaceData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSUserInterface uiData; // Declare a struct with null CSS values. + nsRuleDataUserInterface uiData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_UserInterface, mPresContext, aContext); ruleData.mUIData = &uiData; @@ -1263,7 +1264,7 @@ nsRuleNode::GetUserInterfaceData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetUIResetData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSUserInterface uiData; // Declare a struct with null CSS values. + nsRuleDataUserInterface uiData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_UIReset, mPresContext, aContext); ruleData.mUIData = &uiData; @@ -1275,7 +1276,7 @@ nsRuleNode::GetUIResetData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetFontData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSFont fontData; // Declare a struct with null CSS values. + nsRuleDataFont fontData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Font, mPresContext, aContext); ruleData.mFontData = &fontData; @@ -1285,7 +1286,7 @@ nsRuleNode::GetFontData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetColorData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSColor colorData; // Declare a struct with null CSS values. + nsRuleDataColor colorData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Color, mPresContext, aContext); ruleData.mColorData = &colorData; @@ -1295,7 +1296,7 @@ nsRuleNode::GetColorData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetBackgroundData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSColor colorData; // Declare a struct with null CSS values. + nsRuleDataColor colorData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Background, mPresContext, aContext); ruleData.mColorData = &colorData; @@ -1305,7 +1306,7 @@ nsRuleNode::GetBackgroundData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetMarginData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSMargin marginData; // Declare a struct with null CSS values. + nsRuleDataMargin marginData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Margin, mPresContext, aContext); ruleData.mMarginData = &marginData; @@ -1321,7 +1322,7 @@ nsRuleNode::GetMarginData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetBorderData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSMargin marginData; // Declare a struct with null CSS values. + nsRuleDataMargin marginData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Border, mPresContext, aContext); ruleData.mMarginData = &marginData; @@ -1351,7 +1352,7 @@ nsRuleNode::GetBorderData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetPaddingData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSMargin marginData; // Declare a struct with null CSS values. + nsRuleDataMargin marginData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Padding, mPresContext, aContext); ruleData.mMarginData = &marginData; @@ -1367,7 +1368,7 @@ nsRuleNode::GetPaddingData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetOutlineData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSMargin marginData; // Declare a struct with null CSS values. + nsRuleDataMargin marginData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Outline, mPresContext, aContext); ruleData.mMarginData = &marginData; @@ -1383,7 +1384,7 @@ nsRuleNode::GetOutlineData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetListData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSList listData; // Declare a struct with null CSS values. + nsRuleDataList listData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_List, mPresContext, aContext); ruleData.mListData = &listData; @@ -1398,7 +1399,7 @@ nsRuleNode::GetListData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetPositionData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSPosition posData; // Declare a struct with null CSS values. + nsRuleDataPosition posData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Position, mPresContext, aContext); ruleData.mPositionData = &posData; @@ -1413,7 +1414,7 @@ nsRuleNode::GetPositionData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetTableData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSTable tableData; // Declare a struct with null CSS values. + nsRuleDataTable tableData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Table, mPresContext, aContext); ruleData.mTableData = &tableData; @@ -1423,7 +1424,7 @@ nsRuleNode::GetTableData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetTableBorderData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSTable tableData; // Declare a struct with null CSS values. + nsRuleDataTable tableData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_TableBorder, mPresContext, aContext); ruleData.mTableData = &tableData; @@ -1433,7 +1434,7 @@ nsRuleNode::GetTableBorderData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetContentData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSContent contentData; // Declare a struct with null CSS values. + nsRuleDataContent contentData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Content, mPresContext, aContext); ruleData.mContentData = &contentData; @@ -1446,7 +1447,7 @@ nsRuleNode::GetContentData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetQuotesData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSContent contentData; // Declare a struct with null CSS values. + nsRuleDataContent contentData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Quotes, mPresContext, aContext); ruleData.mContentData = &contentData; @@ -1459,7 +1460,7 @@ nsRuleNode::GetQuotesData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetXULData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSXUL xulData; // Declare a struct with null CSS values. + nsRuleDataXUL xulData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_XUL, mPresContext, aContext); ruleData.mXULData = &xulData; @@ -1471,7 +1472,7 @@ nsRuleNode::GetXULData(nsIStyleContext* aContext, PRBool aComputeData) const nsStyleStruct* nsRuleNode::GetSVGData(nsIStyleContext* aContext, PRBool aComputeData) { - nsCSSSVG svgData; // Declare a struct with null CSS values. + nsRuleDataSVG svgData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_SVG, mPresContext, aContext); ruleData.mSVGData = &svgData; @@ -1483,7 +1484,7 @@ const nsStyleStruct* nsRuleNode::WalkRuleTree(const nsStyleStructID aSID, nsIStyleContext* aContext, nsRuleData* aRuleData, - nsCSSStruct* aSpecificData, + nsRuleDataStruct* aSpecificData, PRBool aComputeData) { // We start at the most specific rule in the tree. @@ -1817,7 +1818,7 @@ nsRuleNode::gComputeStyleDataFn[] = { static void SetFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, nscoord aMinFontSize, PRBool aUseDocumentFonts, PRBool aChromeOverride, - PRBool aIsGeneric, const nsCSSFont& aFontData, + PRBool aIsGeneric, const nsRuleDataFont& aFontData, const nsFont& aDefaultFont, const nsStyleFont* aParentFont, nsStyleFont* aFont, PRBool aZoom, PRBool& aInherited) { @@ -1841,6 +1842,10 @@ SetFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, // now set to defaults aFont->mFont.name = aDefaultFont.name; } + nsCompatibility compat; + aPresContext->GetCompatibilityMode(&compat); + aFont->mFont.familyNameQuirks = + compat == eCompatibility_NavQuirks && aFontData.mFamilyFromHTML; } else if (eCSSUnit_Enumerated == aFontData.mFamily.GetUnit()) { nsSystemFontID sysID; @@ -1876,6 +1881,8 @@ SetFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, aFont->mSize = aFont->mFont.size; // this becomes our cascading size } + aFont->mFont.familyNameQuirks = PR_FALSE; + // XXXldb All of this platform-specific stuff should be in the // nsIDeviceContext implementations, not here. @@ -1905,9 +1912,11 @@ SetFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, else if (eCSSUnit_Inherit == aFontData.mFamily.GetUnit()) { aInherited = PR_TRUE; aFont->mFont.name = aParentFont->mFont.name; + aFont->mFont.familyNameQuirks = aParentFont->mFont.familyNameQuirks; } else if (eCSSUnit_Initial == aFontData.mFamily.GetUnit()) { aFont->mFont.name = aDefaultFont.name; + aFont->mFont.familyNameQuirks = PR_FALSE; } // font-style: enum, normal, inherit @@ -2069,7 +2078,7 @@ SetFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, // - re-apply cascading rules from there without caching intermediate values static void SetGenericFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, - const nsCSSFont& aFontData, PRUint8 aGenericFontID, + const nsRuleDataFont& aFontData, PRUint8 aGenericFontID, nscoord aMinFontSize, PRBool aUseDocumentFonts, PRBool aChromeOverride, nsStyleFont* aFont) { @@ -2118,7 +2127,7 @@ SetGenericFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, for (; i >= 0; --i) { nsIStyleContext* context = (nsIStyleContext*)contextPath[i]; - nsCSSFont fontData; // Declare a struct with null CSS values. + nsRuleDataFont fontData; // Declare a struct with null CSS values. nsRuleData ruleData(eStyleStruct_Font, aPresContext, context); ruleData.mFontData = &fontData; @@ -2163,14 +2172,15 @@ SetGenericFont(nsIPresContext* aPresContext, nsIStyleContext* aContext, } const nsStyleStruct* -nsRuleNode::ComputeFontData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeFontData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSFont& fontData = NS_STATIC_CAST(const nsCSSFont&, aData); + const nsRuleDataFont& fontData = NS_STATIC_CAST(const nsRuleDataFont&, aData); nsStyleFont* font = nsnull; const nsStyleFont* parentFont = nsnull; PRBool inherited = aInherited; @@ -2292,14 +2302,15 @@ nsRuleNode::ComputeFontData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDat } const nsStyleStruct* -nsRuleNode::ComputeTextData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeTextData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSText& textData = NS_STATIC_CAST(const nsCSSText&, aData); + const nsRuleDataText& textData = NS_STATIC_CAST(const nsRuleDataText&, aData); nsStyleText* text = nsnull; const nsStyleText* parentText = nsnull; PRBool inherited = aInherited; @@ -2412,14 +2423,15 @@ nsRuleNode::ComputeTextData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDat } const nsStyleStruct* -nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData, const nsCSSStruct& aData, +nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSText& textData = NS_STATIC_CAST(const nsCSSText&, aData); + const nsRuleDataText& textData = NS_STATIC_CAST(const nsRuleDataText&, aData); nsStyleTextReset* text; if (aStartData) // We only need to compute the delta between this computed data and our @@ -2497,7 +2509,7 @@ nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData, const nsCSSStruct& a const nsStyleStruct* nsRuleNode::ComputeUserInterfaceData(nsStyleStruct* aStartData, - const nsCSSStruct& aData, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, @@ -2505,7 +2517,7 @@ nsRuleNode::ComputeUserInterfaceData(nsStyleStruct* aStartData, { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSUserInterface& uiData = NS_STATIC_CAST(const nsCSSUserInterface&, aData); + const nsRuleDataUserInterface& uiData = NS_STATIC_CAST(const nsRuleDataUserInterface&, aData); nsStyleUserInterface* ui = nsnull; const nsStyleUserInterface* parentUI = nsnull; PRBool inherited = aInherited; @@ -2608,14 +2620,15 @@ nsRuleNode::ComputeUserInterfaceData(nsStyleStruct* aStartData, } const nsStyleStruct* -nsRuleNode::ComputeUIResetData(nsStyleStruct* aStartData, const nsCSSStruct& aData, +nsRuleNode::ComputeUIResetData(nsStyleStruct* aStartData, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSUserInterface& uiData = NS_STATIC_CAST(const nsCSSUserInterface&, aData); + const nsRuleDataUserInterface& uiData = NS_STATIC_CAST(const nsRuleDataUserInterface&, aData); nsStyleUIReset* ui; if (aStartData) // We only need to compute the delta between this computed data and our @@ -2697,14 +2710,15 @@ nsRuleNode::ComputeUIResetData(nsStyleStruct* aStartData, const nsCSSStruct& aDa } const nsStyleStruct* -nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSDisplay& displayData = NS_STATIC_CAST(const nsCSSDisplay&, aData); + const nsRuleDataDisplay& displayData = NS_STATIC_CAST(const nsRuleDataDisplay&, aData); nsStyleDisplay* display; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -2950,14 +2964,15 @@ nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct, const nsCSSStruct& a } const nsStyleStruct* -nsRuleNode::ComputeVisibilityData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeVisibilityData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSDisplay& displayData = NS_STATIC_CAST(const nsCSSDisplay&, aData); + const nsRuleDataDisplay& displayData = NS_STATIC_CAST(const nsRuleDataDisplay&, aData); nsStyleVisibility* visibility = nsnull; const nsStyleVisibility* parentVisibility = nsnull; PRBool inherited = aInherited; @@ -3060,14 +3075,15 @@ nsRuleNode::ComputeVisibilityData(nsStyleStruct* aStartStruct, const nsCSSStruct } const nsStyleStruct* -nsRuleNode::ComputeColorData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeColorData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSColor& colorData = NS_STATIC_CAST(const nsCSSColor&, aData); + const nsRuleDataColor& colorData = NS_STATIC_CAST(const nsRuleDataColor&, aData); nsStyleColor* color = nsnull; const nsStyleColor* parentColor = nsnull; PRBool inherited = aInherited; @@ -3116,14 +3132,15 @@ nsRuleNode::ComputeColorData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDa } const nsStyleStruct* -nsRuleNode::ComputeBackgroundData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeBackgroundData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSColor& colorData = NS_STATIC_CAST(const nsCSSColor&, aData); + const nsRuleDataColor& colorData = NS_STATIC_CAST(const nsRuleDataColor&, aData); nsStyleBackground* bg; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -3279,14 +3296,15 @@ nsRuleNode::ComputeBackgroundData(nsStyleStruct* aStartStruct, const nsCSSStruct } const nsStyleStruct* -nsRuleNode::ComputeMarginData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeMarginData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSMargin& marginData = NS_STATIC_CAST(const nsCSSMargin&, aData); + const nsRuleDataMargin& marginData = NS_STATIC_CAST(const nsRuleDataMargin&, aData); nsStyleMargin* margin; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -3344,14 +3362,15 @@ nsRuleNode::ComputeMarginData(nsStyleStruct* aStartStruct, const nsCSSStruct& aD } const nsStyleStruct* -nsRuleNode::ComputeBorderData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeBorderData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSMargin& marginData = NS_STATIC_CAST(const nsCSSMargin&, aData); + const nsRuleDataMargin& marginData = NS_STATIC_CAST(const nsRuleDataMargin&, aData); nsStyleBorder* border; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -3624,14 +3643,15 @@ nsRuleNode::ComputeBorderData(nsStyleStruct* aStartStruct, const nsCSSStruct& aD } const nsStyleStruct* -nsRuleNode::ComputePaddingData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputePaddingData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSMargin& marginData = NS_STATIC_CAST(const nsCSSMargin&, aData); + const nsRuleDataMargin& marginData = NS_STATIC_CAST(const nsRuleDataMargin&, aData); nsStylePadding* padding; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -3689,14 +3709,15 @@ nsRuleNode::ComputePaddingData(nsStyleStruct* aStartStruct, const nsCSSStruct& a } const nsStyleStruct* -nsRuleNode::ComputeOutlineData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeOutlineData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSMargin& marginData = NS_STATIC_CAST(const nsCSSMargin&, aData); + const nsRuleDataMargin& marginData = NS_STATIC_CAST(const nsRuleDataMargin&, aData); nsStyleOutline* outline; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -3761,14 +3782,15 @@ nsRuleNode::ComputeOutlineData(nsStyleStruct* aStartStruct, const nsCSSStruct& a } const nsStyleStruct* -nsRuleNode::ComputeListData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeListData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSList& listData = NS_STATIC_CAST(const nsCSSList&, aData); + const nsRuleDataList& listData = NS_STATIC_CAST(const nsRuleDataList&, aData); nsStyleList* list = nsnull; const nsStyleList* parentList = nsnull; PRBool inherited = aInherited; @@ -3877,14 +3899,15 @@ nsRuleNode::ComputeListData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDat } const nsStyleStruct* -nsRuleNode::ComputePositionData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputePositionData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSPosition& posData = NS_STATIC_CAST(const nsCSSPosition&, aData); + const nsRuleDataPosition& posData = NS_STATIC_CAST(const nsRuleDataPosition&, aData); nsStylePosition* pos; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -3985,14 +4008,15 @@ nsRuleNode::ComputePositionData(nsStyleStruct* aStartStruct, const nsCSSStruct& } const nsStyleStruct* -nsRuleNode::ComputeTableData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeTableData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSTable& tableData = NS_STATIC_CAST(const nsCSSTable&, aData); + const nsRuleDataTable& tableData = NS_STATIC_CAST(const nsRuleDataTable&, aData); nsStyleTable* table; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -4055,14 +4079,15 @@ nsRuleNode::ComputeTableData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDa } const nsStyleStruct* -nsRuleNode::ComputeTableBorderData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeTableBorderData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSTable& tableData = NS_STATIC_CAST(const nsCSSTable&, aData); + const nsRuleDataTable& tableData = NS_STATIC_CAST(const nsRuleDataTable&, aData); nsStyleTableBorder* table = nsnull; const nsStyleTableBorder* parentTable = nsnull; PRBool inherited = aInherited; @@ -4153,14 +4178,15 @@ nsRuleNode::ComputeTableBorderData(nsStyleStruct* aStartStruct, const nsCSSStruc } const nsStyleStruct* -nsRuleNode::ComputeContentData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeContentData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSContent& contentData = NS_STATIC_CAST(const nsCSSContent&, aData); + const nsRuleDataContent& contentData = NS_STATIC_CAST(const nsRuleDataContent&, aData); nsStyleContent* content; if (aStartStruct) // We only need to compute the delta between this computed data and our @@ -4348,14 +4374,15 @@ nsRuleNode::ComputeContentData(nsStyleStruct* aStartStruct, const nsCSSStruct& a } const nsStyleStruct* -nsRuleNode::ComputeQuotesData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, - nsIStyleContext* aContext, - nsRuleNode* aHighestNode, - const RuleDetail& aRuleDetail, PRBool aInherited) +nsRuleNode::ComputeQuotesData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, + nsIStyleContext* aContext, + nsRuleNode* aHighestNode, + const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSContent& contentData = NS_STATIC_CAST(const nsCSSContent&, aData); + const nsRuleDataContent& contentData = NS_STATIC_CAST(const nsRuleDataContent&, aData); nsStyleQuotes* quotes = nsnull; const nsStyleQuotes* parentQuotes = nsnull; PRBool inherited = aInherited; @@ -4441,14 +4468,15 @@ nsRuleNode::ComputeQuotesData(nsStyleStruct* aStartStruct, const nsCSSStruct& aD #ifdef INCLUDE_XUL const nsStyleStruct* -nsRuleNode::ComputeXULData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeXULData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) { nsCOMPtr parentContext = aContext->GetParent(); - const nsCSSXUL& xulData = NS_STATIC_CAST(const nsCSSXUL&, aData); + const nsRuleDataXUL& xulData = NS_STATIC_CAST(const nsRuleDataXUL&, aData); nsStyleXUL* xul = nsnull; if (aStartStruct) @@ -4590,7 +4618,8 @@ SetSVGLength(const nsCSSValue& aValue, float parentLength, float& length, } const nsStyleStruct* -nsRuleNode::ComputeSVGData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData, +nsRuleNode::ComputeSVGData(nsStyleStruct* aStartStruct, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited) @@ -4600,7 +4629,7 @@ nsRuleNode::ComputeSVGData(nsStyleStruct* aStartStruct, const nsCSSStruct& aData nsStyleSVG* svg = nsnull; nsStyleSVG* parentSVG = svg; PRBool inherited = aInherited; - const nsCSSSVG& SVGData = NS_STATIC_CAST(const nsCSSSVG&, aData); + const nsRuleDataSVG& SVGData = NS_STATIC_CAST(const nsRuleDataSVG&, aData); if (aStartStruct) // We only need to compute the delta between this computed data and our diff --git a/layout/style/nsRuleNode.h b/layout/style/nsRuleNode.h index e982be56e7f..746e6dd01df 100644 --- a/layout/style/nsRuleNode.h +++ b/layout/style/nsRuleNode.h @@ -247,23 +247,23 @@ struct nsRuleData nsIPresContext* mPresContext; nsIStyleContext* mStyleContext; nsPostResolveFunc mPostResolveCallback; - nsCSSFont* mFontData; // Should always be stack-allocated! We don't own these structures! - nsCSSDisplay* mDisplayData; - nsCSSMargin* mMarginData; - nsCSSList* mListData; - nsCSSPosition* mPositionData; - nsCSSTable* mTableData; - nsCSSColor* mColorData; - nsCSSContent* mContentData; - nsCSSText* mTextData; - nsCSSUserInterface* mUIData; + nsRuleDataFont* mFontData; // Should always be stack-allocated! We don't own these structures! + nsRuleDataDisplay* mDisplayData; + nsRuleDataMargin* mMarginData; + nsRuleDataList* mListData; + nsRuleDataPosition* mPositionData; + nsRuleDataTable* mTableData; + nsRuleDataColor* mColorData; + nsRuleDataContent* mContentData; + nsRuleDataText* mTextData; + nsRuleDataUserInterface* mUIData; #ifdef INCLUDE_XUL - nsCSSXUL* mXULData; + nsRuleDataXUL* mXULData; #endif #ifdef MOZ_SVG - nsCSSSVG* mSVGData; + nsRuleDataSVG* mSVGData; #endif nsRuleData(const nsStyleStructID& aSID, nsIPresContext* aContext, nsIStyleContext* aStyleContext) @@ -413,84 +413,84 @@ protected: const nsStyleStruct* WalkRuleTree(const nsStyleStructID aSID, nsIStyleContext* aContext, nsRuleData* aRuleData, - nsCSSStruct* aSpecificData, + nsRuleDataStruct* aSpecificData, PRBool aComputeData); - const nsStyleStruct* ComputeDisplayData(nsStyleStruct* aStartDisplay, const nsCSSStruct& aDisplayData, + const nsStyleStruct* ComputeDisplayData(nsStyleStruct* aStartDisplay, const nsRuleDataStruct& aDisplayData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeVisibilityData(nsStyleStruct* aStartVisibility, const nsCSSStruct& aDisplayData, + const nsStyleStruct* ComputeVisibilityData(nsStyleStruct* aStartVisibility, const nsRuleDataStruct& aDisplayData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeFontData(nsStyleStruct* aStartFont, const nsCSSStruct& aFontData, + const nsStyleStruct* ComputeFontData(nsStyleStruct* aStartFont, const nsRuleDataStruct& aFontData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeColorData(nsStyleStruct* aStartColor, const nsCSSStruct& aColorData, + const nsStyleStruct* ComputeColorData(nsStyleStruct* aStartColor, const nsRuleDataStruct& aColorData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeBackgroundData(nsStyleStruct* aStartBackground, const nsCSSStruct& aColorData, + const nsStyleStruct* ComputeBackgroundData(nsStyleStruct* aStartBackground, const nsRuleDataStruct& aColorData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeMarginData(nsStyleStruct* aStartMargin, const nsCSSStruct& aMarginData, + const nsStyleStruct* ComputeMarginData(nsStyleStruct* aStartMargin, const nsRuleDataStruct& aMarginData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeBorderData(nsStyleStruct* aStartBorder, const nsCSSStruct& aMarginData, + const nsStyleStruct* ComputeBorderData(nsStyleStruct* aStartBorder, const nsRuleDataStruct& aMarginData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputePaddingData(nsStyleStruct* aStartPadding, const nsCSSStruct& aMarginData, + const nsStyleStruct* ComputePaddingData(nsStyleStruct* aStartPadding, const nsRuleDataStruct& aMarginData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeOutlineData(nsStyleStruct* aStartOutline, const nsCSSStruct& aMarginData, + const nsStyleStruct* ComputeOutlineData(nsStyleStruct* aStartOutline, const nsRuleDataStruct& aMarginData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeListData(nsStyleStruct* aStartList, const nsCSSStruct& aListData, + const nsStyleStruct* ComputeListData(nsStyleStruct* aStartList, const nsRuleDataStruct& aListData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputePositionData(nsStyleStruct* aStartPosition, const nsCSSStruct& aPositionData, + const nsStyleStruct* ComputePositionData(nsStyleStruct* aStartPosition, const nsRuleDataStruct& aPositionData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeTableData(nsStyleStruct* aStartTable, const nsCSSStruct& aTableData, + const nsStyleStruct* ComputeTableData(nsStyleStruct* aStartTable, const nsRuleDataStruct& aTableData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeTableBorderData(nsStyleStruct* aStartTable, const nsCSSStruct& aTableData, + const nsStyleStruct* ComputeTableBorderData(nsStyleStruct* aStartTable, const nsRuleDataStruct& aTableData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeContentData(nsStyleStruct* aStartContent, const nsCSSStruct& aData, + const nsStyleStruct* ComputeContentData(nsStyleStruct* aStartContent, const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeQuotesData(nsStyleStruct* aStartQuotes, const nsCSSStruct& aData, + const nsStyleStruct* ComputeQuotesData(nsStyleStruct* aStartQuotes, const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeTextData(nsStyleStruct* aStartData, const nsCSSStruct& aData, + const nsStyleStruct* ComputeTextData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeTextResetData(nsStyleStruct* aStartData, const nsCSSStruct& aData, + const nsStyleStruct* ComputeTextResetData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); const nsStyleStruct* ComputeUserInterfaceData(nsStyleStruct* aStartData, - const nsCSSStruct& aData, + const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); - const nsStyleStruct* ComputeUIResetData(nsStyleStruct* aStartData, const nsCSSStruct& aData, + const nsStyleStruct* ComputeUIResetData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); #ifdef INCLUDE_XUL - const nsStyleStruct* ComputeXULData(nsStyleStruct* aStartXUL, const nsCSSStruct& aXULData, + const nsStyleStruct* ComputeXULData(nsStyleStruct* aStartXUL, const nsRuleDataStruct& aXULData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); #endif #ifdef MOZ_SVG - const nsStyleStruct* ComputeSVGData(nsStyleStruct* aStartSVG, const nsCSSStruct& aSVGData, + const nsStyleStruct* ComputeSVGData(nsStyleStruct* aStartSVG, const nsRuleDataStruct& aSVGData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, PRBool aInherited); @@ -498,7 +498,7 @@ protected: typedef const nsStyleStruct* (nsRuleNode::*ComputeStyleDataFn)(nsStyleStruct* aStartStruct, - const nsCSSStruct& aStartData, + const nsRuleDataStruct& aStartData, nsIStyleContext* aContext, nsRuleNode* aHighestNode, const RuleDetail& aRuleDetail, @@ -506,7 +506,7 @@ protected: static ComputeStyleDataFn gComputeStyleDataFn[]; - inline RuleDetail CheckSpecifiedProperties(const nsStyleStructID aSID, const nsCSSStruct& aCSSStruct); + inline RuleDetail CheckSpecifiedProperties(const nsStyleStructID aSID, const nsRuleDataStruct& aRuleDataStruct); const nsStyleStruct* GetParentData(const nsStyleStructID aSID); const nsStyleStruct* GetDisplayData(nsIStyleContext* aContext, PRBool aComputeData); diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index dee1196d0ef..6bbf26a5e9d 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -263,6 +263,7 @@ nsChangeHint nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont& (aFont1.sizeAdjust == aFont2.sizeAdjust) && (aFont1.style == aFont2.style) && (aFont1.variant == aFont2.variant) && + (aFont1.familyNameQuirks == aFont2.familyNameQuirks) && (aFont1.weight == aFont2.weight) && (aFont1.name == aFont2.name)) { if ((aFont1.decorations == aFont2.decorations)) {