/* THIS FILE IS AUTOGENERATED FROM HTMLObjectElement.webidl BY Codegen.py - DO NOT EDIT */
#include
#include "ElementBinding.h"
#include "HTMLElementBinding.h"
#include "HTMLObjectElementBinding.h"
#include "MainThreadUtils.h"
#include "MozFrameLoaderOwnerBinding.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/BasePrincipal.h"
#include "mozilla/OwningNonNull.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/BindingCallContext.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/BrowsingContext.h"
#include "mozilla/dom/CustomElementRegistry.h"
#include "mozilla/dom/DOMJSClass.h"
#include "mozilla/dom/DocGroup.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLIFrameElement.h"
#include "mozilla/dom/HTMLObjectElement.h"
#include "mozilla/dom/NonRefcountedDOMObject.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrimitiveConversions.h"
#include "mozilla/dom/ValidityState.h"
#include "mozilla/dom/WindowProxyHolder.h"
#include "mozilla/dom/XULFrameElement.h"
#include "mozilla/dom/XrayExpandoClass.h"
#include "nsContentUtils.h"
#include "nsFrameLoader.h"
#include "nsIURI.h"
#include "nsJSPrincipals.h"
namespace mozilla::dom {
namespace binding_detail {}; // Just to make sure it's known as a namespace
using namespace mozilla::dom::binding_detail;
namespace HTMLObjectElement_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_data(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "data", 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_vGetData(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetData(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_data(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "data", 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_vSetData(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetData(NonNullHelper(Constify(arg0)), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.data setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo data_getterinfo = {
{ get_data },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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 data_setterinfo = {
{ (JSJitGetterOp)set_data },
{ prototypes::id::HTMLObjectElement },
{ 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_type(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "type", 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_vGetType(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetType(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_type(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "type", 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_vSetType(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetType(NonNullHelper(Constify(arg0)), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.type setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo type_getterinfo = {
{ get_type },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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 type_setterinfo = {
{ (JSJitGetterOp)set_type },
{ prototypes::id::HTMLObjectElement },
{ 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_name(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "name", 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_vGetName(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetName(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_name(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "name", 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_vSetName(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetName(NonNullHelper(Constify(arg0)), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.name setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo name_getterinfo = {
{ get_name },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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 name_setterinfo = {
{ (JSJitGetterOp)set_name },
{ prototypes::id::HTMLObjectElement },
{ 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_useMap(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "useMap", 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_vGetUseMap(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetUseMap(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_useMap(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "useMap", 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_vSetUseMap(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetUseMap(NonNullHelper(Constify(arg0)), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.useMap setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo useMap_getterinfo = {
{ get_useMap },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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 useMap_setterinfo = {
{ (JSJitGetterOp)set_useMap },
{ prototypes::id::HTMLObjectElement },
{ 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_form(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "form", 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)->GetFormForBindings()));
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;
}
static const JSJitInfo form_getterinfo = {
{ get_form },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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(
"HTMLObjectElement", "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(
"HTMLObjectElement", "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, "HTMLObjectElement.width setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo width_getterinfo = {
{ get_width },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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::HTMLObjectElement },
{ 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_height(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "height", 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_vGetHeight(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetHeight(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_height(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "height", 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_vSetHeight(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetHeight(NonNullHelper(Constify(arg0)), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.height setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo height_getterinfo = {
{ get_height },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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 height_setterinfo = {
{ (JSJitGetterOp)set_height },
{ prototypes::id::HTMLObjectElement },
{ 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_contentDocument(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "contentDocument", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
NonNull subjectPrincipal;
{
JS::Realm* realm = js::GetContextRealm(cx);
MOZ_ASSERT(realm);
JSPrincipals* principals = JS::GetRealmPrincipals(realm);
nsIPrincipal* principal = nsJSPrincipals::get(principals);
subjectPrincipal = principal;
}
auto result(StrongOrRawPtr(MOZ_KnownLive(self)->GetContentDocument(MOZ_KnownLive(NonNullHelper(subjectPrincipal)))));
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;
}
static const JSJitInfo contentDocument_getterinfo = {
{ get_contentDocument },
{ prototypes::id::HTMLObjectElement },
{ 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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_contentWindow(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "contentWindow", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
NonNull subjectPrincipal;
{
JS::Realm* realm = js::GetContextRealm(cx);
MOZ_ASSERT(realm);
JSPrincipals* principals = JS::GetRealmPrincipals(realm);
nsIPrincipal* principal = nsJSPrincipals::get(principals);
subjectPrincipal = principal;
}
Nullable result(MOZ_KnownLive(self)->GetContentWindow(MOZ_KnownLive(NonNullHelper(subjectPrincipal))));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result.IsNull()) {
args.rval().setNull();
return true;
}
if (!WrapObject(cx, result.Value(), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo contentWindow_getterinfo = {
{ get_contentWindow },
{ prototypes::id::HTMLObjectElement },
{ 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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_willValidate(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "willValidate", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
bool result(MOZ_KnownLive(self)->WillValidate());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo willValidate_getterinfo = {
{ get_willValidate },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_BOOLEAN, /* 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_validity(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "validity", 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)->Validity()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo validity_getterinfo = {
{ get_validity },
{ prototypes::id::HTMLObjectElement },
{ 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
get_validationMessage(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "validationMessage", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
FastErrorResult rv;
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_vGetValidationMessage(result, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->GetValidationMessage(result, rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.validationMessage getter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo validationMessage_getterinfo = {
{ get_validationMessage },
{ prototypes::id::HTMLObjectElement },
{ 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. */
};
MOZ_CAN_RUN_SCRIPT static bool
checkValidity(JSContext* cx, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "checkValidity", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
bool result(MOZ_KnownLive(self)->CheckValidity());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo checkValidity_methodinfo = {
{ (JSJitGetterOp)checkValidity },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_BOOLEAN, /* 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
reportValidity(JSContext* cx, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "reportValidity", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
bool result(MOZ_KnownLive(self)->ReportValidity());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo reportValidity_methodinfo = {
{ (JSJitGetterOp)reportValidity },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_BOOLEAN, /* 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
setCustomValidity(JSContext* cx, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "setCustomValidity", 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, "HTMLObjectElement.setCustomValidity", 1)) {
return false;
}
nsAutoString arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_vSetCustomValidity(NonNullHelper(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetCustomValidity(NonNullHelper(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo setCustomValidity_methodinfo = {
{ (JSJitGetterOp)setCustomValidity },
{ prototypes::id::HTMLObjectElement },
{ 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(
"HTMLObjectElement", "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(
"HTMLObjectElement", "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, "HTMLObjectElement.align setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo align_getterinfo = {
{ get_align },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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::HTMLObjectElement },
{ 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_archive(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "archive", 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_vGetArchive(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetArchive(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_archive(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "archive", 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_vSetArchive(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetArchive(NonNullHelper(Constify(arg0)), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.archive setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo archive_getterinfo = {
{ get_archive },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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 archive_setterinfo = {
{ (JSJitGetterOp)set_archive },
{ prototypes::id::HTMLObjectElement },
{ 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_code(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "code", 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_vGetCode(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetCode(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_code(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "code", 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_vSetCode(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetCode(NonNullHelper(Constify(arg0)), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.code setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo code_getterinfo = {
{ get_code },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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 code_setterinfo = {
{ (JSJitGetterOp)set_code },
{ prototypes::id::HTMLObjectElement },
{ 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_declare(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "declare", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
bool result(MOZ_KnownLive(self)->Declare());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_declare(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "declare", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
bool arg0;
if (!ValueToPrimitive(cx, args[0], "Value being assigned", &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_vSetDeclare(arg0, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetDeclare(arg0, rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.declare setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo declare_getterinfo = {
{ get_declare },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
true, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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 declare_setterinfo = {
{ (JSJitGetterOp)set_declare },
{ prototypes::id::HTMLObjectElement },
{ 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_hspace(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "hspace", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
uint32_t result(MOZ_KnownLive(self)->Hspace());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setNumber(result);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_hspace(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "hspace", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
uint32_t arg0;
if (!ValueToPrimitive(cx, args[0], "Value being assigned", &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_vSetHspace(arg0, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetHspace(arg0, rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.hspace setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo hspace_getterinfo = {
{ get_hspace },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
true, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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 hspace_setterinfo = {
{ (JSJitGetterOp)set_hspace },
{ prototypes::id::HTMLObjectElement },
{ 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_standby(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "standby", 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_vGetStandby(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetStandby(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_standby(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "standby", 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_vSetStandby(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetStandby(NonNullHelper(Constify(arg0)), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.standby setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo standby_getterinfo = {
{ get_standby },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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 standby_setterinfo = {
{ (JSJitGetterOp)set_standby },
{ prototypes::id::HTMLObjectElement },
{ 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_vspace(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "vspace", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
uint32_t result(MOZ_KnownLive(self)->Vspace());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setNumber(result);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_vspace(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "vspace", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
uint32_t arg0;
if (!ValueToPrimitive(cx, args[0], "Value being assigned", &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_vSetVspace(arg0, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetVspace(arg0, rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.vspace setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo vspace_getterinfo = {
{ get_vspace },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
true, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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 vspace_setterinfo = {
{ (JSJitGetterOp)set_vspace },
{ prototypes::id::HTMLObjectElement },
{ 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_codeBase(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "codeBase", 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_vGetCodeBase(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetCodeBase(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_codeBase(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "codeBase", 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_vSetCodeBase(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetCodeBase(NonNullHelper(Constify(arg0)), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.codeBase setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo codeBase_getterinfo = {
{ get_codeBase },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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 codeBase_setterinfo = {
{ (JSJitGetterOp)set_codeBase },
{ prototypes::id::HTMLObjectElement },
{ 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_codeType(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "codeType", 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_vGetCodeType(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetCodeType(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_codeType(JSContext* cx, JS::Handle obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "codeType", 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_vSetCodeType(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetCodeType(NonNullHelper(Constify(arg0)), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.codeType setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo codeType_getterinfo = {
{ get_codeType },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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 codeType_setterinfo = {
{ (JSJitGetterOp)set_codeType },
{ prototypes::id::HTMLObjectElement },
{ 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(
"HTMLObjectElement", "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(
"HTMLObjectElement", "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], 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_vSetBorder(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetBorder(NonNullHelper(Constify(arg0)), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.border setter")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo border_getterinfo = {
{ get_border },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
true, /* isMovable. Not relevant for setters. */
true, /* 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::HTMLObjectElement },
{ 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
getSVGDocument(JSContext* cx, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "getSVGDocument", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
NonNull subjectPrincipal;
{
JS::Realm* realm = js::GetContextRealm(cx);
MOZ_ASSERT(realm);
JSPrincipals* principals = JS::GetRealmPrincipals(realm);
nsIPrincipal* principal = nsJSPrincipals::get(principals);
subjectPrincipal = principal;
}
auto result(StrongOrRawPtr(MOZ_KnownLive(self)->GetSVGDocument(MOZ_KnownLive(NonNullHelper(subjectPrincipal)))));
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;
}
static const JSJitInfo getSVGDocument_methodinfo = {
{ (JSJitGetterOp)getSVGDocument },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Method,
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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_frameLoader(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "frameLoader", 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)->GetFrameLoader()));
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;
}
static const JSJitInfo frameLoader_getterinfo = {
{ get_frameLoader },
{ prototypes::id::HTMLObjectElement },
{ 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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_browsingContext(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "browsingContext", 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)->GetBrowsingContext()));
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;
}
static const JSJitInfo browsingContext_getterinfo = {
{ get_browsingContext },
{ prototypes::id::HTMLObjectElement },
{ 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. */
};
MOZ_CAN_RUN_SCRIPT static bool
swapFrameLoaders(JSContext* cx_, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "HTMLObjectElement.swapFrameLoaders");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "swapFrameLoaders", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
unsigned argcount = std::min(args.length(), 1u);
switch (argcount) {
case 1: {
if (args[0].isObject()) {
do {
NonNull arg0;
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject(args[0], arg0, cx);
if (NS_FAILED(rv)) {
break;
}
}
FastErrorResult rv;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_vSwapFrameLoaders(MOZ_KnownLive(NonNullHelper(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SwapFrameLoaders(MOZ_KnownLive(NonNullHelper(arg0)), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.swapFrameLoaders")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
} while (false);
do {
NonNull arg0;
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject(args[0], arg0, cx);
if (NS_FAILED(rv)) {
break;
}
}
FastErrorResult rv;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_vSwapFrameLoaders(MOZ_KnownLive(NonNullHelper(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SwapFrameLoaders(MOZ_KnownLive(NonNullHelper(arg0)), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.swapFrameLoaders")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
} while (false);
}
return cx.ThrowErrorMessage("1", "1");
break;
}
default: {
// Using nsPrintfCString here would require including that
// header. Let's not worry about it.
nsAutoCString argCountStr;
argCountStr.AppendPrintf("%u", args.length());
return cx.ThrowErrorMessage(argCountStr.get());
}
}
MOZ_CRASH("We have an always-returning default case");
return false;
}
static const JSJitInfo swapFrameLoaders_methodinfo = {
{ (JSJitGetterOp)swapFrameLoaders },
{ prototypes::id::HTMLObjectElement },
{ 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
changeRemoteness(JSContext* cx_, JS::Handle obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "HTMLObjectElement.changeRemoteness");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "changeRemoteness", 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, "HTMLObjectElement.changeRemoteness", 1)) {
return false;
}
binding_detail::FastRemotenessOptions arg0;
if (!arg0.Init(cx, args[0], "Argument 1", false)) {
return false;
}
FastErrorResult rv;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_vChangeRemoteness(Constify(arg0), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->ChangeRemoteness(Constify(arg0), rv);
if (rv.MaybeSetPendingException(cx, "HTMLObjectElement.changeRemoteness")) [[unlikely]] {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo changeRemoteness_methodinfo = {
{ (JSJitGetterOp)changeRemoteness },
{ prototypes::id::HTMLObjectElement },
{ 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_actualType(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "actualType", 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_vGetActualType(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetActualType(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo actualType_getterinfo = {
{ get_actualType },
{ prototypes::id::HTMLObjectElement },
{ 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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_displayedType(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "displayedType", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast(void_self);
uint32_t result(MOZ_KnownLive(self)->DisplayedType());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setNumber(result);
return true;
}
static const JSJitInfo displayedType_getterinfo = {
{ get_displayedType },
{ prototypes::id::HTMLObjectElement },
{ PrototypeTraits::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_DOUBLE, /* 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_srcURI(JSContext* cx, JS::Handle obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLObjectElement", "srcURI", 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)->GetSrcURI()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!result) {
args.rval().setNull();
return true;
}
if (!WrapObject(cx, result, &NS_GET_IID(nsIURI), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo srcURI_getterinfo = {
{ get_srcURI },
{ prototypes::id::HTMLObjectElement },
{ 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 void
_finalize(JS::GCContext* gcx, JSObject* obj)
{
mozilla::dom::HTMLObjectElement* 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("checkValidity", (GenericMethod), reinterpret_cast(&checkValidity_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("reportValidity", (GenericMethod), reinterpret_cast(&reportValidity_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("setCustomValidity", (GenericMethod), reinterpret_cast(&setCustomValidity_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("getSVGDocument", (GenericMethod), reinterpret_cast(&getSVGDocument_methodinfo), 0, 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(4 <= 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 JSFunctionSpec sChromeMethods_specs[] = {
JS_FNSPEC("swapFrameLoaders", (GenericMethod), reinterpret_cast(&swapFrameLoaders_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("changeRemoteness", (GenericMethod), reinterpret_cast(&changeRemoteness_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FS_END
};
static const Prefable sChromeMethods[] = {
{ nullptr, &sChromeMethods_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(2 <= 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("data", JSPROP_ENUMERATE, GenericGetter, &data_getterinfo, GenericSetter, &data_setterinfo),
JSPropertySpec::nativeAccessors("type", JSPROP_ENUMERATE, GenericGetter, &type_getterinfo, GenericSetter, &type_setterinfo),
JSPropertySpec::nativeAccessors("name", JSPROP_ENUMERATE, GenericGetter, &name_getterinfo, GenericSetter, &name_setterinfo),
JSPropertySpec::nativeAccessors("useMap", JSPROP_ENUMERATE, GenericGetter, &useMap_getterinfo, GenericSetter, &useMap_setterinfo),
JSPropertySpec::nativeAccessors("form", JSPROP_ENUMERATE, GenericGetter, &form_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("width", JSPROP_ENUMERATE, GenericGetter, &width_getterinfo, GenericSetter, &width_setterinfo),
JSPropertySpec::nativeAccessors("height", JSPROP_ENUMERATE, GenericGetter, &height_getterinfo, GenericSetter, &height_setterinfo),
JSPropertySpec::nativeAccessors("contentDocument", JSPROP_ENUMERATE, GenericGetter, &contentDocument_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("contentWindow", JSPROP_ENUMERATE, GenericGetter, &contentWindow_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("willValidate", JSPROP_ENUMERATE, GenericGetter, &willValidate_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("validity", JSPROP_ENUMERATE, GenericGetter, &validity_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("validationMessage", JSPROP_ENUMERATE, GenericGetter