diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp
index 96dfd52fc38fe0833da7fa4c669e2a911c04c236..bb6749f3275f22e1d462d0180e83eb9aa23b6dc0 100644
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -2665,9 +2665,9 @@ void SVGTextDrawPathCallbacks::ApplyOpacity(
     sRGBColor& aColor, const StyleSVGPaint& aPaint,
     const StyleSVGOpacity& aOpacity) const {
   if (aPaint.kind.tag == StyleSVGPaintKind::Tag::Color) {
-    aColor.a *=
-        sRGBColor::FromABGR(aPaint.kind.AsColor().CalcColor(*mFrame->Style()))
-            .a;
+    aColor.a *= sRGBColor::FromABGR(
+                    aPaint.kind.AsColor().CalcColor(*mFrame->Style(), mFrame))
+                    .a;
   }
   aColor.a *= SVGUtils::GetOpacity(aOpacity, mContextPaint);
 }
@@ -5083,8 +5083,8 @@ bool SVGTextFrame::ShouldRenderAsPath(nsTextFrame* aFrame,
   // It's possible nsTextFrame will support non-opaque shadows in the future,
   // in which case this test can be removed.
   if (style->mFill.kind.IsColor() && aFrame->StyleText()->HasTextShadow() &&
-      NS_GET_A(style->mFill.kind.AsColor().CalcColor(*aFrame->Style())) !=
-          0xFF) {
+      NS_GET_A(style->mFill.kind.AsColor().CalcColor(*aFrame->Style(),
+                                                     aFrame)) != 0xFF) {
     return true;
   }
 
