Bug 1188721 - Part 16: Remove unused NS_STYLE_IS_GOING_AWAY. r?dbaron draft
authorCameron McCormack <cam@mcc.id.au>
Wed, 23 Mar 2016 17:36:00 +1100
changeset 343766 311b3583c49ce79fccc5a22d9bd16600bb0c0a53
parent 343765 30859ee75f010cece5a398b89548319f06b4c656
child 343767 200210f1b5893cb08dba7ae490bb501c9d7454b3
push id13680
push usercmccormack@mozilla.com
push dateWed, 23 Mar 2016 06:36:18 +0000
reviewersdbaron
bugs1188721
milestone48.0a1
Bug 1188721 - Part 16: Remove unused NS_STYLE_IS_GOING_AWAY. r?dbaron MozReview-Commit-ID: G20G1GZfBhI
layout/base/RestyleManager.cpp
layout/style/nsStyleStruct.h
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -3872,26 +3872,16 @@ ElementRestyler::RestyleSelf(nsIFrame* a
                                                          mTreeMatchContext);
           if (!newContext) {
             // This pseudo should no longer exist; gotta reframe
             NS_UpdateHint(mHintsHandled, nsChangeHint_ReconstructFrame);
             mChangeList->AppendChange(aSelf, element,
                                       nsChangeHint_ReconstructFrame);
             // We're reframing anyway; just keep the same context
             newContext = oldContext;
-#ifdef DEBUG
-            // oldContext's parent might have had its style structs swapped out
-            // with parentContext, so to avoid any assertions that might
-            // otherwise trigger in oldContext's parent's destructor, we set a
-            // flag on oldContext to skip it and its descendants in
-            // nsStyleContext::AssertStructsNotUsedElsewhere.
-            if (oldContext->GetParent() != parentContext) {
-              oldContext->AddStyleBit(NS_STYLE_IS_GOING_AWAY);
-            }
-#endif
           }
         } else {
           // Don't expect XUL tree stuff here, since it needs a comparator and
           // all.
           NS_ASSERTION(pseudoType < CSSPseudoElementType::Count,
                        "Unexpected pseudo type");
           Element* pseudoElement =
             PseudoElementForStyleContext(aSelf, pseudoType);
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -62,27 +62,24 @@ struct nsStyleVisibility;
 // See nsStyleContext::RelevantLinkIsVisited
 #define NS_STYLE_RELEVANT_LINK_VISITED     0x004000000
 // See nsStyleContext::IsStyleIfVisited
 #define NS_STYLE_IS_STYLE_IF_VISITED       0x008000000
 // See nsStyleContext::HasChildThatUsesGrandancestorStyle
 #define NS_STYLE_CHILD_USES_GRANDANCESTOR_STYLE 0x010000000
 // See nsStyleContext::IsShared
 #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
+#define NS_STYLE_SUPPRESS_LINEBREAK        0x040000000
 // See nsStyleContext::IsInDisplayNoneSubtree
-#define NS_STYLE_IN_DISPLAY_NONE_SUBTREE   0x100000000
+#define NS_STYLE_IN_DISPLAY_NONE_SUBTREE   0x080000000
 // See nsStyleContext::HasChildThatUsesResetStyle
-#define NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE 0x200000000
+#define NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE 0x100000000
 // See nsStyleContext::GetPseudoEnum
-#define NS_STYLE_CONTEXT_TYPE_SHIFT        34
+#define NS_STYLE_CONTEXT_TYPE_SHIFT        33
 
 // 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