get rid of nsStyleStruct base type. b=408933, r+sr=dbaron, a=beltzner

This commit is contained in:
dwitte@stanford.edu 2008-01-10 12:56:49 -08:00
Родитель 64d25e1d1e
Коммит 7e454eebf6
16 изменённых файлов: 228 добавлений и 251 удалений

Просмотреть файл

@ -1117,7 +1117,7 @@ nsFrameManager::ReResolveStyleContext(nsPresContext *aPresContext,
// assumeDifferenceHint forces the parent's change to be also
// applied to this frame, no matter what
// nsStyleStruct::CalcStyleDifference says. CalcStyleDifference
// nsStyleContext::CalcStyleDifference says. CalcStyleDifference
// can't be trusted because it assumes any changes to the parent
// style context provider will be automatically propagated to
// the frame(s) with child style contexts.

Просмотреть файл

@ -85,7 +85,6 @@ class nsIURI;
class nsILookAndFeel;
class nsICSSPseudoComparator;
class nsIAtom;
struct nsStyleStruct;
struct nsStyleBackground;
template <class T> class nsRunnableMethod;
class nsIRunnable;

Просмотреть файл

@ -36,7 +36,7 @@
*
* ***** END LICENSE BLOCK ***** */
/* constants used in the nsStyleStruct data provided by nsStyleContext */
/* constants used in the style struct data provided by nsStyleContext */
#ifndef nsStyleConsts_h___
#define nsStyleConsts_h___

Просмотреть файл

@ -288,7 +288,7 @@ however there is also a class nsStyleUIReset that holds the non-inherited
values, so we will use that one (remember, our property is not inherited).
Add a <a href="#StyleContextMember">data member</a>
to hold the value:
<pre>struct nsStyleUIReset: public nsStyleStruct {
<pre>struct nsStyleUIReset {
nsStyleUIReset(void);
nsStyleUIReset(const nsStyleUIReset&amp; aOther);
~nsStyleUIReset(void);
@ -471,9 +471,7 @@ style context. Access the new property and get its value. It is that simple.
For this example, it looks like this, in nsImageFrame:<br>
<pre> PRBool forceIcon = PR_FALSE;
const nsStyleUIReset* styleData;
GetStyleData(eStyleStruct_UIReset, (const nsStyleStruct*&amp;) styleData);
if (styleData-&gt;mForceBrokenImageIcon) {
if (GetStyleUIReset()-&gt;mForceBrokenImageIcon) {
forceIcon = PR_TRUE;
}

Просмотреть файл

@ -5635,7 +5635,7 @@ nsIFrame::UnsetProperty(nsIAtom* aPropName, nsresult* aStatus) const
aStatus);
}
/* virtual */ const nsStyleStruct*
/* virtual */ const void*
nsFrame::GetStyleDataExternal(nsStyleStructID aSID) const
{
NS_ASSERTION(mStyleContext, "unexpected null pointer");

Просмотреть файл

@ -411,7 +411,7 @@ public:
NS_IMETHOD CaptureMouse(nsPresContext* aPresContext, PRBool aGrabMouseEvents);
PRBool IsMouseCaptured(nsPresContext* aPresContext);
virtual const nsStyleStruct* GetStyleDataExternal(nsStyleStructID aSID) const;
virtual const void* GetStyleDataExternal(nsStyleStructID aSID) const;
#ifdef NS_DEBUG

Просмотреть файл

@ -641,16 +641,7 @@ public:
* The use of the typesafe functions below is preferred to direct use
* of this function.
*/
virtual const nsStyleStruct* GetStyleDataExternal(nsStyleStructID aSID) const = 0;
const nsStyleStruct* GetStyleData(nsStyleStructID aSID) const {
#ifdef _IMPL_NS_LAYOUT
NS_ASSERTION(mStyleContext, "No style context found!");
return mStyleContext->GetStyleData(aSID);
#else
return GetStyleDataExternal(aSID);
#endif
}
virtual const void* GetStyleDataExternal(nsStyleStructID aSID) const = 0;
/**
* Define typesafe getter functions for each style struct by

Просмотреть файл

@ -109,7 +109,7 @@ nsHTMLStyleSheet::GenericTableRule::List(FILE* out, PRInt32 aIndent) const
}
#endif
static void PostResolveCallback(nsStyleStruct* aStyleStruct, nsRuleData* aRuleData)
static void PostResolveCallback(void* aStyleStruct, nsRuleData* aRuleData)
{
nsStyleText* text = (nsStyleText*)aStyleStruct;
if (text->mTextAlign == NS_STYLE_TEXT_ALIGN_DEFAULT) {
@ -135,13 +135,13 @@ nsHTMLStyleSheet::TableTHRule::MapRuleInfoInto(nsRuleData* aRuleData)
}
static void
ProcessTableRulesAttribute(nsStyleStruct* aStyleStruct,
nsRuleData* aRuleData,
PRUint8 aSide,
PRBool aGroup,
PRUint8 aRulesArg1,
PRUint8 aRulesArg2,
PRUint8 aRulesArg3)
ProcessTableRulesAttribute(void* aStyleStruct,
nsRuleData* aRuleData,
PRUint8 aSide,
PRBool aGroup,
PRUint8 aRulesArg1,
PRUint8 aRulesArg2,
PRUint8 aRulesArg3)
{
if (!aStyleStruct || !aRuleData || !aRuleData->mPresContext) return;
@ -202,7 +202,7 @@ ProcessTableRulesAttribute(nsStyleStruct* aStyleStruct,
}
}
static void TbodyPostResolveCallback(nsStyleStruct* aStyleStruct, nsRuleData* aRuleData)
static void TbodyPostResolveCallback(void* aStyleStruct, nsRuleData* aRuleData)
{
::ProcessTableRulesAttribute(aStyleStruct, aRuleData, NS_SIDE_TOP, PR_TRUE, NS_STYLE_TABLE_RULES_ALL,
NS_STYLE_TABLE_RULES_GROUPS, NS_STYLE_TABLE_RULES_ROWS);
@ -221,7 +221,7 @@ nsHTMLStyleSheet::TableTbodyRule::MapRuleInfoInto(nsRuleData* aRuleData)
}
// -----------------------------------------------------------
static void RowPostResolveCallback(nsStyleStruct* aStyleStruct, nsRuleData* aRuleData)
static void RowPostResolveCallback(void* aStyleStruct, nsRuleData* aRuleData)
{
::ProcessTableRulesAttribute(aStyleStruct, aRuleData, NS_SIDE_TOP, PR_FALSE, NS_STYLE_TABLE_RULES_ALL,
NS_STYLE_TABLE_RULES_ROWS, NS_STYLE_TABLE_RULES_ROWS);
@ -239,7 +239,7 @@ nsHTMLStyleSheet::TableRowRule::MapRuleInfoInto(nsRuleData* aRuleData)
return NS_OK;
}
static void ColgroupPostResolveCallback(nsStyleStruct* aStyleStruct, nsRuleData* aRuleData)
static void ColgroupPostResolveCallback(void* aStyleStruct, nsRuleData* aRuleData)
{
::ProcessTableRulesAttribute(aStyleStruct, aRuleData, NS_SIDE_LEFT, PR_TRUE, NS_STYLE_TABLE_RULES_ALL,
NS_STYLE_TABLE_RULES_GROUPS, NS_STYLE_TABLE_RULES_COLS);
@ -257,7 +257,7 @@ nsHTMLStyleSheet::TableColgroupRule::MapRuleInfoInto(nsRuleData* aRuleData)
return NS_OK;
}
static void ColPostResolveCallback(nsStyleStruct* aStyleStruct, nsRuleData* aRuleData)
static void ColPostResolveCallback(void* aStyleStruct, nsRuleData* aRuleData)
{
::ProcessTableRulesAttribute(aStyleStruct, aRuleData, NS_SIDE_LEFT, PR_FALSE, NS_STYLE_TABLE_RULES_ALL,
NS_STYLE_TABLE_RULES_COLS, NS_STYLE_TABLE_RULES_COLS);
@ -265,7 +265,7 @@ static void ColPostResolveCallback(nsStyleStruct* aStyleStruct, nsRuleData* aRul
NS_STYLE_TABLE_RULES_COLS, NS_STYLE_TABLE_RULES_COLS);
}
static void UngroupedColPostResolveCallback(nsStyleStruct* aStyleStruct,
static void UngroupedColPostResolveCallback(void* aStyleStruct,
nsRuleData* aRuleData)
{
// Pass PR_TRUE for aGroup, so that we find the table's style

Просмотреть файл

@ -50,7 +50,7 @@ class nsPresContext;
class nsStyleContext;
struct nsRuleData;
typedef void (*nsPostResolveFunc)(nsStyleStruct* aStyleStruct, nsRuleData* aData);
typedef void (*nsPostResolveFunc)(void* aStyleStruct, nsRuleData* aData);
struct nsRuleData
{

Просмотреть файл

@ -1116,7 +1116,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID,
return result;
}
const nsStyleStruct*
const void*
nsRuleNode::GetDisplayData(nsStyleContext* aContext)
{
nsRuleDataDisplay displayData; // Declare a struct with null CSS values.
@ -1126,7 +1126,7 @@ nsRuleNode::GetDisplayData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_Display, aContext, &ruleData, &displayData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetVisibilityData(nsStyleContext* aContext)
{
nsRuleDataDisplay displayData; // Declare a struct with null CSS values.
@ -1136,7 +1136,7 @@ nsRuleNode::GetVisibilityData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_Visibility, aContext, &ruleData, &displayData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetTextData(nsStyleContext* aContext)
{
nsRuleDataText textData; // Declare a struct with null CSS values.
@ -1146,42 +1146,42 @@ nsRuleNode::GetTextData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_Text, aContext, &ruleData, &textData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetTextResetData(nsStyleContext* aContext)
{
nsRuleDataText textData; // Declare a struct with null CSS values.
nsRuleData ruleData(NS_STYLE_INHERIT_BIT(TextReset), mPresContext, aContext);
ruleData.mTextData = &textData;
const nsStyleStruct* res = WalkRuleTree(eStyleStruct_TextReset, aContext, &ruleData, &textData);
const void* res = WalkRuleTree(eStyleStruct_TextReset, aContext, &ruleData, &textData);
textData.mTextShadow = nsnull; // We are sharing with some style rule. It really owns the data.
return res;
}
const nsStyleStruct*
const void*
nsRuleNode::GetUserInterfaceData(nsStyleContext* aContext)
{
nsRuleDataUserInterface uiData; // Declare a struct with null CSS values.
nsRuleData ruleData(NS_STYLE_INHERIT_BIT(UserInterface), mPresContext, aContext);
ruleData.mUserInterfaceData = &uiData;
const nsStyleStruct* res = WalkRuleTree(eStyleStruct_UserInterface, aContext, &ruleData, &uiData);
const void* res = WalkRuleTree(eStyleStruct_UserInterface, aContext, &ruleData, &uiData);
uiData.mCursor = nsnull; // We are sharing with some style rule. It really owns the data.
return res;
}
const nsStyleStruct*
const void*
nsRuleNode::GetUIResetData(nsStyleContext* aContext)
{
nsRuleDataUserInterface uiData; // Declare a struct with null CSS values.
nsRuleData ruleData(NS_STYLE_INHERIT_BIT(UIReset), mPresContext, aContext);
ruleData.mUserInterfaceData = &uiData;
const nsStyleStruct* res = WalkRuleTree(eStyleStruct_UIReset, aContext, &ruleData, &uiData);
const void* res = WalkRuleTree(eStyleStruct_UIReset, aContext, &ruleData, &uiData);
return res;
}
const nsStyleStruct*
const void*
nsRuleNode::GetFontData(nsStyleContext* aContext)
{
nsRuleDataFont fontData; // Declare a struct with null CSS values.
@ -1191,7 +1191,7 @@ nsRuleNode::GetFontData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_Font, aContext, &ruleData, &fontData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetColorData(nsStyleContext* aContext)
{
nsRuleDataColor colorData; // Declare a struct with null CSS values.
@ -1201,7 +1201,7 @@ nsRuleNode::GetColorData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_Color, aContext, &ruleData, &colorData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetBackgroundData(nsStyleContext* aContext)
{
nsRuleDataColor colorData; // Declare a struct with null CSS values.
@ -1211,7 +1211,7 @@ nsRuleNode::GetBackgroundData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_Background, aContext, &ruleData, &colorData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetMarginData(nsStyleContext* aContext)
{
nsRuleDataMargin marginData; // Declare a struct with null CSS values.
@ -1221,7 +1221,7 @@ nsRuleNode::GetMarginData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_Margin, aContext, &ruleData, &marginData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetBorderData(nsStyleContext* aContext)
{
nsRuleDataMargin marginData; // Declare a struct with null CSS values.
@ -1231,7 +1231,7 @@ nsRuleNode::GetBorderData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_Border, aContext, &ruleData, &marginData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetPaddingData(nsStyleContext* aContext)
{
nsRuleDataMargin marginData; // Declare a struct with null CSS values.
@ -1241,7 +1241,7 @@ nsRuleNode::GetPaddingData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_Padding, aContext, &ruleData, &marginData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetOutlineData(nsStyleContext* aContext)
{
nsRuleDataMargin marginData; // Declare a struct with null CSS values.
@ -1251,7 +1251,7 @@ nsRuleNode::GetOutlineData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_Outline, aContext, &ruleData, &marginData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetListData(nsStyleContext* aContext)
{
nsRuleDataList listData; // Declare a struct with null CSS values.
@ -1261,7 +1261,7 @@ nsRuleNode::GetListData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_List, aContext, &ruleData, &listData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetPositionData(nsStyleContext* aContext)
{
nsRuleDataPosition posData; // Declare a struct with null CSS values.
@ -1271,7 +1271,7 @@ nsRuleNode::GetPositionData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_Position, aContext, &ruleData, &posData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetTableData(nsStyleContext* aContext)
{
nsRuleDataTable tableData; // Declare a struct with null CSS values.
@ -1281,7 +1281,7 @@ nsRuleNode::GetTableData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_Table, aContext, &ruleData, &tableData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetTableBorderData(nsStyleContext* aContext)
{
nsRuleDataTable tableData; // Declare a struct with null CSS values.
@ -1291,32 +1291,32 @@ nsRuleNode::GetTableBorderData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_TableBorder, aContext, &ruleData, &tableData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetContentData(nsStyleContext* aContext)
{
nsRuleDataContent contentData; // Declare a struct with null CSS values.
nsRuleData ruleData(NS_STYLE_INHERIT_BIT(Content), mPresContext, aContext);
ruleData.mContentData = &contentData;
const nsStyleStruct* res = WalkRuleTree(eStyleStruct_Content, aContext, &ruleData, &contentData);
const void* res = WalkRuleTree(eStyleStruct_Content, aContext, &ruleData, &contentData);
contentData.mCounterIncrement = contentData.mCounterReset = nsnull;
contentData.mContent = nsnull; // We are sharing with some style rule. It really owns the data.
return res;
}
const nsStyleStruct*
const void*
nsRuleNode::GetQuotesData(nsStyleContext* aContext)
{
nsRuleDataContent contentData; // Declare a struct with null CSS values.
nsRuleData ruleData(NS_STYLE_INHERIT_BIT(Quotes), mPresContext, aContext);
ruleData.mContentData = &contentData;
const nsStyleStruct* res = WalkRuleTree(eStyleStruct_Quotes, aContext, &ruleData, &contentData);
const void* res = WalkRuleTree(eStyleStruct_Quotes, aContext, &ruleData, &contentData);
contentData.mQuotes = nsnull; // We are sharing with some style rule. It really owns the data.
return res;
}
const nsStyleStruct*
const void*
nsRuleNode::GetXULData(nsStyleContext* aContext)
{
nsRuleDataXUL xulData; // Declare a struct with null CSS values.
@ -1326,7 +1326,7 @@ nsRuleNode::GetXULData(nsStyleContext* aContext)
return WalkRuleTree(eStyleStruct_XUL, aContext, &ruleData, &xulData);
}
const nsStyleStruct*
const void*
nsRuleNode::GetColumnData(nsStyleContext* aContext)
{
nsRuleDataColumn columnData; // Declare a struct with null CSS values.
@ -1337,19 +1337,19 @@ nsRuleNode::GetColumnData(nsStyleContext* aContext)
}
#ifdef MOZ_SVG
const nsStyleStruct*
const void*
nsRuleNode::GetSVGData(nsStyleContext* aContext)
{
nsRuleDataSVG svgData; // Declare a struct with null CSS values.
nsRuleData ruleData(NS_STYLE_INHERIT_BIT(SVG), mPresContext, aContext);
ruleData.mSVGData = &svgData;
const nsStyleStruct *res = WalkRuleTree(eStyleStruct_SVG, aContext, &ruleData, &svgData);
const void *res = WalkRuleTree(eStyleStruct_SVG, aContext, &ruleData, &svgData);
svgData.mStrokeDasharray = nsnull; // We are sharing with some style rule. It really owns the data.
return res;
}
const nsStyleStruct*
const void*
nsRuleNode::GetSVGResetData(nsStyleContext* aContext)
{
nsRuleDataSVG svgData; // Declare a struct with null CSS values.
@ -1360,14 +1360,14 @@ nsRuleNode::GetSVGResetData(nsStyleContext* aContext)
}
#endif
const nsStyleStruct*
const void*
nsRuleNode::WalkRuleTree(const nsStyleStructID aSID,
nsStyleContext* aContext,
nsRuleData* aRuleData,
nsRuleDataStruct* aSpecificData)
{
// We start at the most specific rule in the tree.
nsStyleStruct* startStruct = nsnull;
void* startStruct = nsnull;
nsRuleNode* ruleNode = this;
nsRuleNode* highestNode = nsnull; // The highest node in the rule tree
@ -1485,9 +1485,9 @@ nsRuleNode::WalkRuleTree(const nsStyleStructID aSID,
// Set the inherit bits on our context. These bits tell the style context that
// it never has to go back to the rule tree for data. Instead the style context tree
// should be walked to find the data.
const nsStyleStruct* parentStruct = parentContext->GetStyleData(aSID);
const void* parentStruct = parentContext->GetStyleData(aSID);
aContext->AddStyleBit(bit); // makes const_cast OK.
aContext->SetStyle(aSID, const_cast<nsStyleStruct*>(parentStruct));
aContext->SetStyle(aSID, const_cast<void*>(parentStruct));
return parentStruct;
}
else
@ -1497,7 +1497,7 @@ nsRuleNode::WalkRuleTree(const nsStyleStructID aSID,
}
// We need to compute the data from the information that the rules specified.
const nsStyleStruct* res;
const void* res;
#define STYLE_STRUCT_TEST aSID
#define STYLE_STRUCT(name, checkdata_cb, ctor_args) \
res = Compute##name##Data(startStruct, *aSpecificData, aContext, \
@ -1508,13 +1508,13 @@ nsRuleNode::WalkRuleTree(const nsStyleStructID aSID,
// If we have a post-resolve callback, handle that now.
if (aRuleData->mPostResolveCallback && (NS_LIKELY(res != nsnull)))
(*aRuleData->mPostResolveCallback)((nsStyleStruct*)res, aRuleData);
(*aRuleData->mPostResolveCallback)(const_cast<void*>(res), aRuleData);
// Now return the result.
return res;
}
const nsStyleStruct*
const void*
nsRuleNode::SetDefaultOnRoot(const nsStyleStructID aSID, nsStyleContext* aContext)
{
switch (aSID) {
@ -2492,7 +2492,7 @@ nsRuleNode::SetGenericFont(nsPresContext* aPresContext,
// XXX Not sure if we need to do this here
// If we have a post-resolve callback, handle that now.
if (ruleData.mPostResolveCallback)
(ruleData.mPostResolveCallback)((nsStyleStruct*)aFont, &ruleData);
(ruleData.mPostResolveCallback)(aFont, &ruleData);
parentFont = *aFont;
}
@ -2510,8 +2510,8 @@ static PRBool ExtractGeneric(const nsString& aFamily, PRBool aGeneric,
return PR_TRUE;
}
const nsStyleStruct*
nsRuleNode::ComputeFontData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeFontData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -2603,8 +2603,8 @@ nsRuleNode::ComputeFontData(nsStyleStruct* aStartStruct,
COMPUTE_END_INHERITED(Font, font)
}
const nsStyleStruct*
nsRuleNode::ComputeTextData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeTextData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -2710,8 +2710,8 @@ nsRuleNode::ComputeTextData(nsStyleStruct* aStartStruct,
COMPUTE_END_INHERITED(Text, text)
}
const nsStyleStruct*
nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeTextResetData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -2769,8 +2769,8 @@ nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartStruct,
COMPUTE_END_RESET(TextReset, text)
}
const nsStyleStruct*
nsRuleNode::ComputeUserInterfaceData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeUserInterfaceData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -2888,8 +2888,8 @@ nsRuleNode::ComputeUserInterfaceData(nsStyleStruct* aStartStruct,
COMPUTE_END_INHERITED(UserInterface, ui)
}
const nsStyleStruct*
nsRuleNode::ComputeUIResetData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeUIResetData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -2941,8 +2941,8 @@ nsRuleNode::ComputeUIResetData(nsStyleStruct* aStartStruct,
COMPUTE_END_RESET(UIReset, ui)
}
const nsStyleStruct*
nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeDisplayData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -3303,8 +3303,8 @@ nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct,
COMPUTE_END_RESET(Display, display)
}
const nsStyleStruct*
nsRuleNode::ComputeVisibilityData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeVisibilityData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -3361,8 +3361,8 @@ nsRuleNode::ComputeVisibilityData(nsStyleStruct* aStartStruct,
COMPUTE_END_INHERITED(Visibility, visibility)
}
const nsStyleStruct*
nsRuleNode::ComputeColorData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeColorData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -3390,8 +3390,8 @@ nsRuleNode::ComputeColorData(nsStyleStruct* aStartStruct,
COMPUTE_END_INHERITED(Color, color)
}
const nsStyleStruct*
nsRuleNode::ComputeBackgroundData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeBackgroundData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -3577,8 +3577,8 @@ nsRuleNode::ComputeBackgroundData(nsStyleStruct* aStartStruct,
COMPUTE_END_RESET(Background, bg)
}
const nsStyleStruct*
nsRuleNode::ComputeMarginData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeMarginData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -3613,8 +3613,8 @@ nsRuleNode::ComputeMarginData(nsStyleStruct* aStartStruct,
COMPUTE_END_RESET(Margin, margin)
}
const nsStyleStruct*
nsRuleNode::ComputeBorderData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeBorderData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -3818,8 +3818,8 @@ nsRuleNode::ComputeBorderData(nsStyleStruct* aStartStruct,
COMPUTE_END_RESET(Border, border)
}
const nsStyleStruct*
nsRuleNode::ComputePaddingData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputePaddingData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -3854,8 +3854,8 @@ nsRuleNode::ComputePaddingData(nsStyleStruct* aStartStruct,
COMPUTE_END_RESET(Padding, padding)
}
const nsStyleStruct*
nsRuleNode::ComputeOutlineData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeOutlineData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -3942,8 +3942,8 @@ nsRuleNode::ComputeOutlineData(nsStyleStruct* aStartStruct,
COMPUTE_END_RESET(Outline, outline)
}
const nsStyleStruct*
nsRuleNode::ComputeListData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeListData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -4027,8 +4027,8 @@ nsRuleNode::ComputeListData(nsStyleStruct* aStartStruct,
COMPUTE_END_INHERITED(List, list)
}
const nsStyleStruct*
nsRuleNode::ComputePositionData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputePositionData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -4094,8 +4094,8 @@ nsRuleNode::ComputePositionData(nsStyleStruct* aStartStruct,
COMPUTE_END_RESET(Position, pos)
}
const nsStyleStruct*
nsRuleNode::ComputeTableData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeTableData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -4135,8 +4135,8 @@ nsRuleNode::ComputeTableData(nsStyleStruct* aStartStruct,
COMPUTE_END_RESET(Table, table)
}
const nsStyleStruct*
nsRuleNode::ComputeTableBorderData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeTableBorderData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -4197,8 +4197,8 @@ nsRuleNode::ComputeTableBorderData(nsStyleStruct* aStartStruct,
COMPUTE_END_INHERITED(TableBorder, table)
}
const nsStyleStruct*
nsRuleNode::ComputeContentData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeContentData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -4384,8 +4384,8 @@ nsRuleNode::ComputeContentData(nsStyleStruct* aStartStruct,
COMPUTE_END_RESET(Content, content)
}
const nsStyleStruct*
nsRuleNode::ComputeQuotesData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeQuotesData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -4401,7 +4401,7 @@ nsRuleNode::ComputeQuotesData(nsStyleStruct* aStartStruct,
if (ourQuotes) {
nsAutoString closeBuffer;
// FIXME Bug 389406: Implement eCSSUnit_Initial (correctly, unlike
// nsStyleStruct), and remove the "initial" value from ua.css.
// style structs), and remove the "initial" value from ua.css.
if (eCSSUnit_Inherit == ourQuotes->mOpen.GetUnit()) {
inherited = PR_TRUE;
count = parentQuotes->QuotesCount();
@ -4439,8 +4439,8 @@ nsRuleNode::ComputeQuotesData(nsStyleStruct* aStartStruct,
COMPUTE_END_INHERITED(Quotes, quotes)
}
const nsStyleStruct*
nsRuleNode::ComputeXULData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeXULData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -4521,8 +4521,8 @@ nsRuleNode::ComputeXULData(nsStyleStruct* aStartStruct,
COMPUTE_END_RESET(XUL, xul)
}
const nsStyleStruct*
nsRuleNode::ComputeColumnData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeColumnData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -4609,8 +4609,8 @@ SetSVGOpacity(const nsCSSValue& aValue, float parentOpacity, float& opacity, PRB
}
}
const nsStyleStruct*
nsRuleNode::ComputeSVGData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeSVGData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -4879,8 +4879,8 @@ nsRuleNode::ComputeSVGData(nsStyleStruct* aStartStruct,
COMPUTE_END_INHERITED(SVG, svg)
}
const nsStyleStruct*
nsRuleNode::ComputeSVGResetData(nsStyleStruct* aStartStruct,
const void*
nsRuleNode::ComputeSVGResetData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
@ -4970,7 +4970,7 @@ nsRuleNode::ComputeSVGResetData(nsStyleStruct* aStartStruct,
}
#endif
inline const nsStyleStruct*
inline const void*
nsRuleNode::GetParentData(const nsStyleStructID aSID)
{
NS_PRECONDITION(mDependentBits & nsCachedStyleData::GetBitForSID(aSID),
@ -5014,12 +5014,12 @@ nsRuleNode::GetParent##name_() \
#include "nsStyleStructList.h"
#undef STYLE_STRUCT
const nsStyleStruct*
const void*
nsRuleNode::GetStyleData(nsStyleStructID aSID,
nsStyleContext* aContext,
PRBool aComputeData)
{
const nsStyleStruct *data;
const void *data;
if (mDependentBits & nsCachedStyleData::GetBitForSID(aSID)) {
// We depend on an ancestor for this struct since the cached struct
// it has is also appropriate for this rule node. Just go up the

Просмотреть файл

@ -193,7 +193,7 @@ struct nsCachedStyleData
return 1 << aSID;
}
NS_HIDDEN_(nsStyleStruct*) NS_FASTCALL GetStyleData(const nsStyleStructID& aSID) {
NS_HIDDEN_(void*) NS_FASTCALL GetStyleData(const nsStyleStructID& aSID) {
// Each struct is stored at this.m##type##Data->m##name##Data where
// |type| is either Inherit or Reset, and |name| is the name of the
// style struct. The |gInfo| stores the offset of the appropriate
@ -214,12 +214,12 @@ struct nsCachedStyleData
// Get either mInheritedData or mResetData.
char* resetOrInherit = reinterpret_cast<char*>(*reinterpret_cast<void**>(resetOrInheritSlot));
nsStyleStruct* data = nsnull;
void* data = nsnull;
if (resetOrInherit) {
// If we have the mInheritedData or mResetData, then we might have
// the struct, so get it.
char* dataSlot = resetOrInherit + info.mInheritResetOffset;
data = *reinterpret_cast<nsStyleStruct**>(dataSlot);
data = *reinterpret_cast<void**>(dataSlot);
}
return data;
}
@ -451,149 +451,149 @@ protected:
nsRuleNode* aHighestNode);
NS_HIDDEN_(void) PropagateNoneBit(PRUint32 aBit, nsRuleNode* aHighestNode);
NS_HIDDEN_(const nsStyleStruct*) SetDefaultOnRoot(const nsStyleStructID aSID,
nsStyleContext* aContext);
NS_HIDDEN_(const void*) SetDefaultOnRoot(const nsStyleStructID aSID,
nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*)
NS_HIDDEN_(const void*)
WalkRuleTree(const nsStyleStructID aSID, nsStyleContext* aContext,
nsRuleData* aRuleData, nsRuleDataStruct* aSpecificData);
NS_HIDDEN_(const nsStyleStruct*)
ComputeDisplayData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeDisplayData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeVisibilityData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeVisibilityData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeFontData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeFontData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeColorData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeColorData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeBackgroundData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeBackgroundData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeMarginData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeMarginData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeBorderData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeBorderData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputePaddingData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputePaddingData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeOutlineData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeOutlineData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeListData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeListData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputePositionData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputePositionData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeTableData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeTableData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeTableBorderData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeTableBorderData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeContentData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeContentData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeQuotesData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeQuotesData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeTextData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeTextData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeTextResetData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeTextResetData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeUserInterfaceData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeUserInterfaceData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeUIResetData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeUIResetData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeXULData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeXULData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeColumnData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeColumnData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
#ifdef MOZ_SVG
NS_HIDDEN_(const nsStyleStruct*)
ComputeSVGData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeSVGData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
NS_HIDDEN_(const nsStyleStruct*)
ComputeSVGResetData(nsStyleStruct* aStartStruct,
NS_HIDDEN_(const void*)
ComputeSVGResetData(void* aStartStruct,
const nsRuleDataStruct& aData,
nsStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail, PRBool aInherited);
@ -637,40 +637,38 @@ protected:
inline RuleDetail CheckSpecifiedProperties(const nsStyleStructID aSID, const nsRuleDataStruct& aRuleDataStruct);
NS_HIDDEN_(const nsStyleStruct*) GetParentData(const nsStyleStructID aSID);
NS_HIDDEN_(const void*) GetParentData(const nsStyleStructID aSID);
#define STYLE_STRUCT(name_, checkdata_cb_, ctor_args_) \
NS_HIDDEN_(const nsStyle##name_*) GetParent##name_();
#include "nsStyleStructList.h"
#undef STYLE_STRUCT
NS_HIDDEN_(const nsStyleStruct*) GetDisplayData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetVisibilityData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetFontData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetColorData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetBackgroundData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetMarginData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetBorderData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetPaddingData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetOutlineData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetListData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetPositionData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetTableData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*)
GetTableBorderData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetDisplayData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetVisibilityData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetFontData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetColorData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetBackgroundData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetMarginData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetBorderData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetPaddingData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetOutlineData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetListData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetPositionData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetTableData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetTableBorderData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetContentData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetQuotesData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetTextData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetTextResetData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*)
GetUserInterfaceData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetContentData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetQuotesData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetTextData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetTextResetData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetUserInterfaceData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetUIResetData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetXULData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetColumnData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetUIResetData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetXULData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetColumnData(nsStyleContext* aContext);
#ifdef MOZ_SVG
NS_HIDDEN_(const nsStyleStruct*) GetSVGData(nsStyleContext* aContext);
NS_HIDDEN_(const nsStyleStruct*) GetSVGResetData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetSVGData(nsStyleContext* aContext);
NS_HIDDEN_(const void*) GetSVGResetData(nsStyleContext* aContext);
#endif
private:
@ -703,9 +701,9 @@ public:
// NOTE: Does not |AddRef|.
nsPresContext* GetPresContext() const { return mPresContext; }
NS_HIDDEN_(const nsStyleStruct*) GetStyleData(nsStyleStructID aSID,
nsStyleContext* aContext,
PRBool aComputeData);
NS_HIDDEN_(const void*) GetStyleData(nsStyleStructID aSID,
nsStyleContext* aContext,
PRBool aComputeData);
#define STYLE_STRUCT(name_, checkdata_cb_, ctor_args_) \
NS_HIDDEN_(const nsStyle##name_*) \

Просмотреть файл

@ -214,9 +214,9 @@ PRBool nsStyleContext::Equals(const nsStyleContext* aOther) const
//=========================================================================================================
const nsStyleStruct* nsStyleContext::GetStyleData(nsStyleStructID aSID)
const void* nsStyleContext::GetStyleData(nsStyleStructID aSID)
{
const nsStyleStruct* cachedData = mCachedStyleData.GetStyleData(aSID);
const void* cachedData = mCachedStyleData.GetStyleData(aSID);
if (cachedData)
return cachedData; // We have computed data stored on this node in the context tree.
return mRuleNode->GetStyleData(aSID, this, PR_TRUE); // Our rule node will take care of it for us.
@ -235,9 +235,9 @@ const nsStyleStruct* nsStyleContext::GetStyleData(nsStyleStructID aSID)
#include "nsStyleStructList.h"
#undef STYLE_STRUCT
inline const nsStyleStruct* nsStyleContext::PeekStyleData(nsStyleStructID aSID)
inline const void* nsStyleContext::PeekStyleData(nsStyleStructID aSID)
{
const nsStyleStruct* cachedData = mCachedStyleData.GetStyleData(aSID);
const void* cachedData = mCachedStyleData.GetStyleData(aSID);
if (cachedData)
return cachedData; // We have computed data stored on this node in the context tree.
return mRuleNode->GetStyleData(aSID, this, PR_FALSE); // Our rule node will take care of it for us.
@ -246,7 +246,7 @@ inline const nsStyleStruct* nsStyleContext::PeekStyleData(nsStyleStructID aSID)
// This is an evil evil function, since it forces you to alloc your own separate copy of
// style data! Do not use this function unless you absolutely have to! You should avoid
// this at all costs! -dwh
nsStyleStruct*
void*
nsStyleContext::GetUniqueStyleData(const nsStyleStructID& aSID)
{
// If we already own the struct and no kids could depend on it, then
@ -254,13 +254,13 @@ nsStyleContext::GetUniqueStyleData(const nsStyleStructID& aSID)
// function really shouldn't be called for style contexts that could
// have kids depending on the data. ClearStyleData would be OK, but
// this test for no mChild or mEmptyChild doesn't catch that case.)
const nsStyleStruct *current = GetStyleData(aSID);
const void *current = GetStyleData(aSID);
if (!mChild && !mEmptyChild &&
!(mBits & nsCachedStyleData::GetBitForSID(aSID)) &&
mCachedStyleData.GetStyleData(aSID))
return const_cast<nsStyleStruct*>(current);
return const_cast<void*>(current);
nsStyleStruct* result;
void* result;
nsPresContext *presContext = PresContext();
switch (aSID) {
@ -283,9 +283,9 @@ nsStyleContext::GetUniqueStyleData(const nsStyleStructID& aSID)
}
if (!result) {
NS_WARNING("Ran out of memory while trying to allocate memory for a unique nsStyleStruct! "
NS_WARNING("Ran out of memory while trying to allocate memory for a unique style struct! "
"Returning the non-unique data.");
return const_cast<nsStyleStruct*>(current);
return const_cast<void*>(current);
}
SetStyle(aSID, result);
@ -295,7 +295,7 @@ nsStyleContext::GetUniqueStyleData(const nsStyleStructID& aSID)
}
void
nsStyleContext::SetStyle(nsStyleStructID aSID, nsStyleStruct* aStruct)
nsStyleContext::SetStyle(nsStyleStructID aSID, void* aStruct)
{
// This method should only be called from nsRuleNode! It is not a public
// method!
@ -325,7 +325,7 @@ nsStyleContext::SetStyle(nsStyleStructID aSID, nsStyleStruct* aStruct)
}
}
char* dataSlot = resetOrInherit + info.mInheritResetOffset;
*reinterpret_cast<nsStyleStruct**>(dataSlot) = aStruct;
*reinterpret_cast<void**>(dataSlot) = aStruct;
}
void

Просмотреть файл

@ -109,7 +109,7 @@ public:
NS_HIDDEN_(PRBool) Equals(const nsStyleContext* aOther) const;
PRBool HasTextDecorations() { return !!(mBits & NS_STYLE_HAS_TEXT_DECORATIONS); }
NS_HIDDEN_(void) SetStyle(nsStyleStructID aSID, nsStyleStruct* aStruct);
NS_HIDDEN_(void) SetStyle(nsStyleStructID aSID, void* aStruct);
nsRuleNode* GetRuleNode() { return mRuleNode; }
void AddStyleBit(const PRUint32& aBit) { mBits |= aBit; }
@ -134,11 +134,8 @@ public:
*
* The typesafe functions below are preferred to the use of this
* function.
*
* See also |nsIFrame::GetStyleData| and the other global
* |GetStyleData| in nsIFrame.h.
*/
NS_HIDDEN_(const nsStyleStruct*) NS_FASTCALL GetStyleData(nsStyleStructID aSID);
NS_HIDDEN_(const void*) NS_FASTCALL GetStyleData(nsStyleStructID aSID);
/**
* Define typesafe getter functions for each style struct by
@ -154,9 +151,9 @@ public:
#undef STYLE_STRUCT
NS_HIDDEN_(const nsStyleStruct*) PeekStyleData(nsStyleStructID aSID);
NS_HIDDEN_(const void*) PeekStyleData(nsStyleStructID aSID);
NS_HIDDEN_(nsStyleStruct*) GetUniqueStyleData(const nsStyleStructID& aSID);
NS_HIDDEN_(void*) GetUniqueStyleData(const nsStyleStructID& aSID);
NS_HIDDEN_(nsChangeHint) CalcStyleDifference(nsStyleContext* aOther);

Просмотреть файл

@ -82,13 +82,9 @@ class imgIRequest;
#define NS_RULE_NODE_LEVEL_MASK 0xf0000000
#define NS_RULE_NODE_LEVEL_SHIFT 28
// The actual structs start here
struct nsStyleStruct {
};
// The lifetime of these objects is managed by the presshell's arena.
struct nsStyleFont : public nsStyleStruct {
struct nsStyleFont {
nsStyleFont(const nsFont& aFont, nsPresContext *aPresContext);
nsStyleFont(const nsStyleFont& aStyleFont);
nsStyleFont(nsPresContext *aPresContext);
@ -123,7 +119,7 @@ struct nsStyleFont : public nsStyleStruct {
#endif
};
struct nsStyleColor : public nsStyleStruct {
struct nsStyleColor {
nsStyleColor(nsPresContext* aPresContext);
nsStyleColor(const nsStyleColor& aOther);
~nsStyleColor(void) {}
@ -146,7 +142,7 @@ struct nsStyleColor : public nsStyleStruct {
nscolor mColor; // [inherited]
};
struct nsStyleBackground : public nsStyleStruct {
struct nsStyleBackground {
nsStyleBackground(nsPresContext* aPresContext);
nsStyleBackground(const nsStyleBackground& aOther);
~nsStyleBackground();
@ -211,7 +207,7 @@ struct nsStyleBackground : public nsStyleStruct {
#define NS_SPACING_BORDER 2
struct nsStyleMargin: public nsStyleStruct {
struct nsStyleMargin {
nsStyleMargin(void);
nsStyleMargin(const nsStyleMargin& aMargin);
~nsStyleMargin(void) {}
@ -242,7 +238,7 @@ protected:
};
struct nsStylePadding: public nsStyleStruct {
struct nsStylePadding {
nsStylePadding(void);
nsStylePadding(const nsStylePadding& aPadding);
~nsStylePadding(void) {}
@ -322,7 +318,7 @@ struct nsBorderColors {
((l) > 0) ? PR_MAX( (tpp), ((l) + ((tpp) / 2)) / (tpp) * (tpp)) : \
PR_MIN(-(tpp), ((l) - ((tpp) / 2)) / (tpp) * (tpp)))
struct nsStyleBorder: public nsStyleStruct {
struct nsStyleBorder {
nsStyleBorder(nsPresContext* aContext);
nsStyleBorder(const nsStyleBorder& aBorder);
~nsStyleBorder(void) {
@ -503,7 +499,7 @@ protected:
};
struct nsStyleOutline: public nsStyleStruct {
struct nsStyleOutline {
nsStyleOutline(nsPresContext* aPresContext);
nsStyleOutline(const nsStyleOutline& aOutline);
~nsStyleOutline(void) {}
@ -604,7 +600,7 @@ protected:
};
struct nsStyleList : public nsStyleStruct {
struct nsStyleList {
nsStyleList(void);
nsStyleList(const nsStyleList& aStyleList);
~nsStyleList(void);
@ -628,7 +624,7 @@ struct nsStyleList : public nsStyleStruct {
nsRect mImageRegion; // [inherited] the rect to use within an image
};
struct nsStylePosition : public nsStyleStruct {
struct nsStylePosition {
nsStylePosition(void);
nsStylePosition(const nsStylePosition& aOther);
~nsStylePosition(void);
@ -657,7 +653,7 @@ struct nsStylePosition : public nsStyleStruct {
nsStyleCoord mZIndex; // [reset]
};
struct nsStyleTextReset : public nsStyleStruct {
struct nsStyleTextReset {
nsStyleTextReset(void);
nsStyleTextReset(const nsStyleTextReset& aOther);
~nsStyleTextReset(void);
@ -681,7 +677,7 @@ struct nsStyleTextReset : public nsStyleStruct {
nsStyleCoord mVerticalAlign; // [reset] see nsStyleConsts.h for enums
};
struct nsStyleText : public nsStyleStruct {
struct nsStyleText {
nsStyleText(void);
nsStyleText(const nsStyleText& aOther);
~nsStyleText(void);
@ -719,7 +715,7 @@ struct nsStyleText : public nsStyleStruct {
}
};
struct nsStyleVisibility : public nsStyleStruct {
struct nsStyleVisibility {
nsStyleVisibility(nsPresContext* aPresContext);
nsStyleVisibility(const nsStyleVisibility& aVisibility);
~nsStyleVisibility() {}
@ -751,7 +747,7 @@ struct nsStyleVisibility : public nsStyleStruct {
}
};
struct nsStyleDisplay : public nsStyleStruct {
struct nsStyleDisplay {
nsStyleDisplay();
nsStyleDisplay(const nsStyleDisplay& aOther);
~nsStyleDisplay() {}
@ -843,7 +839,7 @@ struct nsStyleDisplay : public nsStyleStruct {
}
};
struct nsStyleTable: public nsStyleStruct {
struct nsStyleTable {
nsStyleTable(void);
nsStyleTable(const nsStyleTable& aOther);
~nsStyleTable(void);
@ -868,7 +864,7 @@ struct nsStyleTable: public nsStyleStruct {
PRInt32 mSpan; // [reset] the number of columns spanned by a colgroup or col
};
struct nsStyleTableBorder: public nsStyleStruct {
struct nsStyleTableBorder {
nsStyleTableBorder(nsPresContext* aContext);
nsStyleTableBorder(const nsStyleTableBorder& aOther);
~nsStyleTableBorder(void);
@ -934,7 +930,7 @@ struct nsStyleCounterData {
#define DELETE_ARRAY_IF(array) if (array) { delete[] array; array = nsnull; }
struct nsStyleQuotes : public nsStyleStruct {
struct nsStyleQuotes {
nsStyleQuotes();
nsStyleQuotes(const nsStyleQuotes& aQuotes);
~nsStyleQuotes();
@ -1004,7 +1000,7 @@ protected:
nsString* mQuotes;
};
struct nsStyleContent: public nsStyleStruct {
struct nsStyleContent {
nsStyleContent(void);
nsStyleContent(const nsStyleContent& aContent);
~nsStyleContent(void);
@ -1109,7 +1105,7 @@ protected:
nsStyleCounterData* mResets;
};
struct nsStyleUIReset: public nsStyleStruct {
struct nsStyleUIReset {
nsStyleUIReset(void);
nsStyleUIReset(const nsStyleUIReset& aOther);
~nsStyleUIReset(void);
@ -1140,7 +1136,7 @@ struct nsCursorImage {
nsCursorImage();
};
struct nsStyleUserInterface: public nsStyleStruct {
struct nsStyleUserInterface {
nsStyleUserInterface(void);
nsStyleUserInterface(const nsStyleUserInterface& aOther);
~nsStyleUserInterface(void);
@ -1175,7 +1171,7 @@ struct nsStyleUserInterface: public nsStyleStruct {
void CopyCursorArrayFrom(const nsStyleUserInterface& aSource);
};
struct nsStyleXUL : public nsStyleStruct {
struct nsStyleXUL {
nsStyleXUL();
nsStyleXUL(const nsStyleXUL& aSource);
~nsStyleXUL();
@ -1201,7 +1197,7 @@ struct nsStyleXUL : public nsStyleStruct {
PRUint8 mBoxPack; // [reset] see nsStyleConsts.h
};
struct nsStyleColumn : public nsStyleStruct {
struct nsStyleColumn {
nsStyleColumn();
nsStyleColumn(const nsStyleColumn& aSource);
~nsStyleColumn();
@ -1251,7 +1247,7 @@ struct nsStyleSVGPaint
}
};
struct nsStyleSVG : public nsStyleStruct {
struct nsStyleSVG {
nsStyleSVG();
nsStyleSVG(const nsStyleSVG& aSource);
~nsStyleSVG();
@ -1296,7 +1292,7 @@ struct nsStyleSVG : public nsStyleStruct {
PRUint8 mTextRendering; // [inherited] see nsStyleConsts.h
};
struct nsStyleSVGReset : public nsStyleStruct {
struct nsStyleSVGReset {
nsStyleSVGReset();
nsStyleSVGReset(const nsStyleSVGReset& aSource);
~nsStyleSVGReset();

Просмотреть файл

@ -60,8 +60,6 @@ nsStyleStructID_Length /* one past the end; length of 0-based list */
};
struct nsStyleStruct;
// A bit corresponding to each struct ID
#define NS_STYLE_INHERIT_BIT(sid_) (1 << PRInt32(eStyleStruct_##sid_))

Просмотреть файл

@ -3,7 +3,7 @@
<!--
-->
<head>
<title>Test for nsStyleStruct copy constructors</title>
<title>Test for style struct copy constructors</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="property_database.js"></script>
@ -21,7 +21,7 @@
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for nsStyleStruct copy constructors **/
/** Test for style struct copy constructors **/
/**
* XXX Why doesn't putting a bug in the nsStyleFont copy-constructor for