Bug 890782 - Part 2: Make NS_STATE_SVG_NONDISPLAY_CHILD a global state bit and rename it. r=jwatt
authorCameron McCormack <cam@mcc.id.au>
Fri, 12 Jul 2013 17:13:07 +1000
changeset 150569 dd488e0cc1fd4eeff4261be8bcca7bc5edf43273
parent 150568 44cf1e213d064dbaa438b70cf89f853ae84be611
child 150570 403b121805196a7923bf633b7d80fe49cc85cb70
push idunknown
push userunknown
push dateunknown
reviewersjwatt
bugs890782
milestone25.0a1
Bug 890782 - Part 2: Make NS_STATE_SVG_NONDISPLAY_CHILD a global state bit and rename it. r=jwatt
content/svg/content/src/SVGSVGElement.cpp
content/svg/content/src/SVGTransformableElement.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/generic/nsFrame.cpp
layout/generic/nsIFrame.h
layout/svg/SVGFEContainerFrame.cpp
layout/svg/SVGFEImageFrame.cpp
layout/svg/SVGFELeafFrame.cpp
layout/svg/SVGFEUnstyledLeafFrame.cpp
layout/svg/SVGViewFrame.cpp
layout/svg/nsISVGChildFrame.h
layout/svg/nsSVGAFrame.cpp
layout/svg/nsSVGClipPathFrame.h
layout/svg/nsSVGContainerFrame.cpp
layout/svg/nsSVGFilterFrame.cpp
layout/svg/nsSVGFilterFrame.h
layout/svg/nsSVGForeignObjectFrame.cpp
layout/svg/nsSVGGFrame.cpp
layout/svg/nsSVGGenericContainerFrame.cpp
layout/svg/nsSVGGeometryFrame.cpp
layout/svg/nsSVGGlyphFrame.cpp
layout/svg/nsSVGImageFrame.cpp
layout/svg/nsSVGInnerSVGFrame.cpp
layout/svg/nsSVGIntegrationUtils.cpp
layout/svg/nsSVGMarkerFrame.h
layout/svg/nsSVGMaskFrame.h
layout/svg/nsSVGOuterSVGFrame.cpp
layout/svg/nsSVGPaintServerFrame.h
layout/svg/nsSVGPathGeometryFrame.cpp
layout/svg/nsSVGStopFrame.cpp
layout/svg/nsSVGSwitchFrame.cpp
layout/svg/nsSVGTSpanFrame.cpp
layout/svg/nsSVGTextFrame.cpp
layout/svg/nsSVGTextFrame2.cpp
layout/svg/nsSVGUtils.cpp
layout/svg/nsSVGUtils.h
--- a/content/svg/content/src/SVGSVGElement.cpp
+++ b/content/svg/content/src/SVGSVGElement.cpp
@@ -689,17 +689,17 @@ SVGSVGElement::UpdateHasChildrenOnlyTran
   mHasChildrenOnlyTransform = hasChildrenOnlyTransform;
 }
 
 void
 SVGSVGElement::ChildrenOnlyTransformChanged(uint32_t aFlags)
 {
   // Avoid wasteful calls:
   NS_ABORT_IF_FALSE(!(GetPrimaryFrame()->GetStateBits() &
-                      NS_STATE_SVG_NONDISPLAY_CHILD),
+                      NS_FRAME_IS_NONDISPLAY),
                     "Non-display SVG frames don't maintain overflow rects");
 
   nsChangeHint changeHint;
 
   bool hadChildrenOnlyTransform = mHasChildrenOnlyTransform;
 
   UpdateHasChildrenOnlyTransform();
 
--- a/content/svg/content/src/SVGTransformableElement.cpp
+++ b/content/svg/content/src/SVGTransformableElement.cpp
@@ -51,17 +51,17 @@ SVGTransformableElement::GetAttributeCha
   nsChangeHint retval =
     nsSVGElement::GetAttributeChangeHint(aAttribute, aModType);
   if (aAttribute == nsGkAtoms::transform ||
       aAttribute == nsGkAtoms::mozAnimateMotionDummyAttr) {
     // We add nsChangeHint_UpdateOverflow so that nsFrame::UpdateOverflow()
     // will be called on us and our ancestors.
     nsIFrame* frame =
       const_cast<SVGTransformableElement*>(this)->GetPrimaryFrame();
-    if (!frame || (frame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+    if (!frame || (frame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
       return retval; // no change
     }
     if (aModType == nsIDOMMutationEvent::ADDITION ||
         aModType == nsIDOMMutationEvent::REMOVAL ||
         (aModType == nsIDOMMutationEvent::MODIFICATION &&
          !(mTransforms && mTransforms->HasTransform()))) {
       // Reconstruct the frame tree to handle stacking context changes:
       NS_UpdateHint(retval, nsChangeHint_ReconstructFrame);
@@ -167,17 +167,17 @@ SVGTransformableElement::GetFarthestView
   return SVGContentUtils::GetOuterSVGElement(this);
 }
 
 already_AddRefed<SVGIRect>
 SVGTransformableElement::GetBBox(ErrorResult& rv)
 {
   nsIFrame* frame = GetPrimaryFrame(Flush_Layout);
 
-  if (!frame || (frame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!frame || (frame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     rv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   nsISVGChildFrame* svgframe = do_QueryFrame(frame);
   if (!svgframe) {
     rv.Throw(NS_ERROR_NOT_IMPLEMENTED); // XXX: outer svg
     return nullptr;
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -8189,17 +8189,17 @@ nsCSSFrameConstructor::ProcessRestyledFr
       // the style resolution we will do for the frame construction
       // happens async when we're not in an animation restyle already,
       // problems could arise.
       RecreateFramesForContent(content, false);
     } else {
       NS_ASSERTION(frame, "This shouldn't happen");
 
       if ((frame->GetStateBits() & NS_FRAME_SVG_LAYOUT) &&
-          (frame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+          (frame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
         // frame does not maintain overflow rects, so avoid calling
         // FinishAndStoreOverflow on it:
         hint = NS_SubtractHint(hint,
                  NS_CombineHint(nsChangeHint_UpdateOverflow,
                                 nsChangeHint_ChildrenOnlyTransform));
       }
 
       if (hint & nsChangeHint_UpdateEffects) {
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -5102,17 +5102,17 @@ nsIFrame::GetPreEffectsVisualOverflowRec
     (Properties().Get(nsIFrame::PreEffectsBBoxProperty()));
   return r ? *r : GetVisualOverflowRectRelativeToSelf();
 }
 
 /* virtual */ bool
 nsFrame::UpdateOverflow()
 {
   MOZ_ASSERT(!(mState & NS_FRAME_SVG_LAYOUT) ||
-             !(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
+             !(mState & NS_FRAME_IS_NONDISPLAY),
              "Non-display SVG do not maintain visual overflow rects");
 
   nsRect rect(nsPoint(0, 0), GetSize());
   nsOverflowAreas overflowAreas(rect, rect);
 
   bool isBox = IsBoxFrame() || IsBoxWrapped();
   if (!isBox || (!IsCollapsed() && !DoesClipChildren())) {
     nsLayoutUtils::UnionChildOverflow(this, overflowAreas);
@@ -6769,17 +6769,17 @@ IsInlineFrame(nsIFrame *aFrame)
   return type == nsGkAtoms::inlineFrame;
 }
 
 bool
 nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
                                  nsSize aNewSize, nsSize* aOldSize)
 {
   NS_ASSERTION(!((GetStateBits() & NS_FRAME_SVG_LAYOUT) &&
-                 (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)),
+                 (GetStateBits() & NS_FRAME_IS_NONDISPLAY)),
                "Don't call - overflow rects not maintained on these SVG frames");
 
   nsRect bounds(nsPoint(0, 0), aNewSize);
   // Store the passed in overflow area if we are a preserve-3d frame,
   // and it's not just the frame bounds.
   if ((Preserves3D() || HasPerspective()) && (!aOverflowAreas.VisualOverflow().IsEqualEdges(bounds) ||
                         !aOverflowAreas.ScrollableOverflow().IsEqualEdges(bounds))) {
     nsOverflowAreas* initial =
@@ -6916,17 +6916,17 @@ nsIFrame::RecomputePerspectiveChildrenOv
     SetSize(aBounds->Size());
   }
   nsIFrame::ChildListIterator lists(this);
   for (; !lists.IsDone(); lists.Next()) {
     nsFrameList::Enumerator childFrames(lists.CurrentList());
     for (; !childFrames.AtEnd(); childFrames.Next()) {
       nsIFrame* child = childFrames.get();
       if ((child->GetStateBits() & NS_FRAME_SVG_LAYOUT) &&
-          (child->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+          (child->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
         continue; // frame does not maintain overflow rects
       }
       if (child->HasPerspective()) {
         nsOverflowAreas* overflow = 
           static_cast<nsOverflowAreas*>(child->Properties().Get(nsIFrame::InitialOverflowProperty()));
         nsRect bounds(nsPoint(0, 0), child->GetSize());
         if (overflow) {
           nsOverflowAreas overflowCopy = *overflow;
@@ -6966,17 +6966,17 @@ RecomputePreserve3DChildrenOverflow(nsIF
     aFrame->SetSize(aBounds->Size());
   }
   nsIFrame::ChildListIterator lists(aFrame);
   for (; !lists.IsDone(); lists.Next()) {
     nsFrameList::Enumerator childFrames(lists.CurrentList());
     for (; !childFrames.AtEnd(); childFrames.Next()) {
       nsIFrame* child = childFrames.get();
       if ((child->GetStateBits() & NS_FRAME_SVG_LAYOUT) &&
-          (child->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+          (child->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
         continue; // frame does not maintain overflow rects
       }
       if (child->Preserves3DChildren()) {
         RecomputePreserve3DChildrenOverflow(child, NULL);
       } else if (child->Preserves3D()) {
         nsOverflowAreas* overflow = 
           static_cast<nsOverflowAreas*>(child->Properties().Get(nsIFrame::InitialOverflowProperty()));
         nsRect bounds(nsPoint(0, 0), child->GetSize());
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -316,16 +316,20 @@ typedef uint64_t nsFrameState;
 // NS_FRAME_NEEDS_PAINT and NS_FRAME_ALL_DESCENDANTS_NEED_PAINT, or they 
 // have no display items.
 #define NS_FRAME_ALL_DESCENDANTS_NEED_PAINT         NS_FRAME_STATE_BIT(51)
 
 // Frame is marked as NS_FRAME_NEEDS_PAINT and also has an explicit
 // rect stored to invalidate.
 #define NS_FRAME_HAS_INVALID_RECT                   NS_FRAME_STATE_BIT(52)
 
+// Frame is not displayed directly due to it being, or being under, an SVG
+// <defs> element or an SVG resource element (<mask>, <pattern>, etc.)
+#define NS_FRAME_IS_NONDISPLAY                      NS_FRAME_STATE_BIT(53)
+
 // Box layout bits
 #define NS_STATE_IS_HORIZONTAL                      NS_FRAME_STATE_BIT(22)
 #define NS_STATE_IS_DIRECTION_NORMAL                NS_FRAME_STATE_BIT(31)
 
 // Helper macros
 #define NS_SUBTREE_DIRTY(_frame)  \
   (((_frame)->GetStateBits() &      \
     (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN)) != 0)
--- a/layout/svg/SVGFEContainerFrame.cpp
+++ b/layout/svg/SVGFEContainerFrame.cpp
@@ -20,17 +20,17 @@ typedef nsContainerFrame SVGFEContainerF
 class SVGFEContainerFrame : public SVGFEContainerFrameBase
 {
   friend nsIFrame*
   NS_NewSVGFEContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   SVGFEContainerFrame(nsStyleContext* aContext)
     : SVGFEContainerFrameBase(aContext)
   {
-    AddStateBits(NS_FRAME_SVG_LAYOUT | NS_STATE_SVG_NONDISPLAY_CHILD);
+    AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   virtual bool IsFrameOfType(uint32_t aFlags) const
   {
     return SVGFEContainerFrameBase::IsFrameOfType(
--- a/layout/svg/SVGFEImageFrame.cpp
+++ b/layout/svg/SVGFEImageFrame.cpp
@@ -20,17 +20,17 @@ typedef nsFrame SVGFEImageFrameBase;
 class SVGFEImageFrame : public SVGFEImageFrameBase
 {
   friend nsIFrame*
   NS_NewSVGFEImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   SVGFEImageFrame(nsStyleContext* aContext)
     : SVGFEImageFrameBase(aContext)
   {
-    AddStateBits(NS_FRAME_SVG_LAYOUT | NS_STATE_SVG_NONDISPLAY_CHILD);
+    AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   virtual void Init(nsIContent* aContent,
                     nsIFrame*   aParent,
                     nsIFrame*   aPrevInFlow) MOZ_OVERRIDE;
--- a/layout/svg/SVGFELeafFrame.cpp
+++ b/layout/svg/SVGFELeafFrame.cpp
@@ -18,17 +18,17 @@ typedef nsFrame SVGFELeafFrameBase;
 class SVGFELeafFrame : public SVGFELeafFrameBase
 {
   friend nsIFrame*
   NS_NewSVGFELeafFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   SVGFELeafFrame(nsStyleContext* aContext)
     : SVGFELeafFrameBase(aContext)
   {
-    AddStateBits(NS_FRAME_SVG_LAYOUT | NS_STATE_SVG_NONDISPLAY_CHILD);
+    AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
 #ifdef DEBUG
   virtual void Init(nsIContent* aContent,
                     nsIFrame*   aParent,
--- a/layout/svg/SVGFEUnstyledLeafFrame.cpp
+++ b/layout/svg/SVGFEUnstyledLeafFrame.cpp
@@ -14,17 +14,17 @@ typedef nsFrame SVGFEUnstyledLeafFrameBa
 class SVGFEUnstyledLeafFrame : public SVGFEUnstyledLeafFrameBase
 {
   friend nsIFrame*
   NS_NewSVGFEUnstyledLeafFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   SVGFEUnstyledLeafFrame(nsStyleContext* aContext)
     : SVGFEUnstyledLeafFrameBase(aContext)
   {
-    AddStateBits(NS_FRAME_SVG_LAYOUT | NS_STATE_SVG_NONDISPLAY_CHILD);
+    AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
                               const nsRect&           aDirtyRect,
                               const nsDisplayListSet& aLists) MOZ_OVERRIDE {}
--- a/layout/svg/SVGViewFrame.cpp
+++ b/layout/svg/SVGViewFrame.cpp
@@ -23,17 +23,17 @@ using namespace mozilla::dom;
 class SVGViewFrame : public SVGViewFrameBase
 {
   friend nsIFrame*
   NS_NewSVGViewFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   SVGViewFrame(nsStyleContext* aContext)
     : SVGViewFrameBase(aContext)
   {
-    AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
+    AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
 #ifdef DEBUG
   virtual void Init(nsIContent* aContent,
                     nsIFrame*   aParent,
--- a/layout/svg/nsISVGChildFrame.h
+++ b/layout/svg/nsISVGChildFrame.h
@@ -52,17 +52,17 @@ public:
   // specified in app units relative to the origin of the outer
   // svg frame (origin ill-defined in the case of borders - bug
   // 290770).  See bug 290852 for foreignObject complications.
   NS_IMETHOD_(nsIFrame*) GetFrameForPoint(const nsPoint &aPoint)=0;
 
   // Get bounds in our gfxContext's coordinates space (in app units)
   NS_IMETHOD_(nsRect) GetCoveredRegion()=0;
 
-  // Called on SVG child frames (except NS_STATE_SVG_NONDISPLAY_CHILD frames)
+  // Called on SVG child frames (except NS_FRAME_IS_NONDISPLAY frames)
   // to update and then invalidate their cached bounds. This method is not
   // called until after the nsSVGOuterSVGFrame has had its initial reflow
   // (i.e. once the SVG viewport dimensions are known). It should also only
   // be called by nsSVGOuterSVGFrame during its reflow.
   virtual void ReflowSVG()=0;
 
   /**
    * Flags used to specify to GetCanvasTM what it's being called for so that it
@@ -76,17 +76,17 @@ public:
     FOR_OUTERSVG_TM
   };
 
   // Flags to pass to NotifySVGChange:
   //
   // DO_NOT_NOTIFY_RENDERING_OBSERVERS - this should only be used when
   //                           updating the descendant frames of a clipPath,
   //                           mask, pattern or marker frame (or other similar
-  //                           NS_STATE_SVG_NONDISPLAY_CHILD frame) immediately
+  //                           NS_FRAME_IS_NONDISPLAY frame) immediately
   //                           prior to painting that frame's descendants.
   // TRANSFORM_CHANGED     - the current transform matrix for this frame has changed
   // COORD_CONTEXT_CHANGED - the dimensions of this frame's coordinate context has
   //                           changed (percentage lengths must be reevaluated)
   enum SVGChangedFlags {
     TRANSFORM_CHANGED     = 0x01,
     COORD_CONTEXT_CHANGED = 0x02,
     FULL_ZOOM_CHANGED     = 0x04
--- a/layout/svg/nsSVGAFrame.cpp
+++ b/layout/svg/nsSVGAFrame.cpp
@@ -140,17 +140,17 @@ nsSVGAFrame::NotifySVGChanged(uint32_t a
 }
 
 //----------------------------------------------------------------------
 // nsSVGContainerFrame methods:
 
 gfxMatrix
 nsSVGAFrame::GetCanvasTM(uint32_t aFor)
 {
-  if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
         (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
     }
   }
   if (!mCanvasTM) {
     NS_ASSERTION(mParent, "null parent");
 
--- a/layout/svg/nsSVGClipPathFrame.h
+++ b/layout/svg/nsSVGClipPathFrame.h
@@ -20,17 +20,17 @@ class nsSVGClipPathFrame : public nsSVGC
 {
   friend nsIFrame*
   NS_NewSVGClipPathFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   nsSVGClipPathFrame(nsStyleContext* aContext)
     : nsSVGClipPathFrameBase(aContext)
     , mInUse(false)
   {
-    AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
+    AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   // nsIFrame methods:
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsRect&           aDirtyRect,
--- a/layout/svg/nsSVGContainerFrame.cpp
+++ b/layout/svg/nsSVGContainerFrame.cpp
@@ -28,17 +28,17 @@ NS_QUERYFRAME_TAIL_INHERITING(nsSVGConta
 nsIFrame*
 NS_NewSVGContainerFrame(nsIPresShell* aPresShell,
                         nsStyleContext* aContext)
 {
   nsIFrame *frame = new (aPresShell) nsSVGContainerFrame(aContext);
   // If we were called directly, then the frame is for a <defs> or
   // an unknown element type. In both cases we prevent the content
   // from displaying directly.
-  frame->AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
+  frame->AddStateBits(NS_FRAME_IS_NONDISPLAY);
   return frame;
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsSVGContainerFrame)
 NS_IMPL_FRAMEARENA_HELPERS(nsSVGDisplayContainerFrame)
 
 NS_IMETHODIMP
 nsSVGContainerFrame::AppendFrames(ChildListID  aListID,
@@ -69,32 +69,32 @@ nsSVGContainerFrame::RemoveFrame(ChildLi
 
   mFrames.DestroyFrame(aOldFrame);
   return NS_OK;
 }
 
 bool
 nsSVGContainerFrame::UpdateOverflow()
 {
-  if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
+  if (mState & NS_FRAME_IS_NONDISPLAY) {
     // We don't maintain overflow rects.
     // XXX It would have be better if the restyle request hadn't even happened.
     return false;
   }
   return nsSVGContainerFrameBase::UpdateOverflow();
 }
 
 void
 nsSVGDisplayContainerFrame::Init(nsIContent* aContent,
                                  nsIFrame* aParent,
                                  nsIFrame* aPrevInFlow)
 {
   if (!(GetStateBits() & NS_STATE_IS_OUTER_SVG)) {
     AddStateBits(aParent->GetStateBits() &
-      (NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD));
+      (NS_FRAME_IS_NONDISPLAY | NS_STATE_SVG_CLIPPATH_CHILD));
   }
   nsSVGContainerFrame::Init(aContent, aParent, aPrevInFlow);
 }
 
 void
 nsSVGDisplayContainerFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                              const nsRect&           aDirtyRect,
                                              const nsDisplayListSet& aLists)
@@ -120,22 +120,22 @@ nsSVGDisplayContainerFrame::InsertFrames
   
   // Insert the new frames
   nsSVGContainerFrame::InsertFrames(aListID, aPrevFrame, aFrameList);
 
   // If we are not a non-display SVG frame and we do not have a bounds update
   // pending, then we need to schedule one for our new children:
   if (!(GetStateBits() &
         (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN |
-         NS_STATE_SVG_NONDISPLAY_CHILD))) {
+         NS_FRAME_IS_NONDISPLAY))) {
     for (nsIFrame* kid = firstNewFrame; kid != firstOldFrame;
          kid = kid->GetNextSibling()) {
       nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);
       if (SVGFrame) {
-        NS_ABORT_IF_FALSE(!(kid->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
+        NS_ABORT_IF_FALSE(!(kid->GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                           "Check for this explicitly in the |if|, then");
         bool isFirstReflow = (kid->GetStateBits() & NS_FRAME_FIRST_REFLOW);
         // Remove bits so that ScheduleBoundsUpdate will work:
         kid->RemoveStateBits(NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY |
                              NS_FRAME_HAS_DIRTY_CHILDREN);
         // No need to invalidate the new kid's old bounds, so we just use
         // nsSVGUtils::ScheduleBoundsUpdate.
         nsSVGUtils::ScheduleReflowSVG(kid);
@@ -160,17 +160,17 @@ nsSVGDisplayContainerFrame::RemoveFrame(
   // nsContainerFrame::RemoveFrame, so it doesn't call FrameNeedsReflow. We
   // need to schedule a repaint and schedule an update to our overflow rects.
   SchedulePaint();
   PresContext()->PresShell()->FrameConstructor()->PostRestyleEvent(
     mContent->AsElement(), nsRestyleHint(0), nsChangeHint_UpdateOverflow);
 
   nsresult rv = nsSVGContainerFrame::RemoveFrame(aListID, aOldFrame);
 
-  if (!(GetStateBits() & (NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_IS_OUTER_SVG))) {
+  if (!(GetStateBits() & (NS_FRAME_IS_NONDISPLAY | NS_STATE_IS_OUTER_SVG))) {
     nsSVGUtils::NotifyAncestorsOfFilterRegionChange(this);
   }
 
   return rv;
 }
 
 bool
 nsSVGDisplayContainerFrame::IsSVGTransformed(gfxMatrix *aOwnTransform,
@@ -205,17 +205,17 @@ nsSVGDisplayContainerFrame::IsSVGTransfo
 //----------------------------------------------------------------------
 // nsISVGChildFrame methods
 
 NS_IMETHODIMP
 nsSVGDisplayContainerFrame::PaintSVG(nsRenderingContext* aContext,
                                      const nsIntRect *aDirtyRect)
 {
   NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
-               (mState & NS_STATE_SVG_NONDISPLAY_CHILD) ||
+               (mState & NS_FRAME_IS_NONDISPLAY) ||
                PresContext()->IsGlyph(),
                "If display lists are enabled, only painting of non-display "
                "SVG should take this code path");
 
   const nsStyleDisplay *display = StyleDisplay();
   if (display->mOpacity == 0.0)
     return NS_OK;
 
@@ -226,17 +226,17 @@ nsSVGDisplayContainerFrame::PaintSVG(nsR
 
   return NS_OK;
 }
 
 NS_IMETHODIMP_(nsIFrame*)
 nsSVGDisplayContainerFrame::GetFrameForPoint(const nsPoint &aPoint)
 {
   NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
-               (mState & NS_STATE_SVG_NONDISPLAY_CHILD),
+               (mState & NS_FRAME_IS_NONDISPLAY),
                "If display lists are enabled, only hit-testing of a "
                "clipPath's contents should take this code path");
   return nsSVGUtils::HitTestChildren(this, aPoint);
 }
 
 NS_IMETHODIMP_(nsRect)
 nsSVGDisplayContainerFrame::GetCoveredRegion()
 {
@@ -244,41 +244,41 @@ nsSVGDisplayContainerFrame::GetCoveredRe
 }
 
 /**
  * Traverses a frame tree, marking any nsSVGTextFrame2 frame as dirty
  * and calling InvalidateRenderingObservers() on it.
  *
  * The reason that this helper exists is because nsSVGTextFrame2 is special.
  * None of the other SVG frames ever need to be reflowed when they have the
- * NS_STATE_SVG_NONDISPLAY_CHILD bit set on them because their PaintSVG methods
+ * NS_FRAME_IS_NONDISPLAY bit set on them because their PaintSVG methods
  * (and those of any containers that they can validly be contained within) do
  * not make use of mRect or overflow rects. "em" lengths, etc., are resolved
  * as those elements are painted.
  *
  * nsSVGTextFrame2 is different because its anonymous block and inline frames
  * need to be reflowed in order to get the correct metrics when things like
  * inherited font-size of an ancestor changes, or a delayed webfont loads and
  * applies.
  *
  * We assume that any change that requires the anonymous kid of an
  * nsSVGTextFrame2 to reflow will result in an NS_FRAME_IS_DIRTY reflow. When
- * that reflow reaches an NS_STATE_SVG_NONDISPLAY_CHILD frame it would normally
+ * that reflow reaches an NS_FRAME_IS_NONDISPLAY frame it would normally
  * stop, but this helper looks for any nsSVGTextFrame2 descendants of such
  * frames and marks them NS_FRAME_IS_DIRTY so that the next time that they are
  * painted their anonymous kid will first get the necessary reflow.
  */
 static void
 ReflowSVGNonDisplayText(nsSVGContainerFrame* aContainer)
 {
   NS_ASSERTION(aContainer->GetStateBits() & NS_FRAME_IS_DIRTY,
                "expected aContainer to be NS_FRAME_IS_DIRTY");
-  NS_ASSERTION(aContainer->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD,
+  NS_ASSERTION(aContainer->GetStateBits() & NS_FRAME_IS_NONDISPLAY,
                "it is wasteful to call ReflowSVGNonDisplayText on a container "
-               "frame that is not NS_STATE_SVG_NONDISPLAY_CHILD");
+               "frame that is not NS_FRAME_IS_NONDISPLAY");
   for (nsIFrame* kid = aContainer->GetFirstPrincipalChild(); kid;
        kid = kid->GetNextSibling()) {
     if (kid->GetType() == nsGkAtoms::svgTextFrame2) {
       static_cast<nsSVGTextFrame2*>(kid)->ReflowSVGNonDisplayText();
     } else {
       nsSVGContainerFrame* kidContainer = do_QueryFrame(kid);
       if (kidContainer && kidContainer->GetContent()->IsSVG()) {
         ReflowSVGNonDisplayText(kidContainer);
@@ -288,17 +288,17 @@ ReflowSVGNonDisplayText(nsSVGContainerFr
 }
 
 void
 nsSVGDisplayContainerFrame::ReflowSVG()
 {
   NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
                "This call is probably a wasteful mistake");
 
-  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
+  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                     "ReflowSVG mechanism not designed for this");
 
   NS_ABORT_IF_FALSE(GetType() != nsGkAtoms::svgOuterSVGFrame,
                     "Do not call on outer-<svg>");
 
   if (!nsSVGUtils::NeedsReflowSVG(this)) {
     return;
   }
@@ -318,31 +318,31 @@ nsSVGDisplayContainerFrame::ReflowSVG()
   }
 
   nsOverflowAreas overflowRects;
 
   for (nsIFrame* kid = mFrames.FirstChild(); kid;
        kid = kid->GetNextSibling()) {
     nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);
     if (SVGFrame) {
-      NS_ABORT_IF_FALSE(!(kid->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
+      NS_ABORT_IF_FALSE(!(kid->GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                         "Check for this explicitly in the |if|, then");
       kid->AddStateBits(mState & NS_FRAME_IS_DIRTY);
       SVGFrame->ReflowSVG();
 
       // We build up our child frame overflows here instead of using
       // nsLayoutUtils::UnionChildOverflow since SVG frame's all use the same
       // frame list, and we're iterating over that list now anyway.
       ConsiderChildOverflow(overflowRects, kid);
     } else {
       // Inside a non-display container frame, we might have some
       // nsSVGTextFrame2s.  We need to cause those to get reflowed in
       // case they are the target of a rendering observer.
-      NS_ASSERTION(kid->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD,
-                   "expected kid to be a NS_STATE_SVG_NONDISPLAY_CHILD frame");
+      NS_ASSERTION(kid->GetStateBits() & NS_FRAME_IS_NONDISPLAY,
+                   "expected kid to be a NS_FRAME_IS_NONDISPLAY frame");
       if (kid->GetStateBits() & NS_FRAME_IS_DIRTY) {
         nsSVGContainerFrame* container = do_QueryFrame(kid);
         if (container && container->GetContent()->IsSVG()) {
           ReflowSVGNonDisplayText(container);
         }
       }
     }
   }
--- a/layout/svg/nsSVGFilterFrame.cpp
+++ b/layout/svg/nsSVGFilterFrame.cpp
@@ -502,17 +502,17 @@ nsSVGFilterFrame::GetPreFilterNeededArea
 }
 
 nsRect
 nsSVGFilterFrame::GetPostFilterBounds(nsIFrame *aFilteredFrame,
                                       const gfxRect *aOverrideBBox,
                                       const nsRect *aPreFilterBounds)
 {
   MOZ_ASSERT(!(aFilteredFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) ||
-             !(aFilteredFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
+             !(aFilteredFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY),
              "Non-display SVG do not maintain visual overflow rects");
 
   nsAutoFilterInstance instance(aFilteredFrame, this, nullptr, nullptr,
                                 aPreFilterBounds, aPreFilterBounds,
                                 aOverrideBBox);
   if (!instance.get()) {
     return nsRect();
   }
--- a/layout/svg/nsSVGFilterFrame.h
+++ b/layout/svg/nsSVGFilterFrame.h
@@ -36,17 +36,17 @@ class nsSVGFilterFrame : public nsSVGFil
   friend nsIFrame*
   NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   nsSVGFilterFrame(nsStyleContext* aContext)
     : nsSVGFilterFrameBase(aContext),
       mLoopFlag(false),
       mNoHRefURI(false)
   {
-    AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
+    AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   // nsIFrame methods:
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsRect&           aDirtyRect,
--- a/layout/svg/nsSVGForeignObjectFrame.cpp
+++ b/layout/svg/nsSVGForeignObjectFrame.cpp
@@ -57,28 +57,28 @@ nsSVGForeignObjectFrame::Init(nsIContent
                               nsIFrame*   aParent,
                               nsIFrame*   aPrevInFlow)
 {
   NS_ASSERTION(aContent->IsSVG(nsGkAtoms::foreignObject),
                "Content is not an SVG foreignObject!");
 
   nsSVGForeignObjectFrameBase::Init(aContent, aParent, aPrevInFlow);
   AddStateBits(aParent->GetStateBits() &
-               (NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD));
+               (NS_FRAME_IS_NONDISPLAY | NS_STATE_SVG_CLIPPATH_CHILD));
   AddStateBits(NS_FRAME_FONT_INFLATION_CONTAINER |
                NS_FRAME_FONT_INFLATION_FLOW_ROOT);
-  if (!(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(mState & NS_FRAME_IS_NONDISPLAY)) {
     nsSVGUtils::GetOuterSVGFrame(this)->RegisterForeignObject(this);
   }
 }
 
 void nsSVGForeignObjectFrame::DestroyFrom(nsIFrame* aDestructRoot)
 {
   // Only unregister if we registered in the first place:
-  if (!(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(mState & NS_FRAME_IS_NONDISPLAY)) {
       nsSVGUtils::GetOuterSVGFrame(this)->UnregisterForeignObject(this);
   }
   nsSVGForeignObjectFrameBase::DestroyFrom(aDestructRoot);
 }
 
 nsIAtom *
 nsSVGForeignObjectFrame::GetType() const
 {
@@ -119,17 +119,17 @@ nsSVGForeignObjectFrame::AttributeChange
 }
 
 NS_IMETHODIMP
 nsSVGForeignObjectFrame::Reflow(nsPresContext*           aPresContext,
                                 nsHTMLReflowMetrics&     aDesiredSize,
                                 const nsHTMLReflowState& aReflowState,
                                 nsReflowStatus&          aStatus)
 {
-  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
+  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                     "Should not have been called");
 
   // Only InvalidateAndScheduleBoundsUpdate marks us with NS_FRAME_IS_DIRTY,
   // so if that bit is still set we still have a resize pending. If we hit
   // this assertion, then we should get the presShell to skip reflow roots
   // that have a dirty parent since a reflow is going to come via the
   // reflow root's parent anyway.
   NS_ASSERTION(!(GetStateBits() & NS_FRAME_IS_DIRTY),
@@ -193,17 +193,17 @@ nsSVGForeignObjectFrame::IsSVGTransforme
   return foundTransform;
 }
 
 NS_IMETHODIMP
 nsSVGForeignObjectFrame::PaintSVG(nsRenderingContext *aContext,
                                   const nsIntRect *aDirtyRect)
 {
   NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
-               (mState & NS_STATE_SVG_NONDISPLAY_CHILD),
+               (mState & NS_FRAME_IS_NONDISPLAY),
                "If display lists are enabled, only painting of non-display "
                "SVG should take this code path");
 
   if (IsDisabled())
     return NS_OK;
 
   nsIFrame* kid = GetFirstPrincipalChild();
   if (!kid)
@@ -216,17 +216,17 @@ nsSVGForeignObjectFrame::PaintSVG(nsRend
     return NS_ERROR_FAILURE;
   }
 
   nsRect kidDirtyRect = kid->GetVisualOverflowRect();
 
   /* Check if we need to draw anything. */
   if (aDirtyRect) {
     NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
-                 (mState & NS_STATE_SVG_NONDISPLAY_CHILD),
+                 (mState & NS_FRAME_IS_NONDISPLAY),
                  "Display lists handle dirty rect intersection test");
     // Transform the dirty rect into app units in our userspace.
     gfxMatrix invmatrix = canvasTM;
     invmatrix.Invert();
     NS_ASSERTION(!invmatrix.IsSingular(),
                  "inverse of non-singular matrix should be non-singular");
 
     gfxRect transDirtyRect = gfxRect(aDirtyRect->x, aDirtyRect->y,
@@ -280,21 +280,21 @@ nsSVGForeignObjectFrame::PaintSVG(nsRend
 
   return rv;
 }
 
 NS_IMETHODIMP_(nsIFrame*)
 nsSVGForeignObjectFrame::GetFrameForPoint(const nsPoint &aPoint)
 {
   NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
-               (mState & NS_STATE_SVG_NONDISPLAY_CHILD),
+               (mState & NS_FRAME_IS_NONDISPLAY),
                "If display lists are enabled, only hit-testing of a "
                "clipPath's contents should take this code path");
 
-  if (IsDisabled() || (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD))
+  if (IsDisabled() || (GetStateBits() & NS_FRAME_IS_NONDISPLAY))
     return nullptr;
 
   nsIFrame* kid = GetFirstPrincipalChild();
   if (!kid)
     return nullptr;
 
   float x, y, width, height;
   static_cast<nsSVGElement*>(mContent)->
@@ -339,17 +339,17 @@ nsSVGForeignObjectFrame::GetCoveredRegio
 }
 
 void
 nsSVGForeignObjectFrame::ReflowSVG()
 {
   NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
                "This call is probably a wasteful mistake");
 
-  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
+  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                     "ReflowSVG mechanism not designed for this");
 
   if (!nsSVGUtils::NeedsReflowSVG(this)) {
     return;
   }
 
   // We update mRect before the DoReflow call so that DoReflow uses the
   // correct dimensions:
@@ -484,17 +484,17 @@ nsSVGForeignObjectFrame::GetBBoxContribu
   return aToBBoxUserspace.TransformBounds(gfxRect(0.0, 0.0, w, h));
 }
 
 //----------------------------------------------------------------------
 
 gfxMatrix
 nsSVGForeignObjectFrame::GetCanvasTM(uint32_t aFor)
 {
-  if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
         (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
     }
   }
   if (!mCanvasTM) {
     NS_ASSERTION(mParent, "null parent");
 
--- a/layout/svg/nsSVGGFrame.cpp
+++ b/layout/svg/nsSVGGFrame.cpp
@@ -62,17 +62,17 @@ nsSVGGFrame::NotifySVGChanged(uint32_t a
   }
 
   nsSVGGFrameBase::NotifySVGChanged(aFlags);
 }
 
 gfxMatrix
 nsSVGGFrame::GetCanvasTM(uint32_t aFor)
 {
-  if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
         (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
     }
   }
   if (!mCanvasTM) {
     NS_ASSERTION(mParent, "null parent");
 
--- a/layout/svg/nsSVGGenericContainerFrame.cpp
+++ b/layout/svg/nsSVGGenericContainerFrame.cpp
@@ -43,17 +43,17 @@ nsSVGGenericContainerFrame::GetType() co
 }
 
 //----------------------------------------------------------------------
 // nsSVGContainerFrame methods:
 
 gfxMatrix
 nsSVGGenericContainerFrame::GetCanvasTM(uint32_t aFor)
 {
-  if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
         (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
     }
   }
 
   NS_ASSERTION(mParent, "null parent");
   
--- a/layout/svg/nsSVGGeometryFrame.cpp
+++ b/layout/svg/nsSVGGeometryFrame.cpp
@@ -20,17 +20,17 @@ NS_IMPL_FRAMEARENA_HELPERS(nsSVGGeometry
 // nsIFrame methods
 
 void
 nsSVGGeometryFrame::Init(nsIContent* aContent,
                          nsIFrame* aParent,
                          nsIFrame* aPrevInFlow)
 {
   AddStateBits(aParent->GetStateBits() &
-               (NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD));
+               (NS_FRAME_IS_NONDISPLAY | NS_STATE_SVG_CLIPPATH_CHILD));
   nsSVGGeometryFrameBase::Init(aContent, aParent, aPrevInFlow);
 }
 
 //----------------------------------------------------------------------
 
 uint16_t
 nsSVGGeometryFrame::GetClipRule()
 {
--- a/layout/svg/nsSVGGlyphFrame.cpp
+++ b/layout/svg/nsSVGGlyphFrame.cpp
@@ -302,17 +302,17 @@ nsSVGGlyphFrame::CharacterDataChanged(Ch
 #define PRECISE_SIZE   200
 
 /* virtual */ void
 nsSVGGlyphFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
 {
   nsSVGGlyphFrameBase::DidSetStyleContext(aOldStyleContext);
 
   if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW) ||
-      (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+      (GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     ClearTextRun();
     NotifyGlyphMetricsChange();
   }
 }
 
 void
 nsSVGGlyphFrame::Init(nsIContent* aContent,
                       nsIFrame* aParent,
@@ -494,17 +494,17 @@ nsSVGGlyphFrame::GetCoveredRegion()
 }
 
 void
 nsSVGGlyphFrame::ReflowSVG()
 {
   NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
                "This call is probably a wasteful mistake");
 
-  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
+  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                     "ReflowSVG mechanism not designed for this");
 
   mRect.SetEmpty();
 
   uint32_t flags = nsSVGUtils::eBBoxIncludeFill |
                    nsSVGUtils::eBBoxIncludeStroke |
                    nsSVGUtils::eBBoxIncludeMarkers;
   // Our "visual" overflow rect needs to be valid for building display lists
@@ -672,17 +672,17 @@ nsSVGGlyphFrame::GetBBoxContribution(con
 // nsSVGGeometryFrame methods:
 
 gfxMatrix
 nsSVGGlyphFrame::GetCanvasTM(uint32_t aFor)
 {
   if (mOverrideCanvasTM) {
     return *mOverrideCanvasTM;
   }
-  if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
         (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
     }
   }
   NS_ASSERTION(mParent, "null parent");
   return static_cast<nsSVGContainerFrame*>(mParent)->GetCanvasTM(aFor);
 }
@@ -1674,17 +1674,17 @@ nsSVGGlyphFrame::EnsureTextRun(float *aD
     nsBidiPresUtils::CopyLogicalToVisual(text, visualText,
                                          baseDirection, bidiOverride);
     if (!visualText.IsEmpty()) {
       text = visualText;
     }
 
     gfxMatrix m;
     if (aForceGlobalTransform ||
-        !(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+        !(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
       m = GetCanvasTM(mGetCanvasTMForFlag);
       if (m.IsSingular())
         return false;
     }
 
     // The context scale is the ratio of the length of the transformed
     // diagonal vector (1,1) to the length of the untransformed diagonal
     // (which is sqrt(2)).
--- a/layout/svg/nsSVGImageFrame.cpp
+++ b/layout/svg/nsSVGImageFrame.cpp
@@ -318,17 +318,17 @@ nsSVGImageFrame::PaintSVG(nsRenderingCon
     if (opacity != 1.0f) {
       ctx->PushGroup(gfxASurface::CONTENT_COLOR_ALPHA);
     }
 
     nscoord appUnitsPerDevPx = PresContext()->AppUnitsPerDevPixel();
     nsRect dirtyRect; // only used if aDirtyRect is non-null
     if (aDirtyRect) {
       NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
-                   (mState & NS_STATE_SVG_NONDISPLAY_CHILD),
+                   (mState & NS_FRAME_IS_NONDISPLAY),
                    "Display lists handle dirty rect intersection test");
       dirtyRect = aDirtyRect->ToAppUnits(appUnitsPerDevPx);
       // Adjust dirtyRect to match our local coordinate system.
       nsRect rootRect =
         nsSVGUtils::TransformFrameRectToOuterSVG(mRect,
                       GetCanvasTM(FOR_PAINTING), PresContext());
       dirtyRect.MoveBy(-rootRect.TopLeft());
     }
@@ -427,17 +427,17 @@ nsSVGImageFrame::GetType() const
 // Lie about our fill/stroke so that covered region and hit detection work properly
 
 void
 nsSVGImageFrame::ReflowSVG()
 {
   NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
                "This call is probably a wasteful mistake");
 
-  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
+  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                     "ReflowSVG mechanism not designed for this");
 
   if (!nsSVGUtils::NeedsReflowSVG(this)) {
     return;
   }
 
   gfxContext tmpCtx(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
 
--- a/layout/svg/nsSVGInnerSVGFrame.cpp
+++ b/layout/svg/nsSVGInnerSVGFrame.cpp
@@ -57,17 +57,17 @@ nsSVGInnerSVGFrame::GetType() const
 //----------------------------------------------------------------------
 // nsISVGChildFrame methods
 
 NS_IMETHODIMP
 nsSVGInnerSVGFrame::PaintSVG(nsRenderingContext *aContext,
                              const nsIntRect *aDirtyRect)
 {
   NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
-               (mState & NS_STATE_SVG_NONDISPLAY_CHILD),
+               (mState & NS_FRAME_IS_NONDISPLAY),
                "If display lists are enabled, only painting of non-display "
                "SVG should take this code path");
 
   gfxContextAutoSaveRestore autoSR;
 
   if (StyleDisplay()->IsScrollableOverflow()) {
     float x, y, width, height;
     static_cast<SVGSVGElement*>(mContent)->
@@ -162,17 +162,17 @@ nsSVGInnerSVGFrame::NotifySVGChanged(uin
 }
 
 NS_IMETHODIMP
 nsSVGInnerSVGFrame::AttributeChanged(int32_t  aNameSpaceID,
                                      nsIAtom* aAttribute,
                                      int32_t  aModType)
 {
   if (aNameSpaceID == kNameSpaceID_None &&
-      !(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+      !(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
 
     SVGSVGElement* content = static_cast<SVGSVGElement*>(mContent);
 
     if (aAttribute == nsGkAtoms::width ||
         aAttribute == nsGkAtoms::height) {
       nsSVGEffects::InvalidateRenderingObservers(this);
       nsSVGUtils::ScheduleReflowSVG(this);
 
@@ -223,17 +223,17 @@ nsSVGInnerSVGFrame::AttributeChanged(int
 
   return NS_OK;
 }
 
 NS_IMETHODIMP_(nsIFrame*)
 nsSVGInnerSVGFrame::GetFrameForPoint(const nsPoint &aPoint)
 {
   NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
-               (mState & NS_STATE_SVG_NONDISPLAY_CHILD),
+               (mState & NS_FRAME_IS_NONDISPLAY),
                "If display lists are enabled, only hit-testing of non-display "
                "SVG should take this code path");
 
   if (StyleDisplay()->IsScrollableOverflow()) {
     nsSVGElement *content = static_cast<nsSVGElement*>(mContent);
     nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(mParent);
 
     float clipX, clipY, clipWidth, clipHeight;
@@ -265,17 +265,17 @@ nsSVGInnerSVGFrame::NotifyViewportOrTran
 }
 
 //----------------------------------------------------------------------
 // nsSVGContainerFrame methods:
 
 gfxMatrix
 nsSVGInnerSVGFrame::GetCanvasTM(uint32_t aFor)
 {
-  if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
         (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
     }
   }
   if (!mCanvasTM) {
     NS_ASSERTION(mParent, "null parent");
 
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -397,17 +397,17 @@ nsSVGIntegrationUtils::PaintFramesWithEf
                                               nsIFrame* aFrame,
                                               const nsRect& aDirtyRect,
                                               nsDisplayListBuilder* aBuilder,
                                               LayerManager *aLayerManager)
 {
 #ifdef DEBUG
   NS_ASSERTION(!(aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) ||
                (NS_SVGDisplayListPaintingEnabled() &&
-                !(aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)),
+                !(aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)),
                "Should not use nsSVGIntegrationUtils on this SVG frame");
 #endif
 
   /* SVG defines the following rendering model:
    *
    *  1. Render geometry
    *  2. Apply filter
    *  3. Apply clipping, masking, group opacity
--- a/layout/svg/nsSVGMarkerFrame.h
+++ b/layout/svg/nsSVGMarkerFrame.h
@@ -39,17 +39,17 @@ class nsSVGMarkerFrame : public nsSVGMar
   NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   nsSVGMarkerFrame(nsStyleContext* aContext)
     : nsSVGMarkerFrameBase(aContext)
     , mMarkedFrame(nullptr)
     , mInUse(false)
     , mInUse2(false)
   {
-    AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
+    AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   // nsIFrame interface:
 #ifdef DEBUG
   virtual void Init(nsIContent*      aContent,
--- a/layout/svg/nsSVGMaskFrame.h
+++ b/layout/svg/nsSVGMaskFrame.h
@@ -21,17 +21,17 @@ class nsSVGMaskFrame : public nsSVGMaskF
 {
   friend nsIFrame*
   NS_NewSVGMaskFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   nsSVGMaskFrame(nsStyleContext* aContext)
     : nsSVGMaskFrameBase(aContext)
     , mInUse(false)
   {
-    AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
+    AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   // nsSVGMaskFrame method:
   already_AddRefed<gfxPattern> ComputeMaskAlpha(nsRenderingContext *aContext,
                                                 nsIFrame* aParent,
--- a/layout/svg/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/nsSVGOuterSVGFrame.cpp
@@ -156,32 +156,32 @@ nsSVGOuterSVGFrame::Init(nsIContent* aCo
                NS_FRAME_FONT_INFLATION_CONTAINER |
                NS_FRAME_FONT_INFLATION_FLOW_ROOT);
 
   // Check for conditional processing attributes here rather than in
   // nsCSSFrameConstructor::FindSVGData because we want to avoid
   // simply giving failing outer <svg> elements an nsSVGContainerFrame.
   // We don't create other SVG frames if PassesConditionalProcessingTests
   // returns false, but since we do create nsSVGOuterSVGFrame frames we
-  // prevent them from painting by [ab]use NS_STATE_SVG_NONDISPLAY_CHILD. The
+  // prevent them from painting by [ab]use NS_FRAME_IS_NONDISPLAY. The
   // frame will be recreated via an nsChangeHint_ReconstructFrame restyle if
   // the value returned by PassesConditionalProcessingTests changes.
   SVGSVGElement *svg = static_cast<SVGSVGElement*>(aContent);
   if (!svg->PassesConditionalProcessingTests()) {
-    AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
+    AddStateBits(NS_FRAME_IS_NONDISPLAY);
   } else {
     // If this outer <svg> element is the child of a <foreignObject> that
     // is non-display, or is the child of a frame for HTML content that
     // itself is a descendant of a non-display SVG frame, then we want to
     // it non-display also.  The second case is not as simple to handle
     // as copying a state bit from the parent, since non-SVG frames do
-    // not use NS_STATE_SVG_NONDISPLAY_CHILD.
+    // not use NS_FRAME_IS_NONDISPLAY.
     for (nsIFrame* f = aParent; f; f = f->GetParent()) {
       if (f->IsFrameOfType(eSVG)) {
-        AddStateBits(f->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD);
+        AddStateBits(f->GetStateBits() & NS_FRAME_IS_NONDISPLAY);
         break;
       }
     }
   }
 
   nsSVGOuterSVGFrameBase::Init(aContent, aParent, aPrevInFlow);
 
   nsIDocument* doc = mContent->GetCurrentDoc();
@@ -471,17 +471,17 @@ nsSVGOuterSVGFrame::Reflow(nsPresContext
     changeBits |= FULL_ZOOM_CHANGED;
     mFullZoom = PresContext()->GetFullZoom();
   }
   if (changeBits) {
     NotifyViewportOrTransformChanged(changeBits);
   }
   mViewportInitialized = true;
 
-  if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     // Now that we've marked the necessary children as dirty, call
     // ReflowSVG() on them:
 
     mCallingReflowSVG = true;
 
     // Update the mRects and visual overflow rects of all our descendants,
     // including our anonymous wrapper kid:
     anonKid->AddStateBits(mState & NS_FRAME_IS_DIRTY);
@@ -716,17 +716,17 @@ DependsOnIntrinsicSize(const nsIFrame* a
 }
 
 NS_IMETHODIMP
 nsSVGOuterSVGFrame::AttributeChanged(int32_t  aNameSpaceID,
                                      nsIAtom* aAttribute,
                                      int32_t  aModType)
 {
   if (aNameSpaceID == kNameSpaceID_None &&
-      !(GetStateBits() & (NS_FRAME_FIRST_REFLOW | NS_STATE_SVG_NONDISPLAY_CHILD))) {
+      !(GetStateBits() & (NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_NONDISPLAY))) {
     if (aAttribute == nsGkAtoms::viewBox ||
         aAttribute == nsGkAtoms::preserveAspectRatio ||
         aAttribute == nsGkAtoms::transform) {
 
       // make sure our cached transform matrix gets (lazily) updated
       mCanvasTM = nullptr;
 
       nsSVGUtils::NotifyChildrenOfSVGChange(GetFirstPrincipalChild(),
@@ -767,17 +767,17 @@ nsSVGOuterSVGFrame::AttributeChanged(int
 //----------------------------------------------------------------------
 // painting
 
 void
 nsSVGOuterSVGFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                      const nsRect&           aDirtyRect,
                                      const nsDisplayListSet& aLists)
 {
-  if (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) {
+  if (GetStateBits() & NS_FRAME_IS_NONDISPLAY) {
     return;
   }
 
   DisplayBorderBackgroundOutline(aBuilder, aLists);
 
   // Per-spec, we always clip root-<svg> even when 'overflow' has its initial
   // value of 'visible'. See also the "visual overflow" comments in Reflow.
   DisplayListClipState::AutoSaveRestore autoSR(aBuilder);
@@ -858,17 +858,17 @@ nsSVGOuterSVGFrame::NotifyViewportOrTran
     aFlags = (aFlags & ~FULL_ZOOM_CHANGED) | TRANSFORM_CHANGED;
   }
 
   if (aFlags & TRANSFORM_CHANGED) {
     // Make sure our canvas transform matrix gets (lazily) recalculated:
     mCanvasTM = nullptr;
 
     if (haveNonFulLZoomTransformChange &&
-        !(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+        !(mState & NS_FRAME_IS_NONDISPLAY)) {
       uint32_t flags = (mState & NS_FRAME_IN_REFLOW) ?
                          SVGSVGElement::eDuringReflow : 0;
       content->ChildrenOnlyTransformChanged(flags);
     }
   }
 
   nsSVGUtils::NotifyChildrenOfSVGChange(GetFirstPrincipalChild(), aFlags);
 }
@@ -905,17 +905,17 @@ nsSVGOuterSVGFrame::GetBBoxContribution(
 }
 
 //----------------------------------------------------------------------
 // nsSVGContainerFrame methods:
 
 gfxMatrix
 nsSVGOuterSVGFrame::GetCanvasTM(uint32_t aFor)
 {
-  if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
         (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
     }
   }
   if (!mCanvasTM) {
     SVGSVGElement *content = static_cast<SVGSVGElement*>(mContent);
 
--- a/layout/svg/nsSVGPaintServerFrame.h
+++ b/layout/svg/nsSVGPaintServerFrame.h
@@ -24,17 +24,17 @@ struct gfxRect;
 typedef nsSVGContainerFrame nsSVGPaintServerFrameBase;
 
 class nsSVGPaintServerFrame : public nsSVGPaintServerFrameBase
 {
 protected:
   nsSVGPaintServerFrame(nsStyleContext* aContext)
     : nsSVGPaintServerFrameBase(aContext)
   {
-    AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
+    AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   /**
    * Constructs a gfxPattern of the paint server rendering.
    *
--- a/layout/svg/nsSVGPathGeometryFrame.cpp
+++ b/layout/svg/nsSVGPathGeometryFrame.cpp
@@ -266,17 +266,17 @@ nsSVGPathGeometryFrame::GetCoveredRegion
 }
 
 void
 nsSVGPathGeometryFrame::ReflowSVG()
 {
   NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
                "This call is probably a wasteful mistake");
 
-  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
+  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                     "ReflowSVG mechanism not designed for this");
 
   if (!nsSVGUtils::NeedsReflowSVG(this)) {
     return;
   }
 
   uint32_t flags = nsSVGUtils::eBBoxIncludeFill |
                    nsSVGUtils::eBBoxIncludeStroke |
@@ -477,17 +477,17 @@ nsSVGPathGeometryFrame::GetBBoxContribut
 }
 
 //----------------------------------------------------------------------
 // nsSVGGeometryFrame methods:
 
 gfxMatrix
 nsSVGPathGeometryFrame::GetCanvasTM(uint32_t aFor)
 {
-  if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
         (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
     }
   }
 
   NS_ASSERTION(mParent, "null parent");
 
--- a/layout/svg/nsSVGStopFrame.cpp
+++ b/layout/svg/nsSVGStopFrame.cpp
@@ -18,17 +18,17 @@ typedef nsFrame  nsSVGStopFrameBase;
 class nsSVGStopFrame : public nsSVGStopFrameBase
 {
   friend nsIFrame*
   NS_NewSVGStopFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   nsSVGStopFrame(nsStyleContext* aContext)
     : nsSVGStopFrameBase(aContext)
   {
-    AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
+    AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   // nsIFrame interface:
 #ifdef DEBUG
   virtual void Init(nsIContent*      aContent,
--- a/layout/svg/nsSVGSwitchFrame.cpp
+++ b/layout/svg/nsSVGSwitchFrame.cpp
@@ -103,17 +103,17 @@ nsSVGSwitchFrame::BuildDisplayList(nsDis
   }
 }
 
 NS_IMETHODIMP
 nsSVGSwitchFrame::PaintSVG(nsRenderingContext* aContext,
                            const nsIntRect *aDirtyRect)
 {
   NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
-               (mState & NS_STATE_SVG_NONDISPLAY_CHILD),
+               (mState & NS_FRAME_IS_NONDISPLAY),
                "If display lists are enabled, only painting of non-display "
                "SVG should take this code path");
 
   if (StyleDisplay()->mOpacity == 0.0)
     return NS_OK;
 
   nsIFrame *kid = GetActiveChildFrame();
   if (kid) {
@@ -122,17 +122,17 @@ nsSVGSwitchFrame::PaintSVG(nsRenderingCo
   return NS_OK;
 }
 
 
 NS_IMETHODIMP_(nsIFrame*)
 nsSVGSwitchFrame::GetFrameForPoint(const nsPoint &aPoint)
 {
   NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
-               (mState & NS_STATE_SVG_NONDISPLAY_CHILD),
+               (mState & NS_FRAME_IS_NONDISPLAY),
                "If display lists are enabled, only hit-testing of non-display "
                "SVG should take this code path");
 
   nsIFrame *kid = GetActiveChildFrame();
   if (kid) {
     nsISVGChildFrame* svgFrame = do_QueryFrame(kid);
     if (svgFrame) {
       return svgFrame->GetFrameForPoint(aPoint);
@@ -158,17 +158,17 @@ nsSVGSwitchFrame::GetCoveredRegion()
 }
 
 void
 nsSVGSwitchFrame::ReflowSVG()
 {
   NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
                "This call is probably a wasteful mistake");
 
-  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
+  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                     "ReflowSVG mechanism not designed for this");
 
   if (!nsSVGUtils::NeedsReflowSVG(this)) {
     return;
   }
 
   // If the NS_FRAME_FIRST_REFLOW bit has been removed from our parent frame,
   // then our outer-<svg> has previously had its initial reflow. In that case
@@ -185,17 +185,17 @@ nsSVGSwitchFrame::ReflowSVG()
   }
 
   nsOverflowAreas overflowRects;
 
   nsIFrame *child = GetActiveChildFrame();
   if (child) {
     nsISVGChildFrame* svgChild = do_QueryFrame(child);
     if (svgChild) {
-      NS_ABORT_IF_FALSE(!(child->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
+      NS_ABORT_IF_FALSE(!(child->GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                         "Check for this explicitly in the |if|, then");
       svgChild->ReflowSVG();
 
       // We build up our child frame overflows here instead of using
       // nsLayoutUtils::UnionChildOverflow since SVG frame's all use the same
       // frame list, and we're iterating over that list now anyway.
       ConsiderChildOverflow(overflowRects, child);
     }
--- a/layout/svg/nsSVGTSpanFrame.cpp
+++ b/layout/svg/nsSVGTSpanFrame.cpp
@@ -88,17 +88,17 @@ nsSVGTSpanFrame::AttributeChanged(int32_
 }
 
 //----------------------------------------------------------------------
 // nsSVGContainerFrame methods:
 
 gfxMatrix
 nsSVGTSpanFrame::GetCanvasTM(uint32_t aFor)
 {
-  if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
         (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
     }
   }
   NS_ASSERTION(mParent, "null parent");
   return static_cast<nsSVGContainerFrame*>(mParent)->GetCanvasTM(aFor);
 }
--- a/layout/svg/nsSVGTextFrame.cpp
+++ b/layout/svg/nsSVGTextFrame.cpp
@@ -201,45 +201,45 @@ nsSVGTextFrame::NotifySVGChanged(uint32_
   }
 }
 
 NS_IMETHODIMP
 nsSVGTextFrame::PaintSVG(nsRenderingContext* aContext,
                          const nsIntRect *aDirtyRect)
 {
   NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
-               (mState & NS_STATE_SVG_NONDISPLAY_CHILD),
+               (mState & NS_FRAME_IS_NONDISPLAY),
                "If display lists are enabled, only painting of non-display "
                "SVG should take this code path");
 
   UpdateGlyphPositioning(true);
   
   return nsSVGTextFrameBase::PaintSVG(aContext, aDirtyRect);
 }
 
 NS_IMETHODIMP_(nsIFrame*)
 nsSVGTextFrame::GetFrameForPoint(const nsPoint &aPoint)
 {
   NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
-               (mState & NS_STATE_SVG_NONDISPLAY_CHILD),
+               (mState & NS_FRAME_IS_NONDISPLAY),
                "If display lists are enabled, only hit-testing of non-display "
                "SVG should take this code path");
 
   UpdateGlyphPositioning(true);
   
   return nsSVGTextFrameBase::GetFrameForPoint(aPoint);
 }
 
 void
 nsSVGTextFrame::ReflowSVG()
 {
   NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
                "This call is probably a wasteful mistake");
 
-  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
+  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                     "ReflowSVG mechanism not designed for this");
 
   if (!nsSVGUtils::NeedsReflowSVG(this)) {
     NS_ASSERTION(!(mState & NS_STATE_SVG_POSITIONING_DIRTY), "How did this happen?");
     return;
   }
 
   // UpdateGlyphPositioning may have been called under DOM calls and cleared
@@ -265,17 +265,17 @@ nsSVGTextFrame::GetBBoxContribution(cons
 }
 
 //----------------------------------------------------------------------
 // nsSVGContainerFrame methods:
 
 gfxMatrix
 nsSVGTextFrame::GetCanvasTM(uint32_t aFor)
 {
-  if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
         (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
     }
   }
 
   if (!mCanvasTM) {
     NS_ASSERTION(mParent, "null parent");
--- a/layout/svg/nsSVGTextFrame2.cpp
+++ b/layout/svg/nsSVGTextFrame2.cpp
@@ -3019,17 +3019,17 @@ void
 nsSVGTextFrame2::Init(nsIContent* aContent,
                       nsIFrame* aParent,
                       nsIFrame* aPrevInFlow)
 {
   NS_ASSERTION(aContent->IsSVG(nsGkAtoms::text), "Content is not an SVG text");
 
   nsSVGTextFrame2Base::Init(aContent, aParent, aPrevInFlow);
   AddStateBits((aParent->GetStateBits() &
-                (NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD)) |
+                (NS_FRAME_IS_NONDISPLAY | NS_STATE_SVG_CLIPPATH_CHILD)) |
                NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_SVG_TEXT);
 
   mMutationObserver.StartObserving(this);
 }
 
 void
 nsSVGTextFrame2::BuildDisplayList(nsDisplayListBuilder* aBuilder,
                                   const nsRect& aDirtyRect,
@@ -3078,17 +3078,17 @@ nsIAtom *
 nsSVGTextFrame2::GetType() const
 {
   return nsGkAtoms::svgTextFrame2;
 }
 
 void
 nsSVGTextFrame2::DidSetStyleContext(nsStyleContext* aOldStyleContext)
 {
-  if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
+  if (mState & NS_FRAME_IS_NONDISPLAY) {
     // We need this DidSetStyleContext override to handle cases like this:
     //
     //   <defs>
     //     <g>
     //       <mask>
     //         <text>...</text>
     //       </mask>
     //     </g>
@@ -3109,19 +3109,19 @@ nsSVGTextFrame2::DidSetStyleContext(nsSt
 }
 
 void
 nsSVGTextFrame2::ReflowSVGNonDisplayText()
 {
   MOZ_ASSERT(nsSVGUtils::AnyOuterSVGIsCallingReflowSVG(this),
              "only call ReflowSVGNonDisplayText when an outer SVG frame is "
              "under ReflowSVG");
-  MOZ_ASSERT(mState & NS_STATE_SVG_NONDISPLAY_CHILD,
+  MOZ_ASSERT(mState & NS_FRAME_IS_NONDISPLAY,
              "only call ReflowSVGNonDisplayText if the frame is "
-             "NS_STATE_SVG_NONDISPLAY_CHILD");
+             "NS_FRAME_IS_NONDISPLAY");
 
   // We had a style change, so we mark this frame as dirty so that the next
   // time it is painted, we reflow the anonymous block frame.
   AddStateBits(NS_FRAME_IS_DIRTY);
 
   // We also need to call InvalidateRenderingObservers, so that if the <text>
   // element is within a <mask>, say, the element referencing the <mask> will
   // be updated, which will then cause this nsSVGTextFrame2 to be painted and
@@ -3145,17 +3145,17 @@ nsSVGTextFrame2::ScheduleReflowSVGNonDis
   nsSVGOuterSVGFrame* outerSVGFrame = nullptr;
 
   nsIFrame* f = GetParent();
   while (f) {
     if (f->GetStateBits() & NS_STATE_IS_OUTER_SVG) {
       outerSVGFrame = static_cast<nsSVGOuterSVGFrame*>(f);
       break;
     }
-    if (!(f->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+    if (!(f->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
       // We don't need to set NS_FRAME_HAS_DIRTY_CHILDREN on non-display
       // children in the path from the dirty nsSVGTextFrame2 up to the
       // first display container frame, since ReflowSVGNonDisplayText
       // does not check for it.
       if (NS_SUBTREE_DIRTY(f)) {
         return;
       }
       f->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
@@ -3255,17 +3255,17 @@ nsSVGTextFrame2::MutationObserver::Attri
   }
 }
 
 void
 nsSVGTextFrame2::FindCloserFrameForSelection(
                                  nsPoint aPoint,
                                  nsIFrame::FrameWithDistance* aCurrentBestFrame)
 {
-  if (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) {
+  if (GetStateBits() & NS_FRAME_IS_NONDISPLAY) {
     return;
   }
 
   UpdateGlyphPositioning();
 
   nsPresContext* presContext = PresContext();
 
   // Find the frame that has the closest rendered run rect to aPoint.
@@ -3407,17 +3407,17 @@ nsSVGTextFrame2::PaintSVG(nsRenderingCon
   if (!kid)
     return NS_OK;
 
   nsPresContext* presContext = PresContext();
 
   gfxContext *gfx = aContext->ThebesContext();
   gfxMatrix initialMatrix = gfx->CurrentMatrix();
 
-  if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
+  if (mState & NS_FRAME_IS_NONDISPLAY) {
     // If we are in a canvas DrawWindow call that used the
     // DRAWWINDOW_DO_NOT_FLUSH flag, then we may still have out
     // of date frames.  Just don't paint anything if they are
     // dirty.
     if (presContext->PresShell()->InDrawWindowNotFlushing() &&
         NS_SUBTREE_DIRTY(this)) {
       return NS_OK;
     }
@@ -3438,17 +3438,17 @@ nsSVGTextFrame2::PaintSVG(nsRenderingCon
   }
 
   gfxMatrix matrixForPaintServers(canvasTM);
   matrixForPaintServers.Multiply(initialMatrix);
 
   // Check if we need to draw anything.
   if (aDirtyRect) {
     NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
-                 (mState & NS_STATE_SVG_NONDISPLAY_CHILD),
+                 (mState & NS_FRAME_IS_NONDISPLAY),
                  "Display lists handle dirty rect intersection test");
     nsRect dirtyRect(aDirtyRect->x, aDirtyRect->y,
                      aDirtyRect->width, aDirtyRect->height);
 
     gfxFloat appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();
     gfxRect frameRect(mRect.x / appUnitsPerDevPixel,
                       mRect.y / appUnitsPerDevPixel,
                       mRect.width / appUnitsPerDevPixel,
@@ -3528,17 +3528,17 @@ nsSVGTextFrame2::PaintSVG(nsRenderingCon
   return NS_OK;
 }
 
 NS_IMETHODIMP_(nsIFrame*)
 nsSVGTextFrame2::GetFrameForPoint(const nsPoint& aPoint)
 {
   NS_ASSERTION(GetFirstPrincipalChild(), "must have a child frame");
 
-  if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
+  if (mState & NS_FRAME_IS_NONDISPLAY) {
     // Text frames inside <clipPath> will never have had ReflowSVG called on
     // them, so call UpdateGlyphPositioning to do this now.  (Text frames
     // inside <mask> and other non-display containers will never need to
     // be hit tested.)
     UpdateGlyphPositioning();
   } else {
     NS_ASSERTION(!NS_SUBTREE_DIRTY(this), "reflow should have happened");
   }
@@ -3580,17 +3580,17 @@ nsSVGTextFrame2::GetCoveredRegion()
 }
 
 void
 nsSVGTextFrame2::ReflowSVG()
 {
   NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
                "This call is probaby a wasteful mistake");
 
-  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
+  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                     "ReflowSVG mechanism not designed for this");
 
   if (!nsSVGUtils::NeedsReflowSVG(this)) {
     NS_ASSERTION(!(mState & NS_STATE_SVG_POSITIONING_DIRTY), "How did this happen?");
     return;
   }
 
   MaybeReflowAnonymousBlockChild();
@@ -3692,17 +3692,17 @@ nsSVGTextFrame2::GetBBoxContribution(con
 }
 
 //----------------------------------------------------------------------
 // nsSVGContainerFrame methods
 
 gfxMatrix
 nsSVGTextFrame2::GetCanvasTM(uint32_t aFor)
 {
-  if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
         (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
     }
   }
   if (!mCanvasTM) {
     NS_ASSERTION(mParent, "null parent");
 
@@ -4906,17 +4906,17 @@ nsSVGTextFrame2::ShouldRenderAsPath(nsRe
   }
 
   return false;
 }
 
 void
 nsSVGTextFrame2::ScheduleReflowSVG()
 {
-  if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
+  if (mState & NS_FRAME_IS_NONDISPLAY) {
     ScheduleReflowSVGNonDisplayText();
   } else {
     nsSVGUtils::ScheduleReflowSVG(this);
   }
 }
 
 void
 nsSVGTextFrame2::NotifyGlyphMetricsChange()
@@ -4966,17 +4966,17 @@ nsSVGTextFrame2::MaybeReflowAnonymousBlo
 
 void
 nsSVGTextFrame2::DoReflow()
 {
   // Since we are going to reflow the anonymous block frame, we will
   // need to update mPositions.
   AddStateBits(NS_STATE_SVG_POSITIONING_DIRTY);
 
-  if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
+  if (mState & NS_FRAME_IS_NONDISPLAY) {
     // Normally, these dirty flags would be cleared in ReflowSVG(), but that
     // doesn't get called for non-display frames. We don't want to reflow our
     // descendants every time nsSVGTextFrame2::PaintSVG makes sure that we have
     // valid positions by calling UpdateGlyphPositioning(), so we need to clear
     // these dirty bits. Note that this also breaks an invalidation loop where
     // our descendants invalidate as they reflow, which invalidates rendering
     // observers, which reschedules the frame that is currently painting by
     // referencing us to paint again. See bug 839958 comment 7. Hopefully we
@@ -5072,17 +5072,17 @@ nsSVGTextFrame2::UpdateFontSizeScaleFact
   }
 
   // When we are non-display, we could be painted in different coordinate
   // spaces, and we don't want to have to reflow for each of these.  We
   // just assume that the context scale is 1.0 for them all, so we don't
   // get stuck with a font size scale factor based on whichever referencing
   // frame happens to reflow first.
   double contextScale = 1.0;
-  if (!(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(mState & NS_FRAME_IS_NONDISPLAY)) {
     gfxMatrix m(GetCanvasTM(FOR_OUTERSVG_TM));
     if (!m.IsSingular()) {
       contextScale = GetContextScale(m);
     }
   }
   mLastContextScale = contextScale;
 
   double maxSize = presContext->AppUnitsToFloatCSSPixels(max);
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -476,17 +476,17 @@ nsSVGUtils::ScheduleReflowSVG(nsIFrame *
   NS_ASSERTION(!OuterSVGIsCallingReflowSVG(aFrame),
                "Do not call under nsISVGChildFrame::ReflowSVG!");
 
   // We don't call nsSVGEffects::InvalidateRenderingObservers here because
   // we should only be called under InvalidateAndScheduleReflowSVG (which
   // calls InvalidateBounds) or nsSVGDisplayContainerFrame::InsertFrames
   // (at which point the frame has no observers).
 
-  if (aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) {
+  if (aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY) {
     return;
   }
 
   if (aFrame->GetStateBits() &
       (NS_FRAME_IS_DIRTY | NS_FRAME_FIRST_REFLOW)) {
     // Nothing to do if we're already dirty, or if the outer-<svg>
     // hasn't yet had its initial reflow.
     return;
@@ -619,31 +619,31 @@ nsSVGUtils::GetOuterSVGFrame(nsIFrame *a
 }
 
 nsIFrame*
 nsSVGUtils::GetOuterSVGFrameAndCoveredRegion(nsIFrame* aFrame, nsRect* aRect)
 {
   nsISVGChildFrame* svg = do_QueryFrame(aFrame);
   if (!svg)
     return nullptr;
-  *aRect = (aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) ?
+  *aRect = (aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY) ?
              nsRect(0, 0, 0, 0) : svg->GetCoveredRegion();
   return GetOuterSVGFrame(aFrame);
 }
 
 gfxMatrix
 nsSVGUtils::GetCanvasTM(nsIFrame *aFrame, uint32_t aFor)
 {
   // XXX yuck, we really need a common interface for GetCanvasTM
 
   if (!aFrame->IsFrameOfType(nsIFrame::eSVG)) {
     return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(aFrame);
   }
 
-  if (!(aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+  if (!(aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     if ((aFor == nsISVGChildFrame::FOR_PAINTING &&
          NS_SVGDisplayListPaintingEnabled()) ||
         (aFor == nsISVGChildFrame::FOR_HIT_TESTING &&
          NS_SVGDisplayListHitTestingEnabled())) {
       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(aFrame);
     }
   }
 
@@ -739,17 +739,17 @@ public:
 };
 
 void
 nsSVGUtils::PaintFrameWithEffects(nsRenderingContext *aContext,
                                   const nsIntRect *aDirtyRect,
                                   nsIFrame *aFrame)
 {
   NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
-               (aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) ||
+               (aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY) ||
                aFrame->PresContext()->IsGlyph(),
                "If display lists are enabled, only painting of non-display "
                "SVG should take this code path");
 
   nsISVGChildFrame *svgChildFrame = do_QueryFrame(aFrame);
   if (!svgChildFrame)
     return;
 
@@ -768,17 +768,17 @@ nsSVGUtils::PaintFrameWithEffects(nsRend
 
   nsSVGEffects::EffectProperties effectProperties =
     nsSVGEffects::GetEffectProperties(aFrame);
 
   bool isOK = true;
   nsSVGFilterFrame *filterFrame = effectProperties.GetFilterFrame(&isOK);
 
   if (aDirtyRect &&
-      !(aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+      !(aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     // Here we convert aFrame's paint bounds to outer-<svg> device space,
     // compare it to aDirtyRect, and return early if they don't intersect.
     // We don't do this optimization for nondisplay SVG since nondisplay
     // SVG doesn't maintain bounds/overflow rects.
     nsRect overflowRect = aFrame->GetVisualOverflowRectRelativeToSelf();
     if (aFrame->IsFrameOfType(nsIFrame::eSVGGeometry) ||
         aFrame->IsSVGText()) {
       // Unlike containers, leaf frames do not include GetPosition() in
@@ -839,17 +839,17 @@ nsSVGUtils::PaintFrameWithEffects(nsRend
   if (clipPathFrame || maskFrame)
     matrix = GetCanvasTM(aFrame, nsISVGChildFrame::FOR_PAINTING);
 
   /* Check if we need to do additional operations on this child's
    * rendering, which necessitates rendering into another surface. */
   if (opacity != 1.0f || maskFrame || (clipPathFrame && !isTrivialClip)) {
     complexEffects = true;
     gfx->Save();
-    if (!(aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
+    if (!(aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
       // aFrame has a valid visual overflow rect, so clip to it before calling
       // PushGroup() to minimize the size of the surfaces we'll composite:
       gfxContextMatrixAutoSaveRestore matrixAutoSaveRestore(gfx);
       gfx->Multiply(GetCanvasTM(aFrame, nsISVGChildFrame::FOR_PAINTING));
       nsRect overflowRect = aFrame->GetVisualOverflowRectRelativeToSelf();
       if (aFrame->IsFrameOfType(nsIFrame::eSVGGeometry) ||
           aFrame->IsSVGText()) {
         // Unlike containers, leaf frames do not include GetPosition() in
--- a/layout/svg/nsSVGUtils.h
+++ b/layout/svg/nsSVGUtils.h
@@ -58,33 +58,30 @@ class SVGPreserveAspectRatio;
 namespace dom {
 class Element;
 } // namespace dom
 } // namespace mozilla
 
 // SVG Frame state bits
 #define NS_STATE_IS_OUTER_SVG                    NS_FRAME_STATE_BIT(20)
 
-/* are we the child of a non-display container? */
-#define NS_STATE_SVG_NONDISPLAY_CHILD            NS_FRAME_STATE_BIT(21)
-
 // If this bit is set, we are a <clipPath> element or descendant.
-#define NS_STATE_SVG_CLIPPATH_CHILD              NS_FRAME_STATE_BIT(22)
+#define NS_STATE_SVG_CLIPPATH_CHILD              NS_FRAME_STATE_BIT(21)
 
 /**
  * For text, the NS_FRAME_IS_DIRTY and NS_FRAME_HAS_DIRTY_CHILDREN bits indicate
  * that our anonymous block child needs to be reflowed, and that mPositions
  * will likely need to be updated as a consequence. These are set, for
  * example, when the font-family changes. Sometimes we only need to
  * update mPositions though. For example if the x/y attributes change.
  * mPositioningDirty is used to indicate this latter "things are dirty" case
  * to allow us to avoid reflowing the anonymous block when it is not
  * necessary.
  */
-#define NS_STATE_SVG_POSITIONING_DIRTY           NS_FRAME_STATE_BIT(23)
+#define NS_STATE_SVG_POSITIONING_DIRTY           NS_FRAME_STATE_BIT(22)
 
 /**
  * For text, whether the values from x/y/dx/dy attributes have any percentage values
  * that are used in determining the positions of glyphs.  The value will
  * be true even if a positioning value is overridden by a descendant element's
  * attribute with a non-percentage length.  For example,
  * NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would be set for:
  *
@@ -99,17 +96,17 @@ class Element;
  * NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES is used to determine whether
  * to recompute mPositions when the viewport size changes.  So although the 
  * first example above shows that NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES
  * can be true even if a viewport size change will not affect mPositions,
  * determining a completley accurate value for
  * NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would require extra work that is
  * probably not worth it.
  */
-#define NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES NS_FRAME_STATE_BIT(24)
+#define NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES NS_FRAME_STATE_BIT(23)
 
 /**
  * Byte offsets of channels in a native packed gfxColor or cairo image surface.
  */
 #ifdef IS_BIG_ENDIAN
 #define GFX_ARGB32_OFFSET_A 0
 #define GFX_ARGB32_OFFSET_R 1
 #define GFX_ARGB32_OFFSET_G 2
@@ -314,17 +311,17 @@ public:
    */
   static nsRect GetPostFilterVisualOverflowRect(nsIFrame *aFrame,
                                                 const nsRect &aUnfilteredRect);
 
   /**
    * Schedules an update of the frame's bounds (which will in turn invalidate
    * the new area that the frame should paint to).
    *
-   * This does nothing when passed an NS_STATE_SVG_NONDISPLAY_CHILD frame.
+   * This does nothing when passed an NS_FRAME_IS_NONDISPLAY frame.
    * In future we may want to allow ReflowSVG to be called on such frames,
    * but that would be better implemented as a ForceReflowSVG function to
    * be called synchronously while painting them without marking or paying
    * attention to dirty bits like this function.
    *
    * This is very similar to PresShell::FrameNeedsReflow. The main reason that
    * we have this function instead of using FrameNeedsReflow is because we need
    * to be able to call it under nsSVGOuterSVGFrame::NotifyViewportChange when
@@ -336,17 +333,17 @@ public:
    * will be updated for the new size as appropriate. Otherwise we'd have to
    * post an event to the event loop to mark dirty flags and request an update.
    *
    * Another reason that we don't currently want to call
    * PresShell::FrameNeedsReflow is because passing eRestyle to it to get it to
    * mark descendants dirty would cause it to descend through
    * nsSVGForeignObjectFrame frames to mark their children dirty, but we want to
    * handle nsSVGForeignObjectFrame specially. It would also do unnecessary work
-   * descending into NS_STATE_SVG_NONDISPLAY_CHILD frames.
+   * descending into NS_FRAME_IS_NONDISPLAY frames.
    */
   static void ScheduleReflowSVG(nsIFrame *aFrame);
 
   /**
    * Returns true if the frame or any of its children need ReflowSVG
    * to be called on them.
    */
   static bool NeedsReflowSVG(nsIFrame *aFrame);