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