Bug 1180120 - Part 6: Replace HasSameCachedStyleData call with samePointerStructs bit tests. r=dbaron

This commit is contained in:
Cameron McCormack 2015-08-29 06:13:47 +10:00
parent ec9fcbb753
commit b332673f40
3 changed files with 4 additions and 14 deletions

View File

@ -3585,11 +3585,14 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
//
// (b) when we were unable to swap the structs on the parent because
// either or both of the old parent and new parent are shared.
//
// FIXME This loop could be rewritten as bit operations on
// oldContext->mBits and samePointerStructs.
for (nsStyleStructID sid = nsStyleStructID(0);
sid < nsStyleStructID_Length;
sid = nsStyleStructID(sid + 1)) {
if (oldContext->HasCachedInheritedStyleData(sid) &&
!oldContext->HasSameCachedStyleData(newContext, sid)) {
!(samePointerStructs & nsCachedStyleData::GetBitForSID(sid))) {
LOG_RESTYLE_CONTINUE("there are different struct pointers");
result = eRestyleResult_Continue;
break;

View File

@ -1342,13 +1342,6 @@ nsStyleContext::LookupStruct(const nsACString& aName, nsStyleStructID& aResult)
}
#endif
bool
nsStyleContext::HasSameCachedStyleData(nsStyleContext* aOther,
nsStyleStructID aSID)
{
return GetCachedStyleData(aSID) == aOther->GetCachedStyleData(aSID);
}
void
nsStyleContext::SwapStyleData(nsStyleContext* aNewContext, uint32_t aStructs)
{

View File

@ -274,12 +274,6 @@ public:
#undef STYLE_STRUCT_RESET
#undef STYLE_STRUCT_INHERITED
/**
* Returns whether this style context and aOther both have the same
* cached style struct pointer for a given style struct.
*/
bool HasSameCachedStyleData(nsStyleContext* aOther, nsStyleStructID aSID);
/**
* Returns whether this style context has cached, inherited style data for a
* given style struct.