Bug 1380133 - Part 7: De-templatize CalcStyleDifference(Internal). r=emilio
MozReview-Commit-ID: 8c1E1gbwaHz
---
layout/style/nsStyleContext.cpp | 23 +++++------------------
layout/style/nsStyleContext.h | 7 -------
2 files changed, 5 insertions(+), 25 deletions(-)
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -180,24 +180,23 @@ nsStyleContext::MoveTo(nsStyleContext* a
if (styleIfVisited) {
styleIfVisited->mParent->RemoveChild(styleIfVisited);
styleIfVisited->mParent = aNewParent;
styleIfVisited->mParent->AddChild(styleIfVisited);
}
}
-template<class StyleContextLike>
nsChangeHint
-nsStyleContext::CalcStyleDifferenceInternal(StyleContextLike* aNewContext,
- uint32_t* aEqualStructs,
- uint32_t* aSamePointerStructs,
- uint32_t aRelevantStructs)
+nsStyleContext::CalcStyleDifference(nsStyleContext* aNewContext,
+ uint32_t* aEqualStructs,
+ uint32_t* aSamePointerStructs,
+ uint32_t aRelevantStructs)
{
- AUTO_PROFILER_LABEL("nsStyleContext::CalcStyleDifferenceInternal", CSS);
+ AUTO_PROFILER_LABEL("nsStyleContext::CalcStyleDifference", CSS);
static_assert(nsStyleStructID_Length <= 32,
"aEqualStructs is not big enough");
MOZ_ASSERT(aRelevantStructs == kAllResolvedStructs || IsServo(),
"aRelevantStructs must be kAllResolvedStructs for Gecko contexts");
if (aRelevantStructs == kAllResolvedStructs) {
@@ -442,28 +441,16 @@ nsStyleContext::CalcStyleDifferenceInter
}
}
MOZ_ASSERT(NS_IsHintSubset(hint, nsChangeHint_AllHints),
"Added a new hint without bumping AllHints?");
return hint & ~nsChangeHint_NeutralChange;
}
-nsChangeHint
-nsStyleContext::CalcStyleDifference(nsStyleContext* aNewContext,
- uint32_t* aEqualStructs,
- uint32_t* aSamePointerStructs,
- uint32_t aRelevantStructs)
-{
- return CalcStyleDifferenceInternal(aNewContext,
- aEqualStructs,
- aSamePointerStructs,
- aRelevantStructs);
-}
-
namespace mozilla {
void
GeckoStyleContext::EnsureSameStructsCached(nsStyleContext* aOldContext)
{
// NOTE(emilio): We could do better here for stylo, where we only call
// Style##name_() because we need to run FinishStyle, but otherwise this
// is only a bitwise or.
--- a/layout/style/nsStyleContext.h
+++ b/layout/style/nsStyleContext.h
@@ -282,23 +282,16 @@ public:
* structs to be compared.
*/
nsChangeHint CalcStyleDifference(nsStyleContext* aNewContext,
uint32_t* aEqualStructs,
uint32_t* aSamePointerStructs,
uint32_t aRelevantStructs =
kAllResolvedStructs);
-private:
- template<class StyleContextLike>
- nsChangeHint CalcStyleDifferenceInternal(StyleContextLike* aNewContext,
- uint32_t* aEqualStructs,
- uint32_t* aSamePointerStructs,
- uint32_t aRelevantStructs);
-
public:
/**
* Get a color that depends on link-visitedness using this and
* this->GetStyleIfVisited().
*
* @param aField A pointer to a member variable in a style struct.
* The member variable and its style struct must have
* been listed in nsCSSVisitedDependentPropList.h.