mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Bug 1180120 - Part 6: Replace HasSameCachedStyleData call with samePointerStructs bit tests. r=dbaron
This commit is contained in:
parent
ec9fcbb753
commit
b332673f40
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user