Bug 1388953 - Rename variable name of nsSVGDisplayableFrame type to displayable. draft
authorcku <cku@mozilla.com>
Thu, 10 Aug 2017 21:30:01 +0800
changeset 644119 8654ed8c2dc94c1fdfbeade9049fd59cb6d6dbba
parent 642916 1d042bcb2632ea6a38fa08dbe21a6e8a0ee46961
child 725494 4d47d581a777a045a91e99ce3087db4d5f256329
push id73311
push userbmo:cku@mozilla.com
push dateThu, 10 Aug 2017 13:34:31 +0000
bugs1388953
milestone57.0a1
Bug 1388953 - Rename variable name of nsSVGDisplayableFrame type to displayable. Only try to improve code readibility. MozReview-Commit-ID: 2097vznh99k
dom/svg/SVGTransformableElement.cpp
layout/painting/nsDisplayList.cpp
layout/svg/nsSVGClipPathFrame.cpp
layout/svg/nsSVGContainerFrame.cpp
layout/svg/nsSVGIntegrationUtils.cpp
layout/svg/nsSVGMarkerFrame.cpp
layout/svg/nsSVGMaskFrame.cpp
layout/svg/nsSVGPatternFrame.cpp
layout/svg/nsSVGSwitchFrame.cpp
layout/svg/nsSVGUtils.cpp
--- a/dom/svg/SVGTransformableElement.cpp
+++ b/dom/svg/SVGTransformableElement.cpp
@@ -176,18 +176,18 @@ SVGTransformableElement::GetBBox(const S
                                  ErrorResult& rv)
 {
   nsIFrame* frame = GetPrimaryFrame(FlushType::Layout);
 
   if (!frame || (frame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
     rv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
-  nsSVGDisplayableFrame* svgframe = do_QueryFrame(frame);
-  if (!svgframe) {
+  nsSVGDisplayableFrame* displayable = do_QueryFrame(frame);
+  if (!displayable) {
     rv.Throw(NS_ERROR_NOT_IMPLEMENTED); // XXX: outer svg
     return nullptr;
   }
 
   if (!NS_SVGNewGetBBoxEnabled()) {
     return NS_NewSVGRect(this, ToRect(nsSVGUtils::GetBBox(frame)));
   } else {
     uint32_t flags = 0;
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -8538,18 +8538,18 @@ nsDisplaySVGEffects::ComputeInvalidation
   }
 }
 
 bool nsDisplaySVGEffects::ValidateSVGFrame()
 {
   const nsIContent* content = mFrame->GetContent();
   bool hasSVGLayout = (mFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT);
   if (hasSVGLayout) {
-    nsSVGDisplayableFrame* svgFrame = do_QueryFrame(mFrame);
-    if (!svgFrame || !mFrame->GetContent()->IsSVGElement()) {
+    nsSVGDisplayableFrame* displayable = do_QueryFrame(mFrame);
+    if (!displayable || !mFrame->GetContent()->IsSVGElement()) {
       NS_ASSERTION(false, "why?");
       return false;
     }
     if (!static_cast<const nsSVGElement*>(content)->HasValidDimensions()) {
       return false; // The SVG spec says not to draw filters for this
     }
   }
 
--- a/layout/svg/nsSVGClipPathFrame.cpp
+++ b/layout/svg/nsSVGClipPathFrame.cpp
@@ -45,21 +45,21 @@ nsSVGClipPathFrame::ApplyClipPath(gfxCon
   // No need for AutoReferenceChainGuard since simple clip paths by definition
   // don't reference another clip path.
 
   // Restore current transform after applying clip path:
   gfxContextMatrixAutoSaveRestore autoRestore(&aContext);
 
   RefPtr<Path> clipPath;
 
-  nsSVGDisplayableFrame* singleClipPathChild = nullptr;
-  IsTrivial(&singleClipPathChild);
+  nsSVGDisplayableFrame* displayable = nullptr;
+  IsTrivial(&displayable);
 
-  if (singleClipPathChild) {
-    SVGGeometryFrame* pathFrame = do_QueryFrame(singleClipPathChild);
+  if (displayable) {
+    SVGGeometryFrame* pathFrame = do_QueryFrame(displayable);
     if (pathFrame) {
       SVGGeometryElement* pathElement =
         static_cast<SVGGeometryElement*>(pathFrame->GetContent());
       gfxMatrix toChildsUserSpace = pathElement->
         PrependLocalTransformsTo(GetClipPathTransform(aClippedFrame) * aMatrix,
                                  eUserSpaceToParent);
       gfxMatrix newMatrix =
         aContext.CurrentMatrix().PreMultiply(toChildsUserSpace).NudgeToIntegers();
@@ -191,23 +191,23 @@ nsSVGClipPathFrame::PaintClipMask(gfxCon
 }
 
 void
 nsSVGClipPathFrame::PaintFrameIntoMask(nsIFrame *aFrame,
                                        nsIFrame* aClippedFrame,
                                        gfxContext& aTarget,
                                        const gfxMatrix& aMatrix)
 {
-  nsSVGDisplayableFrame* frame = do_QueryFrame(aFrame);
-  if (!frame) {
+  nsSVGDisplayableFrame* displayable = do_QueryFrame(aFrame);
+  if (!displayable) {
     return;
   }
 
   // The CTM of each frame referencing us can be different.
-  frame->NotifySVGChanged(nsSVGDisplayableFrame::TRANSFORM_CHANGED);
+  displayable->NotifySVGChanged(nsSVGDisplayableFrame::TRANSFORM_CHANGED);
 
   // Children of this clipPath may themselves be clipped.
   nsSVGEffects::EffectProperties effectProperties =
     nsSVGEffects::GetEffectProperties(aFrame);
   if (effectProperties.HasInvalidClipPath()) {
     return;
   }
   nsSVGClipPathFrame *clipPathThatClipsChild =
@@ -224,32 +224,32 @@ nsSVGClipPathFrame::PaintFrameIntoMask(n
                                           aMatrix, &maskTransform);
     aTarget.PushGroupForBlendBack(gfxContentType::ALPHA, 1.0,
                                   maskSurface, maskTransform);
     // The corresponding PopGroupAndBlend call below will mask the
     // blend using |maskSurface|.
   }
 
   gfxMatrix toChildsUserSpace = mMatrixForChildren;
-  nsIFrame* child = do_QueryFrame(frame);
+  nsIFrame* child = do_QueryFrame(displayable);
   nsIContent* childContent = child->GetContent();
   if (childContent->IsSVGElement()) {
     toChildsUserSpace =
       static_cast<const nsSVGElement*>(childContent)->
         PrependLocalTransformsTo(mMatrixForChildren, eUserSpaceToParent);
   }
 
   // clipPath does not result in any image rendering, so we just use a dummy
   // imgDrawingParams instead of requiring our caller to pass one.
   image::imgDrawingParams imgParams;
 
   // Our children have NS_STATE_SVG_CLIPPATH_CHILD set on them, and
   // SVGGeometryFrame::Render checks for that state bit and paints
   // only the geometry (opaque black) if set.
-  frame->PaintSVG(aTarget, toChildsUserSpace, imgParams);
+  displayable->PaintSVG(aTarget, toChildsUserSpace, imgParams);
 
   if (maskUsage.shouldGenerateClipMaskLayer) {
     aTarget.PopGroupAndBlend();
   } else if (maskUsage.shouldApplyClipPath) {
     aTarget.PopClip();
   }
 }
 
@@ -312,67 +312,67 @@ nsSVGClipPathFrame::PointIsInsideClipPat
     nsSVGEffects::GetEffectProperties(this).GetClipPathFrame();
   if (clipPathFrame &&
       !clipPathFrame->PointIsInsideClipPath(aClippedFrame, aPoint)) {
     return false;
   }
 
   for (nsIFrame* kid = mFrames.FirstChild(); kid;
        kid = kid->GetNextSibling()) {
-    nsSVGDisplayableFrame* SVGFrame = do_QueryFrame(kid);
-    if (SVGFrame) {
+    nsSVGDisplayableFrame* displayable = do_QueryFrame(kid);
+    if (displayable) {
       gfxPoint pointForChild = point;
       gfxMatrix m = static_cast<nsSVGElement*>(kid->GetContent())->
         PrependLocalTransformsTo(gfxMatrix(), eUserSpaceToParent);
       if (!m.IsIdentity()) {
         if (!m.Invert()) {
           return false;
         }
         pointForChild = m.TransformPoint(point);
       }
-      if (SVGFrame->GetFrameForPoint(pointForChild)) {
+      if (displayable->GetFrameForPoint(pointForChild)) {
         return true;
       }
     }
   }
 
   return false;
 }
 
 bool
-nsSVGClipPathFrame::IsTrivial(nsSVGDisplayableFrame **aSingleChild)
+nsSVGClipPathFrame::IsTrivial(nsSVGDisplayableFrame **aDisplayable)
 {
   // If the clip path is clipped then it's non-trivial
   if (nsSVGEffects::GetEffectProperties(this).GetClipPathFrame())
     return false;
 
-  if (aSingleChild) {
-    *aSingleChild = nullptr;
+  if (aDisplayable) {
+    *aDisplayable = nullptr;
   }
 
-  nsSVGDisplayableFrame* foundChild = nullptr;
+  nsSVGDisplayableFrame* foundDisplayable = nullptr;
 
   for (nsIFrame* kid = mFrames.FirstChild(); kid;
        kid = kid->GetNextSibling()) {
-    nsSVGDisplayableFrame* svgChild = do_QueryFrame(kid);
-    if (svgChild) {
+    nsSVGDisplayableFrame* displayable = do_QueryFrame(kid);
+    if (displayable) {
       // We consider a non-trivial clipPath to be one containing
       // either more than one svg child and/or a svg container
-      if (foundChild || svgChild->IsDisplayContainer())
+      if (foundDisplayable || displayable->IsDisplayContainer())
         return false;
 
       // or where the child is itself clipped
       if (nsSVGEffects::GetEffectProperties(kid).GetClipPathFrame())
         return false;
 
-      foundChild = svgChild;
+      foundDisplayable = displayable;
     }
   }
-  if (aSingleChild) {
-    *aSingleChild = foundChild;
+  if (aDisplayable) {
+    *aDisplayable = foundDisplayable;
   }
   return true;
 }
 
 bool
 nsSVGClipPathFrame::IsValid()
 {
   static int16_t sRefChainLengthCounter = AutoReferenceChainGuard::noChain;
@@ -473,19 +473,20 @@ nsSVGClipPathFrame::GetBBoxForClipPathFr
                                             const gfxMatrix &aMatrix)
 {
   nsIContent* node = GetContent()->GetFirstChild();
   SVGBBox unionBBox, tmpBBox;
   for (; node; node = node->GetNextSibling()) {
     nsIFrame *frame =
       static_cast<nsSVGElement*>(node)->GetPrimaryFrame();
     if (frame) {
-      nsSVGDisplayableFrame* svg = do_QueryFrame(frame);
-      if (svg) {
-        tmpBBox = svg->GetBBoxContribution(mozilla::gfx::ToMatrix(aMatrix),
+      nsSVGDisplayableFrame* displayable = do_QueryFrame(frame);
+      if (displayable) {
+        tmpBBox =
+          displayable->GetBBoxContribution(mozilla::gfx::ToMatrix(aMatrix),
                                            nsSVGUtils::eBBoxIncludeFill);
         nsSVGEffects::EffectProperties effectProperties =
                               nsSVGEffects::GetEffectProperties(frame);
         if (effectProperties.HasNoOrValidClipPath()) {
           nsSVGClipPathFrame *clipPathFrame =
             effectProperties.GetClipPathFrame();
           if (clipPathFrame) {
             tmpBBox = clipPathFrame->GetBBoxForClipPathFrame(tmpBBox, aMatrix);
--- a/layout/svg/nsSVGContainerFrame.cpp
+++ b/layout/svg/nsSVGContainerFrame.cpp
@@ -172,18 +172,18 @@ nsSVGDisplayContainerFrame::InsertFrames
 
   // 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_FRAME_IS_NONDISPLAY))) {
     for (nsIFrame* kid = firstNewFrame; kid != nextFrame;
          kid = kid->GetNextSibling()) {
-      nsSVGDisplayableFrame* SVGFrame = do_QueryFrame(kid);
-      if (SVGFrame) {
+      nsSVGDisplayableFrame* displayable = do_QueryFrame(kid);
+      if (displayable) {
         MOZ_ASSERT(!(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.
@@ -337,22 +337,22 @@ nsSVGDisplayContainerFrame::ReflowSVG()
   if (outerSVGHasHadFirstReflow) {
     mState &= ~NS_FRAME_FIRST_REFLOW; // tell our children
   }
 
   nsOverflowAreas overflowRects;
 
   for (nsIFrame* kid = mFrames.FirstChild(); kid;
        kid = kid->GetNextSibling()) {
-    nsSVGDisplayableFrame* SVGFrame = do_QueryFrame(kid);
-    if (SVGFrame) {
+    nsSVGDisplayableFrame* displayable = do_QueryFrame(kid);
+    if (displayable) {
       MOZ_ASSERT(!(kid->GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                  "Check for this explicitly in the |if|, then");
       kid->AddStateBits(mState & NS_FRAME_IS_DIRTY);
-      SVGFrame->ReflowSVG();
+      displayable->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
       // SVGTextFrames.  We need to cause those to get reflowed in
@@ -410,27 +410,27 @@ nsSVGDisplayContainerFrame::GetBBoxContr
   const Matrix &aToBBoxUserspace,
   uint32_t aFlags)
 {
   SVGBBox bboxUnion;
 
   nsIFrame* kid = mFrames.FirstChild();
   while (kid) {
     nsIContent *content = kid->GetContent();
-    nsSVGDisplayableFrame* svgKid = do_QueryFrame(kid);
+    nsSVGDisplayableFrame* displayable = do_QueryFrame(kid);
     // content could be a XUL element so check for an SVG element before casting
-    if (svgKid && (!content->IsSVGElement() ||
+    if (displayable && (!content->IsSVGElement() ||
                    static_cast<const nsSVGElement*>(content)->HasValidDimensions())) {
 
       gfxMatrix transform = gfx::ThebesMatrix(aToBBoxUserspace);
       if (content->IsSVGElement()) {
         transform = static_cast<nsSVGElement*>(content)->
                       PrependLocalTransformsTo(transform);
       }
       // We need to include zero width/height vertical/horizontal lines, so we have
       // to use UnionEdges.
-      bboxUnion.UnionEdges(svgKid->GetBBoxContribution(gfx::ToMatrix(transform), aFlags));
+      bboxUnion.UnionEdges(displayable->GetBBoxContribution(gfx::ToMatrix(transform), aFlags));
     }
     kid = kid->GetNextSibling();
   }
 
   return bboxUnion;
 }
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -618,18 +618,18 @@ ValidateSVGFrame(nsIFrame* aFrame)
                (NS_SVGDisplayListPaintingEnabled() &&
                 !(aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)),
                "Should not use nsSVGIntegrationUtils on this SVG frame");
 #endif
 
   bool hasSVGLayout = (aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT);
   if (hasSVGLayout) {
 #ifdef DEBUG
-    nsSVGDisplayableFrame* svgFrame = do_QueryFrame(aFrame);
-    MOZ_ASSERT(svgFrame && aFrame->GetContent()->IsSVGElement(),
+    nsSVGDisplayableFrame* displayable = do_QueryFrame(aFrame);
+    MOZ_ASSERT(displayable && aFrame->GetContent()->IsSVGElement(),
                "A non-SVG frame carries NS_FRAME_SVG_LAYOUT flag?");
 #endif
 
     const nsIContent* content = aFrame->GetContent();
     if (!static_cast<const nsSVGElement*>(content)->HasValidDimensions()) {
       // The SVG spec says not to draw _anything_
       return false;
     }
--- a/layout/svg/nsSVGMarkerFrame.cpp
+++ b/layout/svg/nsSVGMarkerFrame.cpp
@@ -134,19 +134,19 @@ nsSVGMarkerFrame::PaintMark(gfxContext& 
     gfxRect clipRect =
       nsSVGUtils::GetClipRectForFrame(this, viewBox.x, viewBox.y,
                                       viewBox.width, viewBox.height);
     nsSVGUtils::SetClipRect(&aContext, markTM, clipRect);
   }
 
 
   nsIFrame* kid = GetAnonymousChildFrame(this);
-  nsSVGDisplayableFrame* SVGFrame = do_QueryFrame(kid);
+  nsSVGDisplayableFrame* displayable = do_QueryFrame(kid);
   // The CTM of each frame referencing us may be different.
-  SVGFrame->NotifySVGChanged(nsSVGDisplayableFrame::TRANSFORM_CHANGED);
+  displayable->NotifySVGChanged(nsSVGDisplayableFrame::TRANSFORM_CHANGED);
   nsSVGUtils::PaintFrameWithEffects(kid, aContext, markTM, aImgParams);
 
   if (StyleDisplay()->IsScrollableOverflow())
     aContext.Restore();
 }
 
 SVGBBox
 nsSVGMarkerFrame::GetMarkBBoxContribution(const Matrix& aToBBoxUserspace,
@@ -176,24 +176,25 @@ nsSVGMarkerFrame::GetMarkBBoxContributio
     return bbox;
   }
 
   mMarkerTM = content->GetMarkerTransform(aStrokeWidth, aMark);
   Matrix viewBoxTM = content->GetViewBoxTransform();
 
   Matrix tm = viewBoxTM * mMarkerTM * aToBBoxUserspace;
 
-  nsSVGDisplayableFrame* child = do_QueryFrame(GetAnonymousChildFrame(this));
+  nsSVGDisplayableFrame* displayable =
+    do_QueryFrame(GetAnonymousChildFrame(this));
   // When we're being called to obtain the invalidation area, we need to
   // pass down all the flags so that stroke is included. However, once DOM
   // getBBox() accepts flags, maybe we should strip some of those here?
 
   // We need to include zero width/height vertical/horizontal lines, so we have
   // to use UnionEdges.
-  bbox.UnionEdges(child->GetBBoxContribution(tm, aFlags));
+  bbox.UnionEdges(displayable->GetBBoxContribution(tm, aFlags));
 
   return bbox;
 }
 
 void
 nsSVGMarkerFrame::SetParentCoordCtxProvider(SVGSVGElement *aContext)
 {
   SVGMarkerElement *marker = static_cast<SVGMarkerElement*>(mContent);
--- a/layout/svg/nsSVGMaskFrame.cpp
+++ b/layout/svg/nsSVGMaskFrame.cpp
@@ -107,19 +107,19 @@ nsSVGMaskFrame::GetMaskForMaskedFrame(Ma
   tmpCtx->SetMatrix(maskSurfaceMatrix);
 
   mMatrixForChildren = GetMaskTransform(aParams.maskedFrame) *
                        aParams.toUserSpace;
 
   for (nsIFrame* kid = mFrames.FirstChild(); kid;
        kid = kid->GetNextSibling()) {
     // The CTM of each frame referencing us can be different
-    nsSVGDisplayableFrame* SVGFrame = do_QueryFrame(kid);
-    if (SVGFrame) {
-      SVGFrame->NotifySVGChanged(nsSVGDisplayableFrame::TRANSFORM_CHANGED);
+    nsSVGDisplayableFrame* displayable = do_QueryFrame(kid);
+    if (displayable) {
+      displayable->NotifySVGChanged(nsSVGDisplayableFrame::TRANSFORM_CHANGED);
     }
     gfxMatrix m = mMatrixForChildren;
     if (kid->GetContent()->IsSVGElement()) {
       m = static_cast<nsSVGElement*>(kid->GetContent())->
             PrependLocalTransformsTo(m, eUserSpaceToParent);
     }
     nsSVGUtils::PaintFrameWithEffects(kid, *tmpCtx, m, aParams.imgParams);
   }
--- a/layout/svg/nsSVGPatternFrame.cpp
+++ b/layout/svg/nsSVGPatternFrame.cpp
@@ -376,19 +376,19 @@ nsSVGPatternFrame::PaintPattern(const Dr
 
   // Delay checking NS_FRAME_DRAWING_AS_PAINTSERVER bit until here so we can
   // give back a clear surface if there's a loop
   if (!(patternWithChildren->GetStateBits() & NS_FRAME_DRAWING_AS_PAINTSERVER)) {
     AutoSetRestorePaintServerState paintServer(patternWithChildren);
     for (nsIFrame* kid = firstKid; kid;
          kid = kid->GetNextSibling()) {
       // The CTM of each frame referencing us can be different
-      nsSVGDisplayableFrame* SVGFrame = do_QueryFrame(kid);
-      if (SVGFrame) {
-        SVGFrame->NotifySVGChanged(nsSVGDisplayableFrame::TRANSFORM_CHANGED);
+      nsSVGDisplayableFrame* displayable = do_QueryFrame(kid);
+      if (displayable) {
+        displayable->NotifySVGChanged(nsSVGDisplayableFrame::TRANSFORM_CHANGED);
       }
       gfxMatrix tm = *(patternWithChildren->mCTM);
       if (kid->GetContent()->IsSVGElement()) {
         tm = static_cast<nsSVGElement*>(kid->GetContent())->
                PrependLocalTransformsTo(tm, eUserSpaceToParent);
       }
 
       nsSVGUtils::PaintFrameWithEffects(kid, *ctx, tm, aImgParams);
--- a/layout/svg/nsSVGSwitchFrame.cpp
+++ b/layout/svg/nsSVGSwitchFrame.cpp
@@ -122,32 +122,32 @@ nsIFrame*
 nsSVGSwitchFrame::GetFrameForPoint(const gfxPoint& aPoint)
 {
   NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
                (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();
-  nsSVGDisplayableFrame* svgFrame = do_QueryFrame(kid);
-  if (svgFrame) {
+  nsSVGDisplayableFrame* displayable = do_QueryFrame(kid);
+  if (displayable) {
     // Transform the point from our SVG user space to our child's.
     gfxPoint point = aPoint;
     gfxMatrix m =
       static_cast<const nsSVGElement*>(mContent)->
         PrependLocalTransformsTo(gfxMatrix(), eChildToUserSpace);
     m = static_cast<const nsSVGElement*>(kid->GetContent())->
           PrependLocalTransformsTo(m, eUserSpaceToParent);
     if (!m.IsIdentity()) {
       if (!m.Invert()) {
         return nullptr;
       }
       point = m.TransformPoint(point);
     }
-    return svgFrame->GetFrameForPoint(point);
+    return displayable->GetFrameForPoint(point);
   }
 
   return nullptr;
 }
 
 void
 nsSVGSwitchFrame::ReflowSVG()
 {
@@ -175,21 +175,21 @@ nsSVGSwitchFrame::ReflowSVG()
 
   if (outerSVGHasHadFirstReflow) {
     mState &= ~NS_FRAME_FIRST_REFLOW; // tell our children
   }
 
   nsOverflowAreas overflowRects;
 
   nsIFrame *child = GetActiveChildFrame();
-  nsSVGDisplayableFrame* svgChild = do_QueryFrame(child);
-  if (svgChild) {
+  nsSVGDisplayableFrame* displayable = do_QueryFrame(child);
+  if (displayable) {
     MOZ_ASSERT(!(child->GetStateBits() & NS_FRAME_IS_NONDISPLAY),
                "Check for this explicitly in the |if|, then");
-    svgChild->ReflowSVG();
+    displayable->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);
   }
 
   if (isFirstReflow) {
@@ -207,25 +207,25 @@ nsSVGSwitchFrame::ReflowSVG()
               NS_FRAME_HAS_DIRTY_CHILDREN);
 }
 
 SVGBBox
 nsSVGSwitchFrame::GetBBoxContribution(const Matrix &aToBBoxUserspace,
                                       uint32_t aFlags)
 {
   nsIFrame* kid = GetActiveChildFrame();
-  nsSVGDisplayableFrame* svgKid = do_QueryFrame(kid);
-  if (svgKid) {
+  nsSVGDisplayableFrame* displayable = do_QueryFrame(kid);
+  if (displayable) {
     nsIContent *content = kid->GetContent();
     gfxMatrix transform = ThebesMatrix(aToBBoxUserspace);
     if (content->IsSVGElement()) {
       transform = static_cast<nsSVGElement*>(content)->
                     PrependLocalTransformsTo(transform);
     }
-    return svgKid->GetBBoxContribution(ToMatrix(transform), aFlags);
+    return displayable->GetBBoxContribution(ToMatrix(transform), aFlags);
   }
   return SVGBBox();
 }
 
 nsIFrame *
 nsSVGSwitchFrame::GetActiveChildFrame()
 {
   nsIContent *activeChild =
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -355,21 +355,21 @@ nsSVGUtils::GetOuterSVGFrame(nsIFrame *a
   }
 
   return nullptr;
 }
 
 nsIFrame*
 nsSVGUtils::GetOuterSVGFrameAndCoveredRegion(nsIFrame* aFrame, nsRect* aRect)
 {
-  nsSVGDisplayableFrame* svg = do_QueryFrame(aFrame);
-  if (!svg)
+  nsSVGDisplayableFrame* displayable = do_QueryFrame(aFrame);
+  if (!displayable)
     return nullptr;
   nsSVGOuterSVGFrame* outer = GetOuterSVGFrame(aFrame);
-  if (outer == svg) {
+  if (outer == displayable) {
     return nullptr;
   }
 
   if (aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY) {
     *aRect = nsRect(0, 0, 0, 0);
   } else {
     uint32_t flags = nsSVGUtils::eForGetClientRects |
                      nsSVGUtils::eBBoxIncludeFill |
@@ -410,36 +410,36 @@ nsSVGUtils::GetCanvasTM(nsIFrame *aFrame
   }
 
   return static_cast<SVGGeometryFrame*>(aFrame)->GetCanvasTM();
 }
 
 gfxMatrix
 nsSVGUtils::GetUserToCanvasTM(nsIFrame *aFrame)
 {
-  nsSVGDisplayableFrame* svgFrame = do_QueryFrame(aFrame);
-  NS_ASSERTION(svgFrame, "bad frame");
+  nsSVGDisplayableFrame* displayable = do_QueryFrame(aFrame);
+  NS_ASSERTION(displayable, "bad frame");
 
   gfxMatrix tm;
-  if (svgFrame) {
+  if (displayable) {
     nsSVGElement *content = static_cast<nsSVGElement*>(aFrame->GetContent());
     tm = content->PrependLocalTransformsTo(
                     GetCanvasTM(aFrame->GetParent()),
                     eUserSpaceToParent);
   }
   return tm;
 }
 
 void
 nsSVGUtils::NotifyChildrenOfSVGChange(nsIFrame *aFrame, uint32_t aFlags)
 {
   for (nsIFrame* kid : aFrame->PrincipalChildList()) {
-    nsSVGDisplayableFrame* SVGFrame = do_QueryFrame(kid);
-    if (SVGFrame) {
-      SVGFrame->NotifySVGChanged(aFlags);
+    nsSVGDisplayableFrame* displayable = do_QueryFrame(kid);
+    if (displayable) {
+      displayable->NotifySVGChanged(aFlags);
     } else {
       NS_ASSERTION(kid->IsFrameOfType(nsIFrame::eSVG) ||
                    nsSVGUtils::IsInSVGTextSubtree(kid),
                    "SVG frame expected");
       // recurse into the children of container frames e.g. <clipPath>, <mask>
       // in case they have child frames with transformation matrices
       if (kid->IsFrameOfType(nsIFrame::eSVG)) {
         NotifyChildrenOfSVGChange(kid, aFlags);
@@ -453,18 +453,18 @@ nsSVGUtils::NotifyChildrenOfSVGChange(ns
 class SVGPaintCallback : public nsSVGFilterPaintCallback
 {
 public:
   virtual void Paint(gfxContext& aContext, nsIFrame *aTarget,
                            const gfxMatrix& aTransform,
                            const nsIntRect* aDirtyRect,
                            imgDrawingParams& aImgParams) override
   {
-    nsSVGDisplayableFrame* svgFrame = do_QueryFrame(aTarget);
-    NS_ASSERTION(svgFrame, "Expected SVG frame here");
+    nsSVGDisplayableFrame* displayable = do_QueryFrame(aTarget);
+    NS_ASSERTION(displayable, "Expected SVG frame here");
 
     nsIntRect* dirtyRect = nullptr;
     nsIntRect tmpDirtyRect;
 
     // aDirtyRect is in user-space pixels, we need to convert to
     // outer-SVG-frame-relative device pixels.
     if (aDirtyRect) {
       gfxMatrix userToDeviceSpace = aTransform;
@@ -474,17 +474,17 @@ public:
       gfxRect dirtyBounds = userToDeviceSpace.TransformBounds(
         gfxRect(aDirtyRect->x, aDirtyRect->y, aDirtyRect->width, aDirtyRect->height));
       dirtyBounds.RoundOut();
       if (gfxUtils::GfxRectToIntRect(dirtyBounds, &tmpDirtyRect)) {
         dirtyRect = &tmpDirtyRect;
       }
     }
 
-    svgFrame->PaintSVG(aContext, nsSVGUtils::GetCSSPxToDevPxMatrix(aTarget),
+    displayable->PaintSVG(aContext, nsSVGUtils::GetCSSPxToDevPxMatrix(aTarget),
                        aImgParams, dirtyRect);
   }
 };
 
 float
 nsSVGUtils::ComputeOpacity(nsIFrame* aFrame, bool aHandleOpacity)
 {
   float opacity = aFrame->StyleEffects()->mOpacity;
@@ -663,18 +663,18 @@ nsSVGUtils::PaintFrameWithEffects(nsIFra
                                   const nsIntRect *aDirtyRect)
 {
   NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
                (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");
 
-  nsSVGDisplayableFrame* svgFrame = do_QueryFrame(aFrame);
-  if (!svgFrame)
+  nsSVGDisplayableFrame* displayable = do_QueryFrame(aFrame);
+  if (!displayable)
     return;
 
   MaskUsage maskUsage;
   DetermineMaskUsage(aFrame, true, maskUsage);
   if (maskUsage.opacity == 0.0f) {
     return;
   }
 
@@ -853,17 +853,17 @@ nsSVGUtils::PaintFrameWithEffects(nsIFra
       dirtyRegion = &tmpDirtyRegion;
     }
 
     SVGPaintCallback paintCallback;
     nsFilterInstance::PaintFilteredFrame(aFrame, target->GetDrawTarget(),
                                          aTransform, &paintCallback,
                                          dirtyRegion, aImgParams);
   } else {
-     svgFrame->PaintSVG(*target, aTransform, aImgParams, aDirtyRect);
+     displayable->PaintSVG(*target, aTransform, aImgParams, aDirtyRect);
   }
 
   if (maskUsage.shouldApplyClipPath || maskUsage.shouldApplyBasicShape) {
     aContext.PopClip();
   }
 
   if (shouldPushMask) {
     target->PopGroupAndBlend();
@@ -923,18 +923,18 @@ nsSVGUtils::HitTestChildren(nsSVGDisplay
   }
 
   // Traverse the list in reverse order, so that if we get a hit we know that's
   // the topmost frame that intersects the point; then we can just return it.
   nsIFrame* result = nullptr;
   for (nsIFrame* current = aFrame->PrincipalChildList().LastChild();
        current;
        current = current->GetPrevSibling()) {
-    nsSVGDisplayableFrame* SVGFrame = do_QueryFrame(current);
-    if (SVGFrame) {
+    nsSVGDisplayableFrame* displayable = do_QueryFrame(current);
+    if (displayable) {
       const nsIContent* content = current->GetContent();
       if (content->IsSVGElement() &&
           !static_cast<const nsSVGElement*>(content)->HasValidDimensions()) {
         continue;
       }
       // GetFrameForPoint() expects a point in its frame's SVG user space, so
       // we need to convert to that space:
       gfxPoint p = point;
@@ -944,17 +944,17 @@ nsSVGUtils::HitTestChildren(nsSVGDisplay
                                                  eUserSpaceToParent);
         if (!m.IsIdentity()) {
           if (!m.Invert()) {
             continue;
           }
           p = m.TransformPoint(p);
         }
       }
-      result = SVGFrame->GetFrameForPoint(p);
+      result = displayable->GetFrameForPoint(p);
       if (result)
         break;
     }
   }
 
   if (result && !HitTestClip(aFrame, aPoint))
     result = nullptr;
 
@@ -1080,34 +1080,34 @@ nsSVGUtils::GetBBox(nsIFrame* aFrame, ui
     if (ancestor && nsSVGUtils::IsInSVGTextSubtree(ancestor)) {
       while (!ancestor->IsSVGTextFrame()) {
         ancestor = ancestor->GetParent();
       }
     }
     aFrame = ancestor;
   }
 
-  nsSVGDisplayableFrame* svg = do_QueryFrame(aFrame);
+  nsSVGDisplayableFrame* displayable = do_QueryFrame(aFrame);
   const bool hasSVGLayout = aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT;
-  if (hasSVGLayout && !svg) {
+  if (hasSVGLayout && !displayable) {
     // An SVG frame, but not one that can be displayed directly (for
     // example, nsGradientFrame). These can't contribute to the bbox.
     return gfxRect();
   }
 
-  const bool isOuterSVG = svg && !hasSVGLayout;
+  const bool isOuterSVG = displayable && !hasSVGLayout;
   MOZ_ASSERT(!isOuterSVG || aFrame->IsSVGOuterSVGFrame());
-  if (!svg ||
+  if (!displayable ||
       (isOuterSVG && (aFlags & eUseFrameBoundsForOuterSVG))) {
     // An HTML element or an SVG outer frame.
     MOZ_ASSERT(!hasSVGLayout);
     return nsSVGIntegrationUtils::GetSVGBBoxForNonSVGFrame(aFrame);
   }
 
-  MOZ_ASSERT(svg);
+  MOZ_ASSERT(displayable);
 
   nsIContent* content = aFrame->GetContent();
   if (content->IsSVGElement() &&
       !static_cast<const nsSVGElement*>(content)->HasValidDimensions()) {
     return gfxRect();
   }
 
   if (aFlags == eBBoxIncludeFillGeometry &&
@@ -1130,25 +1130,25 @@ nsSVGUtils::GetBBox(nsIFrame* aFrame, ui
     // needs investigation to check that we won't break too much content.
     // NOTE: When changing this to apply to other frame types, make sure to
     // also update nsSVGUtils::FrameSpaceInCSSPxToUserSpaceOffset.
     MOZ_ASSERT(content->IsSVGElement(), "bad cast");
     nsSVGElement *element = static_cast<nsSVGElement*>(content);
     matrix = element->PrependLocalTransformsTo(matrix, eChildToUserSpace);
   }
   gfxRect bbox =
-    svg->GetBBoxContribution(ToMatrix(matrix), aFlags).ToThebesRect();
+    displayable->GetBBoxContribution(ToMatrix(matrix), aFlags).ToThebesRect();
   // Account for 'clipped'.
   if (aFlags & nsSVGUtils::eBBoxIncludeClipped) {
     gfxRect clipRect(0, 0, 0, 0);
     float x, y, width, height;
     gfxMatrix tm;
     gfxRect fillBBox =
-      svg->GetBBoxContribution(ToMatrix(tm),
-                               nsSVGUtils::eBBoxIncludeFill).ToThebesRect();
+      displayable->GetBBoxContribution(ToMatrix(tm),
+                                 nsSVGUtils::eBBoxIncludeFill).ToThebesRect();
     x = fillBBox.x;
     y = fillBBox.y;
     width = fillBBox.width;
     height = fillBBox.height;
     bool hasClip = aFrame->StyleDisplay()->IsScrollableOverflow();
     if (hasClip) {
       clipRect =
         nsSVGUtils::GetClipRectForFrame(aFrame, x, y, width, height);
@@ -1827,53 +1827,53 @@ nsSVGUtils::GetGeometryHitTestFlags(nsIF
 
   return flags;
 }
 
 void
 nsSVGUtils::PaintSVGGlyph(Element* aElement, gfxContext* aContext)
 {
   nsIFrame* frame = aElement->GetPrimaryFrame();
-  nsSVGDisplayableFrame* svgFrame = do_QueryFrame(frame);
-  if (!svgFrame) {
+  nsSVGDisplayableFrame* displayable = do_QueryFrame(frame);
+  if (!displayable) {
     return;
   }
   gfxMatrix m;
   if (frame->GetContent()->IsSVGElement()) {
     // PaintSVG() expects the passed transform to be the transform to its own
     // SVG user space, so we need to account for any 'transform' attribute:
     m = static_cast<nsSVGElement*>(frame->GetContent())->
           PrependLocalTransformsTo(gfxMatrix(), eUserSpaceToParent);
   }
 
   // SVG-in-OpenType is not allowed to paint exteral resources, so we can
   // just pass a dummy params into PatintSVG.
   imgDrawingParams dummy;
-  svgFrame->PaintSVG(*aContext, m, dummy);
+  displayable->PaintSVG(*aContext, m, dummy);
 }
 
 bool
 nsSVGUtils::GetSVGGlyphExtents(Element* aElement,
                                const gfxMatrix& aSVGToAppSpace,
                                gfxRect* aResult)
 {
   nsIFrame* frame = aElement->GetPrimaryFrame();
-  nsSVGDisplayableFrame* svgFrame = do_QueryFrame(frame);
-  if (!svgFrame) {
+  nsSVGDisplayableFrame* displayable = do_QueryFrame(frame);
+  if (!displayable) {
     return false;
   }
 
   gfxMatrix transform(aSVGToAppSpace);
   nsIContent* content = frame->GetContent();
   if (content->IsSVGElement()) {
     transform = static_cast<nsSVGElement*>(content)->
                   PrependLocalTransformsTo(aSVGToAppSpace);
   }
 
-  *aResult = svgFrame->GetBBoxContribution(gfx::ToMatrix(transform),
+  *aResult = displayable->GetBBoxContribution(gfx::ToMatrix(transform),
     nsSVGUtils::eBBoxIncludeFill | nsSVGUtils::eBBoxIncludeFillGeometry |
     nsSVGUtils::eBBoxIncludeStroke | nsSVGUtils::eBBoxIncludeStrokeGeometry |
     nsSVGUtils::eBBoxIncludeMarkers).ToThebesRect();
   return true;
 }
 
 nsRect
 nsSVGUtils::ToCanvasBounds(const gfxRect &aUserspaceRect,