Bug 1302949 - Add a method to serialize a declaration block as a single value; r=heycam
MozReview-Commit-ID: 59CCT0P4CBm
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -615,16 +615,29 @@ Gecko_AtomEqualsUTF8IgnoreCase(nsIAtom*
// XXXbholley: We should be able to do this without converting, I just can't
// find the right thing to call.
nsDependentAtomString atomStr(aAtom);
NS_ConvertUTF8toUTF16 inStr(nsDependentCSubstring(aString, aLength));
return nsContentUtils::EqualsIgnoreASCIICase(atomStr, inStr);
}
void
+Gecko_Utf8SliceToString(nsString* aString,
+ const uint8_t* aBuffer,
+ size_t aBufferLen)
+{
+ MOZ_ASSERT(aString);
+ MOZ_ASSERT(aBuffer);
+
+ aString->Truncate();
+ AppendUTF8toUTF16(Substring(reinterpret_cast<const char*>(aBuffer),
+ aBufferLen), *aString);
+}
+
+void
Gecko_FontFamilyList_Clear(FontFamilyList* aList) {
aList->Clear();
}
void
Gecko_FontFamilyList_AppendNamed(FontFamilyList* aList, nsIAtom* aName)
{
// Servo doesn't record whether the name was quoted or unquoted, so just
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -221,16 +221,21 @@ ServoDeclarationBlockBorrowedOrNull Geck
// Atoms.
nsIAtom* Gecko_Atomize(const char* aString, uint32_t aLength);
void Gecko_AddRefAtom(nsIAtom* aAtom);
void Gecko_ReleaseAtom(nsIAtom* aAtom);
const uint16_t* Gecko_GetAtomAsUTF16(nsIAtom* aAtom, uint32_t* aLength);
bool Gecko_AtomEqualsUTF8(nsIAtom* aAtom, const char* aString, uint32_t aLength);
bool Gecko_AtomEqualsUTF8IgnoreCase(nsIAtom* aAtom, const char* aString, uint32_t aLength);
+// Strings (temporary until bug 1294742)
+void Gecko_Utf8SliceToString(nsString* aString,
+ const uint8_t* aBuffer,
+ size_t aBufferLen);
+
// Font style
void Gecko_FontFamilyList_Clear(FontFamilyList* aList);
void Gecko_FontFamilyList_AppendNamed(FontFamilyList* aList, nsIAtom* aName);
void Gecko_FontFamilyList_AppendGeneric(FontFamilyList* list, FontFamilyType familyType);
void Gecko_CopyFontFamilyFrom(nsFont* dst, const nsFont* src);
// Counter style.
void Gecko_SetListStyleType(nsStyleList* style_struct, uint32_t type);