Bug 1334036 - Part 9: Add one FFI which return None transform. draft
authorBoris Chiou <boris.chiou@gmail.com>
Fri, 19 May 2017 16:09:45 +0800
changeset 581942 7492d38b17b2f3e7bcb55a6adb27ef4fb6ab8f88
parent 581941 31462ec4c7f2b94bb7168f6d13b3c9f1786db0fa
child 581943 287ef9520b1ce20dd1eb59b9ec2736a17c537e2b
push id59916
push userbmo:boris.chiou@gmail.com
push dateSat, 20 May 2017 06:48:29 +0000
bugs1334036
milestone55.0a1
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
js/src/devtools/rootAnalysis/analyzeHeapWrites.js
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
--- 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);