Bug 1328319 part 5 - Add bindings for list and pair list value of nsCSSValue. r?Manishearth
MozReview-Commit-ID: KO0UCkrlxBi
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -1902,16 +1902,38 @@ Gecko_CSSValue_GetArrayItemConst(nsCSSVa
void
Gecko_CSSValue_SetPair(nsCSSValueBorrowedMut aCSSValue,
nsCSSValueBorrowed aXValue, nsCSSValueBorrowed aYValue)
{
MOZ_ASSERT(NS_IsMainThread());
aCSSValue->SetPairValue(*aXValue, *aYValue);
}
+void
+Gecko_CSSValue_SetList(nsCSSValueBorrowedMut aCSSValue, uint32_t aLen)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+ nsCSSValueList* item = aCSSValue->SetListValue();
+ for (uint32_t i = 1; i < aLen; ++i) {
+ item->mNext = new nsCSSValueList;
+ item = item->mNext;
+ }
+}
+
+void
+Gecko_CSSValue_SetPairList(nsCSSValueBorrowedMut aCSSValue, uint32_t aLen)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+ nsCSSValuePairList* item = aCSSValue->SetPairListValue();
+ for (uint32_t i = 1; i < aLen; ++i) {
+ item->mNext = new nsCSSValuePairList;
+ item = item->mNext;
+ }
+}
+
bool
Gecko_PropertyId_IsPrefEnabled(nsCSSPropertyID id)
{
return nsCSSProps::IsEnabled(id);
}
void
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -481,16 +481,18 @@ void Gecko_CSSValue_SetStringFromAtom(ns
nsIAtom* atom, nsCSSUnit unit);
// Take an addrefed nsIAtom and set it to the nsCSSValue
void Gecko_CSSValue_SetAtomIdent(nsCSSValueBorrowedMut css_value, nsIAtom* atom);
void Gecko_CSSValue_SetArray(nsCSSValueBorrowedMut css_value, int32_t len);
void Gecko_CSSValue_SetURL(nsCSSValueBorrowedMut css_value, ServoBundledURI uri);
void Gecko_CSSValue_SetInt(nsCSSValueBorrowedMut css_value, int32_t integer, nsCSSUnit unit);
void Gecko_CSSValue_SetPair(nsCSSValueBorrowedMut css_value,
nsCSSValueBorrowed xvalue, nsCSSValueBorrowed yvalue);
+void Gecko_CSSValue_SetList(nsCSSValueBorrowedMut css_value, uint32_t len);
+void Gecko_CSSValue_SetPairList(nsCSSValueBorrowedMut css_value, uint32_t len);
void Gecko_CSSValue_Drop(nsCSSValueBorrowedMut css_value);
NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsCSSValueSharedList, CSSValueSharedList);
bool Gecko_PropertyId_IsPrefEnabled(nsCSSPropertyID id);
void Gecko_nsStyleFont_SetLang(nsStyleFont* font, nsIAtom* atom);
void Gecko_nsStyleFont_CopyLangFrom(nsStyleFont* aFont, const nsStyleFont* aSource);
void Gecko_nsStyleFont_FixupNoneGeneric(nsStyleFont* font,
RawGeckoPresContextBorrowed pres_context);