Bug 1410624: Add some declarations and bindings so the build isn't busted when servo-vcs-sync goes back alive. r=me,heycam
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 23 Oct 2017 22:36:59 +0200
changeset 387720 b43cc917edadafe3c06888ba02d464a12b2d502b
parent 387719 ebe89bb81bc82615518e6094fa40640816bb0569
child 387721 51fded9c47aa99770e9c2b5a85e82bd988b12e57
push id32734
push userarchaeopteryx@coole-files.de
push dateTue, 24 Oct 2017 09:50:45 +0000
treeherdermozilla-central@25bc10affd99 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, heycam
bugs1410624, 18988
milestone58.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 1410624: Add some declarations and bindings so the build isn't busted when servo-vcs-sync goes back alive. r=me,heycam https://github.com/servo/servo/pull/18988 has merged a while ago in servo, but since the sync service is down, I haven't been able to land the relevant patches today. This at least ensures that the build isn't busted when servo-vcs-sync goes back up. MozReview-Commit-ID: 9ohgwcnMc5T
layout/style/ServoBindingList.h
layout/style/ServoBindingTypes.h
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
layout/style/ServoBindings.toml
--- a/layout/style/ServoBindingList.h
+++ b/layout/style/ServoBindingList.h
@@ -133,16 +133,21 @@ SERVO_BINDING_FUNC(Servo_SelectorList_Dr
                    RawServoSelectorListOwned selector_list)
 SERVO_BINDING_FUNC(Servo_SelectorList_Parse,
                    RawServoSelectorList*,
                    const nsACString* selector_list)
 SERVO_BINDING_FUNC(Servo_SelectorList_Matches, bool,
                    RawGeckoElementBorrowed, RawServoSelectorListBorrowed)
 SERVO_BINDING_FUNC(Servo_SelectorList_Closest, const RawGeckoElement*,
                    RawGeckoElementBorrowed, RawServoSelectorListBorrowed)
+SERVO_BINDING_FUNC(Servo_SelectorList_QueryFirst, const RawGeckoElement*,
+                   RawGeckoNodeBorrowed, RawServoSelectorListBorrowed)
+SERVO_BINDING_FUNC(Servo_SelectorList_QueryAll, void,
+                   RawGeckoNodeBorrowed, RawServoSelectorListBorrowed,
+                   nsSimpleContentList* content_list)
 SERVO_BINDING_FUNC(Servo_StyleSet_AddSizeOfExcludingThis, void,
                    mozilla::MallocSizeOf malloc_size_of,
                    mozilla::MallocSizeOf malloc_enclosing_size_of,
                    mozilla::ServoStyleSetSizes* sizes,
                    RawServoStyleSetBorrowed set)
 SERVO_BINDING_FUNC(Servo_UACache_AddSizeOf, void,
                    mozilla::MallocSizeOf malloc_size_of,
                    mozilla::MallocSizeOf malloc_enclosing_size_of,
--- a/layout/style/ServoBindingTypes.h
+++ b/layout/style/ServoBindingTypes.h
@@ -46,16 +46,17 @@ enum class MatrixTransformOperator: uint
 }
 
 class nsCSSPropertyIDSet;
 class nsCSSValue;
 struct nsFontFaceRuleContainer;
 class nsIDocument;
 class nsINode;
 class nsPresContext;
+class nsSimpleContentList;
 struct nsTimingFunction;
 class nsXBLBinding;
 
 using mozilla::dom::StyleChildrenIterator;
 using mozilla::ServoElementSnapshot;
 
 typedef void* RawServoAnimationValueTableBorrowed;
 
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -2837,19 +2837,36 @@ Gecko_AddBufferToCrashReport(const void*
   MOZ_ASSERT(NS_IsMainThread());
 #ifdef MOZ_CRASHREPORTER
   nsCOMPtr<nsICrashReporter> cr = do_GetService("@mozilla.org/toolkit/crash-reporter;1");
   NS_ENSURE_TRUE_VOID(cr);
   cr->RegisterAppMemory((uint64_t) addr, len);
 #endif
 }
 
-void Gecko_AnnotateCrashReport(const char* key_str, const char* value_str)
+void
+Gecko_AnnotateCrashReport(const char* key_str, const char* value_str)
 {
   MOZ_ASSERT(NS_IsMainThread());
   nsDependentCString key(key_str);
   nsDependentCString value(value_str);
 #ifdef MOZ_CRASHREPORTER
   nsCOMPtr<nsICrashReporter> cr = do_GetService("@mozilla.org/toolkit/crash-reporter;1");
   NS_ENSURE_TRUE_VOID(cr);
   cr->AnnotateCrashReport(key, value);
 #endif
 }
+
+void
+Gecko_ContentList_AppendAll(
+  nsSimpleContentList* aList,
+  const Element** aElements,
+  size_t aLength)
+{
+  MOZ_ASSERT(aElements);
+  MOZ_ASSERT(aLength);
+  MOZ_ASSERT(aList);
+
+  aList->SetCapacity(aLength);
+  for (size_t i = 0; i < aLength; ++i) {
+    aList->AppendElement(const_cast<Element*>(aElements[i]));
+  }
+}
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -61,16 +61,17 @@ namespace mozilla {
 using mozilla::FontFamilyList;
 using mozilla::FontFamilyName;
 using mozilla::FontFamilyType;
 using mozilla::ServoElementSnapshot;
 using mozilla::SharedFontList;
 class nsCSSCounterStyleRule;
 class nsCSSFontFaceRule;
 struct nsMediaFeature;
+class nsSimpleContentList;
 struct nsStyleList;
 struct nsStyleImage;
 struct nsStyleGradientStop;
 class nsStyleGradient;
 class nsStyleCoord;
 struct nsStyleDisplay;
 class nsXBLBinding;
 
@@ -706,11 +707,16 @@ void Gecko_ReportUnexpectedCSSError(mozi
                                     const char* prefixParam,
                                     uint32_t prefixParamLen,
                                     const char* suffix,
                                     const char* source,
                                     uint32_t sourceLen,
                                     uint32_t lineNumber,
                                     uint32_t colNumber);
 
+// DOM APIs.
+void Gecko_ContentList_AppendAll(nsSimpleContentList* aContentList,
+                                 const RawGeckoElement** aElements,
+                                 size_t aLength);
+
 } // extern "C"
 
 #endif // mozilla_ServoBindings_h
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -227,16 +227,17 @@ whitelist-types = [
     "nsMargin",
     "nsMediaExpression",
     "nsMediaFeature",
     "nsMediaFeatures",
     "nsMediaList",
     "nsRect",
     "nsRestyleHint",
     "nsresult",
+    "nsSimpleContentList",
     "nsSize",
     "nsStyleBackground",
     "nsStyleBorder",
     "nsStyleColor",
     "nsStyleColumn",
     "nsStyleContent",
     "nsStyleContentData",
     "nsStyleContext",
@@ -394,16 +395,17 @@ structs-types = [
     "mozilla::AtomArray",
     "mozilla::MallocSizeOf",
     "mozilla::OriginFlags",
     "mozilla::UniquePtr",
     "ServoRawOffsetArc",
     "nsIContent",
     "nsIDocument",
     "nsIDocument_DocumentTheme",
+    "nsSimpleContentList",
     "RawGeckoAnimationPropertySegment",
     "RawGeckoComputedTiming",
     "RawGeckoCSSPropertyIDList",
     "RawGeckoDocument",
     "RawGeckoElement",
     "RawGeckoKeyframeList",
     "RawGeckoPropertyValuePairList",
     "RawGeckoComputedKeyframeValuesList",