LCOV - code coverage report
Current view: top level - obj-x86_64-pc-linux-gnu/dom/bindings - HTMLTableElementBinding.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 518 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 46 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* THIS FILE IS AUTOGENERATED FROM HTMLTableElement.webidl BY Codegen.py - DO NOT EDIT */
       2             : 
       3             : #include "HTMLElementBinding.h"
       4             : #include "HTMLTableElementBinding.h"
       5             : #include "WrapperFactory.h"
       6             : #include "mozilla/OwningNonNull.h"
       7             : #include "mozilla/dom/BindingUtils.h"
       8             : #include "mozilla/dom/CustomElementRegistry.h"
       9             : #include "mozilla/dom/DOMJSClass.h"
      10             : #include "mozilla/dom/HTMLTableCaptionElement.h"
      11             : #include "mozilla/dom/HTMLTableElement.h"
      12             : #include "mozilla/dom/HTMLTableSectionElement.h"
      13             : #include "mozilla/dom/NonRefcountedDOMObject.h"
      14             : #include "mozilla/dom/Nullable.h"
      15             : #include "mozilla/dom/PrimitiveConversions.h"
      16             : #include "mozilla/dom/XrayExpandoClass.h"
      17             : #include "nsContentList.h"
      18             : #include "nsGenericHTMLElement.h"
      19             : 
      20             : namespace mozilla {
      21             : namespace dom {
      22             : 
      23             : namespace HTMLTableElementBinding {
      24             : 
      25             : static_assert(IsRefcounted<NativeType>::value == IsRefcounted<HTMLElementBinding::NativeType>::value,
      26             :               "Can't inherit from an interface with a different ownership model.");
      27             : 
      28             : static bool
      29           0 : get_caption(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
      30             : {
      31           0 :   auto result(StrongOrRawPtr<mozilla::dom::HTMLTableCaptionElement>(self->GetCaption()));
      32           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
      33           0 :   if (!result) {
      34           0 :     args.rval().setNull();
      35           0 :     return true;
      36             :   }
      37           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
      38           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
      39           0 :     return false;
      40             :   }
      41           0 :   return true;
      42             : }
      43             : 
      44             : static bool
      45           0 : set_caption(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitSetterCallArgs args)
      46             : {
      47             :   mozilla::dom::HTMLTableCaptionElement* arg0;
      48           0 :   if (args[0].isObject()) {
      49             :     {
      50           0 :       nsresult rv = UnwrapObject<prototypes::id::HTMLTableCaptionElement, mozilla::dom::HTMLTableCaptionElement>(args[0], arg0);
      51           0 :       if (NS_FAILED(rv)) {
      52           0 :         ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Value being assigned to HTMLTableElement.caption", "HTMLTableCaptionElement");
      53           0 :         return false;
      54             :       }
      55             :     }
      56           0 :   } else if (args[0].isNullOrUndefined()) {
      57           0 :     arg0 = nullptr;
      58             :   } else {
      59           0 :     ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Value being assigned to HTMLTableElement.caption");
      60           0 :     return false;
      61             :   }
      62           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
      63           0 :   Maybe<AutoCEReaction> ceReaction;
      64           0 :   if (reactionsStack) {
      65           0 :     ceReaction.emplace(reactionsStack);
      66             :   }
      67           0 :   binding_detail::FastErrorResult rv;
      68           0 :   self->SetCaption(Constify(arg0), rv);
      69           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
      70           0 :     return false;
      71             :   }
      72           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
      73             : 
      74           0 :   return true;
      75             : }
      76             : 
      77             : static const JSJitInfo caption_getterinfo = {
      78             :   { (JSJitGetterOp)get_caption },
      79             :   { prototypes::id::HTMLTableElement },
      80             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
      81             :   JSJitInfo::Getter,
      82             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
      83             :   JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
      84             :   false,  /* isInfallible. False in setters. */
      85             :   false,  /* isMovable.  Not relevant for setters. */
      86             :   false, /* isEliminatable.  Not relevant for setters. */
      87             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
      88             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
      89             :   false,  /* isTypedMethod.  Only relevant for methods. */
      90             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
      91             : };
      92             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
      93             : static_assert(0 < 1, "There is no slot for us");
      94             : static const JSJitInfo caption_setterinfo = {
      95             :   { (JSJitGetterOp)set_caption },
      96             :   { prototypes::id::HTMLTableElement },
      97             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
      98             :   JSJitInfo::Setter,
      99             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     100             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     101             :   false,  /* isInfallible. False in setters. */
     102             :   false,  /* isMovable.  Not relevant for setters. */
     103             :   false, /* isEliminatable.  Not relevant for setters. */
     104             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     105             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     106             :   false,  /* isTypedMethod.  Only relevant for methods. */
     107             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     108             : };
     109             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     110             : static_assert(0 < 1, "There is no slot for us");
     111             : 
     112             : static bool
     113           0 : createCaption(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, const JSJitMethodCallArgs& args)
     114             : {
     115           0 :   auto result(StrongOrRawPtr<nsGenericHTMLElement>(self->CreateCaption()));
     116           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     117           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
     118           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
     119           0 :     return false;
     120             :   }
     121           0 :   return true;
     122             : }
     123             : 
     124             : static const JSJitInfo createCaption_methodinfo = {
     125             :   { (JSJitGetterOp)createCaption },
     126             :   { prototypes::id::HTMLTableElement },
     127             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     128             :   JSJitInfo::Method,
     129             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     130             :   JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
     131             :   false,  /* isInfallible. False in setters. */
     132             :   false,  /* isMovable.  Not relevant for setters. */
     133             :   false, /* isEliminatable.  Not relevant for setters. */
     134             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     135             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     136             :   false,  /* isTypedMethod.  Only relevant for methods. */
     137             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     138             : };
     139             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     140             : static_assert(0 < 1, "There is no slot for us");
     141             : 
     142             : static bool
     143           0 : deleteCaption(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, const JSJitMethodCallArgs& args)
     144             : {
     145           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
     146           0 :   Maybe<AutoCEReaction> ceReaction;
     147           0 :   if (reactionsStack) {
     148           0 :     ceReaction.emplace(reactionsStack);
     149             :   }
     150           0 :   self->DeleteCaption();
     151           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     152           0 :   args.rval().setUndefined();
     153           0 :   return true;
     154             : }
     155             : 
     156             : static const JSJitInfo deleteCaption_methodinfo = {
     157             :   { (JSJitGetterOp)deleteCaption },
     158             :   { prototypes::id::HTMLTableElement },
     159             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     160             :   JSJitInfo::Method,
     161             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     162             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     163             :   true,  /* isInfallible. False in setters. */
     164             :   false,  /* isMovable.  Not relevant for setters. */
     165             :   false, /* isEliminatable.  Not relevant for setters. */
     166             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     167             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     168             :   false,  /* isTypedMethod.  Only relevant for methods. */
     169             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     170             : };
     171             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     172             : static_assert(0 < 1, "There is no slot for us");
     173             : 
     174             : static bool
     175           0 : get_tHead(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
     176             : {
     177           0 :   auto result(StrongOrRawPtr<mozilla::dom::HTMLTableSectionElement>(self->GetTHead()));
     178           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     179           0 :   if (!result) {
     180           0 :     args.rval().setNull();
     181           0 :     return true;
     182             :   }
     183           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
     184           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
     185           0 :     return false;
     186             :   }
     187           0 :   return true;
     188             : }
     189             : 
     190             : static bool
     191           0 : set_tHead(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitSetterCallArgs args)
     192             : {
     193             :   mozilla::dom::HTMLTableSectionElement* arg0;
     194           0 :   if (args[0].isObject()) {
     195             :     {
     196           0 :       nsresult rv = UnwrapObject<prototypes::id::HTMLTableSectionElement, mozilla::dom::HTMLTableSectionElement>(args[0], arg0);
     197           0 :       if (NS_FAILED(rv)) {
     198           0 :         ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Value being assigned to HTMLTableElement.tHead", "HTMLTableSectionElement");
     199           0 :         return false;
     200             :       }
     201             :     }
     202           0 :   } else if (args[0].isNullOrUndefined()) {
     203           0 :     arg0 = nullptr;
     204             :   } else {
     205           0 :     ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Value being assigned to HTMLTableElement.tHead");
     206           0 :     return false;
     207             :   }
     208           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
     209           0 :   Maybe<AutoCEReaction> ceReaction;
     210           0 :   if (reactionsStack) {
     211           0 :     ceReaction.emplace(reactionsStack);
     212             :   }
     213           0 :   binding_detail::FastErrorResult rv;
     214           0 :   self->SetTHead(Constify(arg0), rv);
     215           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     216           0 :     return false;
     217             :   }
     218           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     219             : 
     220           0 :   return true;
     221             : }
     222             : 
     223             : static const JSJitInfo tHead_getterinfo = {
     224             :   { (JSJitGetterOp)get_tHead },
     225             :   { prototypes::id::HTMLTableElement },
     226             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     227             :   JSJitInfo::Getter,
     228             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     229             :   JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
     230             :   false,  /* isInfallible. False in setters. */
     231             :   false,  /* isMovable.  Not relevant for setters. */
     232             :   false, /* isEliminatable.  Not relevant for setters. */
     233             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     234             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     235             :   false,  /* isTypedMethod.  Only relevant for methods. */
     236             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     237             : };
     238             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     239             : static_assert(0 < 1, "There is no slot for us");
     240             : static const JSJitInfo tHead_setterinfo = {
     241             :   { (JSJitGetterOp)set_tHead },
     242             :   { prototypes::id::HTMLTableElement },
     243             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     244             :   JSJitInfo::Setter,
     245             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     246             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     247             :   false,  /* isInfallible. False in setters. */
     248             :   false,  /* isMovable.  Not relevant for setters. */
     249             :   false, /* isEliminatable.  Not relevant for setters. */
     250             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     251             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     252             :   false,  /* isTypedMethod.  Only relevant for methods. */
     253             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     254             : };
     255             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     256             : static_assert(0 < 1, "There is no slot for us");
     257             : 
     258             : static bool
     259           0 : createTHead(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, const JSJitMethodCallArgs& args)
     260             : {
     261           0 :   auto result(StrongOrRawPtr<nsGenericHTMLElement>(self->CreateTHead()));
     262           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     263           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
     264           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
     265           0 :     return false;
     266             :   }
     267           0 :   return true;
     268             : }
     269             : 
     270             : static const JSJitInfo createTHead_methodinfo = {
     271             :   { (JSJitGetterOp)createTHead },
     272             :   { prototypes::id::HTMLTableElement },
     273             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     274             :   JSJitInfo::Method,
     275             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     276             :   JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
     277             :   false,  /* isInfallible. False in setters. */
     278             :   false,  /* isMovable.  Not relevant for setters. */
     279             :   false, /* isEliminatable.  Not relevant for setters. */
     280             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     281             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     282             :   false,  /* isTypedMethod.  Only relevant for methods. */
     283             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     284             : };
     285             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     286             : static_assert(0 < 1, "There is no slot for us");
     287             : 
     288             : static bool
     289           0 : deleteTHead(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, const JSJitMethodCallArgs& args)
     290             : {
     291           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
     292           0 :   Maybe<AutoCEReaction> ceReaction;
     293           0 :   if (reactionsStack) {
     294           0 :     ceReaction.emplace(reactionsStack);
     295             :   }
     296           0 :   self->DeleteTHead();
     297           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     298           0 :   args.rval().setUndefined();
     299           0 :   return true;
     300             : }
     301             : 
     302             : static const JSJitInfo deleteTHead_methodinfo = {
     303             :   { (JSJitGetterOp)deleteTHead },
     304             :   { prototypes::id::HTMLTableElement },
     305             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     306             :   JSJitInfo::Method,
     307             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     308             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     309             :   true,  /* isInfallible. False in setters. */
     310             :   false,  /* isMovable.  Not relevant for setters. */
     311             :   false, /* isEliminatable.  Not relevant for setters. */
     312             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     313             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     314             :   false,  /* isTypedMethod.  Only relevant for methods. */
     315             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     316             : };
     317             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     318             : static_assert(0 < 1, "There is no slot for us");
     319             : 
     320             : static bool
     321           0 : get_tFoot(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
     322             : {
     323           0 :   auto result(StrongOrRawPtr<mozilla::dom::HTMLTableSectionElement>(self->GetTFoot()));
     324           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     325           0 :   if (!result) {
     326           0 :     args.rval().setNull();
     327           0 :     return true;
     328             :   }
     329           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
     330           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
     331           0 :     return false;
     332             :   }
     333           0 :   return true;
     334             : }
     335             : 
     336             : static bool
     337           0 : set_tFoot(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitSetterCallArgs args)
     338             : {
     339             :   mozilla::dom::HTMLTableSectionElement* arg0;
     340           0 :   if (args[0].isObject()) {
     341             :     {
     342           0 :       nsresult rv = UnwrapObject<prototypes::id::HTMLTableSectionElement, mozilla::dom::HTMLTableSectionElement>(args[0], arg0);
     343           0 :       if (NS_FAILED(rv)) {
     344           0 :         ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Value being assigned to HTMLTableElement.tFoot", "HTMLTableSectionElement");
     345           0 :         return false;
     346             :       }
     347             :     }
     348           0 :   } else if (args[0].isNullOrUndefined()) {
     349           0 :     arg0 = nullptr;
     350             :   } else {
     351           0 :     ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Value being assigned to HTMLTableElement.tFoot");
     352           0 :     return false;
     353             :   }
     354           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
     355           0 :   Maybe<AutoCEReaction> ceReaction;
     356           0 :   if (reactionsStack) {
     357           0 :     ceReaction.emplace(reactionsStack);
     358             :   }
     359           0 :   binding_detail::FastErrorResult rv;
     360           0 :   self->SetTFoot(Constify(arg0), rv);
     361           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     362           0 :     return false;
     363             :   }
     364           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     365             : 
     366           0 :   return true;
     367             : }
     368             : 
     369             : static const JSJitInfo tFoot_getterinfo = {
     370             :   { (JSJitGetterOp)get_tFoot },
     371             :   { prototypes::id::HTMLTableElement },
     372             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     373             :   JSJitInfo::Getter,
     374             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     375             :   JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
     376             :   false,  /* isInfallible. False in setters. */
     377             :   false,  /* isMovable.  Not relevant for setters. */
     378             :   false, /* isEliminatable.  Not relevant for setters. */
     379             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     380             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     381             :   false,  /* isTypedMethod.  Only relevant for methods. */
     382             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     383             : };
     384             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     385             : static_assert(0 < 1, "There is no slot for us");
     386             : static const JSJitInfo tFoot_setterinfo = {
     387             :   { (JSJitGetterOp)set_tFoot },
     388             :   { prototypes::id::HTMLTableElement },
     389             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     390             :   JSJitInfo::Setter,
     391             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     392             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     393             :   false,  /* isInfallible. False in setters. */
     394             :   false,  /* isMovable.  Not relevant for setters. */
     395             :   false, /* isEliminatable.  Not relevant for setters. */
     396             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     397             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     398             :   false,  /* isTypedMethod.  Only relevant for methods. */
     399             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     400             : };
     401             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     402             : static_assert(0 < 1, "There is no slot for us");
     403             : 
     404             : static bool
     405           0 : createTFoot(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, const JSJitMethodCallArgs& args)
     406             : {
     407           0 :   auto result(StrongOrRawPtr<nsGenericHTMLElement>(self->CreateTFoot()));
     408           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     409           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
     410           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
     411           0 :     return false;
     412             :   }
     413           0 :   return true;
     414             : }
     415             : 
     416             : static const JSJitInfo createTFoot_methodinfo = {
     417             :   { (JSJitGetterOp)createTFoot },
     418             :   { prototypes::id::HTMLTableElement },
     419             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     420             :   JSJitInfo::Method,
     421             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     422             :   JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
     423             :   false,  /* isInfallible. False in setters. */
     424             :   false,  /* isMovable.  Not relevant for setters. */
     425             :   false, /* isEliminatable.  Not relevant for setters. */
     426             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     427             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     428             :   false,  /* isTypedMethod.  Only relevant for methods. */
     429             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     430             : };
     431             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     432             : static_assert(0 < 1, "There is no slot for us");
     433             : 
     434             : static bool
     435           0 : deleteTFoot(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, const JSJitMethodCallArgs& args)
     436             : {
     437           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
     438           0 :   Maybe<AutoCEReaction> ceReaction;
     439           0 :   if (reactionsStack) {
     440           0 :     ceReaction.emplace(reactionsStack);
     441             :   }
     442           0 :   self->DeleteTFoot();
     443           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     444           0 :   args.rval().setUndefined();
     445           0 :   return true;
     446             : }
     447             : 
     448             : static const JSJitInfo deleteTFoot_methodinfo = {
     449             :   { (JSJitGetterOp)deleteTFoot },
     450             :   { prototypes::id::HTMLTableElement },
     451             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     452             :   JSJitInfo::Method,
     453             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     454             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     455             :   true,  /* isInfallible. False in setters. */
     456             :   false,  /* isMovable.  Not relevant for setters. */
     457             :   false, /* isEliminatable.  Not relevant for setters. */
     458             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     459             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     460             :   false,  /* isTypedMethod.  Only relevant for methods. */
     461             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     462             : };
     463             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     464             : static_assert(0 < 1, "There is no slot for us");
     465             : 
     466             : static bool
     467           0 : get_tBodies(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
     468             : {
     469           0 :   auto result(StrongOrRawPtr<nsIHTMLCollection>(self->TBodies()));
     470           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     471           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
     472           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
     473           0 :     return false;
     474             :   }
     475           0 :   return true;
     476             : }
     477             : 
     478             : static const JSJitInfo tBodies_getterinfo = {
     479             :   { (JSJitGetterOp)get_tBodies },
     480             :   { prototypes::id::HTMLTableElement },
     481             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     482             :   JSJitInfo::Getter,
     483             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     484             :   JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
     485             :   false,  /* isInfallible. False in setters. */
     486             :   false,  /* isMovable.  Not relevant for setters. */
     487             :   false, /* isEliminatable.  Not relevant for setters. */
     488             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     489             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     490             :   false,  /* isTypedMethod.  Only relevant for methods. */
     491             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     492             : };
     493             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     494             : static_assert(0 < 1, "There is no slot for us");
     495             : 
     496             : static bool
     497           0 : createTBody(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, const JSJitMethodCallArgs& args)
     498             : {
     499           0 :   auto result(StrongOrRawPtr<nsGenericHTMLElement>(self->CreateTBody()));
     500           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     501           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
     502           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
     503           0 :     return false;
     504             :   }
     505           0 :   return true;
     506             : }
     507             : 
     508             : static const JSJitInfo createTBody_methodinfo = {
     509             :   { (JSJitGetterOp)createTBody },
     510             :   { prototypes::id::HTMLTableElement },
     511             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     512             :   JSJitInfo::Method,
     513             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     514             :   JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
     515             :   false,  /* isInfallible. False in setters. */
     516             :   false,  /* isMovable.  Not relevant for setters. */
     517             :   false, /* isEliminatable.  Not relevant for setters. */
     518             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     519             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     520             :   false,  /* isTypedMethod.  Only relevant for methods. */
     521             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     522             : };
     523             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     524             : static_assert(0 < 1, "There is no slot for us");
     525             : 
     526             : static bool
     527           0 : get_rows(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
     528             : {
     529           0 :   auto result(StrongOrRawPtr<nsIHTMLCollection>(self->Rows()));
     530           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     531           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
     532           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
     533           0 :     return false;
     534             :   }
     535           0 :   return true;
     536             : }
     537             : 
     538             : static const JSJitInfo rows_getterinfo = {
     539             :   { (JSJitGetterOp)get_rows },
     540             :   { prototypes::id::HTMLTableElement },
     541             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     542             :   JSJitInfo::Getter,
     543             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     544             :   JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
     545             :   false,  /* isInfallible. False in setters. */
     546             :   false,  /* isMovable.  Not relevant for setters. */
     547             :   false, /* isEliminatable.  Not relevant for setters. */
     548             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     549             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     550             :   false,  /* isTypedMethod.  Only relevant for methods. */
     551             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     552             : };
     553             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     554             : static_assert(0 < 1, "There is no slot for us");
     555             : 
     556             : static bool
     557           0 : insertRow(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, const JSJitMethodCallArgs& args)
     558             : {
     559             :   int32_t arg0;
     560           0 :   if (args.hasDefined(0)) {
     561           0 :     if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
     562           0 :       return false;
     563             :     }
     564             :   } else {
     565           0 :     arg0 = -1;
     566             :   }
     567           0 :   binding_detail::FastErrorResult rv;
     568           0 :   auto result(StrongOrRawPtr<nsGenericHTMLElement>(self->InsertRow(arg0, rv)));
     569           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     570           0 :     return false;
     571             :   }
     572           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     573           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
     574           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
     575           0 :     return false;
     576             :   }
     577           0 :   return true;
     578             : }
     579             : 
     580             : static const JSJitInfo insertRow_methodinfo = {
     581             :   { (JSJitGetterOp)insertRow },
     582             :   { prototypes::id::HTMLTableElement },
     583             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     584             :   JSJitInfo::Method,
     585             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     586             :   JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
     587             :   false,  /* isInfallible. False in setters. */
     588             :   false,  /* isMovable.  Not relevant for setters. */
     589             :   false, /* isEliminatable.  Not relevant for setters. */
     590             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     591             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     592             :   false,  /* isTypedMethod.  Only relevant for methods. */
     593             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     594             : };
     595             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     596             : static_assert(0 < 1, "There is no slot for us");
     597             : 
     598             : static bool
     599           0 : deleteRow(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, const JSJitMethodCallArgs& args)
     600             : {
     601           0 :   if (MOZ_UNLIKELY(args.length() < 1)) {
     602           0 :     return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLTableElement.deleteRow");
     603             :   }
     604             :   int32_t arg0;
     605           0 :   if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
     606           0 :     return false;
     607             :   }
     608           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
     609           0 :   Maybe<AutoCEReaction> ceReaction;
     610           0 :   if (reactionsStack) {
     611           0 :     ceReaction.emplace(reactionsStack);
     612             :   }
     613           0 :   binding_detail::FastErrorResult rv;
     614           0 :   self->DeleteRow(arg0, rv);
     615           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     616           0 :     return false;
     617             :   }
     618           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     619           0 :   args.rval().setUndefined();
     620           0 :   return true;
     621             : }
     622             : 
     623             : static const JSJitInfo deleteRow_methodinfo = {
     624             :   { (JSJitGetterOp)deleteRow },
     625             :   { prototypes::id::HTMLTableElement },
     626             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     627             :   JSJitInfo::Method,
     628             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     629             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     630             :   false,  /* isInfallible. False in setters. */
     631             :   false,  /* isMovable.  Not relevant for setters. */
     632             :   false, /* isEliminatable.  Not relevant for setters. */
     633             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     634             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     635             :   false,  /* isTypedMethod.  Only relevant for methods. */
     636             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     637             : };
     638             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     639             : static_assert(0 < 1, "There is no slot for us");
     640             : 
     641             : static bool
     642           0 : get_align(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
     643             : {
     644           0 :   DOMString result;
     645           0 :   self->GetAlign(result);
     646           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     647           0 :   if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
     648           0 :     return false;
     649             :   }
     650           0 :   return true;
     651             : }
     652             : 
     653             : static bool
     654           0 : set_align(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitSetterCallArgs args)
     655             : {
     656           0 :   binding_detail::FakeString arg0;
     657           0 :   if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
     658           0 :     return false;
     659             :   }
     660           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
     661           0 :   Maybe<AutoCEReaction> ceReaction;
     662           0 :   if (reactionsStack) {
     663           0 :     ceReaction.emplace(reactionsStack);
     664             :   }
     665           0 :   binding_detail::FastErrorResult rv;
     666           0 :   self->SetAlign(NonNullHelper(Constify(arg0)), rv);
     667           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     668           0 :     return false;
     669             :   }
     670           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     671             : 
     672           0 :   return true;
     673             : }
     674             : 
     675             : static const JSJitInfo align_getterinfo = {
     676             :   { (JSJitGetterOp)get_align },
     677             :   { prototypes::id::HTMLTableElement },
     678             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     679             :   JSJitInfo::Getter,
     680             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     681             :   JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
     682             :   false,  /* isInfallible. False in setters. */
     683             :   false,  /* isMovable.  Not relevant for setters. */
     684             :   false, /* isEliminatable.  Not relevant for setters. */
     685             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     686             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     687             :   false,  /* isTypedMethod.  Only relevant for methods. */
     688             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     689             : };
     690             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     691             : static_assert(0 < 1, "There is no slot for us");
     692             : static const JSJitInfo align_setterinfo = {
     693             :   { (JSJitGetterOp)set_align },
     694             :   { prototypes::id::HTMLTableElement },
     695             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     696             :   JSJitInfo::Setter,
     697             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     698             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     699             :   false,  /* isInfallible. False in setters. */
     700             :   false,  /* isMovable.  Not relevant for setters. */
     701             :   false, /* isEliminatable.  Not relevant for setters. */
     702             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     703             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     704             :   false,  /* isTypedMethod.  Only relevant for methods. */
     705             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     706             : };
     707             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     708             : static_assert(0 < 1, "There is no slot for us");
     709             : 
     710             : static bool
     711           0 : get_border(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
     712             : {
     713           0 :   DOMString result;
     714           0 :   self->GetBorder(result);
     715           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     716           0 :   if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
     717           0 :     return false;
     718             :   }
     719           0 :   return true;
     720             : }
     721             : 
     722             : static bool
     723           0 : set_border(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitSetterCallArgs args)
     724             : {
     725           0 :   binding_detail::FakeString arg0;
     726           0 :   if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
     727           0 :     return false;
     728             :   }
     729           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
     730           0 :   Maybe<AutoCEReaction> ceReaction;
     731           0 :   if (reactionsStack) {
     732           0 :     ceReaction.emplace(reactionsStack);
     733             :   }
     734           0 :   binding_detail::FastErrorResult rv;
     735           0 :   self->SetBorder(NonNullHelper(Constify(arg0)), rv);
     736           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     737           0 :     return false;
     738             :   }
     739           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     740             : 
     741           0 :   return true;
     742             : }
     743             : 
     744             : static const JSJitInfo border_getterinfo = {
     745             :   { (JSJitGetterOp)get_border },
     746             :   { prototypes::id::HTMLTableElement },
     747             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     748             :   JSJitInfo::Getter,
     749             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     750             :   JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
     751             :   false,  /* isInfallible. False in setters. */
     752             :   false,  /* isMovable.  Not relevant for setters. */
     753             :   false, /* isEliminatable.  Not relevant for setters. */
     754             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     755             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     756             :   false,  /* isTypedMethod.  Only relevant for methods. */
     757             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     758             : };
     759             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     760             : static_assert(0 < 1, "There is no slot for us");
     761             : static const JSJitInfo border_setterinfo = {
     762             :   { (JSJitGetterOp)set_border },
     763             :   { prototypes::id::HTMLTableElement },
     764             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     765             :   JSJitInfo::Setter,
     766             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     767             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     768             :   false,  /* isInfallible. False in setters. */
     769             :   false,  /* isMovable.  Not relevant for setters. */
     770             :   false, /* isEliminatable.  Not relevant for setters. */
     771             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     772             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     773             :   false,  /* isTypedMethod.  Only relevant for methods. */
     774             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     775             : };
     776             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     777             : static_assert(0 < 1, "There is no slot for us");
     778             : 
     779             : static bool
     780           0 : get_frame(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
     781             : {
     782           0 :   DOMString result;
     783           0 :   self->GetFrame(result);
     784           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     785           0 :   if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
     786           0 :     return false;
     787             :   }
     788           0 :   return true;
     789             : }
     790             : 
     791             : static bool
     792           0 : set_frame(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitSetterCallArgs args)
     793             : {
     794           0 :   binding_detail::FakeString arg0;
     795           0 :   if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
     796           0 :     return false;
     797             :   }
     798           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
     799           0 :   Maybe<AutoCEReaction> ceReaction;
     800           0 :   if (reactionsStack) {
     801           0 :     ceReaction.emplace(reactionsStack);
     802             :   }
     803           0 :   binding_detail::FastErrorResult rv;
     804           0 :   self->SetFrame(NonNullHelper(Constify(arg0)), rv);
     805           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     806           0 :     return false;
     807             :   }
     808           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     809             : 
     810           0 :   return true;
     811             : }
     812             : 
     813             : static const JSJitInfo frame_getterinfo = {
     814             :   { (JSJitGetterOp)get_frame },
     815             :   { prototypes::id::HTMLTableElement },
     816             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     817             :   JSJitInfo::Getter,
     818             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     819             :   JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
     820             :   false,  /* isInfallible. False in setters. */
     821             :   false,  /* isMovable.  Not relevant for setters. */
     822             :   false, /* isEliminatable.  Not relevant for setters. */
     823             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     824             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     825             :   false,  /* isTypedMethod.  Only relevant for methods. */
     826             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     827             : };
     828             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     829             : static_assert(0 < 1, "There is no slot for us");
     830             : static const JSJitInfo frame_setterinfo = {
     831             :   { (JSJitGetterOp)set_frame },
     832             :   { prototypes::id::HTMLTableElement },
     833             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     834             :   JSJitInfo::Setter,
     835             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     836             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     837             :   false,  /* isInfallible. False in setters. */
     838             :   false,  /* isMovable.  Not relevant for setters. */
     839             :   false, /* isEliminatable.  Not relevant for setters. */
     840             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     841             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     842             :   false,  /* isTypedMethod.  Only relevant for methods. */
     843             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     844             : };
     845             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     846             : static_assert(0 < 1, "There is no slot for us");
     847             : 
     848             : static bool
     849           0 : get_rules(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
     850             : {
     851           0 :   DOMString result;
     852           0 :   self->GetRules(result);
     853           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     854           0 :   if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
     855           0 :     return false;
     856             :   }
     857           0 :   return true;
     858             : }
     859             : 
     860             : static bool
     861           0 : set_rules(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitSetterCallArgs args)
     862             : {
     863           0 :   binding_detail::FakeString arg0;
     864           0 :   if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
     865           0 :     return false;
     866             :   }
     867           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
     868           0 :   Maybe<AutoCEReaction> ceReaction;
     869           0 :   if (reactionsStack) {
     870           0 :     ceReaction.emplace(reactionsStack);
     871             :   }
     872           0 :   binding_detail::FastErrorResult rv;
     873           0 :   self->SetRules(NonNullHelper(Constify(arg0)), rv);
     874           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     875           0 :     return false;
     876             :   }
     877           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     878             : 
     879           0 :   return true;
     880             : }
     881             : 
     882             : static const JSJitInfo rules_getterinfo = {
     883             :   { (JSJitGetterOp)get_rules },
     884             :   { prototypes::id::HTMLTableElement },
     885             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     886             :   JSJitInfo::Getter,
     887             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     888             :   JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
     889             :   false,  /* isInfallible. False in setters. */
     890             :   false,  /* isMovable.  Not relevant for setters. */
     891             :   false, /* isEliminatable.  Not relevant for setters. */
     892             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     893             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     894             :   false,  /* isTypedMethod.  Only relevant for methods. */
     895             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     896             : };
     897             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     898             : static_assert(0 < 1, "There is no slot for us");
     899             : static const JSJitInfo rules_setterinfo = {
     900             :   { (JSJitGetterOp)set_rules },
     901             :   { prototypes::id::HTMLTableElement },
     902             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     903             :   JSJitInfo::Setter,
     904             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     905             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     906             :   false,  /* isInfallible. False in setters. */
     907             :   false,  /* isMovable.  Not relevant for setters. */
     908             :   false, /* isEliminatable.  Not relevant for setters. */
     909             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     910             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     911             :   false,  /* isTypedMethod.  Only relevant for methods. */
     912             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     913             : };
     914             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     915             : static_assert(0 < 1, "There is no slot for us");
     916             : 
     917             : static bool
     918           0 : get_summary(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
     919             : {
     920           0 :   DOMString result;
     921           0 :   self->GetSummary(result);
     922           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     923           0 :   if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
     924           0 :     return false;
     925             :   }
     926           0 :   return true;
     927             : }
     928             : 
     929             : static bool
     930           0 : set_summary(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitSetterCallArgs args)
     931             : {
     932           0 :   binding_detail::FakeString arg0;
     933           0 :   if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
     934           0 :     return false;
     935             :   }
     936           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
     937           0 :   Maybe<AutoCEReaction> ceReaction;
     938           0 :   if (reactionsStack) {
     939           0 :     ceReaction.emplace(reactionsStack);
     940             :   }
     941           0 :   binding_detail::FastErrorResult rv;
     942           0 :   self->SetSummary(NonNullHelper(Constify(arg0)), rv);
     943           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     944           0 :     return false;
     945             :   }
     946           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     947             : 
     948           0 :   return true;
     949             : }
     950             : 
     951             : static const JSJitInfo summary_getterinfo = {
     952             :   { (JSJitGetterOp)get_summary },
     953             :   { prototypes::id::HTMLTableElement },
     954             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     955             :   JSJitInfo::Getter,
     956             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     957             :   JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
     958             :   false,  /* isInfallible. False in setters. */
     959             :   false,  /* isMovable.  Not relevant for setters. */
     960             :   false, /* isEliminatable.  Not relevant for setters. */
     961             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     962             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     963             :   false,  /* isTypedMethod.  Only relevant for methods. */
     964             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     965             : };
     966             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     967             : static_assert(0 < 1, "There is no slot for us");
     968             : static const JSJitInfo summary_setterinfo = {
     969             :   { (JSJitGetterOp)set_summary },
     970             :   { prototypes::id::HTMLTableElement },
     971             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
     972             :   JSJitInfo::Setter,
     973             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     974             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     975             :   false,  /* isInfallible. False in setters. */
     976             :   false,  /* isMovable.  Not relevant for setters. */
     977             :   false, /* isEliminatable.  Not relevant for setters. */
     978             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     979             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     980             :   false,  /* isTypedMethod.  Only relevant for methods. */
     981             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     982             : };
     983             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     984             : static_assert(0 < 1, "There is no slot for us");
     985             : 
     986             : static bool
     987           0 : get_width(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
     988             : {
     989           0 :   DOMString result;
     990           0 :   self->GetWidth(result);
     991           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     992           0 :   if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
     993           0 :     return false;
     994             :   }
     995           0 :   return true;
     996             : }
     997             : 
     998             : static bool
     999           0 : set_width(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitSetterCallArgs args)
    1000             : {
    1001           0 :   binding_detail::FakeString arg0;
    1002           0 :   if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
    1003           0 :     return false;
    1004             :   }
    1005           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
    1006           0 :   Maybe<AutoCEReaction> ceReaction;
    1007           0 :   if (reactionsStack) {
    1008           0 :     ceReaction.emplace(reactionsStack);
    1009             :   }
    1010           0 :   binding_detail::FastErrorResult rv;
    1011           0 :   self->SetWidth(NonNullHelper(Constify(arg0)), rv);
    1012           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
    1013           0 :     return false;
    1014             :   }
    1015           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
    1016             : 
    1017           0 :   return true;
    1018             : }
    1019             : 
    1020             : static const JSJitInfo width_getterinfo = {
    1021             :   { (JSJitGetterOp)get_width },
    1022             :   { prototypes::id::HTMLTableElement },
    1023             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
    1024             :   JSJitInfo::Getter,
    1025             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
    1026             :   JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
    1027             :   false,  /* isInfallible. False in setters. */
    1028             :   false,  /* isMovable.  Not relevant for setters. */
    1029             :   false, /* isEliminatable.  Not relevant for setters. */
    1030             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
    1031             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
    1032             :   false,  /* isTypedMethod.  Only relevant for methods. */
    1033             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
    1034             : };
    1035             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
    1036             : static_assert(0 < 1, "There is no slot for us");
    1037             : static const JSJitInfo width_setterinfo = {
    1038             :   { (JSJitGetterOp)set_width },
    1039             :   { prototypes::id::HTMLTableElement },
    1040             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
    1041             :   JSJitInfo::Setter,
    1042             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
    1043             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
    1044             :   false,  /* isInfallible. False in setters. */
    1045             :   false,  /* isMovable.  Not relevant for setters. */
    1046             :   false, /* isEliminatable.  Not relevant for setters. */
    1047             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
    1048             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
    1049             :   false,  /* isTypedMethod.  Only relevant for methods. */
    1050             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
    1051             : };
    1052             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
    1053             : static_assert(0 < 1, "There is no slot for us");
    1054             : 
    1055             : static bool
    1056           0 : get_bgColor(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
    1057             : {
    1058           0 :   DOMString result;
    1059           0 :   self->GetBgColor(result);
    1060           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
    1061           0 :   if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
    1062           0 :     return false;
    1063             :   }
    1064           0 :   return true;
    1065             : }
    1066             : 
    1067             : static bool
    1068           0 : set_bgColor(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitSetterCallArgs args)
    1069             : {
    1070           0 :   binding_detail::FakeString arg0;
    1071           0 :   if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
    1072           0 :     return false;
    1073             :   }
    1074           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
    1075           0 :   Maybe<AutoCEReaction> ceReaction;
    1076           0 :   if (reactionsStack) {
    1077           0 :     ceReaction.emplace(reactionsStack);
    1078             :   }
    1079           0 :   binding_detail::FastErrorResult rv;
    1080           0 :   self->SetBgColor(NonNullHelper(Constify(arg0)), rv);
    1081           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
    1082           0 :     return false;
    1083             :   }
    1084           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
    1085             : 
    1086           0 :   return true;
    1087             : }
    1088             : 
    1089             : static const JSJitInfo bgColor_getterinfo = {
    1090             :   { (JSJitGetterOp)get_bgColor },
    1091             :   { prototypes::id::HTMLTableElement },
    1092             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
    1093             :   JSJitInfo::Getter,
    1094             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
    1095             :   JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
    1096             :   false,  /* isInfallible. False in setters. */
    1097             :   false,  /* isMovable.  Not relevant for setters. */
    1098             :   false, /* isEliminatable.  Not relevant for setters. */
    1099             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
    1100             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
    1101             :   false,  /* isTypedMethod.  Only relevant for methods. */
    1102             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
    1103             : };
    1104             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
    1105             : static_assert(0 < 1, "There is no slot for us");
    1106             : static const JSJitInfo bgColor_setterinfo = {
    1107             :   { (JSJitGetterOp)set_bgColor },
    1108             :   { prototypes::id::HTMLTableElement },
    1109             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
    1110             :   JSJitInfo::Setter,
    1111             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
    1112             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
    1113             :   false,  /* isInfallible. False in setters. */
    1114             :   false,  /* isMovable.  Not relevant for setters. */
    1115             :   false, /* isEliminatable.  Not relevant for setters. */
    1116             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
    1117             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
    1118             :   false,  /* isTypedMethod.  Only relevant for methods. */
    1119             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
    1120             : };
    1121             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
    1122             : static_assert(0 < 1, "There is no slot for us");
    1123             : 
    1124             : static bool
    1125           0 : get_cellPadding(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
    1126             : {
    1127           0 :   DOMString result;
    1128           0 :   self->GetCellPadding(result);
    1129           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
    1130           0 :   if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
    1131           0 :     return false;
    1132             :   }
    1133           0 :   return true;
    1134             : }
    1135             : 
    1136             : static bool
    1137           0 : set_cellPadding(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitSetterCallArgs args)
    1138             : {
    1139           0 :   binding_detail::FakeString arg0;
    1140           0 :   if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
    1141           0 :     return false;
    1142             :   }
    1143           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
    1144           0 :   Maybe<AutoCEReaction> ceReaction;
    1145           0 :   if (reactionsStack) {
    1146           0 :     ceReaction.emplace(reactionsStack);
    1147             :   }
    1148           0 :   binding_detail::FastErrorResult rv;
    1149           0 :   self->SetCellPadding(NonNullHelper(Constify(arg0)), rv);
    1150           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
    1151           0 :     return false;
    1152             :   }
    1153           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
    1154             : 
    1155           0 :   return true;
    1156             : }
    1157             : 
    1158             : static const JSJitInfo cellPadding_getterinfo = {
    1159             :   { (JSJitGetterOp)get_cellPadding },
    1160             :   { prototypes::id::HTMLTableElement },
    1161             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
    1162             :   JSJitInfo::Getter,
    1163             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
    1164             :   JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
    1165             :   false,  /* isInfallible. False in setters. */
    1166             :   false,  /* isMovable.  Not relevant for setters. */
    1167             :   false, /* isEliminatable.  Not relevant for setters. */
    1168             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
    1169             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
    1170             :   false,  /* isTypedMethod.  Only relevant for methods. */
    1171             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
    1172             : };
    1173             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
    1174             : static_assert(0 < 1, "There is no slot for us");
    1175             : static const JSJitInfo cellPadding_setterinfo = {
    1176             :   { (JSJitGetterOp)set_cellPadding },
    1177             :   { prototypes::id::HTMLTableElement },
    1178             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
    1179             :   JSJitInfo::Setter,
    1180             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
    1181             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
    1182             :   false,  /* isInfallible. False in setters. */
    1183             :   false,  /* isMovable.  Not relevant for setters. */
    1184             :   false, /* isEliminatable.  Not relevant for setters. */
    1185             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
    1186             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
    1187             :   false,  /* isTypedMethod.  Only relevant for methods. */
    1188             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
    1189             : };
    1190             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
    1191             : static_assert(0 < 1, "There is no slot for us");
    1192             : 
    1193             : static bool
    1194           0 : get_cellSpacing(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitGetterCallArgs args)
    1195             : {
    1196           0 :   DOMString result;
    1197           0 :   self->GetCellSpacing(result);
    1198           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
    1199           0 :   if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
    1200           0 :     return false;
    1201             :   }
    1202           0 :   return true;
    1203             : }
    1204             : 
    1205             : static bool
    1206           0 : set_cellSpacing(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableElement* self, JSJitSetterCallArgs args)
    1207             : {
    1208           0 :   binding_detail::FakeString arg0;
    1209           0 :   if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
    1210           0 :     return false;
    1211             :   }
    1212           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
    1213           0 :   Maybe<AutoCEReaction> ceReaction;
    1214           0 :   if (reactionsStack) {
    1215           0 :     ceReaction.emplace(reactionsStack);
    1216             :   }
    1217           0 :   binding_detail::FastErrorResult rv;
    1218           0 :   self->SetCellSpacing(NonNullHelper(Constify(arg0)), rv);
    1219           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
    1220           0 :     return false;
    1221             :   }
    1222           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
    1223             : 
    1224           0 :   return true;
    1225             : }
    1226             : 
    1227             : static const JSJitInfo cellSpacing_getterinfo = {
    1228             :   { (JSJitGetterOp)get_cellSpacing },
    1229             :   { prototypes::id::HTMLTableElement },
    1230             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
    1231             :   JSJitInfo::Getter,
    1232             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
    1233             :   JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
    1234             :   false,  /* isInfallible. False in setters. */
    1235             :   false,  /* isMovable.  Not relevant for setters. */
    1236             :   false, /* isEliminatable.  Not relevant for setters. */
    1237             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
    1238             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
    1239             :   false,  /* isTypedMethod.  Only relevant for methods. */
    1240             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
    1241             : };
    1242             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
    1243             : static_assert(0 < 1, "There is no slot for us");
    1244             : static const JSJitInfo cellSpacing_setterinfo = {
    1245             :   { (JSJitGetterOp)set_cellSpacing },
    1246             :   { prototypes::id::HTMLTableElement },
    1247             :   { PrototypeTraits<prototypes::id::HTMLTableElement>::Depth },
    1248             :   JSJitInfo::Setter,
    1249             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
    1250             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
    1251             :   false,  /* isInfallible. False in setters. */
    1252             :   false,  /* isMovable.  Not relevant for setters. */
    1253             :   false, /* isEliminatable.  Not relevant for setters. */
    1254             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
    1255             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
    1256             :   false,  /* isTypedMethod.  Only relevant for methods. */
    1257             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
    1258             : };
    1259             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
    1260             : static_assert(0 < 1, "There is no slot for us");
    1261             : 
    1262             : static bool
    1263           0 : _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
    1264             : {
    1265           0 :   mozilla::dom::HTMLTableElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLTableElement>(obj);
    1266             :   // We don't want to preserve if we don't have a wrapper, and we
    1267             :   // obviously can't preserve if we're not initialized.
    1268           0 :   if (self && self->GetWrapperPreserveColor()) {
    1269           0 :     PreserveWrapper(self);
    1270             :   }
    1271           0 :   return true;
    1272             : }
    1273             : 
    1274             : static void
    1275           0 : _finalize(js::FreeOp* fop, JSObject* obj)
    1276             : {
    1277           0 :   mozilla::dom::HTMLTableElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLTableElement>(obj);
    1278           0 :   if (self) {
    1279           0 :     ClearWrapper(self, self, obj);
    1280           0 :     AddForDeferredFinalization<mozilla::dom::HTMLTableElement>(self);
    1281             :   }
    1282           0 : }
    1283             : 
    1284             : static void
    1285           0 : _objectMoved(JSObject* obj, const JSObject* old)
    1286             : {
    1287           0 :   mozilla::dom::HTMLTableElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLTableElement>(obj);
    1288           0 :   if (self) {
    1289           0 :     UpdateWrapper(self, self, obj, old);
    1290             :   }
    1291           0 : }
    1292             : 
    1293             : // We deliberately use brace-elision to make Visual Studio produce better initalization code.
    1294             : #if defined(__clang__)
    1295             : #pragma clang diagnostic push
    1296             : #pragma clang diagnostic ignored "-Wmissing-braces"
    1297             : #endif
    1298             : static const JSFunctionSpec sMethods_specs[] = {
    1299             :   JS_FNSPEC("createCaption", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&createCaption_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
    1300             :   JS_FNSPEC("deleteCaption", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&deleteCaption_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
    1301             :   JS_FNSPEC("createTHead", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&createTHead_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
    1302             :   JS_FNSPEC("deleteTHead", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&deleteTHead_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
    1303             :   JS_FNSPEC("createTFoot", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&createTFoot_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
    1304             :   JS_FNSPEC("deleteTFoot", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&deleteTFoot_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
    1305             :   JS_FNSPEC("createTBody", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&createTBody_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
    1306             :   JS_FNSPEC("insertRow", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&insertRow_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
    1307             :   JS_FNSPEC("deleteRow", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&deleteRow_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
    1308             :   JS_FS_END
    1309             : };
    1310             : #if defined(__clang__)
    1311             : #pragma clang diagnostic pop
    1312             : #endif
    1313             : 
    1314             : 
    1315             : // Can't be const because the pref-enabled boolean needs to be writable
    1316             : static Prefable<const JSFunctionSpec> sMethods[] = {
    1317             :   { nullptr, &sMethods_specs[0] },
    1318             :   { nullptr, nullptr }
    1319             : };
    1320             : 
    1321             : static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
    1322             :     "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
    1323             : static_assert(9 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
    1324             :     "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
    1325             : 
    1326             : // We deliberately use brace-elision to make Visual Studio produce better initalization code.
    1327             : #if defined(__clang__)
    1328             : #pragma clang diagnostic push
    1329             : #pragma clang diagnostic ignored "-Wmissing-braces"
    1330             : #endif
    1331             : static const JSPropertySpec sAttributes_specs[] = {
    1332             :   { "caption", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &caption_getterinfo, GenericBindingSetter, &caption_setterinfo },
    1333             :   { "tHead", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &tHead_getterinfo, GenericBindingSetter, &tHead_setterinfo },
    1334             :   { "tFoot", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &tFoot_getterinfo, GenericBindingSetter, &tFoot_setterinfo },
    1335             :   { "tBodies", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &tBodies_getterinfo, nullptr, nullptr },
    1336             :   { "rows", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &rows_getterinfo, nullptr, nullptr },
    1337             :   { "align", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &align_getterinfo, GenericBindingSetter, &align_setterinfo },
    1338             :   { "border", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &border_getterinfo, GenericBindingSetter, &border_setterinfo },
    1339             :   { "frame", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &frame_getterinfo, GenericBindingSetter, &frame_setterinfo },
    1340             :   { "rules", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &rules_getterinfo, GenericBindingSetter, &rules_setterinfo },
    1341             :   { "summary", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &summary_getterinfo, GenericBindingSetter, &summary_setterinfo },
    1342             :   { "width", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &width_getterinfo, GenericBindingSetter, &width_setterinfo },
    1343             :   { "bgColor", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &bgColor_getterinfo, GenericBindingSetter, &bgColor_setterinfo },
    1344             :   { "cellPadding", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &cellPadding_getterinfo, GenericBindingSetter, &cellPadding_setterinfo },
    1345             :   { "cellSpacing", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &cellSpacing_getterinfo, GenericBindingSetter, &cellSpacing_setterinfo },
    1346             :   { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
    1347             : };
    1348             : #if defined(__clang__)
    1349             : #pragma clang diagnostic pop
    1350             : #endif
    1351             : 
    1352             : 
    1353             : // Can't be const because the pref-enabled boolean needs to be writable
    1354             : static Prefable<const JSPropertySpec> sAttributes[] = {
    1355             :   { nullptr, &sAttributes_specs[0] },
    1356             :   { nullptr, nullptr }
    1357             : };
    1358             : 
    1359             : static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
    1360             :     "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
    1361             : static_assert(14 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
    1362             :     "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
    1363             : 
    1364             : 
    1365             : static uint16_t sNativeProperties_sortedPropertyIndices[23];
    1366             : static PropertyInfo sNativeProperties_propertyInfos[23];
    1367             : 
    1368             : static const NativePropertiesN<2> sNativeProperties = {
    1369             :   false, 0,
    1370             :   false, 0,
    1371             :   true,  0 /* sMethods */,
    1372             :   true,  1 /* sAttributes */,
    1373             :   false, 0,
    1374             :   false, 0,
    1375             :   false, 0,
    1376             :   -1,
    1377             :   23,
    1378             :   sNativeProperties_sortedPropertyIndices,
    1379             :   {
    1380             :     { sMethods, &sNativeProperties_propertyInfos[0] },
    1381             :     { sAttributes, &sNativeProperties_propertyInfos[9] }
    1382             :   }
    1383             : };
    1384             : static_assert(23 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
    1385             :     "We have a property info count that is oversized");
    1386             : 
    1387             : static bool
    1388           0 : _constructor(JSContext* cx, unsigned argc, JS::Value* vp)
    1389             : {
    1390           0 :   JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    1391           0 :   JS::Rooted<JSObject*> obj(cx, &args.callee());
    1392           0 :   if (!args.isConstructing()) {
    1393             :     // XXXbz wish I could get the name from the callee instead of
    1394             :     // Adding more relocations
    1395           0 :     return ThrowConstructorWithoutNew(cx, "HTMLTableElement");
    1396             :   }
    1397             : 
    1398           0 :   GlobalObject global(cx, obj);
    1399           0 :   if (global.Failed()) {
    1400           0 :     return false;
    1401             :   }
    1402             : 
    1403             :   // The newTarget might be a cross-compartment wrapper. Get the underlying object
    1404             :   // so we can do the spec's object-identity checks.
    1405           0 :   JS::Rooted<JSObject*> newTarget(cx, js::CheckedUnwrap(&args.newTarget().toObject()));
    1406           0 :   if (!newTarget) {
    1407           0 :     return ThrowErrorMessage(cx, MSG_ILLEGAL_CONSTRUCTOR);
    1408             :   }
    1409             : 
    1410             :   // Step 2 of https://html.spec.whatwg.org/multipage/dom.html#htmlconstructor.
    1411             :   // Enter the compartment of our underlying newTarget object, so we end
    1412             :   // up comparing to the constructor object for our interface from that global.
    1413             :   {
    1414           0 :     JSAutoCompartment ac(cx, newTarget);
    1415           0 :     JS::Handle<JSObject*> constructor(GetConstructorObjectHandle(cx));
    1416           0 :     if (!constructor) {
    1417           0 :       return false;
    1418             :     }
    1419           0 :     if (newTarget == constructor) {
    1420           0 :       return ThrowErrorMessage(cx, MSG_ILLEGAL_CONSTRUCTOR);
    1421             :     }
    1422             :   }
    1423             : 
    1424           0 :   JS::Rooted<JSObject*> desiredProto(cx);
    1425           0 :   if (!GetDesiredProto(cx, args, &desiredProto)) {
    1426           0 :     return false;
    1427             :   }
    1428           0 :   if (!desiredProto) {
    1429             :     // Step 7 of https://html.spec.whatwg.org/multipage/dom.html#htmlconstructor.
    1430             :     // This fallback behavior is designed to match analogous behavior for the
    1431             :     // JavaScript built-ins. So we enter the compartment of our underlying
    1432             :     // newTarget object and fall back to the prototype object from that global.
    1433             :     // XXX The spec says to use GetFunctionRealm(), which is not actually
    1434             :     // the same thing as what we have here (e.g. in the case of scripted callable proxies
    1435             :     // whose target is not same-compartment with the proxy, or bound functions, etc).
    1436             :     // https://bugzilla.mozilla.org/show_bug.cgi?id=1317658
    1437             :     {
    1438           0 :       JSAutoCompartment ac(cx, newTarget);
    1439           0 :       desiredProto = GetProtoObjectHandle(cx);
    1440           0 :       if (!desiredProto) {
    1441           0 :           return false;
    1442             :       }
    1443             :     }
    1444             : 
    1445             :     // desiredProto is in the compartment of the underlying newTarget object.
    1446             :     // Wrap it into the context compartment.
    1447           0 :     if (!JS_WrapObject(cx, &desiredProto)) {
    1448           0 :       return false;
    1449             :     }
    1450             :   }
    1451             : 
    1452           0 :   bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
    1453           0 :   Maybe<JSAutoCompartment> ac;
    1454           0 :   if (objIsXray) {
    1455           0 :     obj = js::CheckedUnwrap(obj);
    1456           0 :     if (!obj) {
    1457           0 :       return false;
    1458             :     }
    1459           0 :     ac.emplace(cx, obj);
    1460           0 :     if (!JS_WrapObject(cx, &desiredProto)) {
    1461           0 :       return false;
    1462             :     }
    1463             :   }
    1464           0 :   binding_detail::FastErrorResult rv;
    1465           0 :   auto result(StrongOrRawPtr<mozilla::dom::HTMLTableElement>(CreateHTMLElement(global, args, rv)));
    1466           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
    1467           0 :     return false;
    1468             :   }
    1469           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
    1470             :   static_assert(!IsPointer<decltype(result)>::value,
    1471             :                 "NewObject implies that we need to keep the object alive with a strong reference.");
    1472           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
    1473           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
    1474           0 :     return false;
    1475             :   }
    1476           0 :   return true;
    1477             : }
    1478             : 
    1479             : static const js::ClassOps sInterfaceObjectClassOps = {
    1480             :     nullptr,               /* addProperty */
    1481             :     nullptr,               /* delProperty */
    1482             :     nullptr,               /* getProperty */
    1483             :     nullptr,               /* setProperty */
    1484             :     nullptr,               /* enumerate */
    1485             :     nullptr,               /* newEnumerate */
    1486             :     nullptr,               /* resolve */
    1487             :     nullptr,               /* mayResolve */
    1488             :     nullptr,               /* finalize */
    1489             :     _constructor, /* call */
    1490             :     nullptr,               /* hasInstance */
    1491             :     _constructor, /* construct */
    1492             :     nullptr,               /* trace */
    1493             : };
    1494             : 
    1495             : static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
    1496             :   {
    1497             :     "Function",
    1498             :     JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
    1499             :     &sInterfaceObjectClassOps,
    1500             :     JS_NULL_CLASS_SPEC,
    1501             :     JS_NULL_CLASS_EXT,
    1502             :     &sInterfaceObjectClassObjectOps
    1503             :   },
    1504             :   eInterface,
    1505             :   true,
    1506             :   prototypes::id::HTMLTableElement,
    1507             :   PrototypeTraits<prototypes::id::HTMLTableElement>::Depth,
    1508             :   sNativePropertyHooks,
    1509             :   "function HTMLTableElement() {\n    [native code]\n}",
    1510             :   HTMLElementBinding::GetConstructorObject
    1511             : };
    1512             : 
    1513             : static const DOMIfaceAndProtoJSClass sPrototypeClass = {
    1514             :   {
    1515             :     "HTMLTableElementPrototype",
    1516             :     JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
    1517             :     JS_NULL_CLASS_OPS,
    1518             :     JS_NULL_CLASS_SPEC,
    1519             :     JS_NULL_CLASS_EXT,
    1520             :     JS_NULL_OBJECT_OPS
    1521             :   },
    1522             :   eInterfacePrototype,
    1523             :   false,
    1524             :   prototypes::id::HTMLTableElement,
    1525             :   PrototypeTraits<prototypes::id::HTMLTableElement>::Depth,
    1526             :   sNativePropertyHooks,
    1527             :   "[object HTMLTableElementPrototype]",
    1528             :   HTMLElementBinding::GetProtoObject
    1529             : };
    1530             : 
    1531             : JSObject*
    1532           0 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal)
    1533             : {
    1534           0 :   return GetConstructorObjectHandle(aCx, aDefineOnGlobal);
    1535             : }
    1536             : 
    1537             : static const js::ClassOps sClassOps = {
    1538             :   _addProperty, /* addProperty */
    1539             :   nullptr,               /* delProperty */
    1540             :   nullptr,               /* getProperty */
    1541             :   nullptr,               /* setProperty */
    1542             :   nullptr,               /* enumerate */
    1543             :   nullptr, /* newEnumerate */
    1544             :   nullptr, /* resolve */
    1545             :   nullptr, /* mayResolve */
    1546             :   _finalize, /* finalize */
    1547             :   nullptr, /* call */
    1548             :   nullptr,               /* hasInstance */
    1549             :   nullptr,               /* construct */
    1550             :   nullptr, /* trace */
    1551             : };
    1552             : 
    1553             : static const js::ClassExtension sClassExtension = {
    1554             :   nullptr, /* weakmapKeyDelegateOp */
    1555             :   _objectMoved /* objectMovedOp */
    1556             : };
    1557             : 
    1558             : static const DOMJSClass sClass = {
    1559             :   { "HTMLTableElement",
    1560             :     JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
    1561             :     &sClassOps,
    1562             :     JS_NULL_CLASS_SPEC,
    1563             :     &sClassExtension,
    1564             :     JS_NULL_OBJECT_OPS
    1565             :   },
    1566             :   { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::HTMLElement, prototypes::id::HTMLTableElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
    1567             :   IsBaseOf<nsISupports, mozilla::dom::HTMLTableElement >::value,
    1568             :   sNativePropertyHooks,
    1569             :   FindAssociatedGlobalForNative<mozilla::dom::HTMLTableElement>::Get,
    1570             :   GetProtoObjectHandle,
    1571             :   GetCCParticipant<mozilla::dom::HTMLTableElement>::Get()
    1572             : };
    1573             : static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
    1574             :               "Must have the right minimal number of reserved slots.");
    1575             : static_assert(1 >= 1,
    1576             :               "Must have enough reserved slots.");
    1577             : 
    1578             : const JSClass*
    1579           0 : GetJSClass()
    1580             : {
    1581           0 :   return sClass.ToJSClass();
    1582             : }
    1583             : 
    1584             : bool
    1585           0 : Wrap(JSContext* aCx, mozilla::dom::HTMLTableElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
    1586             : {
    1587             :   MOZ_ASSERT(static_cast<mozilla::dom::HTMLTableElement*>(aObject) ==
    1588             :              reinterpret_cast<mozilla::dom::HTMLTableElement*>(aObject),
    1589             :              "Multiple inheritance for mozilla::dom::HTMLTableElement is broken.");
    1590             :   MOZ_ASSERT(static_cast<nsGenericHTMLElement*>(aObject) ==
    1591             :              reinterpret_cast<nsGenericHTMLElement*>(aObject),
    1592             :              "Multiple inheritance for nsGenericHTMLElement is broken.");
    1593             :   MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) ==
    1594             :              reinterpret_cast<mozilla::dom::Element*>(aObject),
    1595             :              "Multiple inheritance for mozilla::dom::Element is broken.");
    1596             :   MOZ_ASSERT(static_cast<nsINode*>(aObject) ==
    1597             :              reinterpret_cast<nsINode*>(aObject),
    1598             :              "Multiple inheritance for nsINode is broken.");
    1599             :   MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) ==
    1600             :              reinterpret_cast<mozilla::dom::EventTarget*>(aObject),
    1601             :              "Multiple inheritance for mozilla::dom::EventTarget is broken.");
    1602           0 :   MOZ_ASSERT(ToSupportsIsCorrect(aObject));
    1603           0 :   MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
    1604           0 :   MOZ_ASSERT(!aCache->GetWrapper(),
    1605             :              "You should probably not be using Wrap() directly; use "
    1606             :              "GetOrCreateDOMReflector instead");
    1607             : 
    1608           0 :   MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
    1609             :              "nsISupports must be on our primary inheritance chain");
    1610             : 
    1611           0 :   JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
    1612           0 :   if (!global) {
    1613           0 :     return false;
    1614             :   }
    1615           0 :   MOZ_ASSERT(JS_IsGlobalObject(global));
    1616           0 :   MOZ_ASSERT(JS::ObjectIsNotGray(global));
    1617             : 
    1618             :   // That might have ended up wrapping us already, due to the wonders
    1619             :   // of XBL.  Check for that, and bail out as needed.
    1620           0 :   aReflector.set(aCache->GetWrapper());
    1621           0 :   if (aReflector) {
    1622             : #ifdef DEBUG
    1623           0 :     binding_detail::AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
    1624             : #endif // DEBUG
    1625           0 :     return true;
    1626             :   }
    1627             : 
    1628           0 :   JSAutoCompartment ac(aCx, global);
    1629           0 :   JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
    1630           0 :   if (!canonicalProto) {
    1631           0 :     return false;
    1632             :   }
    1633           0 :   JS::Rooted<JSObject*> proto(aCx);
    1634           0 :   if (aGivenProto) {
    1635           0 :     proto = aGivenProto;
    1636             :     // Unfortunately, while aGivenProto was in the compartment of aCx
    1637             :     // coming in, we changed compartments to that of "parent" so may need
    1638             :     // to wrap the proto here.
    1639           0 :     if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
    1640           0 :       if (!JS_WrapObject(aCx, &proto)) {
    1641           0 :         return false;
    1642             :       }
    1643             :     }
    1644             :   } else {
    1645           0 :     proto = canonicalProto;
    1646             :   }
    1647             : 
    1648           0 :   BindingJSObjectCreator<mozilla::dom::HTMLTableElement> creator(aCx);
    1649           0 :   creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
    1650           0 :   if (!aReflector) {
    1651           0 :     return false;
    1652             :   }
    1653             : 
    1654           0 :   aCache->SetWrapper(aReflector);
    1655           0 :   creator.InitializationSucceeded();
    1656             : 
    1657           0 :   MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
    1658             :              aCache->GetWrapperPreserveColor() == aReflector);
    1659             :   // If proto != canonicalProto, we have to preserve our wrapper;
    1660             :   // otherwise we won't be able to properly recreate it later, since
    1661             :   // we won't know what proto to use.  Note that we don't check
    1662             :   // aGivenProto here, since it's entirely possible (and even
    1663             :   // somewhat common) to have a non-null aGivenProto which is the
    1664             :   // same as canonicalProto.
    1665           0 :   if (proto != canonicalProto) {
    1666           0 :     PreserveWrapper(aObject);
    1667             :   }
    1668             : 
    1669           0 :   return true;
    1670             : }
    1671             : 
    1672             : const NativePropertyHooks sNativePropertyHooks[] = { {
    1673             :   nullptr,
    1674             :   nullptr,
    1675             :   nullptr,
    1676             :   { sNativeProperties.Upcast(), nullptr },
    1677             :   prototypes::id::HTMLTableElement,
    1678             :   constructors::id::HTMLTableElement,
    1679             :   HTMLElementBinding::sNativePropertyHooks,
    1680             :   &DefaultXrayExpandoObjectClass
    1681             : } };
    1682             : 
    1683             : void
    1684           0 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
    1685             : {
    1686           0 :   JS::Handle<JSObject*> parentProto(HTMLElementBinding::GetProtoObjectHandle(aCx));
    1687           0 :   if (!parentProto) {
    1688           0 :     return;
    1689             :   }
    1690             : 
    1691           0 :   JS::Handle<JSObject*> constructorProto(HTMLElementBinding::GetConstructorObjectHandle(aCx));
    1692           0 :   if (!constructorProto) {
    1693           0 :     return;
    1694             :   }
    1695             : 
    1696             :   static bool sIdsInited = false;
    1697           0 :   if (!sIdsInited && NS_IsMainThread()) {
    1698           0 :     if (!InitIds(aCx, sNativeProperties.Upcast())) {
    1699           0 :       return;
    1700             :     }
    1701           0 :     sIdsInited = true;
    1702             :   }
    1703             : 
    1704           0 :   JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::HTMLTableElement);
    1705           0 :   JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::HTMLTableElement);
    1706           0 :   dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
    1707             :                               &sPrototypeClass.mBase, protoCache,
    1708             :                               constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
    1709             :                               interfaceCache,
    1710             :                               sNativeProperties.Upcast(),
    1711             :                               nullptr,
    1712             :                               "HTMLTableElement", aDefineOnGlobal,
    1713             :                               nullptr,
    1714           0 :                               false);
    1715             : }
    1716             : 
    1717             : JS::Handle<JSObject*>
    1718           0 : GetProtoObjectHandle(JSContext* aCx)
    1719             : {
    1720             :   /* Get the interface prototype object for this class.  This will create the
    1721             :      object as needed. */
    1722           0 :   bool aDefineOnGlobal = true;
    1723             : 
    1724             :   /* Make sure our global is sane.  Hopefully we can remove this sometime */
    1725           0 :   JSObject* global = JS::CurrentGlobalOrNull(aCx);
    1726           0 :   if (!(js::GetObjectClass(global)->flags & JSCLASS_DOM_GLOBAL)) {
    1727           0 :     return nullptr;
    1728             :   }
    1729             : 
    1730             :   /* Check to see whether the interface objects are already installed */
    1731           0 :   ProtoAndIfaceCache& protoAndIfaceCache = *GetProtoAndIfaceCache(global);
    1732           0 :   if (!protoAndIfaceCache.HasEntryInSlot(prototypes::id::HTMLTableElement)) {
    1733           0 :     JS::Rooted<JSObject*> rootedGlobal(aCx, global);
    1734           0 :     CreateInterfaceObjects(aCx, rootedGlobal, protoAndIfaceCache, aDefineOnGlobal);
    1735             :   }
    1736             : 
    1737             :   /*
    1738             :    * The object might _still_ be null, but that's OK.
    1739             :    *
    1740             :    * Calling fromMarkedLocation() is safe because protoAndIfaceCache is
    1741             :    * traced by TraceProtoAndIfaceCache() and its contents are never
    1742             :    * changed after they have been set.
    1743             :    *
    1744             :    * Calling address() avoids the read read barrier that does gray
    1745             :    * unmarking, but it's not possible for the object to be gray here.
    1746             :    */
    1747             : 
    1748           0 :   const JS::Heap<JSObject*>& entrySlot = protoAndIfaceCache.EntrySlotMustExist(prototypes::id::HTMLTableElement);
    1749           0 :   MOZ_ASSERT(JS::ObjectIsNotGray(entrySlot));
    1750           0 :   return JS::Handle<JSObject*>::fromMarkedLocation(entrySlot.address());
    1751             : }
    1752             : 
    1753             : JS::Handle<JSObject*>
    1754           0 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal)
    1755             : {
    1756             :   /* Get the interface object for this class.  This will create the object as
    1757             :      needed. */
    1758             : 
    1759             :   /* Make sure our global is sane.  Hopefully we can remove this sometime */
    1760           0 :   JSObject* global = JS::CurrentGlobalOrNull(aCx);
    1761           0 :   if (!(js::GetObjectClass(global)->flags & JSCLASS_DOM_GLOBAL)) {
    1762           0 :     return nullptr;
    1763             :   }
    1764             : 
    1765             :   /* Check to see whether the interface objects are already installed */
    1766           0 :   ProtoAndIfaceCache& protoAndIfaceCache = *GetProtoAndIfaceCache(global);
    1767           0 :   if (!protoAndIfaceCache.HasEntryInSlot(constructors::id::HTMLTableElement)) {
    1768           0 :     JS::Rooted<JSObject*> rootedGlobal(aCx, global);
    1769           0 :     CreateInterfaceObjects(aCx, rootedGlobal, protoAndIfaceCache, aDefineOnGlobal);
    1770             :   }
    1771             : 
    1772             :   /*
    1773             :    * The object might _still_ be null, but that's OK.
    1774             :    *
    1775             :    * Calling fromMarkedLocation() is safe because protoAndIfaceCache is
    1776             :    * traced by TraceProtoAndIfaceCache() and its contents are never
    1777             :    * changed after they have been set.
    1778             :    *
    1779             :    * Calling address() avoids the read read barrier that does gray
    1780             :    * unmarking, but it's not possible for the object to be gray here.
    1781             :    */
    1782             : 
    1783           0 :   const JS::Heap<JSObject*>& entrySlot = protoAndIfaceCache.EntrySlotMustExist(constructors::id::HTMLTableElement);
    1784           0 :   MOZ_ASSERT(JS::ObjectIsNotGray(entrySlot));
    1785           0 :   return JS::Handle<JSObject*>::fromMarkedLocation(entrySlot.address());
    1786             : }
    1787             : 
    1788             : JSObject*
    1789           0 : GetConstructorObject(JSContext* aCx)
    1790             : {
    1791           0 :   return GetConstructorObjectHandle(aCx);
    1792             : }
    1793             : 
    1794             : } // namespace HTMLTableElementBinding
    1795             : 
    1796             : 
    1797             : 
    1798             : } // namespace dom
    1799             : } // namespace mozilla

Generated by: LCOV version 1.13