Bug 1334036 - Part 9: Add one FFI which return None transform.
This FFI is used by Servo_AnimationValue_GetTransform(), which needs to
handle and return none transform properly.
MozReview-Commit-ID: 49cFXE2BIbm
--- a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js
+++ b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js
@@ -369,16 +369,17 @@ function ignoreContents(entry)
// The analysis can't cope with the indirection used for the objects
// being initialized here.
"Gecko_GetOrCreateKeyframeAtStart",
"Gecko_GetOrCreateInitialKeyframe",
"Gecko_GetOrCreateFinalKeyframe",
"Gecko_NewStyleQuoteValues",
"Gecko_NewCSSValueSharedList",
+ "Gecko_NewNoneTransform",
"Gecko_NewGridTemplateAreasValue",
/nsCSSValue::SetCalcValue/,
/CSSValueSerializeCalcOps::Append/,
"Gecko_CSSValue_SetFunction",
"Gecko_CSSValue_SetArray",
"Gecko_EnsureMozBorderColors",
"Gecko_ClearMozBorderColors",
"Gecko_AppendMozBorderColors",
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -1739,16 +1739,25 @@ Gecko_NewCSSValueSharedList(uint32_t aLe
for (uint32_t i = 0; i < aLen - 1; i++) {
cur->mNext = new nsCSSValueList;
cur = cur->mNext;
}
return list.forget().take();
}
+nsCSSValueSharedList*
+Gecko_NewNoneTransform()
+{
+ RefPtr<nsCSSValueSharedList> list = new nsCSSValueSharedList;
+ list->mHead = new nsCSSValueList;
+ list->mHead->mValue.SetNoneValue();
+ return list.forget().take();
+}
+
void
Gecko_CSSValue_SetAbsoluteLength(nsCSSValueBorrowedMut aCSSValue, nscoord aLen)
{
MOZ_ASSERT(aCSSValue->GetUnit() == eCSSUnit_Null || aCSSValue->IsLengthUnit());
// The call below could trigger refcounting if aCSSValue were a
// FontFamilyList, but we just asserted that it's not. So we can
// whitelist this for static analysis.
aCSSValue->SetIntegerCoordValue(aLen);
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -448,16 +448,17 @@ NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsSty
nsCSSShadowArray* Gecko_NewCSSShadowArray(uint32_t len);
NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsCSSShadowArray, CSSShadowArray);
nsStyleQuoteValues* Gecko_NewStyleQuoteValues(uint32_t len);
NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsStyleQuoteValues, QuoteValues);
nsCSSValueSharedList* Gecko_NewCSSValueSharedList(uint32_t len);
+nsCSSValueSharedList* Gecko_NewNoneTransform();
// Getter for nsCSSValue
nsCSSValueBorrowedMut Gecko_CSSValue_GetArrayItem(nsCSSValueBorrowedMut css_value, int32_t index);
// const version of the above function.
nsCSSValueBorrowed Gecko_CSSValue_GetArrayItemConst(nsCSSValueBorrowed css_value, int32_t index);
nscoord Gecko_CSSValue_GetAbsoluteLength(nsCSSValueBorrowed css_value);
nsCSSKeyword Gecko_CSSValue_GetKeyword(nsCSSValueBorrowed aCSSValue);
float Gecko_CSSValue_GetNumber(nsCSSValueBorrowed css_value);