Bug 1000376 - part 3, s/FlexItemStyleFixup/FlexOrGridItemStyleFixup/ and corresponding comment changes. r=dholbert
authorMats Palmgren <matspal@gmail.com>
Sat, 03 May 2014 13:42:33 +0000
changeset 181445 d4ec70824b69234210e061878e9f67d2e070883a
parent 181444 1a7278aae6393e98e0b36c285531719f241fc2ab
child 181446 e86e6fc40b8bf3f3fe5ebc3bf74964827b785a33
push id43056
push usermpalmgren@mozilla.com
push dateSat, 03 May 2014 13:42:46 +0000
treeherdermozilla-inbound@e86e6fc40b8b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1000376
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1000376 - part 3, s/FlexItemStyleFixup/FlexOrGridItemStyleFixup/ and corresponding comment changes. r=dholbert
layout/base/RestyleManager.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/style/nsRuleProcessorData.h
layout/style/nsStyleContext.cpp
layout/style/nsStyleContext.h
layout/style/nsStyleSet.cpp
layout/style/nsStyleSet.h
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -2443,19 +2443,19 @@ ElementRestyler::RestyleSelf(nsIFrame* a
                                                          parentContext,
                                                          pseudoElement);
       }
     }
     else {
       NS_ASSERTION(aSelf->GetContent(),
                    "non pseudo-element frame without content node");
       // Skip flex-item style fixup for anonymous subtrees:
-      TreeMatchContext::AutoFlexItemStyleFixupSkipper
-        flexFixupSkipper(mTreeMatchContext,
-                         element->IsRootOfNativeAnonymousSubtree());
+      TreeMatchContext::AutoFlexOrGridItemStyleFixupSkipper
+        flexOrGridFixupSkipper(mTreeMatchContext,
+                               element->IsRootOfNativeAnonymousSubtree());
       newContext = styleSet->ResolveStyleFor(element, parentContext,
                                              mTreeMatchContext);
     }
   }
 
   MOZ_ASSERT(newContext);
 
   if (!parentContext) {
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -3876,18 +3876,18 @@ nsCSSFrameConstructor::CreateAnonymousFr
       NS_ASSERTION(content->GetPrimaryFrame(),
                    "Content must have a primary frame now");
       newFrame->AddStateBits(NS_FRAME_ANONYMOUSCONTENTCREATOR_CONTENT);
       aChildItems.AddChild(newFrame);
     } else {
       FrameConstructionItemList items;
       {
         // Skip flex item style-fixup during our AddFrameConstructionItems() call:
-        TreeMatchContext::AutoFlexItemStyleFixupSkipper
-          flexItemStyleFixupSkipper(aState.mTreeMatchContext);
+        TreeMatchContext::AutoFlexOrGridItemStyleFixupSkipper
+          flexOrGridItemStyleFixupSkipper(aState.mTreeMatchContext);
 
         AddFrameConstructionItems(aState, content, true, aParentFrame, items);
       }
       ConstructFramesFromItemList(aState, items, aParentFrame, aChildItems);
     }
   }
 
   return NS_OK;
@@ -9268,18 +9268,18 @@ nsCSSFrameConstructor::AddFCItemsForAnon
                       "Should have no pending restyle flags");
     NS_ABORT_IF_FALSE(!content->GetPrimaryFrame(),
                       "Should have no existing frame");
     NS_ABORT_IF_FALSE(!content->IsNodeOfType(nsINode::eCOMMENT) &&
                       !content->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION),
                       "Why is someone creating garbage anonymous content");
 
     nsRefPtr<nsStyleContext> styleContext;
-    TreeMatchContext::AutoFlexItemStyleFixupSkipper
-      flexItemStyleFixupSkipper(aState.mTreeMatchContext);
+    TreeMatchContext::AutoFlexOrGridItemStyleFixupSkipper
+      flexOrGridItemStyleFixupSkipper(aState.mTreeMatchContext);
     if (aAnonymousItems[i].mStyleContext) {
       styleContext = aAnonymousItems[i].mStyleContext.forget();
     } else {
       styleContext = ResolveStyleContext(aFrame, content, &aState);
     }
 
     nsTArray<nsIAnonymousContentCreator::ContentInfo>* anonChildren = nullptr;
     if (!aAnonymousItems[i].mChildren.IsEmpty()) {
--- a/layout/style/nsRuleProcessorData.h
+++ b/layout/style/nsRuleProcessorData.h
@@ -294,33 +294,33 @@ struct MOZ_STACK_CLASS TreeMatchContext 
     bool mPushedAncestor;
     bool mPushedStyleScope;
     TreeMatchContext& mTreeMatchContext;
     mozilla::dom::Element* mElement;
     MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
   };
 
   /* Helper class for tracking whether we're skipping the ApplyStyleFixups
-   * code for flex items.
+   * code for flex/grid items.
    *
-   * The optional second parameter aSkipFlexItemStyleFixup allows this
-   * class to be instantiated but only conditionally activated (e.g.
-   * in cases where we may or may not want to be skipping flex-item
+   * The optional second parameter aSkipFlexOrGridItemStyleFixup allows
+   * this class to be instantiated but only conditionally activated (e.g.
+   * in cases where we may or may not want to be skipping flex/grid-item
    * style fixup for a particular chunk of code).
    */
-  class MOZ_STACK_CLASS AutoFlexItemStyleFixupSkipper {
+  class MOZ_STACK_CLASS AutoFlexOrGridItemStyleFixupSkipper {
   public:
-    AutoFlexItemStyleFixupSkipper(TreeMatchContext& aTreeMatchContext,
-                                  bool aSkipFlexItemStyleFixup = true
-                                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
-      : mAutoRestorer(aTreeMatchContext.mSkippingFlexItemStyleFixup)
+    AutoFlexOrGridItemStyleFixupSkipper(TreeMatchContext& aTreeMatchContext,
+                                     bool aSkipFlexOrGridItemStyleFixup = true
+                                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+      : mAutoRestorer(aTreeMatchContext.mSkippingFlexOrGridItemStyleFixup)
     {
       MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-      if (aSkipFlexItemStyleFixup) {
-        aTreeMatchContext.mSkippingFlexItemStyleFixup = true;
+      if (aSkipFlexOrGridItemStyleFixup) {
+        aTreeMatchContext.mSkippingFlexOrGridItemStyleFixup = true;
       }
     }
 
   private:
     mozilla::AutoRestore<bool> mAutoRestorer;
     MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
   };
 
@@ -368,20 +368,20 @@ struct MOZ_STACK_CLASS TreeMatchContext 
   nsNthIndexCache mNthIndexCache;
 
   // An ancestor filter
   AncestorFilter mAncestorFilter;
 
   // Whether this document is using PB mode
   bool mUsingPrivateBrowsing;
 
-  // Whether we're currently skipping the flex item chunk of ApplyStyleFixups
-  // when resolving style (e.g. for children of elements that have a mandatory
-  // frame-type and can't be flex containers despite having "display:flex").
-  bool mSkippingFlexItemStyleFixup;
+  // Whether we're currently skipping the flex/grid item chunk of
+  // ApplyStyleFixups when resolving style (e.g. for children of elements that
+  // have a mandatory frame-type for which we ignore "display:flex/grid").
+  bool mSkippingFlexOrGridItemStyleFixup;
 
   // Whether this TreeMatchContext is being used with an nsCSSRuleProcessor
   // for an HTML5 scoped style sheet.
   bool mForScopedStyle;
 
   enum MatchVisited {
     eNeverMatchVisited,
     eMatchVisitedDefault
@@ -403,17 +403,17 @@ struct MOZ_STACK_CLASS TreeMatchContext 
     , mHaveRelevantLink(false)
     , mHaveSpecifiedScope(false)
     , mVisitedHandling(aVisitedHandling)
     , mDocument(aDocument)
     , mScopedRoot(nullptr)
     , mIsHTMLDocument(aDocument->IsHTML())
     , mCompatMode(aDocument->GetCompatibilityMode())
     , mUsingPrivateBrowsing(false)
-    , mSkippingFlexItemStyleFixup(false)
+    , mSkippingFlexOrGridItemStyleFixup(false)
     , mForScopedStyle(false)
     , mCurrentStyleScope(nullptr)
   {
     if (aMatchVisited != eNeverMatchVisited) {
       nsCOMPtr<nsISupports> container = mDocument->GetContainer();
       if (container) {
         nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(container);
         NS_ASSERTION(loadContext, "Couldn't get loadContext from container; assuming no private browsing.");
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -30,17 +30,17 @@ using namespace mozilla;
 
 //----------------------------------------------------------------------
 
 
 nsStyleContext::nsStyleContext(nsStyleContext* aParent,
                                nsIAtom* aPseudoTag,
                                nsCSSPseudoElements::Type aPseudoType,
                                nsRuleNode* aRuleNode,
-                               bool aSkipFlexItemStyleFixup)
+                               bool aSkipFlexOrGridItemStyleFixup)
   : mParent(aParent),
     mChild(nullptr),
     mEmptyChild(nullptr),
     mPseudoTag(aPseudoTag),
     mRuleNode(aRuleNode),
     mAllocations(nullptr),
     mCachedResetData(nullptr),
     mBits(((uint64_t)aPseudoType) << NS_STYLE_CONTEXT_TYPE_SHIFT),
@@ -66,17 +66,17 @@ nsStyleContext::nsStyleContext(nsStyleCo
       r2 = r2->GetParent();
     NS_ASSERTION(r1 == r2, "must be in the same rule tree as parent");
 #endif
   }
 
   mRuleNode->AddRef();
   mRuleNode->SetUsedDirectly(); // before ApplyStyleFixups()!
 
-  ApplyStyleFixups(aSkipFlexItemStyleFixup);
+  ApplyStyleFixups(aSkipFlexOrGridItemStyleFixup);
 
   #define eStyleStruct_LastItem (nsStyleStructID_Length - 1)
   NS_ASSERTION(NS_STYLE_INHERIT_MASK & NS_STYLE_INHERIT_BIT(LastItem),
                "NS_STYLE_INHERIT_MASK must be bigger, and other bits shifted");
   #undef eStyleStruct_LastItem
 }
 
 nsStyleContext::~nsStyleContext()
@@ -289,17 +289,17 @@ nsStyleContext::SetStyle(nsStyleStructID
     dataSlot = &mCachedInheritedData.mStyleStructs[aSID];
   }
   NS_ASSERTION(!*dataSlot || (mBits & nsCachedStyleData::GetBitForSID(aSID)),
                "Going to leak style data");
   *dataSlot = aStruct;
 }
 
 void
-nsStyleContext::ApplyStyleFixups(bool aSkipFlexItemStyleFixup)
+nsStyleContext::ApplyStyleFixups(bool aSkipFlexOrGridItemStyleFixup)
 {
   // See if we have any text decorations.
   // First see if our parent has text decorations.  If our parent does, then we inherit the bit.
   if (mParent && mParent->HasTextDecorationLines()) {
     mBits |= NS_STYLE_HAS_TEXT_DECORATION_LINES;
   } else {
     // We might have defined a decoration.
     const nsStyleTextReset* text = StyleTextReset();
@@ -354,17 +354,17 @@ nsStyleContext::ApplyStyleFixups(bool aS
     }
   }
 
   // Adjust the "display" values of flex and grid items (but not for raw text,
   // placeholders, or table-parts). CSS3 Flexbox section 4 says:
   //   # The computed 'display' of a flex item is determined
   //   # by applying the table in CSS 2.1 Chapter 9.7.
   // ...which converts inline-level elements to their block-level equivalents.
-  if (!aSkipFlexItemStyleFixup && mParent) {
+  if (!aSkipFlexOrGridItemStyleFixup && mParent) {
     const nsStyleDisplay* parentDisp = mParent->StyleDisplay();
     if ((parentDisp->mDisplay == NS_STYLE_DISPLAY_FLEX ||
          parentDisp->mDisplay == NS_STYLE_DISPLAY_INLINE_FLEX ||
          parentDisp->mDisplay == NS_STYLE_DISPLAY_GRID ||
          parentDisp->mDisplay == NS_STYLE_DISPLAY_INLINE_GRID) &&
         GetPseudo() != nsCSSAnonBoxes::mozNonElement) {
       uint8_t displayVal = disp->mDisplay;
       // Skip table parts.
@@ -377,20 +377,21 @@ nsStyleContext::ApplyStyleFixups(bool aS
           NS_STYLE_DISPLAY_TABLE_HEADER_GROUP != displayVal &&
           NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP != displayVal &&
           NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP != displayVal &&
           NS_STYLE_DISPLAY_TABLE_COLUMN       != displayVal &&
           NS_STYLE_DISPLAY_TABLE_ROW          != displayVal &&
           NS_STYLE_DISPLAY_TABLE_CELL         != displayVal) {
 
         // NOTE: Technically, we shouldn't modify the 'display' value of
-        // positioned elements, since they aren't flex items. However, we don't
-        // need to worry about checking for that, because if we're positioned,
-        // we'll have already been through a call to EnsureBlockDisplay() in
-        // nsRuleNode, so this call here won't change anything. So we're OK.
+        // positioned elements, since they aren't flex/grid items. However,
+        // we don't need to worry about checking for that, because if we're
+        // positioned, we'll have already been through a call to
+        // EnsureBlockDisplay() in nsRuleNode, so this call here won't change
+        // anything. So we're OK.
         nsRuleNode::EnsureBlockDisplay(displayVal);
         if (displayVal != disp->mDisplay) {
           NS_ASSERTION(!disp->IsAbsolutelyPositionedStyle(),
                        "We shouldn't be changing the display value of "
                        "positioned content (and we should have already "
                        "converted its display value to be block-level...)");
           nsStyleDisplay *mutable_display =
             static_cast<nsStyleDisplay*>(GetUniqueStyleData(eStyleStruct_Display));
@@ -730,22 +731,22 @@ nsStyleContext::Destroy()
   presContext->PresShell()->FreeByObjectID(nsPresArena::nsStyleContext_id, this);
 }
 
 already_AddRefed<nsStyleContext>
 NS_NewStyleContext(nsStyleContext* aParentContext,
                    nsIAtom* aPseudoTag,
                    nsCSSPseudoElements::Type aPseudoType,
                    nsRuleNode* aRuleNode,
-                   bool aSkipFlexItemStyleFixup)
+                   bool aSkipFlexOrGridItemStyleFixup)
 {
   nsRefPtr<nsStyleContext> context =
     new (aRuleNode->PresContext())
     nsStyleContext(aParentContext, aPseudoTag, aPseudoType, aRuleNode,
-                   aSkipFlexItemStyleFixup);
+                   aSkipFlexOrGridItemStyleFixup);
   return context.forget();
 }
 
 static inline void
 ExtractAnimationValue(nsCSSProperty aProperty,
                       nsStyleContext* aStyleContext,
                       nsStyleAnimation::Value& aResult)
 {
--- a/layout/style/nsStyleContext.h
+++ b/layout/style/nsStyleContext.h
@@ -51,25 +51,25 @@ public:
    * @param aPseudoTag  The pseudo-element or anonymous box for which
    *                    this style context represents style.  Null if
    *                    this style context is for a normal DOM element.
    * @param aPseudoType  Must match aPseudoTag.
    * @param aRuleNode  A rule node representing the ordered sequence of
    *                   rules that any element, pseudo-element, or
    *                   anonymous box that this style context is for
    *                   matches.  See |nsRuleNode| and |nsIStyleRule|.
-   * @param aSkipFlexItemStyleFixup
+   * @param aSkipFlexOrGridItemStyleFixup
    *                 If set, this flag indicates that we should skip
    *                 the chunk of ApplyStyleFixups() that modifies flex
-   *                 items' display values.
+   *                 and grid items' display values.
    */
   nsStyleContext(nsStyleContext* aParent, nsIAtom* aPseudoTag,
                  nsCSSPseudoElements::Type aPseudoType,
                  nsRuleNode* aRuleNode,
-                 bool aSkipFlexItemStyleFixup);
+                 bool aSkipFlexOrGridItemStyleFixup);
   ~nsStyleContext();
 
   void* operator new(size_t sz, nsPresContext* aPresContext) CPP_THROW_NEW;
   void Destroy();
 
   nsrefcnt AddRef() {
     if (mRefCnt == UINT32_MAX) {
       NS_WARNING("refcount overflow, leaking object");
@@ -343,17 +343,17 @@ public:
   void List(FILE* out, int32_t aIndent);
   static void AssertStyleStructMaxDifferenceValid();
 #endif
 
 protected:
   void AddChild(nsStyleContext* aChild);
   void RemoveChild(nsStyleContext* aChild);
 
-  void ApplyStyleFixups(bool aSkipFlexItemStyleFixup);
+  void ApplyStyleFixups(bool aSkipFlexOrGridItemStyleFixup);
 
   void FreeAllocations(nsPresContext* aPresContext);
 
   // Helper function that GetStyleData and GetUniqueStyleData use.  Only
   // returns the structs we cache ourselves; never consults the ruletree.
   inline const void* GetCachedStyleData(nsStyleStructID aSID);
 
   // Helper functions for GetStyle* and PeekStyle*
@@ -437,10 +437,10 @@ protected:
   uint32_t                mRefCnt;
 };
 
 already_AddRefed<nsStyleContext>
 NS_NewStyleContext(nsStyleContext* aParentContext,
                    nsIAtom* aPseudoTag,
                    nsCSSPseudoElements::Type aPseudoType,
                    nsRuleNode* aRuleNode,
-                   bool aSkipFlexItemStyleFixup);
+                   bool aSkipFlexOrGridItemStyleFixup);
 #endif
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -789,22 +789,23 @@ nsStyleSet::GetContext(nsStyleContext* a
   if (result)
     fprintf(stdout, "--- SharedSC %d ---\n", ++gSharedCount);
   else
     fprintf(stdout, "+++ NewSC %d +++\n", ++gNewCount);
 #endif
 
   if (!result) {
     result = NS_NewStyleContext(aParentContext, aPseudoTag, aPseudoType,
-                                aRuleNode, aFlags & eSkipFlexItemStyleFixup);
+                                aRuleNode,
+                                aFlags & eSkipFlexOrGridItemStyleFixup);
     if (aVisitedRuleNode) {
       nsRefPtr<nsStyleContext> resultIfVisited =
         NS_NewStyleContext(parentIfVisited, aPseudoTag, aPseudoType,
                            aVisitedRuleNode,
-                           aFlags & eSkipFlexItemStyleFixup);
+                           aFlags & eSkipFlexOrGridItemStyleFixup);
       if (!parentIfVisited) {
         mRoots.AppendElement(resultIfVisited);
       }
       resultIfVisited->SetIsStyleIfVisited();
       result->SetStyleIfVisited(resultIfVisited.forget());
 
       bool relevantLinkVisited = (aFlags & eIsLink) ?
         (aFlags & eIsVisitedLink) :
@@ -1209,18 +1210,18 @@ nsStyleSet::ResolveStyleFor(Element* aEl
   uint32_t flags = eDoAnimation;
   if (nsCSSRuleProcessor::IsLink(aElement)) {
     flags |= eIsLink;
   }
   if (nsCSSRuleProcessor::GetContentState(aElement, aTreeMatchContext).
                             HasState(NS_EVENT_STATE_VISITED)) {
     flags |= eIsVisitedLink;
   }
-  if (aTreeMatchContext.mSkippingFlexItemStyleFixup) {
-    flags |= eSkipFlexItemStyleFixup;
+  if (aTreeMatchContext.mSkippingFlexOrGridItemStyleFixup) {
+    flags |= eSkipFlexOrGridItemStyleFixup;
   }
 
   return GetContext(aParentContext, ruleNode, visitedRuleNode,
                     nullptr, nsCSSPseudoElements::ePseudo_NotPseudoElement,
                     aElement, flags);
 }
 
 already_AddRefed<nsStyleContext>
@@ -1373,20 +1374,21 @@ nsStyleSet::ResolvePseudoElementStyle(El
 
   // For pseudos, |data.IsLink()| being true means that
   // our parent node is a link.
   uint32_t flags = eNoFlags;
   if (aType == nsCSSPseudoElements::ePseudo_before ||
       aType == nsCSSPseudoElements::ePseudo_after) {
     flags |= eDoAnimation;
   } else {
-    // Flex containers don't expect to have any pseudo-element children aside
-    // from ::before and ::after.  So if we have such a child, we're not
-    // actually in a flex container, and we should skip flex-item style fixup.
-    flags |= eSkipFlexItemStyleFixup;
+    // Flex and grid containers don't expect to have any pseudo-element children
+    // aside from ::before and ::after.  So if we have such a child, we're not
+    // actually in a flex/grid container, and we should skip flex/grid item
+    // style fixup.
+    flags |= eSkipFlexOrGridItemStyleFixup;
   }
 
   return GetContext(aParentContext, ruleNode, visitedRuleNode,
                     nsCSSPseudoElements::GetPseudoAtom(aType), aType,
                     aParentElement, flags);
 }
 
 already_AddRefed<nsStyleContext>
@@ -1444,20 +1446,21 @@ nsStyleSet::ProbePseudoElementStyle(Elem
 
   // For pseudos, |data.IsLink()| being true means that
   // our parent node is a link.
   uint32_t flags = eNoFlags;
   if (aType == nsCSSPseudoElements::ePseudo_before ||
       aType == nsCSSPseudoElements::ePseudo_after) {
     flags |= eDoAnimation;
   } else {
-    // Flex containers don't expect to have any pseudo-element children aside
-    // from ::before and ::after.  So if we have such a child, we're not
-    // actually in a flex container, and we should skip flex-item style fixup.
-    flags |= eSkipFlexItemStyleFixup;
+    // Flex and grid containers don't expect to have any pseudo-element children
+    // aside from ::before and ::after.  So if we have such a child, we're not
+    // actually in a flex/grid container, and we should skip flex/grid item
+    // style fixup.
+    flags |= eSkipFlexOrGridItemStyleFixup;
   }
 
   nsRefPtr<nsStyleContext> result =
     GetContext(aParentContext, ruleNode, visitedRuleNode,
                pseudoTag, aType,
                aParentElement, flags);
 
   // For :before and :after pseudo-elements, having display: none or no
@@ -1851,21 +1854,21 @@ nsStyleSet::ReparentStyleContext(nsStyle
 
   if (pseudoType == nsCSSPseudoElements::ePseudo_NotPseudoElement ||
       pseudoType == nsCSSPseudoElements::ePseudo_before ||
       pseudoType == nsCSSPseudoElements::ePseudo_after) {
     flags |= eDoAnimation;
   }
 
   if (aElement && aElement->IsRootOfAnonymousSubtree()) {
-    // For anonymous subtree roots, don't tweak "display" value based on
-    // whether or not the parent is styled as a flex container. (If the parent
+    // For anonymous subtree roots, don't tweak "display" value based on whether
+    // or not the parent is styled as a flex/grid container. (If the parent
     // has anonymous-subtree kids, then we know it's not actually going to get
-    // a flex container frame, anyway.)
-    flags |= eSkipFlexItemStyleFixup;
+    // a flex/grid container frame, anyway.)
+    flags |= eSkipFlexOrGridItemStyleFixup;
   }
 
   return GetContext(aNewParentContext, ruleNode, visitedRuleNode,
                     pseudoTag, pseudoType,
                     aElement, flags);
 }
 
 struct MOZ_STACK_CLASS StatefulData : public StateRuleProcessorData {
--- a/layout/style/nsStyleSet.h
+++ b/layout/style/nsStyleSet.h
@@ -392,22 +392,22 @@ class nsStyleSet
    * Bit-flags that can be passed to GetContext() in its parameter 'aFlags'.
    */
   enum {
     eNoFlags =          0,
     eIsLink =           1 << 0,
     eIsVisitedLink =    1 << 1,
     eDoAnimation =      1 << 2,
 
-    // Indicates that we should skip the flex-item-specific chunk of
+    // Indicates that we should skip the flex/grid item specific chunk of
     // ApplyStyleFixups().  This is useful if our parent has "display: flex"
-    // but we can tell it's not going to actually be a flex container (e.g. if
+    // or "display: grid" but we can tell we're not going to honor that (e.g. if
     // it's the outer frame of a button widget, and we're the inline frame for
     // the button's label).
-    eSkipFlexItemStyleFixup = 1 << 3
+    eSkipFlexOrGridItemStyleFixup = 1 << 3
   };
 
   already_AddRefed<nsStyleContext>
   GetContext(nsStyleContext* aParentContext,
              nsRuleNode* aRuleNode,
              nsRuleNode* aVisitedRuleNode,
              nsIAtom* aPseudoTag,
              nsCSSPseudoElements::Type aPseudoType,