Bug 1444507: Remove unused binding functions. r=bholley
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 09 Mar 2018 20:10:22 +0100
changeset 407407 2ea235b4dedb3f3141f1fd845df0c20935361a16
parent 407406 e561c88fc549429f597dd0c3b93cbbcbedfd009f
child 407408 a82647c958da3525ac24ec5b9410d4c8b01644f3
push id33601
push usernerli@mozilla.com
push dateSat, 10 Mar 2018 09:57:55 +0000
treeherdermozilla-central@8a0f43c3f5dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1444507
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1444507: Remove unused binding functions. r=bholley MozReview-Commit-ID: EGceLrhKVIm
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
layout/style/ServoUtils.h
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -1203,48 +1203,16 @@ Gecko_AddRefAtom(nsAtom* aAtom)
 }
 
 void
 Gecko_ReleaseAtom(nsAtom* aAtom)
 {
   NS_RELEASE(aAtom);
 }
 
-const uint16_t*
-Gecko_GetAtomAsUTF16(nsAtom* aAtom, uint32_t* aLength)
-{
-  static_assert(sizeof(char16_t) == sizeof(uint16_t), "Servo doesn't know what a char16_t is");
-  MOZ_ASSERT(aAtom);
-  *aLength = aAtom->GetLength();
-
-  // We need to manually cast from char16ptr_t to const char16_t* to handle the
-  // MOZ_USE_CHAR16_WRAPPER we use on WIndows.
-  return reinterpret_cast<const uint16_t*>(static_cast<const char16_t*>(aAtom->GetUTF16String()));
-}
-
-bool
-Gecko_AtomEqualsUTF8(nsAtom* aAtom, const char* aString, uint32_t aLength)
-{
-  // 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 atomStr.Equals(inStr);
-}
-
-bool
-Gecko_AtomEqualsUTF8IgnoreCase(nsAtom* aAtom, const char* aString, uint32_t aLength)
-{
-  // 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_nsTArray_FontFamilyName_AppendNamed(nsTArray<FontFamilyName>* aNames,
                                           nsAtom* aName,
                                           bool aQuoted)
 {
   FontFamilyName family;
   aName->ToString(family.mName);
   if (aQuoted) {
@@ -2416,22 +2384,16 @@ Gecko_GetBaseSize(nsAtom* aLanguage)
 
 RawGeckoElementBorrowedOrNull
 Gecko_GetBindingParent(RawGeckoElementBorrowed aElement)
 {
   nsIContent* parent = aElement->GetBindingParent();
   return parent ? parent->AsElement() : nullptr;
 }
 
-RawGeckoXBLBindingBorrowedOrNull
-Gecko_GetXBLBinding(RawGeckoElementBorrowed aElement)
-{
-  return aElement->GetXBLBinding();
-}
-
 RawServoAuthorStylesBorrowedOrNull
 Gecko_XBLBinding_GetRawServoStyles(RawGeckoXBLBindingBorrowed aXBLBinding)
 {
   return aXBLBinding->GetServoStyles();
 }
 
 bool
 Gecko_XBLBinding_InheritsStyle(RawGeckoXBLBindingBorrowed aXBLBinding)
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -288,19 +288,16 @@ void Gecko_StyleTransition_SetUnsupporte
   mozilla::StyleTransition* aTransition,
   nsAtom* aAtom);
 
 // Atoms.
 nsAtom* Gecko_Atomize(const char* aString, uint32_t aLength);
 nsAtom* Gecko_Atomize16(const nsAString* aString);
 void Gecko_AddRefAtom(nsAtom* aAtom);
 void Gecko_ReleaseAtom(nsAtom* aAtom);
-const uint16_t* Gecko_GetAtomAsUTF16(nsAtom* aAtom, uint32_t* aLength);
-bool Gecko_AtomEqualsUTF8(nsAtom* aAtom, const char* aString, uint32_t aLength);
-bool Gecko_AtomEqualsUTF8IgnoreCase(nsAtom* aAtom, const char* aString, uint32_t aLength);
 
 // Font style
 void Gecko_CopyFontFamilyFrom(nsFont* dst, const nsFont* src);
 void Gecko_nsTArray_FontFamilyName_AppendNamed(nsTArray<FontFamilyName>* aNames, nsAtom* aName, bool aQuoted);
 void Gecko_nsTArray_FontFamilyName_AppendGeneric(nsTArray<FontFamilyName>* aNames, FontFamilyType aType);
 // Returns an already-AddRefed SharedFontList with an empty mNames array.
 SharedFontList* Gecko_SharedFontList_Create();
 size_t Gecko_SharedFontList_SizeOfIncludingThis(SharedFontList* fontlist);
@@ -599,17 +596,16 @@ void Gecko_nsStyleFont_PrefillDefaultFor
                                                 RawGeckoPresContextBorrowed pres_context,
                                                 uint8_t generic_id);
 void Gecko_nsStyleFont_FixupMinFontSize(nsStyleFont* font,
                                         RawGeckoPresContextBorrowed pres_context);
 FontSizePrefs Gecko_GetBaseSize(nsAtom* lang);
 
 // XBL related functions.
 RawGeckoElementBorrowedOrNull Gecko_GetBindingParent(RawGeckoElementBorrowed aElement);
-RawGeckoXBLBindingBorrowedOrNull Gecko_GetXBLBinding(RawGeckoElementBorrowed aElement);
 RawServoAuthorStylesBorrowedOrNull Gecko_XBLBinding_GetRawServoStyles(RawGeckoXBLBindingBorrowed aXBLBinding);
 bool Gecko_XBLBinding_InheritsStyle(RawGeckoXBLBindingBorrowed aXBLBinding);
 
 struct GeckoFontMetrics
 {
   nscoord mChSize;
   nscoord mXSize;
 };
--- a/layout/style/ServoUtils.h
+++ b/layout/style/ServoUtils.h
@@ -149,19 +149,9 @@ inline bool IsInServoTraversal()
 #else
 #define MOZ_STYLO_FORWARD_CONCRETE(method_, geckoargs_, servoargs_)         \
   return AsServo()->method_ servoargs_;
 #endif
 
 #define MOZ_STYLO_FORWARD(method_, args_) \
   MOZ_STYLO_FORWARD_CONCRETE(method_, args_, args_)
 
-// Warning in MOZ_STYLO builds and non-fatally assert in regular builds.
-#define NS_ASSERTION_STYLO_WARNING_EXPAND(X) X
-#ifdef MOZ_STYLO
-#define NS_ASSERTION_STYLO_WARNING(...) \
-  NS_ASSERTION_STYLO_WARNING_EXPAND(NS_WARNING_ASSERTION(__VA_ARGS__))
-#else
-#define NS_ASSERTION_STYLO_WARNING(...) \
-  NS_ASSERTION_STYLO_WARNING_EXPAND(NS_ASSERTION(__VA_ARGS__))
-#endif
-
 #endif // mozilla_ServoUtils_h