diff --git a/dom/svg/SVGContentUtils.cpp b/dom/svg/SVGContentUtils.cpp index 062a67780948c..d95e9cef5c520 100644 --- a/dom/svg/SVGContentUtils.cpp +++ b/dom/svg/SVGContentUtils.cpp @@ -814,7 +814,7 @@ float SVGContentUtils::CoordToFloat(SVGElement* aContent, return CSSCoord(ctx ? ctx->GetLength(SVGContentUtils::XY) : 0.0f); }); if (aLength.IsCalc()) { - auto& calc = aLength.AsCalc(); + const auto& calc = aLength.AsCalc(); if (calc.clamping_mode == StyleAllowedNumericType::NonNegative) { result = std::max(result, 0.0f); } else { diff --git a/layout/svg/CSSClipPathInstance.cpp b/layout/svg/CSSClipPathInstance.cpp index 0fdf4252bb771..74f72dc10e1b0 100644 --- a/layout/svg/CSSClipPathInstance.cpp +++ b/layout/svg/CSSClipPathInstance.cpp @@ -28,7 +28,7 @@ namespace mozilla { /* static*/ void CSSClipPathInstance::ApplyBasicShapeOrPathClip( gfxContext& aContext, nsIFrame* aFrame, const gfxMatrix& aTransform) { - auto& clipPathStyle = aFrame->StyleSVGReset()->mClipPath; + const auto& clipPathStyle = aFrame->StyleSVGReset()->mClipPath; MOZ_ASSERT(clipPathStyle.IsShape() || clipPathStyle.IsBox() || clipPathStyle.IsPath(), "This is used with basic-shape, geometry-box, and path() only"); @@ -48,7 +48,7 @@ void CSSClipPathInstance::ApplyBasicShapeOrPathClip( /* static*/ bool CSSClipPathInstance::HitTestBasicShapeOrPathClip(nsIFrame* aFrame, const gfxPoint& aPoint) { - auto& clipPathStyle = aFrame->StyleSVGReset()->mClipPath; + const auto& clipPathStyle = aFrame->StyleSVGReset()->mClipPath; MOZ_ASSERT(!clipPathStyle.IsNone(), "unexpected none value"); // In the future CSSClipPathInstance may handle references as // well. For the time being return early. diff --git a/layout/svg/SVGClipPathFrame.cpp b/layout/svg/SVGClipPathFrame.cpp index cf8e6e5263d33..a93fe5a6c9902 100644 --- a/layout/svg/SVGClipPathFrame.cpp +++ b/layout/svg/SVGClipPathFrame.cpp @@ -475,7 +475,7 @@ SVGBBox SVGClipPathFrame::GetBBoxForClipPathFrame(const SVGBBox& aBBox, bool SVGClipPathFrame::IsSVGTransformed(Matrix* aOwnTransforms, Matrix* aFromParentTransforms) const { - auto e = static_cast(GetContent()); + const auto* e = static_cast(GetContent()); Matrix m = ToMatrix(e->PrependLocalTransformsTo({}, eUserSpaceToParent)); if (m.IsIdentity()) { diff --git a/layout/svg/SVGContextPaint.cpp b/layout/svg/SVGContextPaint.cpp index 8bf6637516447..c40fb2f55a947 100644 --- a/layout/svg/SVGContextPaint.cpp +++ b/layout/svg/SVGContextPaint.cpp @@ -189,7 +189,8 @@ SVGContextPaint* SVGContextPaint::GetContextPaint(nsIContent* aContent) { return nullptr; } - auto* contextPaint = ownerDoc->AsSVGDocument()->GetCurrentContextPaint(); + const auto* contextPaint = + ownerDoc->AsSVGDocument()->GetCurrentContextPaint(); MOZ_ASSERT_IF(contextPaint, ownerDoc->IsBeingUsedAsImage()); // XXX The SVGContextPaint that SVGDocument keeps around is const. We could diff --git a/layout/svg/SVGGeometryFrame.cpp b/layout/svg/SVGGeometryFrame.cpp index 25e88e363eb0e..57ad64f49b365 100644 --- a/layout/svg/SVGGeometryFrame.cpp +++ b/layout/svg/SVGGeometryFrame.cpp @@ -93,7 +93,7 @@ void DisplaySVGGeometry::Paint(nsDisplayListBuilder* aBuilder, void DisplaySVGGeometry::ComputeInvalidationRegion( nsDisplayListBuilder* aBuilder, const nsDisplayItemGeometry* aGeometry, nsRegion* aInvalidRegion) const { - auto geometry = + const auto* geometry = static_cast(aGeometry); if (aBuilder->ShouldSyncDecodeImages() && @@ -141,7 +141,7 @@ void SVGGeometryFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle) { SVGGeometryElement* element = static_cast(GetContent()); - auto* oldStyleSVG = aOldComputedStyle->StyleSVG(); + const auto* oldStyleSVG = aOldComputedStyle->StyleSVG(); if (!SVGContentUtils::ShapeTypeHasNoCorners(GetContent())) { if (StyleSVG()->mStrokeLinecap != oldStyleSVG->mStrokeLinecap && element->IsSVGElement(nsGkAtoms::path)) { @@ -729,7 +729,7 @@ void SVGGeometryFrame::Render(gfxContext* aContext, uint32_t aRenderComponents, void SVGGeometryFrame::PaintMarkers(gfxContext& aContext, const gfxMatrix& aTransform, imgDrawingParams& aImgParams) { - auto element = static_cast(GetContent()); + auto* element = static_cast(GetContent()); if (element->IsMarkable()) { SVGMarkerFrame* markerFrames[SVGMark::eTypeCount]; diff --git a/layout/svg/SVGGradientFrame.cpp b/layout/svg/SVGGradientFrame.cpp index 3c292e2c6459a..6d997f9de1477 100644 --- a/layout/svg/SVGGradientFrame.cpp +++ b/layout/svg/SVGGradientFrame.cpp @@ -248,8 +248,8 @@ already_AddRefed SVGGradientFrame::GetPaintServerPattern( } if (nStops == 1 || GradientVectorLengthIsZero()) { - auto lastStopFrame = stopFrames[nStops - 1]; - auto svgReset = lastStopFrame->StyleSVGReset(); + auto* lastStopFrame = stopFrames[nStops - 1]; + const auto* svgReset = lastStopFrame->StyleSVGReset(); // The gradient paints a single colour, using the stop-color of the last // gradient step if there are more than one. float stopOpacity = svgReset->mStopOpacity; diff --git a/layout/svg/SVGObserverUtils.cpp b/layout/svg/SVGObserverUtils.cpp index abd79077a99c2..4992863c7409d 100644 --- a/layout/svg/SVGObserverUtils.cpp +++ b/layout/svg/SVGObserverUtils.cpp @@ -50,11 +50,11 @@ class URLAndReferrerInfoHashKey : public PLDHashEntryHdr { using KeyType = const URLAndReferrerInfo*; using KeyTypePointer = const URLAndReferrerInfo*; - explicit URLAndReferrerInfoHashKey(const URLAndReferrerInfo* aKey) + explicit URLAndReferrerInfoHashKey(const URLAndReferrerInfo* aKey) noexcept : mKey(aKey) { MOZ_COUNT_CTOR(URLAndReferrerInfoHashKey); } - URLAndReferrerInfoHashKey(URLAndReferrerInfoHashKey&& aToMove) + URLAndReferrerInfoHashKey(URLAndReferrerInfoHashKey&& aToMove) noexcept : PLDHashEntryHdr(std::move(aToMove)), mKey(std::move(aToMove.mKey)) { MOZ_COUNT_CTOR(URLAndReferrerInfoHashKey); } diff --git a/layout/svg/SVGOuterSVGFrame.cpp b/layout/svg/SVGOuterSVGFrame.cpp index 6518161dbfdc7..f76174c480f41 100644 --- a/layout/svg/SVGOuterSVGFrame.cpp +++ b/layout/svg/SVGOuterSVGFrame.cpp @@ -674,7 +674,7 @@ void nsDisplayOuterSVG::ComputeInvalidationRegion( nsDisplayItem::ComputeInvalidationRegion(aBuilder, aGeometry, aInvalidRegion); aInvalidRegion->Or(*aInvalidRegion, result); - auto geometry = + const auto* geometry = static_cast(aGeometry); if (aBuilder->ShouldSyncDecodeImages() && diff --git a/layout/svg/SVGUtils.cpp b/layout/svg/SVGUtils.cpp index d2720644a1bcd..9ad989293f4da 100644 --- a/layout/svg/SVGUtils.cpp +++ b/layout/svg/SVGUtils.cpp @@ -933,7 +933,7 @@ gfxRect SVGUtils::GetClipRectForFrame(nsIFrame* aFrame, float aX, float aY, return gfxRect(aX, aY, aWidth, aHeight); } - auto& rect = effects->mClip.AsRect(); + const auto& rect = effects->mClip.AsRect(); nsRect coordClipRect = rect.ToLayoutRect(); nsIntRect clipPxRect = coordClipRect.ToOutsidePixels( aFrame->PresContext()->AppUnitsPerDevPixel());