Revert 9ef12a27ab14 and c87e6a6a41bb (patches 6 and 7 from bug 435441) which are no longer needed after bug 520396.
This commit is contained in:
@@ -192,7 +192,7 @@ ProcessTableRulesAttribute(void* aStyleStruct,
|
||||
}
|
||||
}
|
||||
|
||||
static void TbodyPostResolveCallback(void* aStyleStruct, nsRuleData* aRuleData, nsIStyleRule* aStyleRule)
|
||||
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);
|
||||
@@ -205,14 +205,13 @@ nsHTMLStyleSheet::TableTbodyRule::MapRuleInfoInto(nsRuleData* aRuleData)
|
||||
{
|
||||
if (aRuleData->mSIDs & NS_STYLE_INHERIT_BIT(Border)) {
|
||||
aRuleData->mCanStoreInRuleTree = PR_FALSE;
|
||||
nsPostResolveCallback prc = { &TbodyPostResolveCallback, this };
|
||||
aRuleData->mPostResolveCallbacks.AppendElement(prc);
|
||||
aRuleData->mPostResolveCallback = &TbodyPostResolveCallback;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
// -----------------------------------------------------------
|
||||
|
||||
static void RowPostResolveCallback(void* aStyleStruct, nsRuleData* aRuleData, nsIStyleRule* aStyleRule)
|
||||
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);
|
||||
@@ -225,13 +224,12 @@ nsHTMLStyleSheet::TableRowRule::MapRuleInfoInto(nsRuleData* aRuleData)
|
||||
{
|
||||
if (aRuleData->mSIDs & NS_STYLE_INHERIT_BIT(Border)) {
|
||||
aRuleData->mCanStoreInRuleTree = PR_FALSE;
|
||||
nsPostResolveCallback prc = { &RowPostResolveCallback, this };
|
||||
aRuleData->mPostResolveCallbacks.AppendElement(prc);
|
||||
aRuleData->mPostResolveCallback = &RowPostResolveCallback;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static void ColgroupPostResolveCallback(void* aStyleStruct, nsRuleData* aRuleData, nsIStyleRule* aStyleRule)
|
||||
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);
|
||||
@@ -244,13 +242,12 @@ nsHTMLStyleSheet::TableColgroupRule::MapRuleInfoInto(nsRuleData* aRuleData)
|
||||
{
|
||||
if (aRuleData->mSIDs & NS_STYLE_INHERIT_BIT(Border)) {
|
||||
aRuleData->mCanStoreInRuleTree = PR_FALSE;
|
||||
nsPostResolveCallback prc = { &ColgroupPostResolveCallback, this };
|
||||
aRuleData->mPostResolveCallbacks.AppendElement(prc);
|
||||
aRuleData->mPostResolveCallback = &ColgroupPostResolveCallback;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static void ColPostResolveCallback(void* aStyleStruct, nsRuleData* aRuleData, nsIStyleRule* aStyleRule)
|
||||
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);
|
||||
@@ -259,7 +256,7 @@ static void ColPostResolveCallback(void* aStyleStruct, nsRuleData* aRuleData, ns
|
||||
}
|
||||
|
||||
static void UngroupedColPostResolveCallback(void* aStyleStruct,
|
||||
nsRuleData* aRuleData, nsIStyleRule* aStyleRule)
|
||||
nsRuleData* aRuleData)
|
||||
{
|
||||
// Pass PR_TRUE for aGroup, so that we find the table's style
|
||||
// context correctly.
|
||||
@@ -274,8 +271,7 @@ nsHTMLStyleSheet::TableColRule::MapRuleInfoInto(nsRuleData* aRuleData)
|
||||
{
|
||||
if (aRuleData->mSIDs & NS_STYLE_INHERIT_BIT(Border)) {
|
||||
aRuleData->mCanStoreInRuleTree = PR_FALSE;
|
||||
nsPostResolveCallback prc = { &ColPostResolveCallback, this };
|
||||
aRuleData->mPostResolveCallbacks.AppendElement(prc);
|
||||
aRuleData->mPostResolveCallback = &ColPostResolveCallback;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -285,8 +281,7 @@ nsHTMLStyleSheet::TableUngroupedColRule::MapRuleInfoInto(nsRuleData* aRuleData)
|
||||
{
|
||||
if (aRuleData->mSIDs & NS_STYLE_INHERIT_BIT(Border)) {
|
||||
aRuleData->mCanStoreInRuleTree = PR_FALSE;
|
||||
nsPostResolveCallback prc = { &UngroupedColPostResolveCallback, this };
|
||||
aRuleData->mPostResolveCallbacks.AppendElement(prc);
|
||||
aRuleData->mPostResolveCallback = &UngroupedColPostResolveCallback;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -46,18 +46,11 @@
|
||||
|
||||
#include "nsCSSStruct.h"
|
||||
#include "nsStyleStructFwd.h"
|
||||
#include "nsTArray.h"
|
||||
class nsPresContext;
|
||||
class nsStyleContext;
|
||||
|
||||
struct nsRuleData;
|
||||
typedef void (*nsPostResolveFunc)(void* aStyleStruct, nsRuleData* aData,
|
||||
nsIStyleRule* aRule);
|
||||
|
||||
struct nsPostResolveCallback {
|
||||
nsPostResolveFunc mFunc;
|
||||
nsIStyleRule *mRule;
|
||||
};
|
||||
typedef void (*nsPostResolveFunc)(void* aStyleStruct, nsRuleData* aData);
|
||||
|
||||
struct nsRuleData
|
||||
{
|
||||
@@ -67,9 +60,7 @@ struct nsRuleData
|
||||
PRUint8 mLevel; // an nsStyleSet::sheetType
|
||||
nsPresContext* mPresContext;
|
||||
nsStyleContext* mStyleContext;
|
||||
// MapRuleInfoInto should append to this array, so it is ordered from
|
||||
// most specific to least.
|
||||
nsTArray<nsPostResolveCallback> mPostResolveCallbacks;
|
||||
nsPostResolveFunc mPostResolveCallback;
|
||||
nsRuleDataFont* mFontData; // Should always be stack-allocated! We don't own these structures!
|
||||
nsRuleDataDisplay* mDisplayData;
|
||||
nsRuleDataMargin* mMarginData;
|
||||
@@ -89,7 +80,7 @@ struct nsRuleData
|
||||
nsRuleDataColumn* mColumnData;
|
||||
|
||||
nsRuleData(PRUint32 aSIDs, nsPresContext* aContext, nsStyleContext* aStyleContext)
|
||||
:mSIDs(aSIDs), mPresContext(aContext), mStyleContext(aStyleContext),
|
||||
:mSIDs(aSIDs), mPresContext(aContext), mStyleContext(aStyleContext), mPostResolveCallback(nsnull),
|
||||
mFontData(nsnull), mDisplayData(nsnull), mMarginData(nsnull), mListData(nsnull),
|
||||
mPositionData(nsnull), mTableData(nsnull), mColorData(nsnull), mContentData(nsnull), mTextData(nsnull),
|
||||
mUserInterfaceData(nsnull), mColumnData(nsnull)
|
||||
|
||||
@@ -1952,8 +1952,7 @@ nsRuleNode::WalkRuleTree(const nsStyleStructID aSID,
|
||||
detail = eRulePartialMixed; // Treat as though some data is specified to avoid
|
||||
// the optimizations and force data computation.
|
||||
|
||||
if (detail == eRuleNone && startStruct &&
|
||||
aRuleData->mPostResolveCallbacks.IsEmpty()) {
|
||||
if (detail == eRuleNone && startStruct && !aRuleData->mPostResolveCallback) {
|
||||
// We specified absolutely no rule information, but a parent rule in the tree
|
||||
// specified all the rule information. We set a bit along the branch from our
|
||||
// node in the tree to the node that specified the data that tells nodes on that
|
||||
@@ -1962,7 +1961,7 @@ nsRuleNode::WalkRuleTree(const nsStyleStructID aSID,
|
||||
PropagateDependentBit(bit, ruleNode);
|
||||
return startStruct;
|
||||
}
|
||||
// FIXME Do we need to check for mPostResolveCallbacks?
|
||||
// FIXME Do we need to check for mPostResolveCallback?
|
||||
if ((!startStruct && !isReset &&
|
||||
(detail == eRuleNone || detail == eRulePartialInherited)) ||
|
||||
detail == eRuleFullInherited) {
|
||||
@@ -2017,14 +2016,9 @@ nsRuleNode::WalkRuleTree(const nsStyleStructID aSID,
|
||||
#undef STYLE_STRUCT
|
||||
#undef STYLE_STRUCT_TEST
|
||||
|
||||
// If we have post-resolve callbacks, handle that now.
|
||||
if (NS_LIKELY(res != nsnull)) {
|
||||
// Enumerate from least to most specific rule.
|
||||
for (PRUint32 i = aRuleData->mPostResolveCallbacks.Length(); i-- != 0; ) {
|
||||
nsPostResolveCallback &prc = aRuleData->mPostResolveCallbacks[i];
|
||||
(*prc.mFunc)(const_cast<void*>(res), aRuleData, prc.mRule);
|
||||
}
|
||||
}
|
||||
// If we have a post-resolve callback, handle that now.
|
||||
if (aRuleData->mPostResolveCallback && (NS_LIKELY(res != nsnull)))
|
||||
(*aRuleData->mPostResolveCallback)(const_cast<void*>(res), aRuleData);
|
||||
|
||||
// Now return the result.
|
||||
return res;
|
||||
@@ -3017,12 +3011,9 @@ nsRuleNode::SetGenericFont(nsPresContext* aPresContext,
|
||||
PR_FALSE, dummy);
|
||||
|
||||
// XXX Not sure if we need to do this here
|
||||
// If we have post-resolve callbacks, handle that now.
|
||||
// Enumerate from least to most specific rule.
|
||||
for (PRUint32 j = ruleData.mPostResolveCallbacks.Length(); j-- != 0; ) {
|
||||
nsPostResolveCallback &prc = ruleData.mPostResolveCallbacks[j];
|
||||
(*prc.mFunc)(aFont, &ruleData, prc.mRule);
|
||||
}
|
||||
// If we have a post-resolve callback, handle that now.
|
||||
if (ruleData.mPostResolveCallback)
|
||||
(ruleData.mPostResolveCallback)(aFont, &ruleData);
|
||||
|
||||
parentFont = *aFont;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user