diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp
index e3698a2cbcfd13ce6075e0a155c46191dfc15a57..99c46e11bb80224986c757ab9a9a7dca4d8982d5 100644
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -768,7 +768,7 @@ static void SerializeColorForHTMLCompatibility(const StyleAbsoluteColor& aColor,
   // Raw StyleAbsoluteColor can have floats outside of 0-1 range e.g. when
   // display-p3 color is converted to srgb, and ToColor guarantees to fit the
   // values within the range.
-  nscolor color = aColor.ToColor();
+  nscolor color = aColor.ToColor(nullptr);
   aResult.Truncate();
   aResult.AppendPrintf("#%02x%02x%02x", NS_GET_R(color), NS_GET_G(color),
                        NS_GET_B(color));
