commit c5764046d1760cfd3781b1c934affca04f11257f
parent c345fbc6a425f959a0fc86ba1434b27408d86461
Author: Chris Peterson <cpeterson@mozilla.com>
Date: Tue, 9 Dec 2025 00:01:28 +0000
Bug 2002864 - Replace MOZ_CONSTINIT with C++20 constinit in dom/svg. r=firefox-svg-reviewers,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D274500
Diffstat:
13 files changed, 35 insertions(+), 36 deletions(-)
diff --git a/dom/svg/DOMSVGAnimatedTransformList.cpp b/dom/svg/DOMSVGAnimatedTransformList.cpp
@@ -13,8 +13,8 @@
namespace mozilla::dom {
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedTransformList,
- DOMSVGAnimatedTransformList>
+constinit static SVGAttrTearoffTable<SVGAnimatedTransformList,
+ DOMSVGAnimatedTransformList>
sSVGAnimatedTransformListTearoffTable;
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(DOMSVGAnimatedTransformList,
diff --git a/dom/svg/DOMSVGLength.cpp b/dom/svg/DOMSVGLength.cpp
@@ -21,7 +21,7 @@
namespace mozilla::dom {
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedLength, DOMSVGLength>
+constinit static SVGAttrTearoffTable<SVGAnimatedLength, DOMSVGLength>
sBaseSVGLengthTearOffTable, sAnimSVGLengthTearOffTable;
// We could use NS_IMPL_CYCLE_COLLECTION(, except that in Unlink() we need to
diff --git a/dom/svg/DOMSVGPoint.cpp b/dom/svg/DOMSVGPoint.cpp
@@ -37,7 +37,7 @@ class MOZ_RAII AutoChangePointNotifier {
DOMSVGPoint* const mValue;
};
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGPoint, DOMSVGPoint>
+constinit static SVGAttrTearoffTable<SVGPoint, DOMSVGPoint>
sSVGTranslateTearOffTable;
// We could use NS_IMPL_CYCLE_COLLECTION(, except that in Unlink() we need to
diff --git a/dom/svg/SVGAnimatedClassOrString.cpp b/dom/svg/SVGAnimatedClassOrString.cpp
@@ -13,8 +13,8 @@
namespace mozilla {
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedClassOrString,
- dom::DOMSVGAnimatedString>
+constinit static SVGAttrTearoffTable<SVGAnimatedClassOrString,
+ dom::DOMSVGAnimatedString>
sSVGAnimatedClassOrStringTearoffTable;
already_AddRefed<dom::DOMSVGAnimatedString>
diff --git a/dom/svg/SVGAnimatedEnumeration.cpp b/dom/svg/SVGAnimatedEnumeration.cpp
@@ -44,8 +44,8 @@ class MOZ_RAII AutoChangeEnumNotifier {
bool mDoSetAttr;
};
-MOZ_CONSTINIT static SVGAttrTearoffTable<
- SVGAnimatedEnumeration, SVGAnimatedEnumeration::DOMAnimatedEnum>
+constinit static SVGAttrTearoffTable<SVGAnimatedEnumeration,
+ SVGAnimatedEnumeration::DOMAnimatedEnum>
sSVGAnimatedEnumTearoffTable;
const SVGEnumMapping* SVGAnimatedEnumeration::GetMapping(
diff --git a/dom/svg/SVGAnimatedInteger.cpp b/dom/svg/SVGAnimatedInteger.cpp
@@ -45,8 +45,8 @@ class MOZ_RAII AutoChangeIntegerNotifier {
bool mDoSetAttr;
};
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedInteger,
- SVGAnimatedInteger::DOMAnimatedInteger>
+constinit static SVGAttrTearoffTable<SVGAnimatedInteger,
+ SVGAnimatedInteger::DOMAnimatedInteger>
sSVGAnimatedIntegerTearoffTable;
nsresult SVGAnimatedInteger::SetBaseValueString(const nsAString& aValueAsString,
diff --git a/dom/svg/SVGAnimatedIntegerPair.cpp b/dom/svg/SVGAnimatedIntegerPair.cpp
@@ -57,11 +57,11 @@ class MOZ_RAII AutoChangeIntegerPairNotifier {
bool mDoSetAttr;
};
-MOZ_CONSTINIT static SVGAttrTearoffTable<
- SVGAnimatedIntegerPair, SVGAnimatedIntegerPair::DOMAnimatedInteger>
+constinit static SVGAttrTearoffTable<SVGAnimatedIntegerPair,
+ SVGAnimatedIntegerPair::DOMAnimatedInteger>
sSVGFirstAnimatedIntegerTearoffTable;
-MOZ_CONSTINIT static SVGAttrTearoffTable<
- SVGAnimatedIntegerPair, SVGAnimatedIntegerPair::DOMAnimatedInteger>
+constinit static SVGAttrTearoffTable<SVGAnimatedIntegerPair,
+ SVGAnimatedIntegerPair::DOMAnimatedInteger>
sSVGSecondAnimatedIntegerTearoffTable;
/* Implementation */
diff --git a/dom/svg/SVGAnimatedLength.cpp b/dom/svg/SVGAnimatedLength.cpp
@@ -64,8 +64,7 @@ class MOZ_RAII AutoChangeLengthNotifier {
bool mDoSetAttr;
};
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedLength,
- DOMSVGAnimatedLength>
+constinit static SVGAttrTearoffTable<SVGAnimatedLength, DOMSVGAnimatedLength>
sSVGAnimatedLengthTearoffTable;
/* Helper functions */
diff --git a/dom/svg/SVGAnimatedNumber.cpp b/dom/svg/SVGAnimatedNumber.cpp
@@ -42,8 +42,8 @@ class MOZ_RAII AutoChangeNumberNotifier {
SVGElement* const mSVGElement;
};
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedNumber,
- SVGAnimatedNumber::DOMAnimatedNumber>
+constinit static SVGAttrTearoffTable<SVGAnimatedNumber,
+ SVGAnimatedNumber::DOMAnimatedNumber>
sSVGAnimatedNumberTearoffTable;
static bool GetValueFromString(const nsAString& aString,
diff --git a/dom/svg/SVGAnimatedNumberPair.cpp b/dom/svg/SVGAnimatedNumberPair.cpp
@@ -51,11 +51,11 @@ class MOZ_RAII AutoChangeNumberPairNotifier {
bool mDoSetAttr;
};
-MOZ_CONSTINIT static SVGAttrTearoffTable<
- SVGAnimatedNumberPair, SVGAnimatedNumberPair::DOMAnimatedNumber>
+constinit static SVGAttrTearoffTable<SVGAnimatedNumberPair,
+ SVGAnimatedNumberPair::DOMAnimatedNumber>
sSVGFirstAnimatedNumberTearoffTable;
-MOZ_CONSTINIT static SVGAttrTearoffTable<
- SVGAnimatedNumberPair, SVGAnimatedNumberPair::DOMAnimatedNumber>
+constinit static SVGAttrTearoffTable<SVGAnimatedNumberPair,
+ SVGAnimatedNumberPair::DOMAnimatedNumber>
sSVGSecondAnimatedNumberTearoffTable;
static nsresult ParseNumberOptionalNumber(const nsAString& aValue,
diff --git a/dom/svg/SVGAnimatedOrient.cpp b/dom/svg/SVGAnimatedOrient.cpp
@@ -26,14 +26,14 @@ using namespace mozilla::dom::SVGMarkerElement_Binding;
namespace mozilla {
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedOrient,
- DOMSVGAnimatedEnumeration>
+constinit static SVGAttrTearoffTable<SVGAnimatedOrient,
+ DOMSVGAnimatedEnumeration>
sSVGAnimatedEnumTearoffTable;
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedOrient, DOMSVGAnimatedAngle>
+constinit static SVGAttrTearoffTable<SVGAnimatedOrient, DOMSVGAnimatedAngle>
sSVGAnimatedAngleTearoffTable;
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedOrient, DOMSVGAngle>
+constinit static SVGAttrTearoffTable<SVGAnimatedOrient, DOMSVGAngle>
sBaseSVGAngleTearoffTable;
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedOrient, DOMSVGAngle>
+constinit static SVGAttrTearoffTable<SVGAnimatedOrient, DOMSVGAngle>
sAnimSVGAngleTearoffTable;
/* Helper functions */
diff --git a/dom/svg/SVGAnimatedPreserveAspectRatio.cpp b/dom/svg/SVGAnimatedPreserveAspectRatio.cpp
@@ -66,14 +66,14 @@ class MOZ_RAII AutoChangePreserveAspectRatioNotifier {
bool mDoSetAttr;
};
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedPreserveAspectRatio,
- DOMSVGAnimatedPreserveAspectRatio>
+constinit static SVGAttrTearoffTable<SVGAnimatedPreserveAspectRatio,
+ DOMSVGAnimatedPreserveAspectRatio>
sSVGAnimatedPAspectRatioTearoffTable;
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedPreserveAspectRatio,
- DOMSVGPreserveAspectRatio>
+constinit static SVGAttrTearoffTable<SVGAnimatedPreserveAspectRatio,
+ DOMSVGPreserveAspectRatio>
sBaseSVGPAspectRatioTearoffTable;
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedPreserveAspectRatio,
- DOMSVGPreserveAspectRatio>
+constinit static SVGAttrTearoffTable<SVGAnimatedPreserveAspectRatio,
+ DOMSVGPreserveAspectRatio>
sAnimSVGPAspectRatioTearoffTable;
already_AddRefed<DOMSVGPreserveAspectRatio>
diff --git a/dom/svg/SVGAnimatedViewBox.cpp b/dom/svg/SVGAnimatedViewBox.cpp
@@ -66,11 +66,11 @@ nsresult SVGViewBox::FromString(const nsAString& aStr, SVGViewBox* aViewBox) {
return NS_OK;
}
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedViewBox, SVGRect>
+constinit static SVGAttrTearoffTable<SVGAnimatedViewBox, SVGRect>
sBaseSVGViewBoxTearoffTable;
-MOZ_CONSTINIT static SVGAttrTearoffTable<SVGAnimatedViewBox, SVGRect>
+constinit static SVGAttrTearoffTable<SVGAnimatedViewBox, SVGRect>
sAnimSVGViewBoxTearoffTable;
-MOZ_CONSTINIT SVGAttrTearoffTable<SVGAnimatedViewBox, SVGAnimatedRect>
+constinit SVGAttrTearoffTable<SVGAnimatedViewBox, SVGAnimatedRect>
SVGAnimatedViewBox::sSVGAnimatedRectTearoffTable;
//----------------------------------------------------------------------