Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM HTMLTextAreaElement.webidl BY Codegen.py - DO NOT EDIT */
#include <type_traits>
#include "HTMLElementBinding.h"
#include "HTMLTextAreaElementBinding.h"
#include "MainThreadUtils.h"
#include "WrapperFactory.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/String.h"
#include "js/experimental/JitInfo.h"
#include "mozilla/Atomics.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/OwningNonNull.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/dom/BindingCallContext.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/CustomElementRegistry.h"
#include "mozilla/dom/DOMJSClass.h"
#include "mozilla/dom/DocGroup.h"
#include "mozilla/dom/HTMLFormElement.h"
#include "mozilla/dom/HTMLTextAreaElement.h"
#include "mozilla/dom/NonRefcountedDOMObject.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrimitiveConversions.h"
#include "mozilla/dom/ValidityState.h"
#include "mozilla/dom/WebIDLPrefs.h"
#include "mozilla/dom/XrayExpandoClass.h"
#include "nsContentUtils.h"
#include "nsIControllers.h"
#include "nsIEditor.h"
#include "nsINodeList.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 HTMLTextAreaElement_Binding {
static_assert(IsRefcounted<NativeType>::value == IsRefcounted<HTMLElement_Binding::NativeType>::value,
"Can't inherit from an interface with a different ownership model.");
MOZ_CAN_RUN_SCRIPT static bool
get_autocomplete(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "autocomplete", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetAutocomplete(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetAutocomplete(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_autocomplete(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "autocomplete", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetAutocomplete(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetAutocomplete(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.autocomplete setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo autocomplete_getterinfo = {
{ get_autocomplete },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 autocomplete_setterinfo = {
{ (JSJitGetterOp)set_autocomplete },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_cols(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "cols", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
uint32_t result(MOZ_KnownLive(self)->Cols());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setNumber(result);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_cols(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "cols", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
uint32_t arg0;
if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetCols(arg0, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetCols(arg0, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.cols setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo cols_getterinfo = {
{ get_cols },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 cols_setterinfo = {
{ (JSJitGetterOp)set_cols },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_dirName(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "dirName", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetDirName(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetDirName(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_dirName(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "dirName", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetDirName(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetDirName(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.dirName setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo dirName_getterinfo = {
{ get_dirName },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 dirName_setterinfo = {
{ (JSJitGetterOp)set_dirName },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_disabled(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "disabled", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
bool result(MOZ_KnownLive(self)->Disabled());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_disabled(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "disabled", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
bool arg0;
if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetDisabled(arg0, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetDisabled(arg0, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.disabled setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo disabled_getterinfo = {
{ get_disabled },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 disabled_setterinfo = {
{ (JSJitGetterOp)set_disabled },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "form", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::HTMLFormElement>(MOZ_KnownLive(self)->GetForm()));
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::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_maxLength(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "maxLength", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
int32_t result(MOZ_KnownLive(self)->MaxLength());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setInt32(int32_t(result));
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_maxLength(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "maxLength", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
int32_t arg0;
if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetMaxLength(arg0, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetMaxLength(arg0, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.maxLength setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo maxLength_getterinfo = {
{ get_maxLength },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_INT32, /* 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 maxLength_setterinfo = {
{ (JSJitGetterOp)set_maxLength },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_minLength(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "minLength", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
int32_t result(MOZ_KnownLive(self)->MinLength());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setInt32(int32_t(result));
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_minLength(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "minLength", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
int32_t arg0;
if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetMinLength(arg0, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetMinLength(arg0, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.minLength setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo minLength_getterinfo = {
{ get_minLength },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_INT32, /* 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 minLength_setterinfo = {
{ (JSJitGetterOp)set_minLength },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "name", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetName(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<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "name", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetName(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetName(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.name setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo name_getterinfo = {
{ get_name },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_placeholder(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "placeholder", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetPlaceholder(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetPlaceholder(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_placeholder(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "placeholder", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetPlaceholder(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetPlaceholder(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.placeholder setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo placeholder_getterinfo = {
{ get_placeholder },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 placeholder_setterinfo = {
{ (JSJitGetterOp)set_placeholder },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_readOnly(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "readOnly", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
bool result(MOZ_KnownLive(self)->ReadOnly());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_readOnly(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "readOnly", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
bool arg0;
if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetReadOnly(arg0, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetReadOnly(arg0, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.readOnly setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo readOnly_getterinfo = {
{ get_readOnly },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 readOnly_setterinfo = {
{ (JSJitGetterOp)set_readOnly },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_required(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "required", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
bool result(MOZ_KnownLive(self)->Required());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_required(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "required", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
bool arg0;
if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetRequired(arg0, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetRequired(arg0, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.required setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo required_getterinfo = {
{ get_required },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 required_setterinfo = {
{ (JSJitGetterOp)set_required },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_rows(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "rows", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
uint32_t result(MOZ_KnownLive(self)->Rows());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setNumber(result);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_rows(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "rows", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
uint32_t arg0;
if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetRows(arg0, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetRows(arg0, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.rows setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo rows_getterinfo = {
{ get_rows },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 rows_setterinfo = {
{ (JSJitGetterOp)set_rows },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_wrap(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "wrap", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetWrap(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetWrap(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_wrap(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "wrap", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetWrap(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetWrap(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.wrap setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo wrap_getterinfo = {
{ get_wrap },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 wrap_setterinfo = {
{ (JSJitGetterOp)set_wrap },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "type", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetType(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;
}
static const JSJitInfo type_getterinfo = {
{ get_type },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* 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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_defaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "defaultValue", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
FastErrorResult rv;
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetDefaultValue(result, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->GetDefaultValue(result, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.defaultValue getter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_defaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "defaultValue", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetDefaultValue(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetDefaultValue(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.defaultValue setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo defaultValue_getterinfo = {
{ get_defaultValue },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* 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 defaultValue_setterinfo = {
{ (JSJitGetterOp)set_defaultValue },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_value(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "value", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetValue(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetValue(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_value(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "value", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
return false;
}
Maybe<AutoCEReaction> 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_v<decltype(MOZ_KnownLive(self)->SetValue(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetValue(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.value setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo value_getterinfo = {
{ get_value },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 value_setterinfo = {
{ (JSJitGetterOp)set_value },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_textLength(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "textLength", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
uint32_t result(MOZ_KnownLive(self)->GetTextLength());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setNumber(result);
return true;
}
static const JSJitInfo textLength_getterinfo = {
{ get_textLength },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_willValidate(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "willValidate", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(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::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "validity", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::ValidityState>(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::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "validationMessage", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
FastErrorResult rv;
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetValidationMessage(result, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->GetValidationMessage(result, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.validationMessage getter"))) {
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::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "checkValidity", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(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::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "reportValidity", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(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::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "setCustomValidity", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
if (!args.requireAtLeast(cx, "HTMLTextAreaElement.setCustomValidity", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetCustomValidity(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::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_labels(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "labels", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
auto result(StrongOrRawPtr<nsINodeList>(MOZ_KnownLive(self)->Labels()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo labels_getterinfo = {
{ get_labels },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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
select(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "select", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->Select())>, "Should be returning void here");
MOZ_KnownLive(self)->Select();
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo select_methodinfo = {
{ (JSJitGetterOp)select },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_selectionStart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "selectionStart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
FastErrorResult rv;
Nullable<uint32_t> result(MOZ_KnownLive(self)->GetSelectionStart(rv));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.selectionStart getter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result.IsNull()) {
args.rval().setNull();
return true;
}
args.rval().setNumber(result.Value());
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_selectionStart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "selectionStart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
Nullable<uint32_t> arg0;
if (args[0].isNullOrUndefined()) {
arg0.SetNull();
} else if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
return false;
}
FastErrorResult rv;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetSelectionStart(Constify(arg0), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetSelectionStart(Constify(arg0), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.selectionStart setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo selectionStart_getterinfo = {
{ get_selectionStart },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 selectionStart_setterinfo = {
{ (JSJitGetterOp)set_selectionStart },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_selectionEnd(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "selectionEnd", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
FastErrorResult rv;
Nullable<uint32_t> result(MOZ_KnownLive(self)->GetSelectionEnd(rv));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.selectionEnd getter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result.IsNull()) {
args.rval().setNull();
return true;
}
args.rval().setNumber(result.Value());
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_selectionEnd(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "selectionEnd", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
Nullable<uint32_t> arg0;
if (args[0].isNullOrUndefined()) {
arg0.SetNull();
} else if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
return false;
}
FastErrorResult rv;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetSelectionEnd(Constify(arg0), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetSelectionEnd(Constify(arg0), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.selectionEnd setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo selectionEnd_getterinfo = {
{ get_selectionEnd },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 selectionEnd_setterinfo = {
{ (JSJitGetterOp)set_selectionEnd },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_selectionDirection(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "selectionDirection", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
FastErrorResult rv;
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetSelectionDirection(result, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->GetSelectionDirection(result, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.selectionDirection getter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::StringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_selectionDirection(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "selectionDirection", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
return false;
}
FastErrorResult rv;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetSelectionDirection(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetSelectionDirection(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.selectionDirection setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo selectionDirection_getterinfo = {
{ get_selectionDirection },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 selectionDirection_setterinfo = {
{ (JSJitGetterOp)set_selectionDirection },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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
setRangeText(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "HTMLTextAreaElement.setRangeText");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "setRangeText", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
unsigned argcount = std::min(args.length(), 4u);
switch (argcount) {
case 1: {
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
FastErrorResult rv;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetRangeText(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetRangeText(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.setRangeText"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
break;
}
case 3: {
[[fallthrough]];
}
case 4: {
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
uint32_t arg1;
if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
return false;
}
uint32_t arg2;
if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], "Argument 3", &arg2)) {
return false;
}
SelectionMode arg3;
if (args.hasDefined(3)) {
{
int index;
if (!binding_detail::FindEnumStringIndex<true>(cx, args[3],
binding_detail::EnumStrings<SelectionMode>::Values,
"SelectionMode", "argument 4",
&index)) {
return false;
}
MOZ_ASSERT(index >= 0);
arg3 = static_cast<SelectionMode>(index);
}
} else {
arg3 = SelectionMode::Preserve;
}
FastErrorResult rv;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetRangeText(NonNullHelper(Constify(arg0)), arg1, arg2, arg3, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetRangeText(NonNullHelper(Constify(arg0)), arg1, arg2, arg3, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.setRangeText"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
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<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
}
}
MOZ_CRASH("We have an always-returning default case");
return false;
}
static const JSJitInfo setRangeText_methodinfo = {
{ (JSJitGetterOp)setRangeText },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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
setSelectionRange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "setSelectionRange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
if (!args.requireAtLeast(cx, "HTMLTextAreaElement.setSelectionRange", 2)) {
return false;
}
uint32_t arg0;
if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
return false;
}
uint32_t arg1;
if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
return false;
}
Optional<nsAString> arg2;
binding_detail::FakeString<char16_t> arg2_holder;
if (args.hasDefined(2)) {
if (!ConvertJSValueToString(cx, args[2], eStringify, eStringify, arg2_holder)) {
return false;
}
arg2 = &arg2_holder;
}
FastErrorResult rv;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetSelectionRange(arg0, arg1, NonNullHelper(Constify(arg2)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetSelectionRange(arg0, arg1, NonNullHelper(Constify(arg2)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.setSelectionRange"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo setSelectionRange_methodinfo = {
{ (JSJitGetterOp)setSelectionRange },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_controllers(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "controllers", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
FastErrorResult rv;
auto result(StrongOrRawPtr<nsIControllers>(MOZ_KnownLive(self)->GetControllers(rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "HTMLTextAreaElement.controllers getter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!WrapObject(cx, result, &NS_GET_IID(nsIControllers), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo controllers_getterinfo = {
{ get_controllers },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_previewValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "previewValue", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetPreviewValue(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetPreviewValue(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_previewValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "previewValue", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetPreviewValue(NonNullHelper(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetPreviewValue(NonNullHelper(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo previewValue_getterinfo = {
{ get_previewValue },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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 previewValue_setterinfo = {
{ (JSJitGetterOp)set_previewValue },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_editor(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "editor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
auto result(StrongOrRawPtr<nsIEditor>(MOZ_KnownLive(self)->GetEditorForBindings()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!result) {
args.rval().setNull();
return true;
}
if (!WrapObject(cx, result, &NS_GET_IID(nsIEditor), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo editor_getterinfo = {
{ get_editor },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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_hasEditor(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "hasEditor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
bool result(MOZ_KnownLive(self)->HasEditor());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo hasEditor_getterinfo = {
{ get_hasEditor },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_isInputEventTarget(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "isInputEventTarget", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
bool result(MOZ_KnownLive(self)->IsInputEventTarget());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo isInputEventTarget_getterinfo = {
{ get_isInputEventTarget },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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
setUserInput(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "setUserInput", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::HTMLTextAreaElement*>(void_self);
if (!args.requireAtLeast(cx, "HTMLTextAreaElement.setUserInput", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
NonNull<nsIPrincipal> subjectPrincipal;
{
JS::Realm* realm = js::GetContextRealm(cx);
MOZ_ASSERT(realm);
JSPrincipals* principals = JS::GetRealmPrincipals(realm);
nsIPrincipal* principal = nsJSPrincipals::get(principals);
subjectPrincipal = principal;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetUserInput(NonNullHelper(Constify(arg0)), MOZ_KnownLive(NonNullHelper(subjectPrincipal))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetUserInput(NonNullHelper(Constify(arg0)), MOZ_KnownLive(NonNullHelper(subjectPrincipal)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo setUserInput_methodinfo = {
{ (JSJitGetterOp)setUserInput },
{ prototypes::id::HTMLTextAreaElement },
{ PrototypeTraits<prototypes::id::HTMLTextAreaElement>::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. */
};
static bool
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
{
mozilla::dom::HTMLTextAreaElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLTextAreaElement>(obj);
// We don't want to preserve if we don't have a wrapper, and we
// obviously can't preserve if we're not initialized.
if (self && self->GetWrapperPreserveColor()) {
PreserveWrapper(self);
}
return true;
}
static void
_finalize(JS::GCContext* gcx, JSObject* obj)
{
mozilla::dom::HTMLTextAreaElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLTextAreaElement>(obj);
if (self) {
JS::SetReservedSlot(obj, DOM_OBJECT_SLOT, JS::UndefinedValue());
ClearWrapper(self, self, obj);
if (size_t mallocBytes = BindingJSObjectMallocBytes(self)) {
JS::RemoveAssociatedMemory(obj, mallocBytes,
JS::MemoryUse::DOMBinding);
}
AddForDeferredFinalization<mozilla::dom::HTMLTextAreaElement>(self);
}
}
static nsWrapperCache*
_getWrapperCache(JS::Handle<JSObject*> obj)
{
mozilla::dom::HTMLTextAreaElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLTextAreaElement>(obj);
return self;
}
static size_t
_objectMoved(JSObject* obj, JSObject* old)
{
mozilla::dom::HTMLTextAreaElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLTextAreaElement>(obj);
if (self) {
UpdateWrapper(self, self, obj, old);
}
return 0;
}
static const JSFunctionSpec sMethods_specs[] = {
JS_FNSPEC("checkValidity", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&checkValidity_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("reportValidity", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&reportValidity_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("setCustomValidity", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&setCustomValidity_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("select", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&select_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("setRangeText", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&setRangeText_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("setSelectionRange", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&setSelectionRange_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("setUserInput", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&setUserInput_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FS_END
};
static const PrefableDisablers sMethods_disablers7 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &IsChromeOrUAWidget
};
static const Prefable<const JSFunctionSpec> sMethods[] = {
{ nullptr, &sMethods_specs[0] },
{ &sMethods_disablers7, &sMethods_specs[7] },
{ nullptr, nullptr }
};
static_assert(2 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
"We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
static_assert(6 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
"We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
static const JSPropertySpec sAttributes_specs[] = {
JSPropertySpec::nativeAccessors("autocomplete", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &autocomplete_getterinfo, GenericSetter<NormalThisPolicy>, &autocomplete_setterinfo),
JSPropertySpec::nativeAccessors("cols", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &cols_getterinfo, GenericSetter<NormalThisPolicy>, &cols_setterinfo),
JSPropertySpec::nativeAccessors("dirName", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &dirName_getterinfo, GenericSetter<NormalThisPolicy>, &dirName_setterinfo),
JSPropertySpec::nativeAccessors("disabled", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &disabled_getterinfo, GenericSetter<NormalThisPolicy>, &disabled_setterinfo),
JSPropertySpec::nativeAccessors("form", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &form_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("maxLength", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &maxLength_getterinfo, GenericSetter<NormalThisPolicy>, &maxLength_setterinfo),
JSPropertySpec::nativeAccessors("minLength", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &minLength_getterinfo, GenericSetter<NormalThisPolicy>, &minLength_setterinfo),
JSPropertySpec::nativeAccessors("name", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &name_getterinfo, GenericSetter<NormalThisPolicy>, &name_setterinfo),
JSPropertySpec::nativeAccessors("placeholder", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &placeholder_getterinfo, GenericSetter<NormalThisPolicy>, &placeholder_setterinfo),
JSPropertySpec::nativeAccessors("readOnly", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readOnly_getterinfo, GenericSetter<NormalThisPolicy>, &readOnly_setterinfo),
JSPropertySpec::nativeAccessors("required", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &required_getterinfo, GenericSetter<NormalThisPolicy>, &required_setterinfo),
JSPropertySpec::nativeAccessors("rows", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &rows_getterinfo, GenericSetter<NormalThisPolicy>, &rows_setterinfo),
JSPropertySpec::nativeAccessors("wrap", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &wrap_getterinfo, GenericSetter<NormalThisPolicy>, &wrap_setterinfo),
JSPropertySpec::nativeAccessors("type", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &type_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("defaultValue", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &defaultValue_getterinfo, GenericSetter<NormalThisPolicy>, &defaultValue_setterinfo),
JSPropertySpec::nativeAccessors("value", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &value_getterinfo, GenericSetter<NormalThisPolicy>, &value_setterinfo),
JSPropertySpec::nativeAccessors("textLength", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &textLength_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("willValidate", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &willValidate_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("validity", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &validity_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("validationMessage", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &validationMessage_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("labels", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &labels_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("selectionStart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &selectionStart_getterinfo, GenericSetter<NormalThisPolicy>, &selectionStart_setterinfo),
JSPropertySpec::nativeAccessors("selectionEnd", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &selectionEnd_getterinfo, GenericSetter<NormalThisPolicy>, &selectionEnd_setterinfo),
JSPropertySpec::nativeAccessors("selectionDirection", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &selectionDirection_getterinfo, GenericSetter<NormalThisPolicy>, &selectionDirection_setterinfo),
JS_PS_END
};
static const Prefable<const JSPropertySpec> 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(24 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
"We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
static const JSPropertySpec sChromeAttributes_specs[] = {
JSPropertySpec::nativeAccessors("controllers", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &controllers_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("previewValue", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &previewValue_getterinfo, GenericSetter<NormalThisPolicy>, &previewValue_setterinfo),
JSPropertySpec::nativeAccessors("editor", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &editor_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("hasEditor", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &hasEditor_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("isInputEventTarget", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &isInputEventTarget_getterinfo, nullptr, nullptr),
JS_PS_END
};
static const Prefable<const JSPropertySpec> sChromeAttributes[] = {
{ nullptr, &sChromeAttributes_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(5 <= 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[31];
static PropertyInfo sNativeProperties_propertyInfos[31];
static const NativePropertiesN<2> sNativeProperties = {
false, 0,
false, 0,
true, 0 /* sMethods */,
true, 1 /* sAttributes */,
false, 0,
false, 0,
false, 0,
-1,
31,
sNativeProperties_sortedPropertyIndices,
{
{ sMethods, &sNativeProperties_propertyInfos[0] },
{ sAttributes, &sNativeProperties_propertyInfos[7] }
}
};
static_assert(31 < 1ull << (CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount)),
"We have a property info count that is oversized");
static uint16_t sChromeOnlyNativeProperties_sortedPropertyIndices[5];
static PropertyInfo sChromeOnlyNativeProperties_propertyInfos[5];
static const NativePropertiesN<1> sChromeOnlyNativeProperties = {
false, 0,
false, 0,
false, 0,
true, 0 /* sChromeAttributes */,
false, 0,
false, 0,
false, 0,
-1,
5,
sChromeOnlyNativeProperties_sortedPropertyIndices,
{
{ sChromeAttributes, &sChromeOnlyNativeProperties_propertyInfos[0] }
}
};
static_assert(5 < 1ull << (CHAR_BIT * sizeof(sChromeOnlyNativeProperties.propertyInfoCount)),
"We have a property info count that is oversized");
bool sNativePropertiesInited = false;
const NativePropertyHooks sNativePropertyHooks = {
nullptr,
{ sNativeProperties.Upcast(), sChromeOnlyNativeProperties.Upcast(), &sNativePropertiesInited },
prototypes::id::HTMLTextAreaElement,
constructors::id::HTMLTextAreaElement,
&DefaultXrayExpandoObjectClass
};
static bool
_constructor(JSContext* cx, unsigned argc, JS::Value* vp)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"HTMLTextAreaElement", "constructor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
return HTMLConstructor(cx, argc, vp,
constructors::id::HTMLTextAreaElement,
prototypes::id::HTMLTextAreaElement,
CreateInterfaceObjects);
}
static const DOMInterfaceInfo sInterfaceObjectInfo = {
{ _constructor, &sNativePropertyHooks },
HTMLElement_Binding::GetConstructorObject,
prototypes::id::HTMLTextAreaElement,
PrototypeTraits<prototypes::id::HTMLTextAreaElement>::Depth,
true,
};
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
{
"HTMLTextAreaElementPrototype",
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::HTMLTextAreaElement,
PrototypeTraits<prototypes::id::HTMLTextAreaElement>::Depth,
&sNativePropertyHooks,
HTMLElement_Binding::GetProtoObject
};
bool
CountMaybeMissingProperty(JS::Handle<JSObject*> proxy, JS::Handle<jsid> id)
{
if (HTMLElement_Binding::CountMaybeMissingProperty(proxy, id)) {
return true;
}
return false;
}
static const JSClassOps sClassOps = {
_addProperty, /* addProperty */
nullptr, /* delProperty */
nullptr, /* enumerate */
nullptr, /* newEnumerate */
nullptr, /* resolve */
nullptr, /* mayResolve */
_finalize, /* finalize */
nullptr, /* call */
nullptr, /* construct */
nullptr, /* trace */
};
static const js::ClassExtension sClassExtension = {
_objectMoved /* objectMovedOp */
};
static const DOMJSClass sClass = {
{ "HTMLTextAreaElement",
JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
&sClassOps,
JS_NULL_CLASS_SPEC,
&sClassExtension,
JS_NULL_OBJECT_OPS
},
{ prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::HTMLElement, prototypes::id::HTMLTextAreaElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
std::is_base_of_v<nsISupports, mozilla::dom::HTMLTextAreaElement>,
&sNativePropertyHooks,
FindAssociatedGlobalForNative<mozilla::dom::HTMLTextAreaElement>::Get,
GetProtoObjectHandle,
GetCCParticipant<mozilla::dom::HTMLTextAreaElement>::Get(),
nullptr,
_getWrapperCache
};
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
"Must have the right minimal number of reserved slots.");
static_assert(1 >= 1,
"Must have enough reserved slots.");
bool
Wrap(JSContext* aCx, mozilla::dom::HTMLTextAreaElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
{
static_assert(!std::is_base_of_v<NonRefcountedDOMObject, mozilla::dom::HTMLTextAreaElement>,
"Shouldn't have wrappercached things that are not refcounted.");
static_assert(std::is_same_v<decltype(aObject), mozilla::dom::HTMLTextAreaElement*>);
MOZ_ASSERT(static_cast<nsGenericHTMLElement*>(aObject) ==
reinterpret_cast<nsGenericHTMLElement*>(aObject),
"Multiple inheritance for nsGenericHTMLElement is broken.");
MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) ==
reinterpret_cast<mozilla::dom::Element*>(aObject),
"Multiple inheritance for mozilla::dom::Element is broken.");
MOZ_ASSERT(static_cast<nsINode*>(aObject) ==
reinterpret_cast<nsINode*>(aObject),
"Multiple inheritance for nsINode is broken.");
MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) ==
reinterpret_cast<mozilla::dom::EventTarget*>(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<JSObject*> 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<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
if (!canonicalProto) {
return false;
}
JS::Rooted<JSObject*> 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<mozilla::dom::HTMLTextAreaElement> 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<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
{
JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::HTMLTextAreaElement);
JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::HTMLTextAreaElement);
JS::Handle<JSObject*> parentProto(HTMLElement_Binding::GetProtoObjectHandle(aCx));
if (!parentProto) {
return;
}
JS::Handle<JSObject*> constructorProto(HTMLElement_Binding::GetConstructorObjectHandle(aCx));
if (!constructorProto) {
return;
}
dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
&sPrototypeClass, protoCache,
constructorProto, &sInterfaceObjectInfo, 0, false, Span<const LegacyFactoryFunction, 0>{},
interfaceCache,
sNativeProperties.Upcast(),
sChromeOnlyNativeProperties.Upcast(),
"HTMLTextAreaElement", aDefineOnGlobal,
nullptr,
false,
nullptr);
}
JSObject*
GetConstructorObject(JSContext* aCx)
{
return GetConstructorObjectHandle(aCx);
}
} // namespace HTMLTextAreaElement_Binding
} // namespace mozilla::dom