/* THIS FILE IS AUTOGENERATED FROM HTMLTableElement.webidl BY Codegen.py - DO NOT EDIT */ #include #include "ElementBinding.h" #include "HTMLElementBinding.h" #include "HTMLTableElementBinding.h" #include "MainThreadUtils.h" #include "WrapperFactory.h" #include "XrayWrapper.h" #include "js/CallAndConstruct.h" #include "js/Exception.h" #include "js/MapAndSet.h" #include "js/Object.h" #include "js/PropertyAndElement.h" #include "js/PropertyDescriptor.h" #include "js/experimental/JitInfo.h" #include "mozilla/Atomics.h" #include "mozilla/OwningNonNull.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/dom/BindingCallContext.h" #include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/ContentList.h" #include "mozilla/dom/CustomElementRegistry.h" #include "mozilla/dom/DOMJSClass.h" #include "mozilla/dom/DocGroup.h" #include "mozilla/dom/HTMLTableCaptionElement.h" #include "mozilla/dom/HTMLTableElement.h" #include "mozilla/dom/HTMLTableSectionElement.h" #include "mozilla/dom/NonRefcountedDOMObject.h" #include "mozilla/dom/Nullable.h" #include "mozilla/dom/PrimitiveConversions.h" #include "mozilla/dom/XrayExpandoClass.h" #include "nsGenericHTMLElement.h" namespace mozilla::dom { namespace binding_detail {}; // Just to make sure it's known as a namespace using namespace mozilla::dom::binding_detail; namespace HTMLTableElement_Binding { static_assert(IsRefcounted::value == IsRefcounted::value, "Can't inherit from an interface with a different ownership model."); MOZ_CAN_RUN_SCRIPT static bool get_caption(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "caption", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); auto result(StrongOrRawPtr(MOZ_KnownLive(self)->GetCaption())); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!result) { args.rval().setNull(); return true; } if (!GetOrCreateDOMReflector(cx, result, args.rval())) { MOZ_ASSERT(JS_IsExceptionPending(cx)); return false; } return true; } MOZ_CAN_RUN_SCRIPT static bool set_caption(JSContext* cx_, JS::Handle obj, void* void_self, JSJitSetterCallArgs args) { BindingCallContext cx(cx_, "HTMLTableElement.caption setter"); AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "caption", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); mozilla::dom::HTMLTableCaptionElement* arg0; if (args[0].isObject()) { { // Our JSContext should be in the right global to do unwrapping in. nsresult rv = UnwrapObject(args[0], arg0, cx); if (NS_FAILED(rv)) { cx.ThrowErrorMessage("Value being assigned", "HTMLTableCaptionElement"); return false; } } } else if (args[0].isNullOrUndefined()) { arg0 = nullptr; } else { cx.ThrowErrorMessage("Value being assigned"); return false; } Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } FastErrorResult rv; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vSetCaption(MOZ_KnownLive(Constify(arg0)), rv))>, "Should be returning void here"); MOZ_KnownLive(self)->SetCaption(MOZ_KnownLive(Constify(arg0)), rv); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.caption setter")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); return true; } static const JSJitInfo caption_getterinfo = { { get_caption }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; static const JSJitInfo caption_setterinfo = { { (JSJitGetterOp)set_caption }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Setter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool createCaption(JSContext* cx, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "createCaption", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); auto result(StrongOrRawPtr(MOZ_KnownLive(self)->CreateCaption())); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!GetOrCreateDOMReflector(cx, result, args.rval())) { MOZ_ASSERT(JS_IsExceptionPending(cx)); return false; } return true; } static const JSJitInfo createCaption_methodinfo = { { (JSJitGetterOp)createCaption }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Method, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool deleteCaption(JSContext* cx, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "deleteCaption", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } // NOTE: This assert does NOT call the function. static_assert(std::is_void_vDeleteCaption())>, "Should be returning void here"); MOZ_KnownLive(self)->DeleteCaption(); MOZ_ASSERT(!JS_IsExceptionPending(cx)); args.rval().setUndefined(); return true; } static const JSJitInfo deleteCaption_methodinfo = { { (JSJitGetterOp)deleteCaption }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Method, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ true, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool get_tHead(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "tHead", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); auto result(StrongOrRawPtr(MOZ_KnownLive(self)->GetTHead())); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!result) { args.rval().setNull(); return true; } if (!GetOrCreateDOMReflector(cx, result, args.rval())) { MOZ_ASSERT(JS_IsExceptionPending(cx)); return false; } return true; } MOZ_CAN_RUN_SCRIPT static bool set_tHead(JSContext* cx_, JS::Handle obj, void* void_self, JSJitSetterCallArgs args) { BindingCallContext cx(cx_, "HTMLTableElement.tHead setter"); AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "tHead", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); mozilla::dom::HTMLTableSectionElement* arg0; if (args[0].isObject()) { { // Our JSContext should be in the right global to do unwrapping in. nsresult rv = UnwrapObject(args[0], arg0, cx); if (NS_FAILED(rv)) { cx.ThrowErrorMessage("Value being assigned", "HTMLTableSectionElement"); return false; } } } else if (args[0].isNullOrUndefined()) { arg0 = nullptr; } else { cx.ThrowErrorMessage("Value being assigned"); return false; } Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } FastErrorResult rv; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vSetTHead(MOZ_KnownLive(Constify(arg0)), rv))>, "Should be returning void here"); MOZ_KnownLive(self)->SetTHead(MOZ_KnownLive(Constify(arg0)), rv); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.tHead setter")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); return true; } static const JSJitInfo tHead_getterinfo = { { get_tHead }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; static const JSJitInfo tHead_setterinfo = { { (JSJitGetterOp)set_tHead }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Setter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool createTHead(JSContext* cx, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "createTHead", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); auto result(StrongOrRawPtr(MOZ_KnownLive(self)->CreateTHead())); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!GetOrCreateDOMReflector(cx, result, args.rval())) { MOZ_ASSERT(JS_IsExceptionPending(cx)); return false; } return true; } static const JSJitInfo createTHead_methodinfo = { { (JSJitGetterOp)createTHead }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Method, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool deleteTHead(JSContext* cx, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "deleteTHead", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } // NOTE: This assert does NOT call the function. static_assert(std::is_void_vDeleteTHead())>, "Should be returning void here"); MOZ_KnownLive(self)->DeleteTHead(); MOZ_ASSERT(!JS_IsExceptionPending(cx)); args.rval().setUndefined(); return true; } static const JSJitInfo deleteTHead_methodinfo = { { (JSJitGetterOp)deleteTHead }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Method, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ true, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool get_tFoot(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "tFoot", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); auto result(StrongOrRawPtr(MOZ_KnownLive(self)->GetTFoot())); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!result) { args.rval().setNull(); return true; } if (!GetOrCreateDOMReflector(cx, result, args.rval())) { MOZ_ASSERT(JS_IsExceptionPending(cx)); return false; } return true; } MOZ_CAN_RUN_SCRIPT static bool set_tFoot(JSContext* cx_, JS::Handle obj, void* void_self, JSJitSetterCallArgs args) { BindingCallContext cx(cx_, "HTMLTableElement.tFoot setter"); AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "tFoot", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); mozilla::dom::HTMLTableSectionElement* arg0; if (args[0].isObject()) { { // Our JSContext should be in the right global to do unwrapping in. nsresult rv = UnwrapObject(args[0], arg0, cx); if (NS_FAILED(rv)) { cx.ThrowErrorMessage("Value being assigned", "HTMLTableSectionElement"); return false; } } } else if (args[0].isNullOrUndefined()) { arg0 = nullptr; } else { cx.ThrowErrorMessage("Value being assigned"); return false; } Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } FastErrorResult rv; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vSetTFoot(MOZ_KnownLive(Constify(arg0)), rv))>, "Should be returning void here"); MOZ_KnownLive(self)->SetTFoot(MOZ_KnownLive(Constify(arg0)), rv); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.tFoot setter")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); return true; } static const JSJitInfo tFoot_getterinfo = { { get_tFoot }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; static const JSJitInfo tFoot_setterinfo = { { (JSJitGetterOp)set_tFoot }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Setter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool createTFoot(JSContext* cx, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "createTFoot", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); auto result(StrongOrRawPtr(MOZ_KnownLive(self)->CreateTFoot())); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!GetOrCreateDOMReflector(cx, result, args.rval())) { MOZ_ASSERT(JS_IsExceptionPending(cx)); return false; } return true; } static const JSJitInfo createTFoot_methodinfo = { { (JSJitGetterOp)createTFoot }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Method, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool deleteTFoot(JSContext* cx, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "deleteTFoot", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } // NOTE: This assert does NOT call the function. static_assert(std::is_void_vDeleteTFoot())>, "Should be returning void here"); MOZ_KnownLive(self)->DeleteTFoot(); MOZ_ASSERT(!JS_IsExceptionPending(cx)); args.rval().setUndefined(); return true; } static const JSJitInfo deleteTFoot_methodinfo = { { (JSJitGetterOp)deleteTFoot }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Method, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ true, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool get_tBodies(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "tBodies", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); auto result(StrongOrRawPtr(MOZ_KnownLive(self)->TBodies())); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!GetOrCreateDOMReflector(cx, result, args.rval())) { MOZ_ASSERT(JS_IsExceptionPending(cx)); return false; } return true; } static const JSJitInfo tBodies_getterinfo = { { get_tBodies }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool createTBody(JSContext* cx, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "createTBody", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); auto result(StrongOrRawPtr(MOZ_KnownLive(self)->CreateTBody())); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!GetOrCreateDOMReflector(cx, result, args.rval())) { MOZ_ASSERT(JS_IsExceptionPending(cx)); return false; } return true; } static const JSJitInfo createTBody_methodinfo = { { (JSJitGetterOp)createTBody }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Method, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool get_rows(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "rows", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); auto result(StrongOrRawPtr(MOZ_KnownLive(self)->Rows())); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!GetOrCreateDOMReflector(cx, result, args.rval())) { MOZ_ASSERT(JS_IsExceptionPending(cx)); return false; } return true; } static const JSJitInfo rows_getterinfo = { { get_rows }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool insertRow(JSContext* cx, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "insertRow", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); int32_t arg0; if (args.hasDefined(0)) { if (!ValueToPrimitive(cx, args[0], "Argument 1", &arg0)) { return false; } } else { arg0 = -1; } FastErrorResult rv; auto result(StrongOrRawPtr(MOZ_KnownLive(self)->InsertRow(arg0, rv))); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.insertRow")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!GetOrCreateDOMReflector(cx, result, args.rval())) { MOZ_ASSERT(JS_IsExceptionPending(cx)); return false; } return true; } static const JSJitInfo insertRow_methodinfo = { { (JSJitGetterOp)insertRow }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Method, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool deleteRow(JSContext* cx, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "deleteRow", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); if (!args.requireAtLeast(cx, "HTMLTableElement.deleteRow", 1)) { return false; } int32_t arg0; if (!ValueToPrimitive(cx, args[0], "Argument 1", &arg0)) { return false; } Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } FastErrorResult rv; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vDeleteRow(arg0, rv))>, "Should be returning void here"); MOZ_KnownLive(self)->DeleteRow(arg0, rv); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.deleteRow")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); args.rval().setUndefined(); return true; } static const JSJitInfo deleteRow_methodinfo = { { (JSJitGetterOp)deleteRow }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Method, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool get_align(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "align", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); DOMString result; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vGetAlign(result))>, "Should be returning void here"); MOZ_KnownLive(self)->GetAlign(result); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { return false; } return true; } MOZ_CAN_RUN_SCRIPT static bool set_align(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "align", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); nsAutoString arg0; if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { return false; } Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } FastErrorResult rv; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vSetAlign(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here"); MOZ_KnownLive(self)->SetAlign(NonNullHelper(Constify(arg0)), rv); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.align setter")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); return true; } static const JSJitInfo align_getterinfo = { { get_align }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; static const JSJitInfo align_setterinfo = { { (JSJitGetterOp)set_align }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Setter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool get_border(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "border", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); DOMString result; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vGetBorder(result))>, "Should be returning void here"); MOZ_KnownLive(self)->GetBorder(result); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { return false; } return true; } MOZ_CAN_RUN_SCRIPT static bool set_border(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "border", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); nsAutoString arg0; if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { return false; } Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } FastErrorResult rv; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vSetBorder(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here"); MOZ_KnownLive(self)->SetBorder(NonNullHelper(Constify(arg0)), rv); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.border setter")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); return true; } static const JSJitInfo border_getterinfo = { { get_border }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; static const JSJitInfo border_setterinfo = { { (JSJitGetterOp)set_border }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Setter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool get_frame(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "frame", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); DOMString result; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vGetFrame(result))>, "Should be returning void here"); MOZ_KnownLive(self)->GetFrame(result); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { return false; } return true; } MOZ_CAN_RUN_SCRIPT static bool set_frame(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "frame", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); nsAutoString arg0; if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { return false; } Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } FastErrorResult rv; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vSetFrame(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here"); MOZ_KnownLive(self)->SetFrame(NonNullHelper(Constify(arg0)), rv); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.frame setter")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); return true; } static const JSJitInfo frame_getterinfo = { { get_frame }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; static const JSJitInfo frame_setterinfo = { { (JSJitGetterOp)set_frame }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Setter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool get_rules(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "rules", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); DOMString result; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vGetRules(result))>, "Should be returning void here"); MOZ_KnownLive(self)->GetRules(result); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { return false; } return true; } MOZ_CAN_RUN_SCRIPT static bool set_rules(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "rules", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); nsAutoString arg0; if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { return false; } Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } FastErrorResult rv; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vSetRules(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here"); MOZ_KnownLive(self)->SetRules(NonNullHelper(Constify(arg0)), rv); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.rules setter")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); return true; } static const JSJitInfo rules_getterinfo = { { get_rules }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; static const JSJitInfo rules_setterinfo = { { (JSJitGetterOp)set_rules }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Setter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool get_summary(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "summary", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); DOMString result; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vGetSummary(result))>, "Should be returning void here"); MOZ_KnownLive(self)->GetSummary(result); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { return false; } return true; } MOZ_CAN_RUN_SCRIPT static bool set_summary(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "summary", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); nsAutoString arg0; if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { return false; } Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } FastErrorResult rv; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vSetSummary(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here"); MOZ_KnownLive(self)->SetSummary(NonNullHelper(Constify(arg0)), rv); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.summary setter")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); return true; } static const JSJitInfo summary_getterinfo = { { get_summary }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; static const JSJitInfo summary_setterinfo = { { (JSJitGetterOp)set_summary }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Setter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool get_width(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "width", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); DOMString result; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vGetWidth(result))>, "Should be returning void here"); MOZ_KnownLive(self)->GetWidth(result); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { return false; } return true; } MOZ_CAN_RUN_SCRIPT static bool set_width(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "width", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); nsAutoString arg0; if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { return false; } Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } FastErrorResult rv; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vSetWidth(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here"); MOZ_KnownLive(self)->SetWidth(NonNullHelper(Constify(arg0)), rv); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.width setter")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); return true; } static const JSJitInfo width_getterinfo = { { get_width }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; static const JSJitInfo width_setterinfo = { { (JSJitGetterOp)set_width }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Setter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool get_bgColor(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "bgColor", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); DOMString result; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vGetBgColor(result))>, "Should be returning void here"); MOZ_KnownLive(self)->GetBgColor(result); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { return false; } return true; } MOZ_CAN_RUN_SCRIPT static bool set_bgColor(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "bgColor", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); nsAutoString arg0; if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) { return false; } Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } FastErrorResult rv; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vSetBgColor(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here"); MOZ_KnownLive(self)->SetBgColor(NonNullHelper(Constify(arg0)), rv); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.bgColor setter")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); return true; } static const JSJitInfo bgColor_getterinfo = { { get_bgColor }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; static const JSJitInfo bgColor_setterinfo = { { (JSJitGetterOp)set_bgColor }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Setter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool get_cellPadding(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "cellPadding", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); DOMString result; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vGetCellPadding(result))>, "Should be returning void here"); MOZ_KnownLive(self)->GetCellPadding(result); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { return false; } return true; } MOZ_CAN_RUN_SCRIPT static bool set_cellPadding(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "cellPadding", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); nsAutoString arg0; if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) { return false; } Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } FastErrorResult rv; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vSetCellPadding(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here"); MOZ_KnownLive(self)->SetCellPadding(NonNullHelper(Constify(arg0)), rv); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.cellPadding setter")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); return true; } static const JSJitInfo cellPadding_getterinfo = { { get_cellPadding }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; static const JSJitInfo cellPadding_setterinfo = { { (JSJitGetterOp)set_cellPadding }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Setter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; MOZ_CAN_RUN_SCRIPT static bool get_cellSpacing(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "cellSpacing", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); DOMString result; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vGetCellSpacing(result))>, "Should be returning void here"); MOZ_KnownLive(self)->GetCellSpacing(result); MOZ_ASSERT(!JS_IsExceptionPending(cx)); if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { return false; } return true; } MOZ_CAN_RUN_SCRIPT static bool set_cellSpacing(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "cellSpacing", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); auto* self = static_cast(void_self); nsAutoString arg0; if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) { return false; } Maybe ceReaction; DocGroup* docGroup = self->GetDocGroup(); if (docGroup) { ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); } FastErrorResult rv; // NOTE: This assert does NOT call the function. static_assert(std::is_void_vSetCellSpacing(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here"); MOZ_KnownLive(self)->SetCellSpacing(NonNullHelper(Constify(arg0)), rv); if (rv.MaybeSetPendingException(cx, "HTMLTableElement.cellSpacing setter")) [[unlikely]] { return false; } MOZ_ASSERT(!JS_IsExceptionPending(cx)); return true; } static const JSJitInfo cellSpacing_getterinfo = { { get_cellSpacing }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Getter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; static const JSJitInfo cellSpacing_setterinfo = { { (JSJitGetterOp)set_cellSpacing }, { prototypes::id::HTMLTableElement }, { PrototypeTraits::Depth }, JSJitInfo::Setter, JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ false, /* isInfallible. False in setters. */ false, /* isMovable. Not relevant for setters. */ false, /* isEliminatable. Not relevant for setters. */ false, /* isAlwaysInSlot. Only relevant for getters. */ false, /* isLazilyCachedInSlot. Only relevant for getters. */ false, /* isTypedMethod. Only relevant for methods. */ 0 /* Reserved slot index, if we're stored in a slot, else 0. */ }; static void _finalize(JS::GCContext* gcx, JSObject* obj) { mozilla::dom::HTMLTableElement* self = UnwrapPossiblyNotInitializedDOMObject(obj); if (self) { JS::SetNativeObjectReservedSlot(obj, DOM_OBJECT_SLOT, JS::UndefinedValue()); Element_Binding::ReflectedHTMLAttributeSlots::Finalize(obj); ClearWrapper(self, self, obj); if (size_t mallocBytes = BindingJSObjectMallocBytes(self)) { JS::RemoveAssociatedMemory(obj, mallocBytes, JS::MemoryUse::DOMBinding); } AddForDeferredFinalization(self); } } MOZ_GLOBINIT static const JSFunctionSpec sMethods_specs[] = { JS_FNSPEC("createCaption", (GenericMethod), reinterpret_cast(&createCaption_methodinfo), 0, JSPROP_ENUMERATE, nullptr), JS_FNSPEC("deleteCaption", (GenericMethod), reinterpret_cast(&deleteCaption_methodinfo), 0, JSPROP_ENUMERATE, nullptr), JS_FNSPEC("createTHead", (GenericMethod), reinterpret_cast(&createTHead_methodinfo), 0, JSPROP_ENUMERATE, nullptr), JS_FNSPEC("deleteTHead", (GenericMethod), reinterpret_cast(&deleteTHead_methodinfo), 0, JSPROP_ENUMERATE, nullptr), JS_FNSPEC("createTFoot", (GenericMethod), reinterpret_cast(&createTFoot_methodinfo), 0, JSPROP_ENUMERATE, nullptr), JS_FNSPEC("deleteTFoot", (GenericMethod), reinterpret_cast(&deleteTFoot_methodinfo), 0, JSPROP_ENUMERATE, nullptr), JS_FNSPEC("createTBody", (GenericMethod), reinterpret_cast(&createTBody_methodinfo), 0, JSPROP_ENUMERATE, nullptr), JS_FNSPEC("insertRow", (GenericMethod), reinterpret_cast(&insertRow_methodinfo), 0, JSPROP_ENUMERATE, nullptr), JS_FNSPEC("deleteRow", (GenericMethod), reinterpret_cast(&deleteRow_methodinfo), 1, JSPROP_ENUMERATE, nullptr), JS_FS_END }; static const Prefable sMethods[] = { { nullptr, &sMethods_specs[0] }, { nullptr, nullptr } }; static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); static_assert(9 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); MOZ_GLOBINIT static const JSPropertySpec sAttributes_specs[] = { JSPropertySpec::nativeAccessors("caption", JSPROP_ENUMERATE, GenericGetter, &caption_getterinfo, GenericSetter, &caption_setterinfo), JSPropertySpec::nativeAccessors("tHead", JSPROP_ENUMERATE, GenericGetter, &tHead_getterinfo, GenericSetter, &tHead_setterinfo), JSPropertySpec::nativeAccessors("tFoot", JSPROP_ENUMERATE, GenericGetter, &tFoot_getterinfo, GenericSetter, &tFoot_setterinfo), JSPropertySpec::nativeAccessors("tBodies", JSPROP_ENUMERATE, GenericGetter, &tBodies_getterinfo, nullptr, nullptr), JSPropertySpec::nativeAccessors("rows", JSPROP_ENUMERATE, GenericGetter, &rows_getterinfo, nullptr, nullptr), JSPropertySpec::nativeAccessors("align", JSPROP_ENUMERATE, GenericGetter, &align_getterinfo, GenericSetter, &align_setterinfo), JSPropertySpec::nativeAccessors("border", JSPROP_ENUMERATE, GenericGetter, &border_getterinfo, GenericSetter, &border_setterinfo), JSPropertySpec::nativeAccessors("frame", JSPROP_ENUMERATE, GenericGetter, &frame_getterinfo, GenericSetter, &frame_setterinfo), JSPropertySpec::nativeAccessors("rules", JSPROP_ENUMERATE, GenericGetter, &rules_getterinfo, GenericSetter, &rules_setterinfo), JSPropertySpec::nativeAccessors("summary", JSPROP_ENUMERATE, GenericGetter, &summary_getterinfo, GenericSetter, &summary_setterinfo), JSPropertySpec::nativeAccessors("width", JSPROP_ENUMERATE, GenericGetter, &width_getterinfo, GenericSetter, &width_setterinfo), JSPropertySpec::nativeAccessors("bgColor", JSPROP_ENUMERATE, GenericGetter, &bgColor_getterinfo, GenericSetter, &bgColor_setterinfo), JSPropertySpec::nativeAccessors("cellPadding", JSPROP_ENUMERATE, GenericGetter, &cellPadding_getterinfo, GenericSetter, &cellPadding_setterinfo), JSPropertySpec::nativeAccessors("cellSpacing", JSPROP_ENUMERATE, GenericGetter, &cellSpacing_getterinfo, GenericSetter, &cellSpacing_setterinfo), JS_PS_END }; static const Prefable sAttributes[] = { { nullptr, &sAttributes_specs[0] }, { nullptr, nullptr } }; static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); static_assert(14 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); static uint16_t sNativeProperties_sortedPropertyIndices[23]; static PropertyInfo sNativeProperties_propertyInfos[23]; static const NativePropertiesN<2> sNativeProperties = { false, 0, false, 0, true, 0 /* sMethods */, true, 1 /* sAttributes */, false, 0, false, 0, false, 0, -1, 23, sNativeProperties_sortedPropertyIndices, { { sMethods, &sNativeProperties_propertyInfos[0] }, { sAttributes, &sNativeProperties_propertyInfos[9] } } }; static_assert(23 < 1ull << (CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount)), "We have a property info count that is oversized"); // This may allocate too many slots, because we only really need // slots for our non-interface-typed members that we cache. But // allocating slots only for those would make the slot index // computations much more complicated, so let's do this the simple // way for now. DEFINE_XRAY_EXPANDO_CLASS_WITH_OPS(static, sXrayExpandoObjectClass, 1, &Element_Binding::ReflectedHTMLAttributeSlots::sXrayExpandoObjectClassOps); bool sNativePropertiesInited = false; const NativePropertyHooks sNativePropertyHooks = { nullptr, { sNativeProperties.Upcast(), nullptr, &sNativePropertiesInited }, prototypes::id::HTMLTableElement, constructors::id::HTMLTableElement, &sXrayExpandoObjectClass }; static bool _constructor(JSContext* cx, unsigned argc, JS::Value* vp) { AUTO_PROFILER_LABEL_DYNAMIC_FAST( "HTMLTableElement", "constructor", DOM, cx, uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); return HTMLConstructor(cx, argc, vp, constructors::id::HTMLTableElement, prototypes::id::HTMLTableElement, CreateInterfaceObjects); } static const DOMInterfaceInfo sInterfaceObjectInfo = { { _constructor, &sNativePropertyHooks }, HTMLElement_Binding::GetConstructorObjectHandle, PrototypeTraits::Depth, prototypes::id::HTMLTableElement, true, 0, "HTMLTableElement", }; static const DOMIfaceAndProtoJSClass sPrototypeClass = { { "HTMLTableElementPrototype", JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE), JS_NULL_CLASS_OPS, JS_NULL_CLASS_SPEC, JS_NULL_CLASS_EXT, JS_NULL_OBJECT_OPS }, eInterfacePrototype, prototypes::id::HTMLTableElement, PrototypeTraits::Depth, &sNativePropertyHooks, HTMLElement_Binding::GetProtoObject }; static JS::Handle GetProtoObjectHandle(JSContext* aCx); static const JSClassOps sClassOps = { nullptr, /* addProperty */ nullptr, /* delProperty */ nullptr, /* enumerate */ nullptr, /* newEnumerate */ nullptr, /* resolve */ nullptr, /* mayResolve */ _finalize, /* finalize */ nullptr, /* call */ nullptr, /* construct */ Element_Binding::ReflectedHTMLAttributeSlots::Trace, /* trace */ }; static const DOMJSClass sClass = { { "HTMLTableElement", JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(2) | JSCLASS_PRESERVES_WRAPPER, &sClassOps, JS_NULL_CLASS_SPEC, &NativeTypeHelpers::sClassExtension, JS_NULL_OBJECT_OPS }, { 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 }, std::is_base_of_v, &sNativePropertyHooks, GetProtoObjectHandle, GetCCParticipant::Get(), nullptr, NativeTypeHelpers::GetWrapperCache }; static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS, "Must have the right minimal number of reserved slots."); static_assert(2 >= 2, "Must have enough reserved slots."); bool Wrap(JSContext* aCx, mozilla::dom::HTMLTableElement* aObject, nsWrapperCache* aCache, JS::Handle aGivenProto, JS::MutableHandle aReflector) { static_assert(!std::is_base_of_v, "Shouldn't have wrappercached things that are not refcounted."); static_assert(std::is_same_v); MOZ_ASSERT(static_cast(aObject) == reinterpret_cast(aObject), "Multiple inheritance for nsGenericHTMLElement is broken."); MOZ_ASSERT(static_cast(aObject) == reinterpret_cast(aObject), "Multiple inheritance for mozilla::dom::Element is broken."); MOZ_ASSERT(static_cast(aObject) == reinterpret_cast(aObject), "Multiple inheritance for nsINode is broken."); MOZ_ASSERT(static_cast(aObject) == reinterpret_cast(aObject), "Multiple inheritance for mozilla::dom::EventTarget is broken."); MOZ_ASSERT(ToSupportsIsCorrect(aObject)); MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx)); MOZ_ASSERT(!aCache->GetWrapper(), "You should probably not be using Wrap() directly; use " "GetOrCreateDOMReflector instead"); MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache), "nsISupports must be on our primary inheritance chain"); // If the wrapper cache contains a dead reflector then finalize that // now, ensuring that the finalizer for the old reflector always // runs before the new reflector is created and attached. This // avoids the awkward situation where there are multiple reflector // objects that contain pointers to the same native. if (JSObject* oldReflector = aCache->GetWrapperMaybeDead()) { _finalize(nullptr /* unused */, oldReflector); MOZ_ASSERT(!aCache->GetWrapperMaybeDead()); } JS::Rooted global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject())); if (!global) { return false; } MOZ_ASSERT(JS_IsGlobalObject(global)); JS::AssertObjectIsNotGray(global); // That might have ended up wrapping us already, due to the wonders // of XBL. Check for that, and bail out as needed. aReflector.set(aCache->GetWrapper()); if (aReflector) { #ifdef DEBUG AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto); #endif // DEBUG return true; } JSAutoRealm ar(aCx, global); JS::Handle canonicalProto = GetProtoObjectHandle(aCx); if (!canonicalProto) { return false; } JS::Rooted proto(aCx); if (aGivenProto) { proto = aGivenProto; // Unfortunately, while aGivenProto was in the compartment of aCx // coming in, we changed compartments to that of "parent" so may need // to wrap the proto here. if (js::GetContextCompartment(aCx) != JS::GetCompartment(proto)) { if (!JS_WrapObject(aCx, &proto)) { return false; } } } else { proto = canonicalProto; } BindingJSObjectCreator creator(aCx); creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector); if (!aReflector) { return false; } aCache->SetWrapper(aReflector); creator.InitializationSucceeded(); MOZ_ASSERT(aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector); // If proto != canonicalProto, we have to preserve our wrapper; // otherwise we won't be able to properly recreate it later, since // we won't know what proto to use. Note that we don't check // aGivenProto here, since it's entirely possible (and even // somewhat common) to have a non-null aGivenProto which is the // same as canonicalProto. if (proto != canonicalProto) { PreserveWrapper(aObject); } return true; } void CreateInterfaceObjects(JSContext* aCx, JS::Handle aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal) { JS::Heap* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::HTMLTableElement); JS::Heap* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::HTMLTableElement); JS::Handle parentProto(HTMLElement_Binding::GetProtoObjectHandle(aCx)); if (!parentProto) { return; } JS::Handle constructorProto(HTMLElement_Binding::GetConstructorObjectHandle(aCx)); if (!constructorProto) { return; } dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, &sPrototypeClass, protoCache, constructorProto, &sInterfaceObjectInfo, 0, false, Span{}, interfaceCache, sNativeProperties.Upcast(), nullptr, "HTMLTableElement", aDefineOnGlobal != DefineInterfaceProperty::No, nullptr, false, nullptr); } static JS::Handle GetProtoObjectHandle(JSContext* aCx) { /* Get the interface prototype object for this class. This will create the object as needed. */ return GetPerInterfaceObjectHandle(aCx, prototypes::id::HTMLTableElement, &CreateInterfaceObjects, DefineInterfaceProperty::CheckExposure); } JS::Handle GetConstructorObjectHandle(JSContext* aCx) { /* Get the interface object for this class. This will create the object as needed. */ return GetPerInterfaceObjectHandle(aCx, constructors::id::HTMLTableElement, &CreateInterfaceObjects, DefineInterfaceProperty::CheckExposure); } } // namespace HTMLTableElement_Binding } // namespace mozilla::dom