diff --git a/layout/svg/SVGImageContext.cpp b/layout/svg/SVGImageContext.cpp
index 384401ae2cb80a1bf438b1fb3d849254de100210..e5ef332bc529e6588c33b507993880ca9def51d1 100644
--- a/layout/svg/SVGImageContext.cpp
+++ b/layout/svg/SVGImageContext.cpp
@@ -10,6 +10,7 @@
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/ServoCSSParser.h"
 #include "mozilla/StaticPrefs_svg.h"
+#include "mozilla/dom/BrowsingContext.h"
 #include "mozilla/dom/Document.h"
 #include "nsIFrame.h"
 #include "nsISVGPaintContext.h"
@@ -18,6 +19,19 @@
 
 namespace mozilla {
 
+/* static */
+void SVGImageContext::MaybeStoreZenBoosts(SVGImageContext& aContext,
+                                          const nsPresContext& aPresContext) {
+  if (dom::Document* doc = aPresContext.Document()) {
+    if (dom::BrowsingContext* bc = doc->GetBrowsingContext()) {
+      bc = bc->Top();
+      aContext.SetZenBoosts(bc->ZenBoostsData(),
+                            bc->ZenBoostsComplementaryRotation(),
+                            bc->IsZenBoostsInverted());
+    }
+  }
+}
+
 /* static */
 void SVGImageContext::MaybeStoreContextPaint(SVGImageContext& aContext,
                                              nsIFrame* aFromFrame,
@@ -50,6 +64,8 @@ void SVGImageContext::MaybeStoreContextPaint(SVGImageContext& aContext,
     }
   }
 
+  MaybeStoreZenBoosts(aContext, aPresContext);
+
   const nsStyleSVG* style = aStyle.StyleSVG();
   if (!style->ExposesContextProperties()) {
     // Content must have '-moz-context-properties' set to the names of the
@@ -64,12 +80,14 @@ void SVGImageContext::MaybeStoreContextPaint(SVGImageContext& aContext,
   if ((style->mMozContextProperties.bits & StyleContextPropertyBits::FILL) &&
       style->mFill.kind.IsColor()) {
     haveContextPaint = true;
-    contextPaint->SetFill(style->mFill.kind.AsColor().CalcColor(aStyle));
+    contextPaint->SetFill(
+        style->mFill.kind.AsColor().CalcColor(aStyle, nullptr));
   }
   if ((style->mMozContextProperties.bits & StyleContextPropertyBits::STROKE) &&
       style->mStroke.kind.IsColor()) {
     haveContextPaint = true;
-    contextPaint->SetStroke(style->mStroke.kind.AsColor().CalcColor(aStyle));
+    contextPaint->SetStroke(
+        style->mStroke.kind.AsColor().CalcColor(aStyle, nullptr));
   }
   if (style->mMozContextProperties.bits &
       StyleContextPropertyBits::FILL_OPACITY) {
