Bug 523294 part 1. Change the signature of HasAttributeDependentStyle. r=dbaron

This commit is contained in:
Boris Zbarsky 2009-12-10 14:36:03 -08:00
parent 43bec57640
commit 5d3ef89b12
9 changed files with 28 additions and 38 deletions

View File

@ -2201,9 +2201,8 @@ AttributeEnumFunc(nsCSSSelector* aSelector, AttributeEnumData* aData)
}
}
NS_IMETHODIMP
nsCSSRuleProcessor::HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
nsReStyleHint* aResult)
nsReStyleHint
nsCSSRuleProcessor::HasAttributeDependentStyle(AttributeRuleProcessorData* aData)
{
NS_PRECONDITION(aData->mContent->IsNodeOfType(nsINode::eELEMENT),
"content must be element");
@ -2277,8 +2276,7 @@ nsCSSRuleProcessor::HasAttributeDependentStyle(AttributeRuleProcessorData* aData
}
}
*aResult = data.change;
return NS_OK;
return data.change;
}
NS_IMETHODIMP

View File

@ -96,8 +96,8 @@ public:
NS_IMETHOD HasStateDependentStyle(StateRuleProcessorData* aData,
nsReStyleHint* aResult);
NS_IMETHOD HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
nsReStyleHint* aResult);
virtual nsReStyleHint
HasAttributeDependentStyle(AttributeRuleProcessorData* aData);
NS_IMETHOD MediumFeaturesChanged(nsPresContext* aPresContext,
PRBool* aRulesChanged);

View File

@ -94,8 +94,8 @@ public:
NS_IMETHOD HasStateDependentStyle(StateRuleProcessorData* aData,
nsReStyleHint* aResult);
NS_IMETHOD HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
nsReStyleHint* aResult);
virtual nsReStyleHint
HasAttributeDependentStyle(AttributeRuleProcessorData* aData);
NS_IMETHOD MediumFeaturesChanged(nsPresContext* aPresContext,
PRBool* aResult);
@ -188,12 +188,10 @@ HTMLCSSStyleSheetImpl::HasStateDependentStyle(StateRuleProcessorData* aData,
}
// Test if style is dependent on attribute
NS_IMETHODIMP
HTMLCSSStyleSheetImpl::HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
nsReStyleHint* aResult)
nsReStyleHint
HTMLCSSStyleSheetImpl::HasAttributeDependentStyle(AttributeRuleProcessorData* aData)
{
*aResult = nsReStyleHint(0);
return NS_OK;
return nsReStyleHint(0);
}
NS_IMETHODIMP

View File

@ -520,9 +520,8 @@ nsHTMLStyleSheet::HasStateDependentStyle(StateRuleProcessorData* aData,
return NS_OK;
}
NS_IMETHODIMP
nsHTMLStyleSheet::HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
nsReStyleHint* aResult)
nsReStyleHint
nsHTMLStyleSheet::HasAttributeDependentStyle(AttributeRuleProcessorData* aData)
{
// Note: no need to worry about whether some states changed with this
// attribute here, because we handle that under HasStateDependentStyle() as
@ -535,8 +534,7 @@ nsHTMLStyleSheet::HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
content &&
content->IsHTML() &&
aData->mContentTag == nsGkAtoms::a) {
*aResult = eReStyle_Self;
return NS_OK;
return eReStyle_Self;
}
// Don't worry about the mDocumentColorRule since it only applies
@ -544,12 +542,10 @@ nsHTMLStyleSheet::HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
// Handle the content style rules.
if (content && content->IsAttributeMapped(aData->mAttribute)) {
*aResult = eReStyle_Self;
return NS_OK;
return eReStyle_Self;
}
*aResult = nsReStyleHint(0);
return NS_OK;
return nsReStyleHint(0);
}
NS_IMETHODIMP

View File

@ -82,8 +82,8 @@ public:
NS_IMETHOD RulesMatching(PseudoRuleProcessorData* aData);
NS_IMETHOD HasStateDependentStyle(StateRuleProcessorData* aData,
nsReStyleHint* aResult);
NS_IMETHOD HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
nsReStyleHint* aResult);
virtual nsReStyleHint
HasAttributeDependentStyle(AttributeRuleProcessorData* aData);
NS_IMETHOD MediumFeaturesChanged(nsPresContext* aPresContext,
PRBool* aRulesChanged);

View File

@ -56,9 +56,10 @@ struct StateRuleProcessorData;
struct AttributeRuleProcessorData;
class nsPresContext;
// IID for the nsIStyleRuleProcessor interface {015575fe-7b6c-11d3-ba05-001083023c2b}
// IID for the nsIStyleRuleProcessor interface {a4ec760e-6bfb-4b9f-bd08-9d1c23b700f6}
#define NS_ISTYLE_RULE_PROCESSOR_IID \
{0x015575fe, 0x7b6c, 0x11d3, {0xba, 0x05, 0x00, 0x10, 0x83, 0x02, 0x3c, 0x2b}}
{ 0xa4ec760e, 0x6bfb, 0x4b9f, \
{ 0xbd, 0x08, 0x9d, 0x1c, 0x23, 0xb7, 0x00, 0xf6 } }
/* The style rule processor interface is a mechanism to separate the matching
* of style rules from style sheet instances.
@ -107,8 +108,8 @@ public:
* node. This test is used for optimization only, and may err on the
* side of reporting more dependencies than really exist.
*/
NS_IMETHOD HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
nsReStyleHint* aResult) = 0;
virtual nsReStyleHint
HasAttributeDependentStyle(AttributeRuleProcessorData* aData) = 0;
/**
* Do any processing that needs to happen as a result of a change in

View File

@ -1069,8 +1069,7 @@ static PRBool
SheetHasAttributeStyle(nsIStyleRuleProcessor* aProcessor, void *aData)
{
AttributeData* data = (AttributeData*)aData;
nsReStyleHint hint;
aProcessor->HasAttributeDependentStyle(data, &hint);
nsReStyleHint hint = aProcessor->HasAttributeDependentStyle(data);
data->mHint = nsReStyleHint(data->mHint | hint);
return PR_TRUE; // continue
}

View File

@ -768,12 +768,10 @@ nsTransitionManager::HasStateDependentStyle(StateRuleProcessorData* aData,
return NS_OK;
}
NS_IMETHODIMP
nsTransitionManager::HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
nsReStyleHint* aResult)
nsReStyleHint
nsTransitionManager::HasAttributeDependentStyle(AttributeRuleProcessorData* aData)
{
*aResult = nsReStyleHint(0);
return NS_OK;
return nsReStyleHint(0);
}
NS_IMETHODIMP

View File

@ -88,8 +88,8 @@ public:
NS_IMETHOD RulesMatching(PseudoRuleProcessorData* aData);
NS_IMETHOD HasStateDependentStyle(StateRuleProcessorData* aData,
nsReStyleHint* aResult);
NS_IMETHOD HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
nsReStyleHint* aResult);
virtual nsReStyleHint
HasAttributeDependentStyle(AttributeRuleProcessorData* aData);
NS_IMETHOD MediumFeaturesChanged(nsPresContext* aPresContext,
PRBool* aRulesChanged);