Bug 1188721 - Part 15: Remove unused NS_STYLE_INELIGIBLE_FOR_SHARING. r?dbaron
MozReview-Commit-ID: 8mwUzLSdk7z
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -385,17 +385,17 @@ nsStyleContext::FindChildWithRules(const
child->RelevantLinkVisited() == aRelevantLinkVisited) {
bool match = false;
if (aRulesIfVisited) {
match = child->GetStyleIfVisited() &&
child->GetStyleIfVisited()->mRuleNode == aRulesIfVisited;
} else {
match = !child->GetStyleIfVisited();
}
- if (match && !(child->mBits & NS_STYLE_INELIGIBLE_FOR_SHARING)) {
+ if (match) {
result = child;
break;
}
}
child = child->mNextSibling;
threshold--;
if (threshold == 0)
break;
@@ -1446,39 +1446,16 @@ nsStyleContext::DoClearCachedInheritedSt
if (aStructs == 0) {
return;
}
ClearCachedInheritedStyleDataOnDescendants(aStructs);
}
-void
-nsStyleContext::SetIneligibleForSharing()
-{
- if (mBits & NS_STYLE_INELIGIBLE_FOR_SHARING) {
- return;
- }
- mBits |= NS_STYLE_INELIGIBLE_FOR_SHARING;
- if (mChild) {
- nsStyleContext* child = mChild;
- do {
- child->SetIneligibleForSharing();
- child = child->mNextSibling;
- } while (mChild != child);
- }
- if (mEmptyChild) {
- nsStyleContext* child = mEmptyChild;
- do {
- child->SetIneligibleForSharing();
- child = child->mNextSibling;
- } while (mEmptyChild != child);
- }
-}
-
#ifdef RESTYLE_LOGGING
nsCString
nsStyleContext::GetCachedStyleDataAsString(uint32_t aStructs)
{
nsCString structs;
for (nsStyleStructID i = nsStyleStructID(0);
i < nsStyleStructID_Length;
i = nsStyleStructID(i + 1)) {
--- a/layout/style/nsStyleContext.h
+++ b/layout/style/nsStyleContext.h
@@ -395,23 +395,16 @@ public:
void MoveTo(nsStyleContext* aNewParent);
/**
* On each descendant of this style context, clears out any cached inherited
* structs indicated in aStructs.
*/
void ClearCachedInheritedStyleDataOnDescendants(uint32_t aStructs);
- /**
- * Sets the NS_STYLE_INELIGIBLE_FOR_SHARING bit on this style context
- * and its descendants. If it finds a descendant that has the bit
- * already set, assumes that it can skip that subtree.
- */
- void SetIneligibleForSharing();
-
#ifdef DEBUG
void List(FILE* out, int32_t aIndent, bool aListDescendants = true);
static void AssertStyleStructMaxDifferenceValid();
static const char* StructName(nsStyleStructID aSID);
static bool LookupStruct(const nsACString& aName, nsStyleStructID& aResult);
#endif
#ifdef RESTYLE_LOGGING
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -69,22 +69,20 @@ struct nsStyleVisibility;
#define NS_STYLE_IS_SHARED 0x020000000
// See nsStyleContext::AssertStructsNotUsedElsewhere
// (This bit is currently only used in #ifdef DEBUG code.)
#define NS_STYLE_IS_GOING_AWAY 0x040000000
// See nsStyleContext::ShouldSuppressLineBreak
#define NS_STYLE_SUPPRESS_LINEBREAK 0x080000000
// See nsStyleContext::IsInDisplayNoneSubtree
#define NS_STYLE_IN_DISPLAY_NONE_SUBTREE 0x100000000
-// See nsStyleContext::FindChildWithRules
-#define NS_STYLE_INELIGIBLE_FOR_SHARING 0x200000000
// See nsStyleContext::HasChildThatUsesResetStyle
-#define NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE 0x400000000
+#define NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE 0x200000000
// See nsStyleContext::GetPseudoEnum
-#define NS_STYLE_CONTEXT_TYPE_SHIFT 35
+#define NS_STYLE_CONTEXT_TYPE_SHIFT 34
// Additional bits for nsRuleNode's mDependentBits:
#define NS_RULE_NODE_IS_ANIMATION_RULE 0x01000000
#define NS_RULE_NODE_GC_MARK 0x02000000
#define NS_RULE_NODE_USED_DIRECTLY 0x04000000
#define NS_RULE_NODE_IS_IMPORTANT 0x08000000
#define NS_RULE_NODE_LEVEL_MASK 0xf0000000
#define NS_RULE_NODE_LEVEL_SHIFT 28