Bug 1289622 - Delegate CalcStyleDifference to a templated helper. r=heycam

This commit is contained in:
Bobby Holley 2016-07-26 11:54:05 -07:00
Родитель 55b3f93f9f
Коммит 9f75d89883
2 изменённых файлов: 23 добавлений и 4 удалений

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

@ -891,11 +891,12 @@ nsStyleContext::ApplyStyleFixups(bool aSkipParentDisplayBasedStyleFixup)
#undef GET_UNIQUE_STYLE_DATA
}
template<class StyleContextLike>
nsChangeHint
nsStyleContext::CalcStyleDifference(nsStyleContext* aNewContext,
nsChangeHint aParentHintsNotHandledForDescendants,
uint32_t* aEqualStructs,
uint32_t* aSamePointerStructs)
nsStyleContext::CalcStyleDifferenceInternal(StyleContextLike* aNewContext,
nsChangeHint aParentHintsNotHandledForDescendants,
uint32_t* aEqualStructs,
uint32_t* aSamePointerStructs)
{
PROFILER_LABEL("nsStyleContext", "CalcStyleDifference",
js::ProfileEntry::Category::CSS);
@ -1213,6 +1214,16 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aNewContext,
return hint & ~nsChangeHint_NeutralChange;
}
nsChangeHint
nsStyleContext::CalcStyleDifference(nsStyleContext* aNewContext,
nsChangeHint aParentHintsNotHandledForDescendants,
uint32_t* aEqualStructs,
uint32_t* aSamePointerStructs)
{
return CalcStyleDifferenceInternal(aNewContext, aParentHintsNotHandledForDescendants,
aEqualStructs, aSamePointerStructs);
}
#ifdef DEBUG
void nsStyleContext::List(FILE* out, int32_t aIndent, bool aListDescendants)
{

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

@ -398,6 +398,14 @@ public:
uint32_t* aEqualStructs,
uint32_t* aSamePointerStructs);
private:
template<class StyleContextLike>
nsChangeHint CalcStyleDifferenceInternal(StyleContextLike* aNewContext,
nsChangeHint aParentHintsNotHandledForDescendants,
uint32_t* aEqualStructs,
uint32_t* aSamePointerStructs);
public:
/**
* Get a color that depends on link-visitedness using this and
* this->GetStyleIfVisited().