Bug 1188721 - Part 6: Remove cached struct pointer equality requirement for stopping restyles. r?dbaron
MozReview-Commit-ID: GW10C2tsEnu
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -4113,50 +4113,16 @@ ElementRestyler::RestyleSelf(nsIFrame* a
NS_STYLE_RESET_STRUCT_MASK &&
oldContext->HasChildThatUsesResetStyle()) {
LOG_RESTYLE("can't return eRestyleResult_StopWithStyleChange since "
"there is different reset data and descendants use it");
canStopWithStyleChange = false;
}
}
- if (result == eRestyleResult_Stop) {
- // Since we currently have eRestyleResult_Stop, we know at this
- // point that all of our style structs are equal in terms of styles.
- // However, some of them might be different pointers. Since our
- // descendants might share those pointers, we have to continue to
- // restyling our descendants.
- //
- // However, because of the swapping of equal structs we've done on
- // ancestors (later in this function), we've ensured that for structs
- // that cannot be stored in the rule tree, we keep the old equal structs
- // around rather than replacing them with new ones. This means that we
- // only time we hit this deoptimization is either
- //
- // (a) when at least one of the (old or new) equal structs could be stored
- // in the rule tree, and those structs are then inherited (by pointer
- // sharing) to descendant style contexts; or
- //
- // (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->HasCachedDependentStyleData(sid) &&
- !(samePointerStructs & nsCachedStyleData::GetBitForSID(sid))) {
- LOG_RESTYLE_CONTINUE("there are different struct pointers");
- result = eRestyleResult_Continue;
- break;
- }
- }
- }
-
// From this point we no longer do any assignments of
// eRestyleResult_Continue to |result|. If canStopWithStyleChange is true,
// it means that we can convert |result| (whether it is
// eRestyleResult_Continue or eRestyleResult_Stop) into
// eRestyleResult_StopWithStyleChange.
if (canStopWithStyleChange) {
LOG_RESTYLE("converting %s into eRestyleResult_StopWithStyleChange",
RestyleResultToString(result).get());