Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM Document.webidl BY Codegen.py - DO NOT EDIT */
#include <type_traits>
#include "AtomList.h"
#include "DOMPointBinding.h"
#include "Document.h"
#include "DocumentBinding.h"
#include "Event.h"
#include "EventHandlerBinding.h"
#include "EventListenerBinding.h"
#include "FailedCertSecurityInfoBinding.h"
#include "GeometryUtilsBinding.h"
#include "MainThreadUtils.h"
#include "NetErrorInfoBinding.h"
#include "NodeBinding.h"
#include "NodeFilterBinding.h"
#include "WrapperFactory.h"
#include "XPathNSResolverBinding.h"
#include "XrayWrapper.h"
#include "js/Array.h"
#include "js/CallAndConstruct.h"
#include "js/Exception.h"
#include "js/ForOfIterator.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 "jsapi.h"
#include "mozilla/Atomics.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/FloatingPoint.h"
#include "mozilla/OwningNonNull.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/UseCounter.h"
#include "mozilla/dom/Animation.h"
#include "mozilla/dom/AnonymousContent.h"
#include "mozilla/dom/Attr.h"
#include "mozilla/dom/BindingCallContext.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/CDATASection.h"
#include "mozilla/dom/Comment.h"
#include "mozilla/dom/CustomElementRegistry.h"
#include "mozilla/dom/DOMImplementation.h"
#include "mozilla/dom/DOMJSClass.h"
#include "mozilla/dom/DOMPoint.h"
#include "mozilla/dom/DOMQuad.h"
#include "mozilla/dom/DOMRect.h"
#include "mozilla/dom/DOMStringList.h"
#include "mozilla/dom/DocGroup.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/DocumentFragment.h"
#include "mozilla/dom/DocumentL10n.h"
#include "mozilla/dom/DocumentTimeline.h"
#include "mozilla/dom/DocumentType.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/Event.h"
#include "mozilla/dom/EventTarget.h"
#include "mozilla/dom/FeaturePolicy.h"
#include "mozilla/dom/FontFaceSet.h"
#include "mozilla/dom/FragmentDirective.h"
#include "mozilla/dom/HTMLAllCollection.h"
#include "mozilla/dom/HTMLSharedElement.h"
#include "mozilla/dom/Location.h"
#include "mozilla/dom/NodeIterator.h"
#include "mozilla/dom/NonRefcountedDOMObject.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/ObservableArrayProxyHandler.h"
#include "mozilla/dom/PrimitiveConversions.h"
#include "mozilla/dom/ProcessingInstruction.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/SVGSVGElement.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/dom/ShadowRoot.h"
#include "mozilla/dom/SimpleGlobalObject.h"
#include "mozilla/dom/StyleSheetList.h"
#include "mozilla/dom/ToJSValue.h"
#include "mozilla/dom/Touch.h"
#include "mozilla/dom/TouchEvent.h"
#include "mozilla/dom/TreeWalker.h"
#include "mozilla/dom/UnionTypes.h"
#include "mozilla/dom/WebIDLPrefs.h"
#include "mozilla/dom/WindowProxyHolder.h"
#include "mozilla/dom/XPathExpression.h"
#include "mozilla/dom/XPathResult.h"
#include "mozilla/dom/XrayExpandoClass.h"
#include "nsContentList.h"
#include "nsContentUtils.h"
#include "nsDOMCaretPosition.h"
#include "nsGenericHTMLElement.h"
#include "nsGlobalWindowInner.h"
#include "nsIContent.h"
#include "nsIContentSecurityPolicy.h"
#include "nsICookieJarSettings.h"
#include "nsIDOMXULCommandDispatcher.h"
#include "nsILoadGroup.h"
#include "nsINode.h"
#include "nsINodeList.h"
#include "nsIPermissionDelegateHandler.h"
#include "nsIPrincipal.h"
#include "nsIReferrerInfo.h"
#include "nsIURI.h"
#include "nsJSPrincipals.h"
#include "nsRange.h"
#include "nsTextNode.h"
namespace mozilla {
namespace dom {
namespace binding_detail {}; // Just to make sure it's known as a namespace
using namespace mozilla::dom::binding_detail;
namespace binding_detail {
const nsLiteralCString EnumStrings<VisibilityState>::Values[2] = {
"hidden"_ns,
"visible"_ns,
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, VisibilityState aArgument, JS::MutableHandle<JS::Value> aValue)
{
MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(binding_detail::EnumStrings<VisibilityState>::Values));
JSString* resultStr =
JS_NewStringCopyN(aCx, binding_detail::EnumStrings<VisibilityState>::Values[uint32_t(aArgument)].BeginReading(),
binding_detail::EnumStrings<VisibilityState>::Values[uint32_t(aArgument)].Length());
if (!resultStr) {
return false;
}
aValue.setString(resultStr);
return true;
}
namespace binding_detail {
const nsLiteralCString EnumStrings<WireframeRectType>::Values[4] = {
"image"_ns,
"background"_ns,
"text"_ns,
"unknown"_ns,
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, WireframeRectType aArgument, JS::MutableHandle<JS::Value> aValue)
{
MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(binding_detail::EnumStrings<WireframeRectType>::Values));
JSString* resultStr =
JS_NewStringCopyN(aCx, binding_detail::EnumStrings<WireframeRectType>::Values[uint32_t(aArgument)].BeginReading(),
binding_detail::EnumStrings<WireframeRectType>::Values[uint32_t(aArgument)].Length());
if (!resultStr) {
return false;
}
aValue.setString(resultStr);
return true;
}
BlockParsingOptions::BlockParsingOptions()
{
// Safe to pass a null context if we pass a null value
Init(nullptr, JS::NullHandleValue);
}
bool
BlockParsingOptions::InitIds(JSContext* cx, BlockParsingOptionsAtoms* atomsCache)
{
MOZ_ASSERT(reinterpret_cast<jsid*>(atomsCache)->isVoid());
// Initialize these in reverse order so that any failure leaves the first one
// uninitialized.
if (!atomsCache->blockScriptCreated_id.init(cx, "blockScriptCreated")) {
return false;
}
return true;
}
bool
BlockParsingOptions::Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
{
// Passing a null JSContext is OK only if we're initing from null,
// Since in that case we will not have to do any property gets
// Also evaluate isNullOrUndefined in order to avoid false-positive
// checkers by static analysis tools
MOZ_ASSERT_IF(!cx, val.isNull() && val.isNullOrUndefined());
BlockParsingOptionsAtoms* atomsCache = nullptr;
if (cx) {
atomsCache = GetAtomCache<BlockParsingOptionsAtoms>(cx);
if (reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
!InitIds(cx, atomsCache)) {
return false;
}
}
if (!IsConvertibleToDictionary(val)) {
return cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>(sourceDescription, "dictionary");
}
bool isNull = val.isNullOrUndefined();
// We only need these if !isNull, in which case we have |cx|.
Maybe<JS::Rooted<JSObject *> > object;
Maybe<JS::Rooted<JS::Value> > temp;
if (!isNull) {
MOZ_ASSERT(cx);
object.emplace(cx, &val.toObject());
temp.emplace(cx);
}
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->blockScriptCreated_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
if (!ValueToPrimitive<bool, eDefault>(cx, temp.ref(), "'blockScriptCreated' member of BlockParsingOptions", &mBlockScriptCreated)) {
return false;
}
} else {
mBlockScriptCreated = true;
}
mIsAnyMemberPresent = true;
return true;
}
bool
BlockParsingOptions::Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
{
// We don't want to use sourceDescription for our context here;
// that's not really what it's formatted for.
BindingCallContext cx(cx_, nullptr);
return Init(cx, val, sourceDescription, passedToJSImpl);
}
void
BlockParsingOptions::TraceDictionary(JSTracer* trc)
{
}
BlockParsingOptions&
BlockParsingOptions::operator=(const BlockParsingOptions& aOther)
{
DictionaryBase::operator=(aOther);
mBlockScriptCreated = aOther.mBlockScriptCreated;
return *this;
}
bool
BlockParsingOptions::operator==(const BlockParsingOptions& aOther) const
{
if (mBlockScriptCreated != aOther.mBlockScriptCreated) {
return false;
}
return true;
}
ElementCreationOptions::ElementCreationOptions()
{
// Safe to pass a null context if we pass a null value
Init(nullptr, JS::NullHandleValue);
}
bool
ElementCreationOptions::InitIds(JSContext* cx, ElementCreationOptionsAtoms* atomsCache)
{
MOZ_ASSERT(reinterpret_cast<jsid*>(atomsCache)->isVoid());
// Initialize these in reverse order so that any failure leaves the first one
// uninitialized.
if (!atomsCache->pseudo_id.init(cx, "pseudo") ||
!atomsCache->is_id.init(cx, "is")) {
return false;
}
return true;
}
bool
ElementCreationOptions::Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
{
// Passing a null JSContext is OK only if we're initing from null,
// Since in that case we will not have to do any property gets
// Also evaluate isNullOrUndefined in order to avoid false-positive
// checkers by static analysis tools
MOZ_ASSERT_IF(!cx, val.isNull() && val.isNullOrUndefined());
ElementCreationOptionsAtoms* atomsCache = nullptr;
if (cx) {
atomsCache = GetAtomCache<ElementCreationOptionsAtoms>(cx);
if (reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
!InitIds(cx, atomsCache)) {
return false;
}
}
if (!IsConvertibleToDictionary(val)) {
return cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>(sourceDescription, "dictionary");
}
bool isNull = val.isNullOrUndefined();
// We only need these if !isNull, in which case we have |cx|.
Maybe<JS::Rooted<JSObject *> > object;
Maybe<JS::Rooted<JS::Value> > temp;
if (!isNull) {
MOZ_ASSERT(cx);
object.emplace(cx, &val.toObject());
temp.emplace(cx);
}
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->is_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
mIs.Construct();
if (!ConvertJSValueToString(cx, temp.ref(), eStringify, eStringify, (mIs.Value()))) {
return false;
}
mIsAnyMemberPresent = true;
}
if (!isNull) {
if (nsContentUtils::ThreadsafeIsSystemCaller(cx)) {
if (!JS_GetPropertyById(cx, *object, atomsCache->pseudo_id, temp.ptr())) {
return false;
}
} else {
temp->setUndefined();
}
}
if (!isNull && !temp->isUndefined()) {
mPseudo.Construct();
if (!ConvertJSValueToString(cx, temp.ref(), eStringify, eStringify, (mPseudo.Value()))) {
return false;
}
mIsAnyMemberPresent = true;
}
return true;
}
bool
ElementCreationOptions::Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
{
// We don't want to use sourceDescription for our context here;
// that's not really what it's formatted for.
BindingCallContext cx(cx_, nullptr);
return Init(cx, val, sourceDescription, passedToJSImpl);
}
void
ElementCreationOptions::TraceDictionary(JSTracer* trc)
{
}
ElementCreationOptions&
ElementCreationOptions::operator=(const ElementCreationOptions& aOther)
{
DictionaryBase::operator=(aOther);
mIs.Reset();
if (aOther.mIs.WasPassed()) {
mIs.Construct(aOther.mIs.Value());
}
mPseudo.Reset();
if (aOther.mPseudo.WasPassed()) {
mPseudo.Construct(aOther.mPseudo.Value());
}
return *this;
}
bool
ElementCreationOptions::operator==(const ElementCreationOptions& aOther) const
{
if (mIs != aOther.mIs) {
return false;
}
if (mPseudo != aOther.mPseudo) {
return false;
}
return true;
}
WireframeTaggedRect::WireframeTaggedRect()
{
// Safe to pass a null context if we pass a null value
Init(nullptr, JS::NullHandleValue);
}
bool
WireframeTaggedRect::InitIds(JSContext* cx, WireframeTaggedRectAtoms* atomsCache)
{
MOZ_ASSERT(reinterpret_cast<jsid*>(atomsCache)->isVoid());
// Initialize these in reverse order so that any failure leaves the first one
// uninitialized.
if (!atomsCache->y_id.init(cx, "y") ||
!atomsCache->x_id.init(cx, "x") ||
!atomsCache->width_id.init(cx, "width") ||
!atomsCache->type_id.init(cx, "type") ||
!atomsCache->node_id.init(cx, "node") ||
!atomsCache->height_id.init(cx, "height") ||
!atomsCache->color_id.init(cx, "color")) {
return false;
}
return true;
}
bool
WireframeTaggedRect::Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
{
// Passing a null JSContext is OK only if we're initing from null,
// Since in that case we will not have to do any property gets
// Also evaluate isNullOrUndefined in order to avoid false-positive
// checkers by static analysis tools
MOZ_ASSERT_IF(!cx, val.isNull() && val.isNullOrUndefined());
WireframeTaggedRectAtoms* atomsCache = nullptr;
if (cx) {
atomsCache = GetAtomCache<WireframeTaggedRectAtoms>(cx);
if (reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
!InitIds(cx, atomsCache)) {
return false;
}
}
if (!IsConvertibleToDictionary(val)) {
return cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>(sourceDescription, "dictionary");
}
bool isNull = val.isNullOrUndefined();
// We only need these if !isNull, in which case we have |cx|.
Maybe<JS::Rooted<JSObject *> > object;
Maybe<JS::Rooted<JS::Value> > temp;
if (!isNull) {
MOZ_ASSERT(cx);
object.emplace(cx, &val.toObject());
temp.emplace(cx);
}
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->color_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
if (!ValueToPrimitive<uint32_t, eDefault>(cx, temp.ref(), "'color' member of WireframeTaggedRect", &mColor)) {
return false;
}
} else {
mColor = 0U;
}
mIsAnyMemberPresent = true;
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->height_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
if (!ValueToPrimitive<double, eDefault>(cx, temp.ref(), "'height' member of WireframeTaggedRect", &mHeight)) {
return false;
}
} else {
mHeight = 0.0;
}
mIsAnyMemberPresent = true;
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->node_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
mNode.Construct();
if (temp.ref().isObject()) {
static_assert(IsRefcounted<nsINode>::value, "We can only store refcounted classes.");
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(temp.ptr(), (mNode.Value()), cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("'node' member of WireframeTaggedRect", "Node");
return false;
}
}
} else if (temp.ref().isNullOrUndefined()) {
(mNode.Value()) = nullptr;
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("'node' member of WireframeTaggedRect");
return false;
}
mIsAnyMemberPresent = true;
}
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->type_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
mType.Construct();
{
int index;
if (!binding_detail::FindEnumStringIndex<true>(cx, temp.ref(),
binding_detail::EnumStrings<WireframeRectType>::Values,
"WireframeRectType", "'type' member of WireframeTaggedRect",
&index)) {
return false;
}
MOZ_ASSERT(index >= 0);
(mType.Value()) = static_cast<WireframeRectType>(index);
}
mIsAnyMemberPresent = true;
}
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->width_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
if (!ValueToPrimitive<double, eDefault>(cx, temp.ref(), "'width' member of WireframeTaggedRect", &mWidth)) {
return false;
}
} else {
mWidth = 0.0;
}
mIsAnyMemberPresent = true;
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->x_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
if (!ValueToPrimitive<double, eDefault>(cx, temp.ref(), "'x' member of WireframeTaggedRect", &mX)) {
return false;
}
} else {
mX = 0.0;
}
mIsAnyMemberPresent = true;
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->y_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
if (!ValueToPrimitive<double, eDefault>(cx, temp.ref(), "'y' member of WireframeTaggedRect", &mY)) {
return false;
}
} else {
mY = 0.0;
}
mIsAnyMemberPresent = true;
return true;
}
bool
WireframeTaggedRect::Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
{
// We don't want to use sourceDescription for our context here;
// that's not really what it's formatted for.
BindingCallContext cx(cx_, nullptr);
return Init(cx, val, sourceDescription, passedToJSImpl);
}
bool
WireframeTaggedRect::ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const
{
WireframeTaggedRectAtoms* atomsCache = GetAtomCache<WireframeTaggedRectAtoms>(cx);
if (reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
!InitIds(cx, atomsCache)) {
return false;
}
JS::Rooted<JSObject*> obj(cx, JS_NewPlainObject(cx));
if (!obj) {
return false;
}
rval.set(JS::ObjectValue(*obj));
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
uint32_t const & currentValue = mColor;
temp.setNumber(currentValue);
if (!JS_DefinePropertyById(cx, obj, atomsCache->color_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
double const & currentValue = mHeight;
temp.set(JS_NumberValue(double(currentValue)));
if (!JS_DefinePropertyById(cx, obj, atomsCache->height_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
if (mNode.WasPassed()) {
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
RefPtr<nsINode> const & currentValue = mNode.InternalValue();
if (!currentValue) {
temp.setNull();
if (!JS_DefinePropertyById(cx, obj, atomsCache->node_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
}
if (!GetOrCreateDOMReflector(cx, currentValue, &temp)) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
if (!JS_DefinePropertyById(cx, obj, atomsCache->node_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
}
if (mType.WasPassed()) {
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
WireframeRectType const & currentValue = mType.InternalValue();
if (!ToJSValue(cx, currentValue, &temp)) {
return false;
}
if (!JS_DefinePropertyById(cx, obj, atomsCache->type_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
}
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
double const & currentValue = mWidth;
temp.set(JS_NumberValue(double(currentValue)));
if (!JS_DefinePropertyById(cx, obj, atomsCache->width_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
double const & currentValue = mX;
temp.set(JS_NumberValue(double(currentValue)));
if (!JS_DefinePropertyById(cx, obj, atomsCache->x_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
double const & currentValue = mY;
temp.set(JS_NumberValue(double(currentValue)));
if (!JS_DefinePropertyById(cx, obj, atomsCache->y_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
return true;
}
void
WireframeTaggedRect::TraceDictionary(JSTracer* trc)
{
}
WireframeTaggedRect&
WireframeTaggedRect::operator=(const WireframeTaggedRect& aOther)
{
DictionaryBase::operator=(aOther);
mColor = aOther.mColor;
mHeight = aOther.mHeight;
mNode.Reset();
if (aOther.mNode.WasPassed()) {
mNode.Construct(aOther.mNode.Value());
}
mType.Reset();
if (aOther.mType.WasPassed()) {
mType.Construct(aOther.mType.Value());
}
mWidth = aOther.mWidth;
mX = aOther.mX;
mY = aOther.mY;
return *this;
}
bool
ElementCreationOptionsOrString::TrySetToElementCreationOptions(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl)
{
tryNext = false;
{ // scope for memberSlot
binding_detail::FastElementCreationOptions& memberSlot = RawSetAsElementCreationOptions();
if (!IsConvertibleToDictionary(value)) {
DestroyElementCreationOptions();
tryNext = true;
return true;
}
if (!memberSlot.Init(cx, value, "ElementCreationOptions branch of (ElementCreationOptions or DOMString)", passedToJSImpl)) {
return false;
}
}
return true;
}
bool
ElementCreationOptionsOrString::TrySetToElementCreationOptions(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl)
{
BindingCallContext cx(cx_, nullptr);
return TrySetToElementCreationOptions(cx, value, tryNext, passedToJSImpl);
}
bool
ElementCreationOptionsOrString::TrySetToString(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl)
{
tryNext = false;
{ // scope for memberSlot
binding_detail::FakeString<char16_t>& memberSlot = RawSetAsString();
if (!ConvertJSValueToString(cx, value, eStringify, eStringify, memberSlot)) {
return false;
}
}
return true;
}
bool
ElementCreationOptionsOrString::Init(BindingCallContext& cx, JS::Handle<JS::Value> value, const char* sourceDescription, bool passedToJSImpl)
{
MOZ_ASSERT(mType == eUninitialized);
bool done = false, failed = false, tryNext;
if (!done) {
done = (failed = !TrySetToElementCreationOptions(cx, value, tryNext, passedToJSImpl)) || !tryNext;
}
if (!done) {
do {
done = (failed = !TrySetToString(cx, value, tryNext)) || !tryNext;
break;
} while (false);
}
if (failed) {
return false;
}
if (!done) {
cx.ThrowErrorMessage<MSG_NOT_IN_UNION>(sourceDescription, "ElementCreationOptions");
return false;
}
return true;
}
bool
ElementCreationOptionsOrString::Init(JSContext* cx_, JS::Handle<JS::Value> value, const char* sourceDescription, bool passedToJSImpl)
{
BindingCallContext cx(cx_, nullptr);
return Init(cx, value, sourceDescription, passedToJSImpl);
}
OwningElementCreationOptionsOrString::OwningElementCreationOptionsOrString(OwningElementCreationOptionsOrString&& aOther)
: mType(eUninitialized)
{
switch (aOther.mType) {
case eUninitialized: {
MOZ_ASSERT(mType == eUninitialized,
"We need to destroy ourselves?");
break;
}
case eElementCreationOptions: {
mType = eElementCreationOptions;
mValue.mElementCreationOptions.SetValue(std::move(aOther.mValue.mElementCreationOptions.Value()));
break;
}
case eString: {
mType = eString;
mValue.mString.SetValue(std::move(aOther.mValue.mString.Value()));
break;
}
}
}
bool
OwningElementCreationOptionsOrString::TrySetToElementCreationOptions(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl)
{
tryNext = false;
{ // scope for memberSlot
ElementCreationOptions& memberSlot = RawSetAsElementCreationOptions();
if (!IsConvertibleToDictionary(value)) {
DestroyElementCreationOptions();
tryNext = true;
return true;
}
if (!memberSlot.Init(cx, value, "ElementCreationOptions branch of (ElementCreationOptions or DOMString)", passedToJSImpl)) {
return false;
}
}
return true;
}
bool
OwningElementCreationOptionsOrString::TrySetToElementCreationOptions(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl)
{
BindingCallContext cx(cx_, nullptr);
return TrySetToElementCreationOptions(cx, value, tryNext, passedToJSImpl);
}
[[nodiscard]] ElementCreationOptions&
OwningElementCreationOptionsOrString::RawSetAsElementCreationOptions()
{
if (mType == eElementCreationOptions) {
return mValue.mElementCreationOptions.Value();
}
MOZ_ASSERT(mType == eUninitialized);
mType = eElementCreationOptions;
return mValue.mElementCreationOptions.SetValue();
}
[[nodiscard]] ElementCreationOptions&
OwningElementCreationOptionsOrString::SetAsElementCreationOptions()
{
if (mType == eElementCreationOptions) {
return mValue.mElementCreationOptions.Value();
}
Uninit();
mType = eElementCreationOptions;
return mValue.mElementCreationOptions.SetValue();
}
void
OwningElementCreationOptionsOrString::DestroyElementCreationOptions()
{
MOZ_RELEASE_ASSERT(IsElementCreationOptions(), "Wrong type!");
mValue.mElementCreationOptions.Destroy();
mType = eUninitialized;
}
bool
OwningElementCreationOptionsOrString::TrySetToString(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl)
{
tryNext = false;
{ // scope for memberSlot
nsString& memberSlot = RawSetAsString();
if (!ConvertJSValueToString(cx, value, eStringify, eStringify, memberSlot)) {
return false;
}
}
return true;
}
[[nodiscard]] nsString&
OwningElementCreationOptionsOrString::RawSetAsString()
{
if (mType == eString) {
return mValue.mString.Value();
}
MOZ_ASSERT(mType == eUninitialized);
mType = eString;
return mValue.mString.SetValue();
}
[[nodiscard]] nsString&
OwningElementCreationOptionsOrString::SetAsString()
{
if (mType == eString) {
return mValue.mString.Value();
}
Uninit();
mType = eString;
return mValue.mString.SetValue();
}
void
OwningElementCreationOptionsOrString::DestroyString()
{
MOZ_RELEASE_ASSERT(IsString(), "Wrong type!");
mValue.mString.Destroy();
mType = eUninitialized;
}
bool
OwningElementCreationOptionsOrString::Init(BindingCallContext& cx, JS::Handle<JS::Value> value, const char* sourceDescription, bool passedToJSImpl)
{
MOZ_ASSERT(mType == eUninitialized);
bool done = false, failed = false, tryNext;
if (!done) {
done = (failed = !TrySetToElementCreationOptions(cx, value, tryNext, passedToJSImpl)) || !tryNext;
}
if (!done) {
do {
done = (failed = !TrySetToString(cx, value, tryNext)) || !tryNext;
break;
} while (false);
}
if (failed) {
return false;
}
if (!done) {
cx.ThrowErrorMessage<MSG_NOT_IN_UNION>(sourceDescription, "ElementCreationOptions");
return false;
}
return true;
}
bool
OwningElementCreationOptionsOrString::Init(JSContext* cx_, JS::Handle<JS::Value> value, const char* sourceDescription, bool passedToJSImpl)
{
BindingCallContext cx(cx_, nullptr);
return Init(cx, value, sourceDescription, passedToJSImpl);
}
void
OwningElementCreationOptionsOrString::Uninit()
{
switch (mType) {
case eUninitialized: {
break;
}
case eElementCreationOptions: {
DestroyElementCreationOptions();
break;
}
case eString: {
DestroyString();
break;
}
}
}
OwningElementCreationOptionsOrString&
OwningElementCreationOptionsOrString::operator=(OwningElementCreationOptionsOrString&& aOther)
{
this->~OwningElementCreationOptionsOrString();
new (this) OwningElementCreationOptionsOrString (std::move(aOther));
return *this;
}
OwningElementCreationOptionsOrString&
OwningElementCreationOptionsOrString::operator=(const OwningElementCreationOptionsOrString& aOther)
{
switch (aOther.mType) {
case eUninitialized: {
MOZ_ASSERT(mType == eUninitialized,
"We need to destroy ourselves?");
break;
}
case eElementCreationOptions: {
SetAsElementCreationOptions() = aOther.GetAsElementCreationOptions();
break;
}
case eString: {
SetAsString() = aOther.GetAsString();
break;
}
}
return *this;
}
Wireframe::Wireframe()
{
// Safe to pass a null context if we pass a null value
Init(nullptr, JS::NullHandleValue);
}
bool
Wireframe::InitIds(JSContext* cx, WireframeAtoms* atomsCache)
{
MOZ_ASSERT(reinterpret_cast<jsid*>(atomsCache)->isVoid());
// Initialize these in reverse order so that any failure leaves the first one
// uninitialized.
if (!atomsCache->version_id.init(cx, "version") ||
!atomsCache->rects_id.init(cx, "rects") ||
!atomsCache->canvasBackground_id.init(cx, "canvasBackground")) {
return false;
}
return true;
}
bool
Wireframe::Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
{
// Passing a null JSContext is OK only if we're initing from null,
// Since in that case we will not have to do any property gets
// Also evaluate isNullOrUndefined in order to avoid false-positive
// checkers by static analysis tools
MOZ_ASSERT_IF(!cx, val.isNull() && val.isNullOrUndefined());
WireframeAtoms* atomsCache = nullptr;
if (cx) {
atomsCache = GetAtomCache<WireframeAtoms>(cx);
if (reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
!InitIds(cx, atomsCache)) {
return false;
}
}
if (!IsConvertibleToDictionary(val)) {
return cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>(sourceDescription, "dictionary");
}
bool isNull = val.isNullOrUndefined();
// We only need these if !isNull, in which case we have |cx|.
Maybe<JS::Rooted<JSObject *> > object;
Maybe<JS::Rooted<JS::Value> > temp;
if (!isNull) {
MOZ_ASSERT(cx);
object.emplace(cx, &val.toObject());
temp.emplace(cx);
}
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->canvasBackground_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
if (!ValueToPrimitive<uint32_t, eDefault>(cx, temp.ref(), "'canvasBackground' member of Wireframe", &mCanvasBackground)) {
return false;
}
} else {
mCanvasBackground = 0U;
}
mIsAnyMemberPresent = true;
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->rects_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
mRects.Construct();
if (temp.ref().isObject()) {
JS::ForOfIterator iter(cx);
if (!iter.init(temp.ref(), JS::ForOfIterator::AllowNonIterable)) {
return false;
}
if (!iter.valueIsIterable()) {
cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("'rects' member of Wireframe", "sequence");
return false;
}
Sequence<WireframeTaggedRect> &arr = (mRects.Value());
JS::Rooted<JS::Value> temp(cx);
while (true) {
bool done;
if (!iter.next(&temp, &done)) {
return false;
}
if (done) {
break;
}
WireframeTaggedRect* slotPtr = arr.AppendElement(mozilla::fallible);
if (!slotPtr) {
JS_ReportOutOfMemory(cx);
return false;
}
WireframeTaggedRect& slot = *slotPtr;
if (!slot.Init(cx, temp, "Element of 'rects' member of Wireframe", passedToJSImpl)) {
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("'rects' member of Wireframe", "sequence");
return false;
}
mIsAnyMemberPresent = true;
}
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->version_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
if (!ValueToPrimitive<uint32_t, eDefault>(cx, temp.ref(), "'version' member of Wireframe", &mVersion)) {
return false;
}
} else {
mVersion = 1U;
}
mIsAnyMemberPresent = true;
return true;
}
bool
Wireframe::Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
{
// We don't want to use sourceDescription for our context here;
// that's not really what it's formatted for.
BindingCallContext cx(cx_, nullptr);
return Init(cx, val, sourceDescription, passedToJSImpl);
}
bool
Wireframe::ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const
{
WireframeAtoms* atomsCache = GetAtomCache<WireframeAtoms>(cx);
if (reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
!InitIds(cx, atomsCache)) {
return false;
}
JS::Rooted<JSObject*> obj(cx, JS_NewPlainObject(cx));
if (!obj) {
return false;
}
rval.set(JS::ObjectValue(*obj));
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
uint32_t const & currentValue = mCanvasBackground;
temp.setNumber(currentValue);
if (!JS_DefinePropertyById(cx, obj, atomsCache->canvasBackground_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
if (mRects.WasPassed()) {
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
Sequence<WireframeTaggedRect> const & currentValue = mRects.InternalValue();
uint32_t length = currentValue.Length();
JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
if (!returnArray) {
return false;
}
// Scope for 'tmp'
{
JS::Rooted<JS::Value> tmp(cx);
for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
// Control block to let us common up the JS_DefineElement calls when there
// are different ways to succeed at wrapping the object.
do {
if (!currentValue[sequenceIdx0].ToObjectInternal(cx, &tmp)) {
return false;
}
break;
} while (false);
if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
JSPROP_ENUMERATE)) {
return false;
}
}
}
temp.setObject(*returnArray);
if (!JS_DefinePropertyById(cx, obj, atomsCache->rects_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
}
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
uint32_t const & currentValue = mVersion;
temp.setNumber(currentValue);
if (!JS_DefinePropertyById(cx, obj, atomsCache->version_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
return true;
}
void
Wireframe::TraceDictionary(JSTracer* trc)
{
}
Wireframe&
Wireframe::operator=(const Wireframe& aOther)
{
DictionaryBase::operator=(aOther);
mCanvasBackground = aOther.mCanvasBackground;
mRects.Reset();
if (aOther.mRects.WasPassed()) {
mRects.Construct(aOther.mRects.Value());
}
mVersion = aOther.mVersion;
return *this;
}
namespace Document_Binding {
static_assert(IsRefcounted<NativeType>::value == IsRefcounted<Node_Binding::NativeType>::value,
"Can't inherit from an interface with a different ownership model.");
MOZ_CAN_RUN_SCRIPT static bool
get_implementation(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "implementation", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::DOMImplementation>(MOZ_KnownLive(self)->GetImplementation(rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.implementation getter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo implementation_getterinfo = {
{ get_implementation },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_URL(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "URL", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetDocumentURIFromJS(result, nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->GetDocumentURIFromJS(result, nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.URL getter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo URL_getterinfo = {
{ get_URL },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_documentURI(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "documentURI", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetDocumentURIFromJS(result, nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->GetDocumentURIFromJS(result, nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.documentURI getter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo documentURI_getterinfo = {
{ get_documentURI },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_compatMode(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "compatMode", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetCompatMode(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetCompatMode(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo compatMode_getterinfo = {
{ get_compatMode },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_characterSet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "characterSet", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetCharacterSet(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetCharacterSet(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo characterSet_getterinfo = {
{ get_characterSet },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_charset(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "charset", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetCharacterSet(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetCharacterSet(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo charset_getterinfo = {
{ get_charset },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_inputEncoding(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "inputEncoding", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetCharacterSet(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetCharacterSet(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo inputEncoding_getterinfo = {
{ get_inputEncoding },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_contentType(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "contentType", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetContentType(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetContentType(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo contentType_getterinfo = {
{ get_contentType },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_doctype(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "doctype", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::DocumentType>(MOZ_KnownLive(self)->GetDoctype()));
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 doctype_getterinfo = {
{ get_doctype },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_documentElement(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "documentElement", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->GetDocumentElement()));
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 documentElement_getterinfo = {
{ get_documentElement },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
getElementsByTagName(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getElementsByTagName", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.getElementsByTagName", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->GetElementsByTagName(NonNullHelper(Constify(arg0)))));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo::ArgType getElementsByTagName_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
static const JSTypedMethodJitInfo getElementsByTagName_methodinfo = {
{
{ (JSJitGetterOp)getElementsByTagName },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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. */
true, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
},
getElementsByTagName_methodinfo_argTypes
};
MOZ_CAN_RUN_SCRIPT static bool
getElementsByTagNameNS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getElementsByTagNameNS", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.getElementsByTagNameNS", 2)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
return false;
}
binding_detail::FakeString<char16_t> arg1;
if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->GetElementsByTagNameNS(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.getElementsByTagNameNS"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo::ArgType getElementsByTagNameNS_methodinfo_argTypes[] = { JSJitInfo::ArgType(JSJitInfo::Null | JSJitInfo::String), JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
static const JSTypedMethodJitInfo getElementsByTagNameNS_methodinfo = {
{
{ (JSJitGetterOp)getElementsByTagNameNS },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasDOMSets, /* 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. */
true, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
},
getElementsByTagNameNS_methodinfo_argTypes
};
MOZ_CAN_RUN_SCRIPT static bool
getElementsByClassName(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getElementsByClassName", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.getElementsByClassName", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->GetElementsByClassName(NonNullHelper(Constify(arg0)))));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo::ArgType getElementsByClassName_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
static const JSTypedMethodJitInfo getElementsByClassName_methodinfo = {
{
{ (JSJitGetterOp)getElementsByClassName },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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. */
true, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
},
getElementsByClassName_methodinfo_argTypes
};
MOZ_CAN_RUN_SCRIPT static bool
createElement(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.createElement");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createElement", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createElement", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
ElementCreationOptionsOrString arg1;
if (!(args.hasDefined(1))) {
if (!arg1.RawSetAsElementCreationOptions().Init(cx, JS::NullHandleValue, "Member of (ElementCreationOptions or DOMString)")) {
return false;
}
} else {
if (!arg1.Init(cx, args[1], "Argument 2", false)) {
return false;
}
}
Maybe<AutoCEReaction> ceReaction;
DocGroup* docGroup = self->GetDocGroup();
if (docGroup) {
ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->CreateElement(NonNullHelper(Constify(arg0)), Constify(arg1), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.createElement"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createElement_methodinfo = {
{ (JSJitGetterOp)createElement },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createElementNS(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.createElementNS");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createElementNS", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createElementNS", 2)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
return false;
}
binding_detail::FakeString<char16_t> arg1;
if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
return false;
}
ElementCreationOptionsOrString arg2;
if (!(args.hasDefined(2))) {
if (!arg2.RawSetAsElementCreationOptions().Init(cx, JS::NullHandleValue, "Member of (ElementCreationOptions or DOMString)")) {
return false;
}
} else {
if (!arg2.Init(cx, args[2], "Argument 3", false)) {
return false;
}
}
Maybe<AutoCEReaction> ceReaction;
DocGroup* docGroup = self->GetDocGroup();
if (docGroup) {
ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->CreateElementNS(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), Constify(arg2), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.createElementNS"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createElementNS_methodinfo = {
{ (JSJitGetterOp)createElementNS },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createDocumentFragment(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createDocumentFragment", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::DocumentFragment>(MOZ_KnownLive(self)->CreateDocumentFragment()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createDocumentFragment_methodinfo = {
{ (JSJitGetterOp)createDocumentFragment },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createTextNode(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createTextNode", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createTextNode", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
auto result(StrongOrRawPtr<mozilla::dom::Text>(MOZ_KnownLive(self)->CreateTextNode(NonNullHelper(Constify(arg0)))));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createTextNode_methodinfo = {
{ (JSJitGetterOp)createTextNode },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createComment(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createComment", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createComment", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
auto result(StrongOrRawPtr<mozilla::dom::Comment>(MOZ_KnownLive(self)->CreateComment(NonNullHelper(Constify(arg0)))));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createComment_methodinfo = {
{ (JSJitGetterOp)createComment },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createProcessingInstruction(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createProcessingInstruction", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createProcessingInstruction", 2)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
binding_detail::FakeString<char16_t> arg1;
if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::ProcessingInstruction>(MOZ_KnownLive(self)->CreateProcessingInstruction(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.createProcessingInstruction"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createProcessingInstruction_methodinfo = {
{ (JSJitGetterOp)createProcessingInstruction },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
importNode(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.importNode");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "importNode", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.importNode", 1)) {
return false;
}
NonNull<nsINode> arg0;
if (args[0].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Node");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
return false;
}
bool arg1;
if (args.hasDefined(1)) {
if (!ValueToPrimitive<bool, eDefault>(cx, args[1], "Argument 2", &arg1)) {
return false;
}
} else {
arg1 = false;
}
Maybe<AutoCEReaction> ceReaction;
DocGroup* docGroup = self->GetDocGroup();
if (docGroup) {
ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
}
FastErrorResult rv;
auto result(StrongOrRawPtr<nsINode>(MOZ_KnownLive(self)->ImportNode(MOZ_KnownLive(NonNullHelper(arg0)), arg1, rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.importNode"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo importNode_methodinfo = {
{ (JSJitGetterOp)importNode },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
adoptNode(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.adoptNode");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "adoptNode", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.adoptNode", 1)) {
return false;
}
NonNull<nsINode> arg0;
if (args[0].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Node");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
return false;
}
Maybe<AutoCEReaction> ceReaction;
DocGroup* docGroup = self->GetDocGroup();
if (docGroup) {
ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
}
FastErrorResult rv;
auto result(StrongOrRawPtr<nsINode>(MOZ_KnownLive(self)->AdoptNode(MOZ_KnownLive(NonNullHelper(arg0)), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.adoptNode"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo adoptNode_methodinfo = {
{ (JSJitGetterOp)adoptNode },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createEvent(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createEvent", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createEvent", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::Event>(MOZ_KnownLive(self)->CreateEvent(NonNullHelper(Constify(arg0)), nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.createEvent"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createEvent_methodinfo = {
{ (JSJitGetterOp)createEvent },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createRange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createRange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
auto result(StrongOrRawPtr<nsRange>(MOZ_KnownLive(self)->CreateRange(rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.createRange"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createRange_methodinfo = {
{ (JSJitGetterOp)createRange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createNodeIterator(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.createNodeIterator");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createNodeIterator", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createNodeIterator", 1)) {
return false;
}
NonNull<nsINode> arg0;
if (args[0].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Node");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
return false;
}
uint32_t arg1;
if (args.hasDefined(1)) {
if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
return false;
}
} else {
arg1 = 4294967295U;
}
RootedCallback<RefPtr<binding_detail::FastNodeFilter>> arg2(cx);
if (args.hasDefined(2)) {
if (args[2].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg2 = new binding_detail::FastNodeFilter(&args[2].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else if (args[2].isNullOrUndefined()) {
arg2 = nullptr;
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 3");
return false;
}
} else {
arg2 = nullptr;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::NodeIterator>(MOZ_KnownLive(self)->CreateNodeIterator(MOZ_KnownLive(NonNullHelper(arg0)), arg1, MOZ_KnownLive(Constify(arg2)), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.createNodeIterator"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createNodeIterator_methodinfo = {
{ (JSJitGetterOp)createNodeIterator },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createTreeWalker(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.createTreeWalker");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createTreeWalker", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createTreeWalker", 1)) {
return false;
}
NonNull<nsINode> arg0;
if (args[0].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Node");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
return false;
}
uint32_t arg1;
if (args.hasDefined(1)) {
if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
return false;
}
} else {
arg1 = 4294967295U;
}
RootedCallback<RefPtr<binding_detail::FastNodeFilter>> arg2(cx);
if (args.hasDefined(2)) {
if (args[2].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg2 = new binding_detail::FastNodeFilter(&args[2].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else if (args[2].isNullOrUndefined()) {
arg2 = nullptr;
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 3");
return false;
}
} else {
arg2 = nullptr;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::TreeWalker>(MOZ_KnownLive(self)->CreateTreeWalker(MOZ_KnownLive(NonNullHelper(arg0)), arg1, MOZ_KnownLive(Constify(arg2)), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.createTreeWalker"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createTreeWalker_methodinfo = {
{ (JSJitGetterOp)createTreeWalker },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createCDATASection(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createCDATASection", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createCDATASection", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::CDATASection>(MOZ_KnownLive(self)->CreateCDATASection(NonNullHelper(Constify(arg0)), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.createCDATASection"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createCDATASection_methodinfo = {
{ (JSJitGetterOp)createCDATASection },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createAttribute", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createAttribute", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::Attr>(MOZ_KnownLive(self)->CreateAttribute(NonNullHelper(Constify(arg0)), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.createAttribute"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createAttribute_methodinfo = {
{ (JSJitGetterOp)createAttribute },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createAttributeNS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createAttributeNS", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createAttributeNS", 2)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
return false;
}
binding_detail::FakeString<char16_t> arg1;
if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::Attr>(MOZ_KnownLive(self)->CreateAttributeNS(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.createAttributeNS"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createAttributeNS_methodinfo = {
{ (JSJitGetterOp)createAttributeNS },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
parseHTMLUnsafe(JSContext* cx, unsigned argc, JS::Value* vp)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "parseHTMLUnsafe", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::Rooted<JSObject*> obj(cx, &args.callee());
if (!args.requireAtLeast(cx, "Document.parseHTMLUnsafe", 1)) {
return false;
}
GlobalObject global(cx, xpc::XrayAwareCalleeGlobal(obj));
if (global.Failed()) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
auto result(StrongOrRawPtr<mozilla::dom::Document>(mozilla::dom::Document::ParseHTMLUnsafe(global, NonNullHelper(Constify(arg0)))));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
get_location(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "location", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::Location>(MOZ_KnownLive(self)->GetLocation()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!result) {
args.rval().setNull();
return true;
}
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_location(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
BindingCallContext cx(cx_, "Document.location setter");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "location", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
JS::Rooted<JS::Value> v(cx);
if (!JS_GetProperty(cx, obj, "location", &v)) {
return false;
}
if (!v.isObject()) {
return cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Document.location");
}
JS::Rooted<JSObject*> targetObj(cx, &v.toObject());
return JS_SetProperty(cx, targetObj, "href", args[0]);
}
static const JSJitInfo location_getterinfo = {
{ get_location },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 location_setterinfo = {
{ (JSJitGetterOp)set_location },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_domain(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "domain", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetDomain(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetDomain(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_domain(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "domain", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
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)->SetDomain(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetDomain(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.domain setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo domain_getterinfo = {
{ get_domain },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 domain_setterinfo = {
{ (JSJitGetterOp)set_domain },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_referrer(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "referrer", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
nsAutoCString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetReferrer(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetReferrer(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!NonVoidUTF8StringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo referrer_getterinfo = {
{ get_referrer },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_cookie(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "cookie", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetCookie(result, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->GetCookie(result, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.cookie 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_cookie(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "cookie", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
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)->SetCookie(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetCookie(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.cookie setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo cookie_getterinfo = {
{ get_cookie },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 cookie_setterinfo = {
{ (JSJitGetterOp)set_cookie },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_lastModified(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "lastModified", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetLastModified(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetLastModified(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo lastModified_getterinfo = {
{ get_lastModified },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_readyState(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "readyState", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetReadyState(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetReadyState(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo readyState_getterinfo = {
{ get_readyState },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_title(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "title", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetTitle(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetTitle(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_title(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "title", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(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)->SetTitle(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetTitle(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.title setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo title_getterinfo = {
{ get_title },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 title_setterinfo = {
{ (JSJitGetterOp)set_title },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_dir(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "dir", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetDir(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetDir(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_dir(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "dir", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(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);
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetDir(NonNullHelper(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetDir(NonNullHelper(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo dir_getterinfo = {
{ get_dir },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 dir_setterinfo = {
{ (JSJitGetterOp)set_dir },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_body(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "body", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsGenericHTMLElement>(MOZ_KnownLive(self)->GetBody()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!result) {
args.rval().setNull();
return true;
}
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_body(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
BindingCallContext cx(cx_, "Document.body setter");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "body", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
nsGenericHTMLElement* arg0;
if (args[0].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::HTMLElement, nsGenericHTMLElement>(args[0], arg0, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "HTMLElement");
return false;
}
}
} else if (args[0].isNullOrUndefined()) {
arg0 = nullptr;
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
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)->SetBody(MOZ_KnownLive(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetBody(MOZ_KnownLive(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.body setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo body_getterinfo = {
{ get_body },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
static const JSJitInfo body_setterinfo = {
{ (JSJitGetterOp)set_body },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_head(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "head", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::HTMLSharedElement>(MOZ_KnownLive(self)->GetHead()));
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 head_getterinfo = {
{ get_head },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_images(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "images", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->Images()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo images_getterinfo = {
{ get_images },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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_embeds(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "embeds", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->Embeds()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo embeds_getterinfo = {
{ get_embeds },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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_plugins(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "plugins", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->Plugins()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo plugins_getterinfo = {
{ get_plugins },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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_links(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "links", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->Links()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo links_getterinfo = {
{ get_links },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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_forms(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "forms", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->Forms()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo forms_getterinfo = {
{ get_forms },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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_scripts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "scripts", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->Scripts()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo scripts_getterinfo = {
{ get_scripts },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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
getElementsByName(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getElementsByName", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.getElementsByName", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
auto result(StrongOrRawPtr<nsINodeList>(MOZ_KnownLive(self)->GetElementsByName(NonNullHelper(Constify(arg0)))));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo::ArgType getElementsByName_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
static const JSTypedMethodJitInfo getElementsByName_methodinfo = {
{
{ (JSJitGetterOp)getElementsByName },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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. */
true, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
},
getElementsByName_methodinfo_argTypes
};
MOZ_CAN_RUN_SCRIPT static bool
open(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.open");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "open", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
unsigned argcount = std::min(args.length(), 3u);
switch (argcount) {
case 0: {
[[fallthrough]];
}
case 1: {
[[fallthrough]];
}
case 2: {
Optional<nsAString> arg0;
binding_detail::FakeString<char16_t> arg0_holder;
if (args.hasDefined(0)) {
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0_holder)) {
return false;
}
arg0 = &arg0_holder;
}
Optional<nsAString> arg1;
binding_detail::FakeString<char16_t> arg1_holder;
if (args.hasDefined(1)) {
if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1_holder)) {
return false;
}
arg1 = &arg1_holder;
}
Maybe<AutoCEReaction> ceReaction;
DocGroup* docGroup = self->GetDocGroup();
if (docGroup) {
ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::Document>(MOZ_KnownLive(self)->Open(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.open"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
break;
}
case 3: {
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
if (!NormalizeUSVString(arg0)) {
JS_ReportOutOfMemory(cx);
return false;
}
binding_detail::FakeString<char16_t> arg1;
if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
return false;
}
binding_detail::FakeString<char16_t> arg2;
if (!ConvertJSValueToString(cx, args[2], eStringify, eStringify, arg2)) {
return false;
}
Maybe<AutoCEReaction> ceReaction;
DocGroup* docGroup = self->GetDocGroup();
if (docGroup) {
ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
}
FastErrorResult rv;
Nullable<WindowProxyHolder> result(MOZ_KnownLive(self)->Open(Constify(arg0), NonNullHelper(Constify(arg1)), NonNullHelper(Constify(arg2)), rv));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.open"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result.IsNull()) {
args.rval().setNull();
return true;
}
if (!WrapObject(cx, result.Value(), args.rval())) {
return false;
}
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 open_methodinfo = {
{ (JSJitGetterOp)open },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
close(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "close", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
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)->Close(rv))>, "Should be returning void here");
MOZ_KnownLive(self)->Close(rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.close"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo close_methodinfo = {
{ (JSJitGetterOp)close },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
write(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "write", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
AutoSequence<nsString> arg0;
if (args.length() > 0) {
if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
JS_ReportOutOfMemory(cx);
return false;
}
for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
// OK to do infallible append here, since we ensured capacity already.
nsString& slot = *arg0.AppendElement();
if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) {
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)->Write(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->Write(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.write"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo write_methodinfo = {
{ (JSJitGetterOp)write },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
writeln(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "writeln", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
AutoSequence<nsString> arg0;
if (args.length() > 0) {
if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
JS_ReportOutOfMemory(cx);
return false;
}
for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
// OK to do infallible append here, since we ensured capacity already.
nsString& slot = *arg0.AppendElement();
if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) {
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)->Writeln(NonNullHelper(Constify(arg0)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->Writeln(NonNullHelper(Constify(arg0)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.writeln"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo writeln_methodinfo = {
{ (JSJitGetterOp)writeln },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_defaultView(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "defaultView", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
Nullable<WindowProxyHolder> result(MOZ_KnownLive(self)->GetDefaultView());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result.IsNull()) {
args.rval().setNull();
return true;
}
if (!WrapObject(cx, result.Value(), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo defaultView_getterinfo = {
{ get_defaultView },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
hasFocus(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "hasFocus", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
bool result(MOZ_KnownLive(self)->HasFocus(rv));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.hasFocus"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo hasFocus_methodinfo = {
{ (JSJitGetterOp)hasFocus },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_BOOLEAN, /* 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_designMode(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "designMode", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetDesignMode(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetDesignMode(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_designMode(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "designMode", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(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;
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)->SetDesignMode(NonNullHelper(Constify(arg0)), MOZ_KnownLive(NonNullHelper(subjectPrincipal)), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->SetDesignMode(NonNullHelper(Constify(arg0)), MOZ_KnownLive(NonNullHelper(subjectPrincipal)), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.designMode setter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo designMode_getterinfo = {
{ get_designMode },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 designMode_setterinfo = {
{ (JSJitGetterOp)set_designMode },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
execCommand(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "execCommand", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.execCommand", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
bool arg1;
if (args.hasDefined(1)) {
if (!ValueToPrimitive<bool, eDefault>(cx, args[1], "Argument 2", &arg1)) {
return false;
}
} else {
arg1 = false;
}
binding_detail::FakeString<char16_t> arg2;
if (args.hasDefined(2)) {
if (!ConvertJSValueToString(cx, args[2], eStringify, eStringify, arg2)) {
return false;
}
} else {
arg2.AssignLiteral(u"");
}
Maybe<AutoCEReaction> ceReaction;
DocGroup* docGroup = self->GetDocGroup();
if (docGroup) {
ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
}
FastErrorResult rv;
NonNull<nsIPrincipal> subjectPrincipal;
{
JS::Realm* realm = js::GetContextRealm(cx);
MOZ_ASSERT(realm);
JSPrincipals* principals = JS::GetRealmPrincipals(realm);
nsIPrincipal* principal = nsJSPrincipals::get(principals);
subjectPrincipal = principal;
}
bool result(MOZ_KnownLive(self)->ExecCommand(NonNullHelper(Constify(arg0)), arg1, NonNullHelper(Constify(arg2)), MOZ_KnownLive(NonNullHelper(subjectPrincipal)), rv));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.execCommand"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo execCommand_methodinfo = {
{ (JSJitGetterOp)execCommand },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_BOOLEAN, /* 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
queryCommandEnabled(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "queryCommandEnabled", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.queryCommandEnabled", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
FastErrorResult rv;
NonNull<nsIPrincipal> subjectPrincipal;
{
JS::Realm* realm = js::GetContextRealm(cx);
MOZ_ASSERT(realm);
JSPrincipals* principals = JS::GetRealmPrincipals(realm);
nsIPrincipal* principal = nsJSPrincipals::get(principals);
subjectPrincipal = principal;
}
bool result(MOZ_KnownLive(self)->QueryCommandEnabled(NonNullHelper(Constify(arg0)), MOZ_KnownLive(NonNullHelper(subjectPrincipal)), rv));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.queryCommandEnabled"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo queryCommandEnabled_methodinfo = {
{ (JSJitGetterOp)queryCommandEnabled },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_BOOLEAN, /* 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
queryCommandIndeterm(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "queryCommandIndeterm", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.queryCommandIndeterm", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
FastErrorResult rv;
bool result(MOZ_KnownLive(self)->QueryCommandIndeterm(NonNullHelper(Constify(arg0)), rv));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.queryCommandIndeterm"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo queryCommandIndeterm_methodinfo = {
{ (JSJitGetterOp)queryCommandIndeterm },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_BOOLEAN, /* 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
queryCommandState(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "queryCommandState", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.queryCommandState", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
FastErrorResult rv;
bool result(MOZ_KnownLive(self)->QueryCommandState(NonNullHelper(Constify(arg0)), rv));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.queryCommandState"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo queryCommandState_methodinfo = {
{ (JSJitGetterOp)queryCommandState },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_BOOLEAN, /* 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
queryCommandSupported(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "queryCommandSupported", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.queryCommandSupported", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
FastErrorResult rv;
bool result(MOZ_KnownLive(self)->QueryCommandSupported(NonNullHelper(Constify(arg0)), nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.queryCommandSupported"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo queryCommandSupported_methodinfo = {
{ (JSJitGetterOp)queryCommandSupported },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_BOOLEAN, /* 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
queryCommandValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "queryCommandValue", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.queryCommandValue", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
FastErrorResult rv;
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->QueryCommandValue(NonNullHelper(Constify(arg0)), result, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->QueryCommandValue(NonNullHelper(Constify(arg0)), result, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.queryCommandValue"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo queryCommandValue_methodinfo = {
{ (JSJitGetterOp)queryCommandValue },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_onreadystatechange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onreadystatechange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnreadystatechange());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onreadystatechange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onreadystatechange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnreadystatechange(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnreadystatechange(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onreadystatechange_getterinfo = {
{ get_onreadystatechange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onreadystatechange_setterinfo = {
{ (JSJitGetterOp)set_onreadystatechange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onbeforescriptexecute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onbeforescriptexecute", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnbeforescriptexecute());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onbeforescriptexecute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onbeforescriptexecute", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnbeforescriptexecute(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnbeforescriptexecute(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onbeforescriptexecute_getterinfo = {
{ get_onbeforescriptexecute },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onbeforescriptexecute_setterinfo = {
{ (JSJitGetterOp)set_onbeforescriptexecute },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onafterscriptexecute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onafterscriptexecute", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnafterscriptexecute());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onafterscriptexecute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onafterscriptexecute", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnafterscriptexecute(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnafterscriptexecute(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onafterscriptexecute_getterinfo = {
{ get_onafterscriptexecute },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onafterscriptexecute_setterinfo = {
{ (JSJitGetterOp)set_onafterscriptexecute },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_mozSyntheticDocument(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "mozSyntheticDocument", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->MozSyntheticDocument());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo mozSyntheticDocument_getterinfo = {
{ get_mozSyntheticDocument },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_currentScript(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "currentScript", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->GetCurrentScript()));
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 currentScript_getterinfo = {
{ get_currentScript },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
releaseCapture(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "releaseCapture", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DeprecationWarning(cx, obj, DeprecatedOperations::eDocumentReleaseCapture);
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->ReleaseCapture())>, "Should be returning void here");
MOZ_KnownLive(self)->ReleaseCapture();
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo releaseCapture_methodinfo = {
{ (JSJitGetterOp)releaseCapture },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
mozSetImageElement(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.mozSetImageElement");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "mozSetImageElement", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.mozSetImageElement", 2)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
mozilla::dom::Element* arg1;
if (args[1].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Element, mozilla::dom::Element>(args[1], arg1, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 2", "Element");
return false;
}
}
} else if (args[1].isNullOrUndefined()) {
arg1 = nullptr;
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->MozSetImageElement(NonNullHelper(Constify(arg0)), MOZ_KnownLive(Constify(arg1))))>, "Should be returning void here");
MOZ_KnownLive(self)->MozSetImageElement(NonNullHelper(Constify(arg0)), MOZ_KnownLive(Constify(arg1)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
SetUseCounter(obj, eUseCounter_Document_mozSetImageElement);
args.rval().setUndefined();
return true;
}
static const JSJitInfo mozSetImageElement_methodinfo = {
{ (JSJitGetterOp)mozSetImageElement },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_documentURIObject(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "documentURIObject", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIURI>(MOZ_KnownLive(self)->GetDocumentURIObject()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!result) {
args.rval().setNull();
return true;
}
if (!WrapObject(cx, result, &NS_GET_IID(nsIURI), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo documentURIObject_getterinfo = {
{ get_documentURIObject },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_referrerPolicy(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "referrerPolicy", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
ReferrerPolicy result(MOZ_KnownLive(self)->ReferrerPolicy());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!ToJSValue(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo referrerPolicy_getterinfo = {
{ get_referrerPolicy },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_referrerInfo(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "referrerInfo", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIReferrerInfo>(MOZ_KnownLive(self)->ReferrerInfo()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!WrapObject(cx, result, &NS_GET_IID(nsIReferrerInfo), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo referrerInfo_getterinfo = {
{ get_referrerInfo },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_fgColor(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "fgColor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetFgColor(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetFgColor(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_fgColor(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "fgColor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(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);
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetFgColor(NonNullHelper(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetFgColor(NonNullHelper(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo fgColor_getterinfo = {
{ get_fgColor },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 fgColor_setterinfo = {
{ (JSJitGetterOp)set_fgColor },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_linkColor(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "linkColor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetLinkColor(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetLinkColor(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_linkColor(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "linkColor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(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);
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetLinkColor(NonNullHelper(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetLinkColor(NonNullHelper(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo linkColor_getterinfo = {
{ get_linkColor },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 linkColor_setterinfo = {
{ (JSJitGetterOp)set_linkColor },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_vlinkColor(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "vlinkColor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetVlinkColor(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetVlinkColor(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_vlinkColor(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "vlinkColor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(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);
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetVlinkColor(NonNullHelper(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetVlinkColor(NonNullHelper(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo vlinkColor_getterinfo = {
{ get_vlinkColor },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 vlinkColor_setterinfo = {
{ (JSJitGetterOp)set_vlinkColor },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_alinkColor(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "alinkColor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetAlinkColor(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetAlinkColor(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_alinkColor(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "alinkColor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(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);
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetAlinkColor(NonNullHelper(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetAlinkColor(NonNullHelper(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo alinkColor_getterinfo = {
{ get_alinkColor },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 alinkColor_setterinfo = {
{ (JSJitGetterOp)set_alinkColor },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Setter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_bgColor(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "bgColor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetBgColor(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetBgColor(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_bgColor(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "bgColor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(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);
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetBgColor(NonNullHelper(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetBgColor(NonNullHelper(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo bgColor_getterinfo = {
{ get_bgColor },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
static const JSJitInfo bgColor_setterinfo = {
{ (JSJitGetterOp)set_bgColor },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_anchors(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "anchors", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->Anchors()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo anchors_getterinfo = {
{ get_anchors },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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_applets(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "applets", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->Applets()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo applets_getterinfo = {
{ get_applets },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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
clear(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "clear", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->Clear())>, "Should be returning void here");
MOZ_KnownLive(self)->Clear();
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo clear_methodinfo = {
{ (JSJitGetterOp)clear },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
captureEvents(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "captureEvents", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->CaptureEvents())>, "Should be returning void here");
MOZ_KnownLive(self)->CaptureEvents();
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo captureEvents_methodinfo = {
{ (JSJitGetterOp)captureEvents },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
releaseEvents(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "releaseEvents", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->ReleaseEvents())>, "Should be returning void here");
MOZ_KnownLive(self)->ReleaseEvents();
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo releaseEvents_methodinfo = {
{ (JSJitGetterOp)releaseEvents },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_all(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "all", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::HTMLAllCollection>(MOZ_KnownLive(self)->All()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo all_getterinfo = {
{ get_all },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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_fullscreen(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "fullscreen", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->Fullscreen());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_fullscreen(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "fullscreen", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
DeprecationWarning(cx, obj, DeprecatedOperations::eLenientSetter);
return true;
}
static const JSJitInfo fullscreen_getterinfo = {
{ get_fullscreen },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
static const JSJitInfo fullscreen_setterinfo = {
{ (JSJitGetterOp)set_fullscreen },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_mozFullScreen(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "mozFullScreen", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->Fullscreen());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo mozFullScreen_getterinfo = {
{ get_mozFullScreen },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_fullscreenEnabled(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "fullscreenEnabled", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->FullscreenEnabled(nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_fullscreenEnabled(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "fullscreenEnabled", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
DeprecationWarning(cx, obj, DeprecatedOperations::eLenientSetter);
return true;
}
static const JSJitInfo fullscreenEnabled_getterinfo = {
{ get_fullscreenEnabled },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
static const JSJitInfo fullscreenEnabled_setterinfo = {
{ (JSJitGetterOp)set_fullscreenEnabled },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_mozFullScreenEnabled(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "mozFullScreenEnabled", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->FullscreenEnabled(nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo mozFullScreenEnabled_getterinfo = {
{ get_mozFullScreenEnabled },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
exitFullscreen(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "exitFullscreen", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)->ExitFullscreen(rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.exitFullscreen"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!ToJSValue(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
exitFullscreen_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
bool ok = exitFullscreen(cx, obj, void_self, args);
if (ok) {
return true;
}
return ConvertExceptionToPromise(cx, args.rval());
}
static const JSJitInfo exitFullscreen_methodinfo = {
{ (JSJitGetterOp)exitFullscreen_promiseWrapper },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
mozCancelFullScreen(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "mozCancelFullScreen", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)->ExitFullscreen(rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.mozCancelFullScreen"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!ToJSValue(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
mozCancelFullScreen_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
bool ok = mozCancelFullScreen(cx, obj, void_self, args);
if (ok) {
return true;
}
return ConvertExceptionToPromise(cx, args.rval());
}
static const JSJitInfo mozCancelFullScreen_methodinfo = {
{ (JSJitGetterOp)mozCancelFullScreen_promiseWrapper },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_onfullscreenchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onfullscreenchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnfullscreenchange());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onfullscreenchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onfullscreenchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnfullscreenchange(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnfullscreenchange(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onfullscreenchange_getterinfo = {
{ get_onfullscreenchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onfullscreenchange_setterinfo = {
{ (JSJitGetterOp)set_onfullscreenchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onfullscreenerror(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onfullscreenerror", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnfullscreenerror());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onfullscreenerror(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onfullscreenerror", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnfullscreenerror(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnfullscreenerror(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onfullscreenerror_getterinfo = {
{ get_onfullscreenerror },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onfullscreenerror_setterinfo = {
{ (JSJitGetterOp)set_onfullscreenerror },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
exitPointerLock(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "exitPointerLock", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->ExitPointerLock())>, "Should be returning void here");
MOZ_KnownLive(self)->ExitPointerLock();
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo exitPointerLock_methodinfo = {
{ (JSJitGetterOp)exitPointerLock },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onpointerlockchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerlockchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnpointerlockchange());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onpointerlockchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerlockchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnpointerlockchange(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnpointerlockchange(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onpointerlockchange_getterinfo = {
{ get_onpointerlockchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onpointerlockchange_setterinfo = {
{ (JSJitGetterOp)set_onpointerlockchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onpointerlockerror(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerlockerror", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnpointerlockerror());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onpointerlockerror(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerlockerror", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnpointerlockerror(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnpointerlockerror(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onpointerlockerror_getterinfo = {
{ get_onpointerlockerror },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onpointerlockerror_setterinfo = {
{ (JSJitGetterOp)set_onpointerlockerror },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
addCertException(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "addCertException", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.addCertException", 1)) {
return false;
}
bool arg0;
if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)->AddCertException(arg0, rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.addCertException"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!ToJSValue(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
addCertException_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
bool ok = addCertException(cx, obj, void_self, args);
if (ok) {
return true;
}
return ConvertExceptionToPromise(cx, args.rval());
}
static const JSJitInfo addCertException_methodinfo = {
{ (JSJitGetterOp)addCertException_promiseWrapper },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
reloadWithHttpsOnlyException(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "reloadWithHttpsOnlyException", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->ReloadWithHttpsOnlyException())>, "Should be returning void here");
MOZ_KnownLive(self)->ReloadWithHttpsOnlyException();
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo reloadWithHttpsOnlyException_methodinfo = {
{ (JSJitGetterOp)reloadWithHttpsOnlyException },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
getFailedCertSecurityInfo(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getFailedCertSecurityInfo", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
FailedCertSecurityInfo result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetFailedCertSecurityInfo(result, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->GetFailedCertSecurityInfo(result, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.getFailedCertSecurityInfo"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!result.ToObjectInternal(cx, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo getFailedCertSecurityInfo_methodinfo = {
{ (JSJitGetterOp)getFailedCertSecurityInfo },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
getNetErrorInfo(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getNetErrorInfo", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
NetErrorInfo result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetNetErrorInfo(result, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->GetNetErrorInfo(result, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.getNetErrorInfo"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!result.ToObjectInternal(cx, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo getNetErrorInfo_methodinfo = {
{ (JSJitGetterOp)getNetErrorInfo },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_hidden(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "hidden", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->Hidden());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo hidden_getterinfo = {
{ get_hidden },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_visibilityState(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "visibilityState", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
VisibilityState result(MOZ_KnownLive(self)->VisibilityState());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!ToJSValue(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo visibilityState_getterinfo = {
{ get_visibilityState },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_onvisibilitychange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onvisibilitychange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnvisibilitychange());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onvisibilitychange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onvisibilitychange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnvisibilitychange(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnvisibilitychange(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onvisibilitychange_getterinfo = {
{ get_onvisibilitychange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onvisibilitychange_setterinfo = {
{ (JSJitGetterOp)set_onvisibilitychange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_selectedStyleSheetSet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "selectedStyleSheetSet", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetSelectedStyleSheetSet(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetSelectedStyleSheetSet(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::StringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_selectedStyleSheetSet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "selectedStyleSheetSet", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetSelectedStyleSheetSet(NonNullHelper(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetSelectedStyleSheetSet(NonNullHelper(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo selectedStyleSheetSet_getterinfo = {
{ get_selectedStyleSheetSet },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 selectedStyleSheetSet_setterinfo = {
{ (JSJitGetterOp)set_selectedStyleSheetSet },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_lastStyleSheetSet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "lastStyleSheetSet", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetLastStyleSheetSet(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetLastStyleSheetSet(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::StringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo lastStyleSheetSet_getterinfo = {
{ get_lastStyleSheetSet },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_preferredStyleSheetSet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "preferredStyleSheetSet", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetPreferredStyleSheetSet(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetPreferredStyleSheetSet(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::StringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo preferredStyleSheetSet_getterinfo = {
{ get_preferredStyleSheetSet },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_styleSheetSets(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "styleSheetSets", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::DOMStringList>(MOZ_KnownLive(self)->StyleSheetSets()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo styleSheetSets_getterinfo = {
{ get_styleSheetSets },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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
enableStyleSheetsForSet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "enableStyleSheetsForSet", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.enableStyleSheetsForSet", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->EnableStyleSheetsForSet(NonNullHelper(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->EnableStyleSheetsForSet(NonNullHelper(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo enableStyleSheetsForSet_methodinfo = {
{ (JSJitGetterOp)enableStyleSheetsForSet },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
caretPositionFromPoint(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.caretPositionFromPoint");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "caretPositionFromPoint", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.caretPositionFromPoint", 2)) {
return false;
}
float arg0;
if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Argument 1", &arg0)) {
return false;
} else if (!std::isfinite(arg0)) {
cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 1");
return false;
}
float arg1;
if (!ValueToPrimitive<float, eDefault>(cx, args[1], "Argument 2", &arg1)) {
return false;
} else if (!std::isfinite(arg1)) {
cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 2");
return false;
}
auto result(StrongOrRawPtr<nsDOMCaretPosition>(MOZ_KnownLive(self)->CaretPositionFromPoint(arg0, arg1)));
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 caretPositionFromPoint_methodinfo = {
{ (JSJitGetterOp)caretPositionFromPoint },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_scrollingElement(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "scrollingElement", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->GetScrollingElement()));
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 scrollingElement_getterinfo = {
{ get_scrollingElement },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_timeline(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "timeline", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::DocumentTimeline>(MOZ_KnownLive(self)->Timeline()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo timeline_getterinfo = {
{ get_timeline },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_rootElement(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "rootElement", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::SVGSVGElement>(MOZ_KnownLive(self)->GetSVGRootElement()));
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 rootElement_getterinfo = {
{ get_rootElement },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createXULElement(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.createXULElement");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createXULElement", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createXULElement", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
ElementCreationOptionsOrString arg1;
if (!(args.hasDefined(1))) {
if (!arg1.RawSetAsElementCreationOptions().Init(cx, JS::NullHandleValue, "Member of (ElementCreationOptions or DOMString)")) {
return false;
}
} else {
if (!arg1.Init(cx, args[1], "Argument 2", false)) {
return false;
}
}
Maybe<AutoCEReaction> ceReaction;
DocGroup* docGroup = self->GetDocGroup();
if (docGroup) {
ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->CreateXULElement(NonNullHelper(Constify(arg0)), Constify(arg1), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.createXULElement"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createXULElement_methodinfo = {
{ (JSJitGetterOp)createXULElement },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_loadedFromPrototype(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "loadedFromPrototype", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->LoadedFromPrototype());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo loadedFromPrototype_getterinfo = {
{ get_loadedFromPrototype },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_effectiveStoragePrincipal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "effectiveStoragePrincipal", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIPrincipal>(MOZ_KnownLive(self)->EffectiveStoragePrincipal()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!WrapObject(cx, result, &NS_GET_IID(nsIPrincipal), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo effectiveStoragePrincipal_getterinfo = {
{ get_effectiveStoragePrincipal },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_partitionedPrincipal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "partitionedPrincipal", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIPrincipal>(MOZ_KnownLive(self)->PartitionedPrincipal()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!WrapObject(cx, result, &NS_GET_IID(nsIPrincipal), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo partitionedPrincipal_getterinfo = {
{ get_partitionedPrincipal },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_cookieJarSettings(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "cookieJarSettings", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsICookieJarSettings>(MOZ_KnownLive(self)->CookieJarSettings()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!WrapObject(cx, result, &NS_GET_IID(nsICookieJarSettings), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo cookieJarSettings_getterinfo = {
{ get_cookieJarSettings },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
createTouch(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.createTouch");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createTouch", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
nsGlobalWindowInner* arg0;
if (args.hasDefined(0)) {
if (args[0].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Window, nsGlobalWindowInner>(args[0], arg0, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Window");
return false;
}
}
} else if (args[0].isNullOrUndefined()) {
arg0 = nullptr;
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
return false;
}
} else {
arg0 = nullptr;
}
mozilla::dom::EventTarget* arg1;
if (args.hasDefined(1)) {
if (args[1].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::EventTarget, mozilla::dom::EventTarget>(args[1], arg1, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 2", "EventTarget");
return false;
}
}
} else if (args[1].isNullOrUndefined()) {
arg1 = nullptr;
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
return false;
}
} else {
arg1 = nullptr;
}
int32_t arg2;
if (args.hasDefined(2)) {
if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], "Argument 3", &arg2)) {
return false;
}
} else {
arg2 = 0;
}
int32_t arg3;
if (args.hasDefined(3)) {
if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], "Argument 4", &arg3)) {
return false;
}
} else {
arg3 = 0;
}
int32_t arg4;
if (args.hasDefined(4)) {
if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], "Argument 5", &arg4)) {
return false;
}
} else {
arg4 = 0;
}
int32_t arg5;
if (args.hasDefined(5)) {
if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], "Argument 6", &arg5)) {
return false;
}
} else {
arg5 = 0;
}
int32_t arg6;
if (args.hasDefined(6)) {
if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], "Argument 7", &arg6)) {
return false;
}
} else {
arg6 = 0;
}
int32_t arg7;
if (args.hasDefined(7)) {
if (!ValueToPrimitive<int32_t, eDefault>(cx, args[7], "Argument 8", &arg7)) {
return false;
}
} else {
arg7 = 0;
}
int32_t arg8;
if (args.hasDefined(8)) {
if (!ValueToPrimitive<int32_t, eDefault>(cx, args[8], "Argument 9", &arg8)) {
return false;
}
} else {
arg8 = 0;
}
int32_t arg9;
if (args.hasDefined(9)) {
if (!ValueToPrimitive<int32_t, eDefault>(cx, args[9], "Argument 10", &arg9)) {
return false;
}
} else {
arg9 = 0;
}
int32_t arg10;
if (args.hasDefined(10)) {
if (!ValueToPrimitive<int32_t, eDefault>(cx, args[10], "Argument 11", &arg10)) {
return false;
}
} else {
arg10 = 0;
}
float arg11;
if (args.hasDefined(11)) {
if (!ValueToPrimitive<float, eDefault>(cx, args[11], "Argument 12", &arg11)) {
return false;
} else if (!std::isfinite(arg11)) {
cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 12");
return false;
}
} else {
arg11 = 0.0F;
}
float arg12;
if (args.hasDefined(12)) {
if (!ValueToPrimitive<float, eDefault>(cx, args[12], "Argument 13", &arg12)) {
return false;
} else if (!std::isfinite(arg12)) {
cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 13");
return false;
}
} else {
arg12 = 0.0F;
}
auto result(StrongOrRawPtr<mozilla::dom::Touch>(MOZ_KnownLive(self)->CreateTouch(MOZ_KnownLive(Constify(arg0)), MOZ_KnownLive(Constify(arg1)), arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createTouch_methodinfo = {
{ (JSJitGetterOp)createTouch },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createTouchList(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.createTouchList");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createTouchList", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
unsigned argcount = std::min(args.length(), 2u);
switch (argcount) {
case 0: {
auto result(StrongOrRawPtr<mozilla::dom::TouchList>(MOZ_KnownLive(self)->CreateTouchList()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
break;
}
case 1: {
if (args[0].isObject()) {
do {
NonNull<mozilla::dom::Touch> arg0;
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Touch, mozilla::dom::Touch>(args[0], arg0, cx);
if (NS_FAILED(rv)) {
break;
}
}
AutoSequence<OwningNonNull<mozilla::dom::Touch>> arg1;
if (args.length() > 1) {
if (!arg1.SetCapacity(args.length() - 1, mozilla::fallible)) {
JS_ReportOutOfMemory(cx);
return false;
}
for (uint32_t variadicArg = 1; variadicArg < args.length(); ++variadicArg) {
// OK to do infallible append here, since we ensured capacity already.
OwningNonNull<mozilla::dom::Touch>& slot = *arg1.AppendElement();
if (args[variadicArg].isObject()) {
static_assert(IsRefcounted<mozilla::dom::Touch>::value, "We can only store refcounted classes.");
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Touch, mozilla::dom::Touch>(args[variadicArg], slot, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 2", "Touch");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
return false;
}
}
}
auto result(StrongOrRawPtr<mozilla::dom::TouchList>(MOZ_KnownLive(self)->CreateTouchList(MOZ_KnownLive(NonNullHelper(arg0)), MOZ_KnownLive(NonNullHelper(Constify(arg1))))));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
} while (false);
do {
binding_detail::AutoSequence<OwningNonNull<mozilla::dom::Touch>> arg0;
JS::ForOfIterator iter(cx);
if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
return false;
}
if (!iter.valueIsIterable()) {
break;
}
binding_detail::AutoSequence<OwningNonNull<mozilla::dom::Touch>> &arr = arg0;
JS::Rooted<JS::Value> temp(cx);
while (true) {
bool done;
if (!iter.next(&temp, &done)) {
return false;
}
if (done) {
break;
}
OwningNonNull<mozilla::dom::Touch>* slotPtr = arr.AppendElement(mozilla::fallible);
if (!slotPtr) {
JS_ReportOutOfMemory(cx);
return false;
}
OwningNonNull<mozilla::dom::Touch>& slot = *slotPtr;
if (temp.isObject()) {
static_assert(IsRefcounted<mozilla::dom::Touch>::value, "We can only store refcounted classes.");
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Touch, mozilla::dom::Touch>(&temp, slot, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "Touch");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
return false;
}
}
auto result(StrongOrRawPtr<mozilla::dom::TouchList>(MOZ_KnownLive(self)->CreateTouchList(Constify(arg0))));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
} while (false);
}
return cx.ThrowErrorMessage<MSG_OVERLOAD_RESOLUTION_FAILED>("1", "1");
break;
}
case 2: {
NonNull<mozilla::dom::Touch> arg0;
if (args[0].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Touch, mozilla::dom::Touch>(args[0], arg0, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Touch");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
return false;
}
AutoSequence<OwningNonNull<mozilla::dom::Touch>> arg1;
if (args.length() > 1) {
if (!arg1.SetCapacity(args.length() - 1, mozilla::fallible)) {
JS_ReportOutOfMemory(cx);
return false;
}
for (uint32_t variadicArg = 1; variadicArg < args.length(); ++variadicArg) {
// OK to do infallible append here, since we ensured capacity already.
OwningNonNull<mozilla::dom::Touch>& slot = *arg1.AppendElement();
if (args[variadicArg].isObject()) {
static_assert(IsRefcounted<mozilla::dom::Touch>::value, "We can only store refcounted classes.");
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Touch, mozilla::dom::Touch>(args[variadicArg], slot, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 2", "Touch");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
return false;
}
}
}
auto result(StrongOrRawPtr<mozilla::dom::TouchList>(MOZ_KnownLive(self)->CreateTouchList(MOZ_KnownLive(NonNullHelper(arg0)), MOZ_KnownLive(NonNullHelper(Constify(arg1))))));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
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 createTouchList_methodinfo = {
{ (JSJitGetterOp)createTouchList },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_styleSheetChangeEventsEnabled(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "styleSheetChangeEventsEnabled", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->StyleSheetChangeEventsEnabled());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_styleSheetChangeEventsEnabled(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "styleSheetChangeEventsEnabled", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool arg0;
if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetStyleSheetChangeEventsEnabled(arg0))>, "Should be returning void here");
MOZ_KnownLive(self)->SetStyleSheetChangeEventsEnabled(arg0);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo styleSheetChangeEventsEnabled_getterinfo = {
{ get_styleSheetChangeEventsEnabled },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
static const JSJitInfo styleSheetChangeEventsEnabled_setterinfo = {
{ (JSJitGetterOp)set_styleSheetChangeEventsEnabled },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_devToolsAnonymousAndShadowEventsEnabled(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "devToolsAnonymousAndShadowEventsEnabled", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->DevToolsAnonymousAndShadowEventsEnabled());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_devToolsAnonymousAndShadowEventsEnabled(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "devToolsAnonymousAndShadowEventsEnabled", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool arg0;
if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetDevToolsAnonymousAndShadowEventsEnabled(arg0))>, "Should be returning void here");
MOZ_KnownLive(self)->SetDevToolsAnonymousAndShadowEventsEnabled(arg0);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo devToolsAnonymousAndShadowEventsEnabled_getterinfo = {
{ get_devToolsAnonymousAndShadowEventsEnabled },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
static const JSJitInfo devToolsAnonymousAndShadowEventsEnabled_setterinfo = {
{ (JSJitGetterOp)set_devToolsAnonymousAndShadowEventsEnabled },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_contentLanguage(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "contentLanguage", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetContentLanguageForBindings(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetContentLanguageForBindings(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo contentLanguage_getterinfo = {
{ get_contentLanguage },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_documentLoadGroup(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "documentLoadGroup", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsILoadGroup>(MOZ_KnownLive(self)->GetDocumentLoadGroup()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!result) {
args.rval().setNull();
return true;
}
if (!WrapObject(cx, result, &NS_GET_IID(nsILoadGroup), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo documentLoadGroup_getterinfo = {
{ get_documentLoadGroup },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
blockParsing(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.blockParsing");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "blockParsing", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.blockParsing", 1)) {
return false;
}
OwningNonNull<Promise> arg0;
{ // Scope for our GlobalObject, FastErrorResult, JSAutoRealm,
// etc.
JS::Rooted<JSObject*> globalObj(cx);
globalObj = JS::CurrentGlobalOrNull(cx);
JSAutoRealm ar(cx, globalObj);
GlobalObject promiseGlobal(cx, globalObj);
if (promiseGlobal.Failed()) {
return false;
}
JS::Rooted<JS::Value> valueToResolve(cx, args[0]);
if (!JS_WrapValue(cx, &valueToResolve)) {
return false;
}
binding_detail::FastErrorResult promiseRv;
nsCOMPtr<nsIGlobalObject> global =
do_QueryInterface(promiseGlobal.GetAsSupports());
if (!global) {
promiseRv.Throw(NS_ERROR_UNEXPECTED);
MOZ_ALWAYS_TRUE(promiseRv.MaybeSetPendingException(cx));
return false;
}
arg0 = Promise::Resolve(global, cx, valueToResolve,
promiseRv);
if (promiseRv.MaybeSetPendingException(cx)) {
return false;
}
}
binding_detail::FastBlockParsingOptions arg1;
if (!arg1.Init(cx, (args.hasDefined(1)) ? args[1] : JS::NullHandleValue, "Argument 2", false)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)->BlockParsing(NonNullHelper(arg0), Constify(arg1), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.blockParsing"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!ToJSValue(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
blockParsing_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
bool ok = blockParsing(cx, obj, void_self, args);
if (ok) {
return true;
}
return ConvertExceptionToPromise(cx, args.rval());
}
static const JSJitInfo blockParsing_methodinfo = {
{ (JSJitGetterOp)blockParsing_promiseWrapper },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
blockUnblockOnload(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "blockUnblockOnload", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.blockUnblockOnload", 1)) {
return false;
}
bool arg0;
if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->BlockUnblockOnloadForSystemOrPDFJS(arg0))>, "Should be returning void here");
MOZ_KnownLive(self)->BlockUnblockOnloadForSystemOrPDFJS(arg0);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo blockUnblockOnload_methodinfo = {
{ (JSJitGetterOp)blockUnblockOnload },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_mozDocumentURIIfNotForErrorPages(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "mozDocumentURIIfNotForErrorPages", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIURI>(MOZ_KnownLive(self)->GetMozDocumentURIIfNotForErrorPages()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!result) {
args.rval().setNull();
return true;
}
if (!WrapObject(cx, result, &NS_GET_IID(nsIURI), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo mozDocumentURIIfNotForErrorPages_getterinfo = {
{ get_mozDocumentURIIfNotForErrorPages },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_documentReadyForIdle(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "documentReadyForIdle", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)->GetDocumentReadyForIdle(rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.documentReadyForIdle getter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!ToJSValue(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
get_documentReadyForIdle_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
bool ok = get_documentReadyForIdle(cx, obj, void_self, args);
if (ok) {
return true;
}
return ConvertExceptionToPromise(cx, args.rval());
}
static const JSJitInfo documentReadyForIdle_getterinfo = {
{ get_documentReadyForIdle_promiseWrapper },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_commandDispatcher(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "commandDispatcher", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIDOMXULCommandDispatcher>(MOZ_KnownLive(self)->GetCommandDispatcher()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!result) {
args.rval().setNull();
return true;
}
if (!WrapObject(cx, result, &NS_GET_IID(nsIDOMXULCommandDispatcher), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo commandDispatcher_getterinfo = {
{ get_commandDispatcher },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_devToolsWatchingDOMMutations(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "devToolsWatchingDOMMutations", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->DevToolsWatchingDOMMutations());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_devToolsWatchingDOMMutations(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "devToolsWatchingDOMMutations", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool arg0;
if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetDevToolsWatchingDOMMutations(arg0))>, "Should be returning void here");
MOZ_KnownLive(self)->SetDevToolsWatchingDOMMutations(arg0);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo devToolsWatchingDOMMutations_getterinfo = {
{ get_devToolsWatchingDOMMutations },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
static const JSJitInfo devToolsWatchingDOMMutations_setterinfo = {
{ (JSJitGetterOp)set_devToolsWatchingDOMMutations },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
getConnectedShadowRoots(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getConnectedShadowRoots", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
nsTArray<StrongPtrForMember<mozilla::dom::ShadowRoot>> result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetConnectedShadowRoots(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetConnectedShadowRoots(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
uint32_t length = result.Length();
JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
if (!returnArray) {
return false;
}
// Scope for 'tmp'
{
JS::Rooted<JS::Value> tmp(cx);
for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
// Control block to let us common up the JS_DefineElement calls when there
// are different ways to succeed at wrapping the object.
do {
if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
break;
} while (false);
if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
JSPROP_ENUMERATE)) {
return false;
}
}
}
args.rval().setObject(*returnArray);
return true;
}
static const JSJitInfo getConnectedShadowRoots_methodinfo = {
{ (JSJitGetterOp)getConnectedShadowRoots },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_isSrcdocDocument(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "isSrcdocDocument", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->IsSrcdocDocument());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo isSrcdocDocument_getterinfo = {
{ get_isSrcdocDocument },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_sandboxFlagsAsString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "sandboxFlagsAsString", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetSandboxFlagsAsString(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetSandboxFlagsAsString(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::StringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo sandboxFlagsAsString_getterinfo = {
{ get_sandboxFlagsAsString },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
insertAnonymousContent(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "insertAnonymousContent", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool arg0;
if (args.hasDefined(0)) {
if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
return false;
}
} else {
arg0 = false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::AnonymousContent>(MOZ_KnownLive(self)->InsertAnonymousContent(arg0, rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.insertAnonymousContent"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo insertAnonymousContent_methodinfo = {
{ (JSJitGetterOp)insertAnonymousContent },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
removeAnonymousContent(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.removeAnonymousContent");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "removeAnonymousContent", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.removeAnonymousContent", 1)) {
return false;
}
NonNull<mozilla::dom::AnonymousContent> arg0;
if (args[0].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::AnonymousContent, mozilla::dom::AnonymousContent>(args[0], arg0, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "AnonymousContent");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->RemoveAnonymousContent(MOZ_KnownLive(NonNullHelper(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->RemoveAnonymousContent(MOZ_KnownLive(NonNullHelper(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo removeAnonymousContent_methodinfo = {
{ (JSJitGetterOp)removeAnonymousContent },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
getSelection(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getSelection", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::Selection>(MOZ_KnownLive(self)->GetSelection(rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.getSelection"))) {
return false;
}
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 getSelection_methodinfo = {
{ (JSJitGetterOp)getSelection },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
hasStorageAccess(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "hasStorageAccess", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)->HasStorageAccess(rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.hasStorageAccess"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!ToJSValue(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
hasStorageAccess_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
bool ok = hasStorageAccess(cx, obj, void_self, args);
if (ok) {
return true;
}
return ConvertExceptionToPromise(cx, args.rval());
}
static const JSJitInfo hasStorageAccess_methodinfo = {
{ (JSJitGetterOp)hasStorageAccess_promiseWrapper },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
requestStorageAccess(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "requestStorageAccess", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)->RequestStorageAccess(rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.requestStorageAccess"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!ToJSValue(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
requestStorageAccess_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
bool ok = requestStorageAccess(cx, obj, void_self, args);
if (ok) {
return true;
}
return ConvertExceptionToPromise(cx, args.rval());
}
static const JSJitInfo requestStorageAccess_methodinfo = {
{ (JSJitGetterOp)requestStorageAccess_promiseWrapper },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
requestStorageAccessUnderSite(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "requestStorageAccessUnderSite", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.requestStorageAccessUnderSite", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)->RequestStorageAccessUnderSite(NonNullHelper(Constify(arg0)), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.requestStorageAccessUnderSite"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!ToJSValue(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
requestStorageAccessUnderSite_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
bool ok = requestStorageAccessUnderSite(cx, obj, void_self, args);
if (ok) {
return true;
}
return ConvertExceptionToPromise(cx, args.rval());
}
static const JSJitInfo requestStorageAccessUnderSite_methodinfo = {
{ (JSJitGetterOp)requestStorageAccessUnderSite_promiseWrapper },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
completeStorageAccessRequestFromSite(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "completeStorageAccessRequestFromSite", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.completeStorageAccessRequestFromSite", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)->CompleteStorageAccessRequestFromSite(NonNullHelper(Constify(arg0)), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.completeStorageAccessRequestFromSite"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!ToJSValue(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
completeStorageAccessRequestFromSite_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
bool ok = completeStorageAccessRequestFromSite(cx, obj, void_self, args);
if (ok) {
return true;
}
return ConvertExceptionToPromise(cx, args.rval());
}
static const JSJitInfo completeStorageAccessRequestFromSite_methodinfo = {
{ (JSJitGetterOp)completeStorageAccessRequestFromSite_promiseWrapper },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
requestStorageAccessForOrigin(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "requestStorageAccessForOrigin", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.requestStorageAccessForOrigin", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
bool arg1;
if (args.hasDefined(1)) {
if (!ValueToPrimitive<bool, eDefault>(cx, args[1], "Argument 2", &arg1)) {
return false;
}
} else {
arg1 = true;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)->RequestStorageAccessForOrigin(NonNullHelper(Constify(arg0)), arg1, rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.requestStorageAccessForOrigin"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!ToJSValue(cx, result, args.rval())) {
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
requestStorageAccessForOrigin_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
bool ok = requestStorageAccessForOrigin(cx, obj, void_self, args);
if (ok) {
return true;
}
return ConvertExceptionToPromise(cx, args.rval());
}
static const JSJitInfo requestStorageAccessForOrigin_methodinfo = {
{ (JSJitGetterOp)requestStorageAccessForOrigin_promiseWrapper },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_userHasInteracted(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "userHasInteracted", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->UserHasInteracted());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo userHasInteracted_getterinfo = {
{ get_userHasInteracted },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
notifyUserGestureActivation(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "notifyUserGestureActivation", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->NotifyUserGestureActivation())>, "Should be returning void here");
MOZ_KnownLive(self)->NotifyUserGestureActivation();
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo notifyUserGestureActivation_methodinfo = {
{ (JSJitGetterOp)notifyUserGestureActivation },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
clearUserGestureActivation(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "clearUserGestureActivation", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->ClearUserGestureActivation())>, "Should be returning void here");
MOZ_KnownLive(self)->ClearUserGestureActivation();
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo clearUserGestureActivation_methodinfo = {
{ (JSJitGetterOp)clearUserGestureActivation },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_hasBeenUserGestureActivated(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "hasBeenUserGestureActivated", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->HasBeenUserGestureActivated());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo hasBeenUserGestureActivated_getterinfo = {
{ get_hasBeenUserGestureActivated },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_hasValidTransientUserGestureActivation(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "hasValidTransientUserGestureActivation", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->HasValidTransientUserGestureActivation());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo hasValidTransientUserGestureActivation_getterinfo = {
{ get_hasValidTransientUserGestureActivation },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_lastUserGestureTimeStamp(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "lastUserGestureTimeStamp", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
double result(MOZ_KnownLive(self)->LastUserGestureTimeStamp());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().set(JS_NumberValue(double(result)));
return true;
}
static const JSJitInfo lastUserGestureTimeStamp_getterinfo = {
{ get_lastUserGestureTimeStamp },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
consumeTransientUserGestureActivation(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "consumeTransientUserGestureActivation", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->ConsumeTransientUserGestureActivation());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo consumeTransientUserGestureActivation_methodinfo = {
{ (JSJitGetterOp)consumeTransientUserGestureActivation },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
setSuppressedEventListener(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.setSuppressedEventListener");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "setSuppressedEventListener", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.setSuppressedEventListener", 1)) {
return false;
}
RootedCallback<RefPtr<binding_detail::FastEventListener>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventListener(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else if (args[0].isNullOrUndefined()) {
arg0 = nullptr;
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetSuppressedEventListener(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetSuppressedEventListener(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo setSuppressedEventListener_methodinfo = {
{ (JSJitGetterOp)setSuppressedEventListener },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_csp(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "csp", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIContentSecurityPolicy>(MOZ_KnownLive(self)->GetCsp()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!result) {
args.rval().setNull();
return true;
}
if (!WrapObject(cx, result, &NS_GET_IID(nsIContentSecurityPolicy), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo csp_getterinfo = {
{ get_csp },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_cspJSON(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "cspJSON", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DOMString result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetCspJSON(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetCspJSON(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo cspJSON_getterinfo = {
{ get_cspJSON },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_l10n(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "l10n", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::DocumentL10n>(MOZ_KnownLive(self)->GetL10n()));
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 l10n_getterinfo = {
{ get_l10n },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_hasPendingL10nMutations(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "hasPendingL10nMutations", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->HasPendingL10nMutations());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo hasPendingL10nMutations_getterinfo = {
{ get_hasPendingL10nMutations },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_featurePolicy(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "featurePolicy", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::FeaturePolicy>(MOZ_KnownLive(self)->FeaturePolicy()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo featurePolicy_getterinfo = {
{ get_featurePolicy },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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
setKeyPressEventModel(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "setKeyPressEventModel", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.setKeyPressEventModel", 1)) {
return false;
}
uint16_t arg0;
if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetKeyPressEventModel(arg0))>, "Should be returning void here");
MOZ_KnownLive(self)->SetKeyPressEventModel(arg0);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo setKeyPressEventModel_methodinfo = {
{ (JSJitGetterOp)setKeyPressEventModel },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_blockedNodeByClassifierCount(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "blockedNodeByClassifierCount", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
int32_t result(MOZ_KnownLive(self)->BlockedNodeByClassifierCount());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setInt32(int32_t(result));
return true;
}
static const JSJitInfo blockedNodeByClassifierCount_getterinfo = {
{ get_blockedNodeByClassifierCount },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_blockedNodesByClassifier(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "blockedNodesByClassifier", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsINodeList>(MOZ_KnownLive(self)->BlockedNodesByClassifier()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo blockedNodesByClassifier_getterinfo = {
{ get_blockedNodesByClassifier },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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
userInteractionForTesting(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "userInteractionForTesting", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetUserHasInteracted())>, "Should be returning void here");
MOZ_KnownLive(self)->SetUserHasInteracted();
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo userInteractionForTesting_methodinfo = {
{ (JSJitGetterOp)userInteractionForTesting },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_permDelegateHandler(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "permDelegateHandler", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIPermissionDelegateHandler>(MOZ_KnownLive(self)->PermDelegateHandler()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!WrapObject(cx, result, &NS_GET_IID(nsIPermissionDelegateHandler), args.rval())) {
return false;
}
return true;
}
static const JSJitInfo permDelegateHandler_getterinfo = {
{ get_permDelegateHandler },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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
setNotifyFetchSuccess(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "setNotifyFetchSuccess", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.setNotifyFetchSuccess", 1)) {
return false;
}
bool arg0;
if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetNotifyFetchSuccess(arg0))>, "Should be returning void here");
MOZ_KnownLive(self)->SetNotifyFetchSuccess(arg0);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo setNotifyFetchSuccess_methodinfo = {
{ (JSJitGetterOp)setNotifyFetchSuccess },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
setNotifyFormOrPasswordRemoved(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "setNotifyFormOrPasswordRemoved", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.setNotifyFormOrPasswordRemoved", 1)) {
return false;
}
bool arg0;
if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
return false;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetNotifyFormOrPasswordRemoved(arg0))>, "Should be returning void here");
MOZ_KnownLive(self)->SetNotifyFormOrPasswordRemoved(arg0);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo setNotifyFormOrPasswordRemoved_methodinfo = {
{ (JSJitGetterOp)setNotifyFormOrPasswordRemoved },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_isInitialDocument(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "isInitialDocument", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->IsInitialDocument());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo isInitialDocument_getterinfo = {
{ get_isInitialDocument },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
getWireframe(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getWireframe", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool arg0;
if (args.hasDefined(0)) {
if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
return false;
}
} else {
arg0 = false;
}
Nullable<Wireframe> result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetWireframe(arg0, result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetWireframe(arg0, result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result.IsNull()) {
args.rval().setNull();
return true;
}
if (!result.Value().ToObjectInternal(cx, args.rval())) {
return false;
}
return true;
}
static const JSJitInfo getWireframe_methodinfo = {
{ (JSJitGetterOp)getWireframe },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
isActive(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "isActive", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
bool result(MOZ_KnownLive(self)->IsActive());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setBoolean(result);
return true;
}
static const JSJitInfo isActive_methodinfo = {
{ (JSJitGetterOp)isActive },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
get_fragmentDirective(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "fragmentDirective", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::FragmentDirective>(MOZ_KnownLive(self)->FragmentDirective()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo fragmentDirective_getterinfo = {
{ get_fragmentDirective },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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
elementFromPoint(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.elementFromPoint");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "elementFromPoint", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.elementFromPoint", 2)) {
return false;
}
float arg0;
if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Argument 1", &arg0)) {
return false;
} else if (!std::isfinite(arg0)) {
cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 1");
return false;
}
float arg1;
if (!ValueToPrimitive<float, eDefault>(cx, args[1], "Argument 2", &arg1)) {
return false;
} else if (!std::isfinite(arg1)) {
cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 2");
return false;
}
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->ElementFromPoint(arg0, arg1)));
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 elementFromPoint_methodinfo = {
{ (JSJitGetterOp)elementFromPoint },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
elementsFromPoint(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.elementsFromPoint");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "elementsFromPoint", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.elementsFromPoint", 2)) {
return false;
}
float arg0;
if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Argument 1", &arg0)) {
return false;
} else if (!std::isfinite(arg0)) {
cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 1");
return false;
}
float arg1;
if (!ValueToPrimitive<float, eDefault>(cx, args[1], "Argument 2", &arg1)) {
return false;
} else if (!std::isfinite(arg1)) {
cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 2");
return false;
}
nsTArray<StrongPtrForMember<mozilla::dom::Element>> result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->ElementsFromPoint(arg0, arg1, result))>, "Should be returning void here");
MOZ_KnownLive(self)->ElementsFromPoint(arg0, arg1, result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
uint32_t length = result.Length();
JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
if (!returnArray) {
return false;
}
// Scope for 'tmp'
{
JS::Rooted<JS::Value> tmp(cx);
for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
// Control block to let us common up the JS_DefineElement calls when there
// are different ways to succeed at wrapping the object.
do {
if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
break;
} while (false);
if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
JSPROP_ENUMERATE)) {
return false;
}
}
}
args.rval().setObject(*returnArray);
return true;
}
static const JSJitInfo elementsFromPoint_methodinfo = {
{ (JSJitGetterOp)elementsFromPoint },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
nodeFromPoint(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.nodeFromPoint");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "nodeFromPoint", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.nodeFromPoint", 2)) {
return false;
}
float arg0;
if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Argument 1", &arg0)) {
return false;
} else if (!std::isfinite(arg0)) {
cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 1");
return false;
}
float arg1;
if (!ValueToPrimitive<float, eDefault>(cx, args[1], "Argument 2", &arg1)) {
return false;
} else if (!std::isfinite(arg1)) {
cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 2");
return false;
}
auto result(StrongOrRawPtr<nsINode>(MOZ_KnownLive(self)->NodeFromPoint(arg0, arg1)));
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 nodeFromPoint_methodinfo = {
{ (JSJitGetterOp)nodeFromPoint },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
nodesFromPoint(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.nodesFromPoint");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "nodesFromPoint", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.nodesFromPoint", 2)) {
return false;
}
float arg0;
if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Argument 1", &arg0)) {
return false;
} else if (!std::isfinite(arg0)) {
cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 1");
return false;
}
float arg1;
if (!ValueToPrimitive<float, eDefault>(cx, args[1], "Argument 2", &arg1)) {
return false;
} else if (!std::isfinite(arg1)) {
cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 2");
return false;
}
nsTArray<StrongPtrForMember<nsINode>> result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->NodesFromPoint(arg0, arg1, result))>, "Should be returning void here");
MOZ_KnownLive(self)->NodesFromPoint(arg0, arg1, result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
uint32_t length = result.Length();
JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
if (!returnArray) {
return false;
}
// Scope for 'tmp'
{
JS::Rooted<JS::Value> tmp(cx);
for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
// Control block to let us common up the JS_DefineElement calls when there
// are different ways to succeed at wrapping the object.
do {
if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
break;
} while (false);
if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
JSPROP_ENUMERATE)) {
return false;
}
}
}
args.rval().setObject(*returnArray);
return true;
}
static const JSJitInfo nodesFromPoint_methodinfo = {
{ (JSJitGetterOp)nodesFromPoint },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_activeElement(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "activeElement", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->GetActiveElement()));
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 activeElement_getterinfo = {
{ get_activeElement },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_styleSheets(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "styleSheets", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::StyleSheetList>(MOZ_KnownLive(self)->StyleSheets()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo styleSheets_getterinfo = {
{ get_styleSheets },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_pointerLockElement(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "pointerLockElement", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->GetPointerLockElement()));
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 pointerLockElement_getterinfo = {
{ get_pointerLockElement },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_fullscreenElement(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "fullscreenElement", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->GetFullscreenElement()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!result) {
args.rval().setNull();
return true;
}
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_fullscreenElement(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "fullscreenElement", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
DeprecationWarning(cx, obj, DeprecatedOperations::eLenientSetter);
return true;
}
static const JSJitInfo fullscreenElement_getterinfo = {
{ get_fullscreenElement },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 fullscreenElement_setterinfo = {
{ (JSJitGetterOp)set_fullscreenElement },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_mozFullScreenElement(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "mozFullScreenElement", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->GetFullscreenElement()));
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 mozFullScreenElement_getterinfo = {
{ get_mozFullScreenElement },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
getAnimations(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getAnimations", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
nsTArray<StrongPtrForMember<mozilla::dom::Animation>> result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetAnimations(result))>, "Should be returning void here");
MOZ_KnownLive(self)->GetAnimations(result);
MOZ_ASSERT(!JS_IsExceptionPending(cx));
uint32_t length = result.Length();
JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
if (!returnArray) {
return false;
}
// Scope for 'tmp'
{
JS::Rooted<JS::Value> tmp(cx);
for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
// Control block to let us common up the JS_DefineElement calls when there
// are different ways to succeed at wrapping the object.
do {
if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
break;
} while (false);
if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
JSPROP_ENUMERATE)) {
return false;
}
}
}
args.rval().setObject(*returnArray);
return true;
}
static const JSJitInfo getAnimations_methodinfo = {
{ (JSJitGetterOp)getAnimations },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
namespace AdoptedStyleSheets_Binding {
class ObservableArrayProxyHandler : public mozilla::dom::ObservableArrayProxyHandler
{
protected:
bool
OnDeleteItem(JSContext* aCx, JS::Handle<JSObject*> aProxy, JS::Handle<JS::Value> aValue, uint32_t aIndex) const override;
bool
SetIndexedValue(JSContext* aCx, JS::Handle<JSObject*> aProxy, JS::Handle<JSObject*> aBackingList, uint32_t aIndex, JS::Handle<JS::Value> aValue, JS::ObjectOpResult& aResult) const override;
public:
static const ObservableArrayProxyHandler*
getInstance();
};
bool
ObservableArrayProxyHandler::OnDeleteItem(JSContext* aCx, JS::Handle<JSObject*> aProxy, JS::Handle<JS::Value> aValue, uint32_t aIndex) const
{
MOZ_ASSERT(IsObservableArrayProxy(aProxy));
BindingCallContext cx(aCx, "ObservableArray OnDeleteItem");
NonNull<mozilla::StyleSheet> decl;
if (aValue.isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::CSSStyleSheet, mozilla::StyleSheet>(aValue, decl, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element in ObservableArray backing list", "CSSStyleSheet");
MOZ_ASSERT_UNREACHABLE("The item in ObservableArray backing list is not CSSStyleSheet (Wrapper)?");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element in ObservableArray backing list");
MOZ_ASSERT_UNREACHABLE("The item in ObservableArray backing list is not CSSStyleSheet (Wrapper)?");
return false;
}
JS::Value val = js::GetProxyReservedSlot(aProxy, OBSERVABLE_ARRAY_DOM_INTERFACE_SLOT);
auto* interface = static_cast<mozilla::dom::Document*>(val.toPrivate());
MOZ_ASSERT(interface);
ErrorResult rv;
MOZ_KnownLive(interface)->OnDeleteAdoptedStyleSheets(decl, aIndex, rv);
return !rv.MaybeSetPendingException(cx);
}
bool
ObservableArrayProxyHandler::SetIndexedValue(JSContext* aCx, JS::Handle<JSObject*> aProxy, JS::Handle<JSObject*> aBackingList, uint32_t aIndex, JS::Handle<JS::Value> aValue, JS::ObjectOpResult& aResult) const
{
MOZ_ASSERT(IsObservableArrayProxy(aProxy));
uint32_t oldLen;
if (!JS::GetArrayLength(aCx, aBackingList, &oldLen)) {
return false;
}
if (aIndex > oldLen) {
return aResult.failBadIndex();
}
BindingCallContext cx(aCx, "ObservableArray SetIndexedValue");
NonNull<mozilla::StyleSheet> decl;
if (aValue.isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::CSSStyleSheet, mozilla::StyleSheet>(aValue, decl, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element in ObservableArray backing list", "CSSStyleSheet");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element in ObservableArray backing list");
return false;
}
if (aIndex < oldLen) {
JS::Rooted<JS::Value> value(aCx);
if (!JS_GetElement(aCx, aBackingList, aIndex, &value)) {
return false;
}
if (!OnDeleteItem(aCx, aProxy, value, aIndex)) {
return false;
}
}
JS::Value val = js::GetProxyReservedSlot(aProxy, OBSERVABLE_ARRAY_DOM_INTERFACE_SLOT);
auto* interface = static_cast<mozilla::dom::Document*>(val.toPrivate());
MOZ_ASSERT(interface);
ErrorResult rv;
MOZ_KnownLive(interface)->OnSetAdoptedStyleSheets(decl, aIndex, rv);
if (rv.MaybeSetPendingException(cx)) {
return false;
}
if (!JS_SetElement(aCx, aBackingList, aIndex, aValue)) {
return false;
}
return aResult.succeed();
}
const ObservableArrayProxyHandler*
ObservableArrayProxyHandler::getInstance()
{
static const ObservableArrayProxyHandler instance;
return &instance;
}
} // namespace AdoptedStyleSheets_Binding
namespace AdoptedStyleSheetsHelpers {
already_AddRefed<StyleSheet>
ElementAt(mozilla::dom::Document* self, uint32_t aIndex, ErrorResult& aRv)
{
MOZ_ASSERT(self);
AutoJSAPI jsapi;
jsapi.Init();
JSContext* cx = jsapi.cx();
// It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here because
// all we want is to wrap into _some_ scope and then unwrap to find
// the reflector, and wrapping has no side-effects.
JSObject* scope = UnprivilegedJunkScopeOrWorkerGlobal(fallible);
if (!scope) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
JSAutoRealm tempRealm(cx, scope);
JS::Rooted<JS::Value> v(cx);
if(!ToJSValue(cx, self, &v)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
// This is a reflector, but due to trying to name things
// similarly across method generators, it's called obj here.
JS::Rooted<JSObject*> obj(cx);
obj = js::UncheckedUnwrap(&v.toObject(), /* stopAtWindowProxy = */ false);
JSAutoRealm reflectorRealm(cx, obj);
JS::Rooted<JSObject*> backingObj(cx);
bool created = false;
if (!GetObservableArrayBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0),
&backingObj, &created, AdoptedStyleSheets_Binding::ObservableArrayProxyHandler::getInstance(),
self)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
if (created) {
PreserveWrapper(self);
}
JS::Rooted<JS::Value> result(cx);
aRv.MightThrowJSException();
if (!JS_GetElement(cx, backingObj, aIndex, &result)) {
aRv.StealExceptionFromJSContext(cx);
return nullptr;
}
if (result.isUndefined()) {
aRv.Throw(NS_ERROR_NOT_AVAILABLE);
return nullptr;
}
RefPtr<mozilla::StyleSheet> rvalDecl;
static_assert(IsRefcounted<mozilla::StyleSheet>::value, "We can only store refcounted classes.");
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::CSSStyleSheet, mozilla::StyleSheet>(result, rvalDecl, cx);
if (NS_FAILED(rv)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
}
return rvalDecl.forget();
}
void
ReplaceElementAt(mozilla::dom::Document* self, uint32_t aIndex, StyleSheet& aValue, ErrorResult& aRv)
{
MOZ_ASSERT(self);
AutoJSAPI jsapi;
jsapi.Init();
JSContext* cx = jsapi.cx();
// It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here because
// all we want is to wrap into _some_ scope and then unwrap to find
// the reflector, and wrapping has no side-effects.
JSObject* scope = UnprivilegedJunkScopeOrWorkerGlobal(fallible);
if (!scope) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
JSAutoRealm tempRealm(cx, scope);
JS::Rooted<JS::Value> v(cx);
if(!ToJSValue(cx, self, &v)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
// This is a reflector, but due to trying to name things
// similarly across method generators, it's called obj here.
JS::Rooted<JSObject*> obj(cx);
obj = js::UncheckedUnwrap(&v.toObject(), /* stopAtWindowProxy = */ false);
JSAutoRealm reflectorRealm(cx, obj);
JS::RootedVector<JS::Value> argv(cx);
if (!argv.resize(1)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
do {
if (!GetOrCreateDOMReflector(cx, aValue, argv[0])) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
break;
} while (false);
JS::Rooted<JSObject*> backingObj(cx);
bool created = false;
if (!GetObservableArrayBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0),
&backingObj, &created, AdoptedStyleSheets_Binding::ObservableArrayProxyHandler::getInstance(),
self)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
if (created) {
PreserveWrapper(self);
}
uint32_t length;
aRv.MightThrowJSException();
if (!JS::GetArrayLength(cx, backingObj, &length)) {
aRv.StealExceptionFromJSContext(cx);
return;
}
if (aIndex > length) {
aRv.ThrowRangeError("Invalid index");
return;
}
aRv.MightThrowJSException();
if (!JS_SetElement(cx, backingObj, aIndex, argv[0])) {
aRv.StealExceptionFromJSContext(cx);
return;
}
}
void
AppendElement(mozilla::dom::Document* self, StyleSheet& aValue, ErrorResult& aRv)
{
MOZ_ASSERT(self);
AutoJSAPI jsapi;
jsapi.Init();
JSContext* cx = jsapi.cx();
// It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here because
// all we want is to wrap into _some_ scope and then unwrap to find
// the reflector, and wrapping has no side-effects.
JSObject* scope = UnprivilegedJunkScopeOrWorkerGlobal(fallible);
if (!scope) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
JSAutoRealm tempRealm(cx, scope);
JS::Rooted<JS::Value> v(cx);
if(!ToJSValue(cx, self, &v)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
// This is a reflector, but due to trying to name things
// similarly across method generators, it's called obj here.
JS::Rooted<JSObject*> obj(cx);
obj = js::UncheckedUnwrap(&v.toObject(), /* stopAtWindowProxy = */ false);
JSAutoRealm reflectorRealm(cx, obj);
JS::RootedVector<JS::Value> argv(cx);
if (!argv.resize(1)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
do {
if (!GetOrCreateDOMReflector(cx, aValue, argv[0])) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
break;
} while (false);
JS::Rooted<JSObject*> backingObj(cx);
bool created = false;
if (!GetObservableArrayBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0),
&backingObj, &created, AdoptedStyleSheets_Binding::ObservableArrayProxyHandler::getInstance(),
self)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
if (created) {
PreserveWrapper(self);
}
uint32_t length;
aRv.MightThrowJSException();
if (!JS::GetArrayLength(cx, backingObj, &length)) {
aRv.StealExceptionFromJSContext(cx);
return;
}
aRv.MightThrowJSException();
if (!JS_SetElement(cx, backingObj, length, argv[0])) {
aRv.StealExceptionFromJSContext(cx);
return;
}
}
void
RemoveLastElement(mozilla::dom::Document* self, ErrorResult& aRv)
{
MOZ_ASSERT(self);
AutoJSAPI jsapi;
jsapi.Init();
JSContext* cx = jsapi.cx();
// It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here because
// all we want is to wrap into _some_ scope and then unwrap to find
// the reflector, and wrapping has no side-effects.
JSObject* scope = UnprivilegedJunkScopeOrWorkerGlobal(fallible);
if (!scope) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
JSAutoRealm tempRealm(cx, scope);
JS::Rooted<JS::Value> v(cx);
if(!ToJSValue(cx, self, &v)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
// This is a reflector, but due to trying to name things
// similarly across method generators, it's called obj here.
JS::Rooted<JSObject*> obj(cx);
obj = js::UncheckedUnwrap(&v.toObject(), /* stopAtWindowProxy = */ false);
JSAutoRealm reflectorRealm(cx, obj);
JS::Rooted<JSObject*> backingObj(cx);
bool created = false;
if (!GetObservableArrayBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0),
&backingObj, &created, AdoptedStyleSheets_Binding::ObservableArrayProxyHandler::getInstance(),
self)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
if (created) {
PreserveWrapper(self);
}
uint32_t length;
aRv.MightThrowJSException();
if (!JS::GetArrayLength(cx, backingObj, &length)) {
aRv.StealExceptionFromJSContext(cx);
return;
}
if (length == 0) {
aRv.Throw(NS_ERROR_NOT_AVAILABLE);
return;
}
aRv.MightThrowJSException();
if (!JS::SetArrayLength(cx, backingObj, length - 1)) {
aRv.StealExceptionFromJSContext(cx);
return;
}
}
uint32_t
Length(mozilla::dom::Document* self, ErrorResult& aRv)
{
MOZ_ASSERT(self);
AutoJSAPI jsapi;
jsapi.Init();
JSContext* cx = jsapi.cx();
// It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here because
// all we want is to wrap into _some_ scope and then unwrap to find
// the reflector, and wrapping has no side-effects.
JSObject* scope = UnprivilegedJunkScopeOrWorkerGlobal(fallible);
if (!scope) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return uint32_t(0);
}
JSAutoRealm tempRealm(cx, scope);
JS::Rooted<JS::Value> v(cx);
if(!ToJSValue(cx, self, &v)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return uint32_t(0);
}
// This is a reflector, but due to trying to name things
// similarly across method generators, it's called obj here.
JS::Rooted<JSObject*> obj(cx);
obj = js::UncheckedUnwrap(&v.toObject(), /* stopAtWindowProxy = */ false);
JSAutoRealm reflectorRealm(cx, obj);
JS::Rooted<JSObject*> backingObj(cx);
bool created = false;
if (!GetObservableArrayBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0),
&backingObj, &created, AdoptedStyleSheets_Binding::ObservableArrayProxyHandler::getInstance(),
self)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return uint32_t(0);
}
if (created) {
PreserveWrapper(self);
}
uint32_t retVal;
aRv.MightThrowJSException();
if (!JS::GetArrayLength(cx, backingObj, &retVal)) {
aRv.StealExceptionFromJSContext(cx);
return uint32_t(0);
}
return retVal;
}
} // namespace AdoptedStyleSheetsHelpers
MOZ_CAN_RUN_SCRIPT static bool
get_adoptedStyleSheets(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "adoptedStyleSheets", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
JS::Rooted<JSObject*> backingObj(cx);
bool created = false;
if (!GetObservableArrayBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0),
&backingObj, &created, AdoptedStyleSheets_Binding::ObservableArrayProxyHandler::getInstance(),
self)) {
return false;
}
if (created) {
PreserveWrapper(self);
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setObject(*backingObj);
return true;
}
MOZ_CAN_RUN_SCRIPT static bool
set_adoptedStyleSheets(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
BindingCallContext cx(cx_, "Document.adoptedStyleSheets setter");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "adoptedStyleSheets", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
binding_detail::AutoSequence<OwningNonNull<mozilla::StyleSheet>> arg0;
if (args[0].isObject()) {
JS::ForOfIterator iter(cx);
if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
return false;
}
if (!iter.valueIsIterable()) {
cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Value being assigned", "observable array");
return false;
}
binding_detail::AutoSequence<OwningNonNull<mozilla::StyleSheet>> &arr = arg0;
JS::Rooted<JS::Value> temp(cx);
while (true) {
bool done;
if (!iter.next(&temp, &done)) {
return false;
}
if (done) {
break;
}
OwningNonNull<mozilla::StyleSheet>* slotPtr = arr.AppendElement(mozilla::fallible);
if (!slotPtr) {
JS_ReportOutOfMemory(cx);
return false;
}
OwningNonNull<mozilla::StyleSheet>& slot = *slotPtr;
if (temp.isObject()) {
static_assert(IsRefcounted<mozilla::StyleSheet>::value, "We can only store refcounted classes.");
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::CSSStyleSheet, mozilla::StyleSheet>(&temp, slot, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of value being assigned", "CSSStyleSheet");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of value being assigned");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Value being assigned", "observable array");
return false;
}
if (xpc::WrapperFactory::IsXrayWrapper(obj)) {
JS_ReportErrorASCII(cx, "Accessing from Xray wrapper is not supported.");
return false;
}
JS::Rooted<JSObject*> backingObj(cx);
bool created = false;
if (!GetObservableArrayBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0),
&backingObj, &created, AdoptedStyleSheets_Binding::ObservableArrayProxyHandler::getInstance(),
self)) {
return false;
}
if (created) {
PreserveWrapper(self);
}
const ObservableArrayProxyHandler* handler = GetObservableArrayProxyHandler(backingObj);
if (!handler->SetLength(cx, backingObj, 0)) {
return false;
}
JS::Rooted<JS::Value> val(cx);
for (size_t i = 0; i < arg0.Length(); i++) {
if (!GetOrCreateDOMReflector(cx, arg0.ElementAt(i), &val)) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
if (!JS_SetElement(cx, backingObj, i, val)) {
return false;
}
}
return true;
}
static const JSJitInfo adoptedStyleSheets_getterinfo = {
{ get_adoptedStyleSheets },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
true, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
(DOM_INSTANCE_RESERVED_SLOTS + 0) /* Reserved slot index, if we're stored in a slot, else 0. */
};
static_assert((DOM_INSTANCE_RESERVED_SLOTS + 0) <= JSJitInfo::maxSlotIndex, "We won't fit");
static_assert((DOM_INSTANCE_RESERVED_SLOTS + 0) < 2, "There is no slot for us");
static const JSJitInfo adoptedStyleSheets_setterinfo = {
{ (JSJitGetterOp)set_adoptedStyleSheets },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_fonts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "fonts", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::FontFaceSet>(MOZ_KnownLive(self)->GetFonts(rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.fonts getter"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo fonts_getterinfo = {
{ get_fonts },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
getBoxQuads(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.getBoxQuads");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getBoxQuads", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
binding_detail::FastBoxQuadOptions arg0;
if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", false)) {
return false;
}
FastErrorResult rv;
nsTArray<StrongPtrForMember<mozilla::dom::DOMQuad>> result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetBoxQuads(Constify(arg0), result, nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->GetBoxQuads(Constify(arg0), result, nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.getBoxQuads"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
uint32_t length = result.Length();
JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
if (!returnArray) {
return false;
}
// Scope for 'tmp'
{
JS::Rooted<JS::Value> tmp(cx);
for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
// Control block to let us common up the JS_DefineElement calls when there
// are different ways to succeed at wrapping the object.
do {
if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
break;
} while (false);
if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
JSPROP_ENUMERATE)) {
return false;
}
}
}
args.rval().setObject(*returnArray);
return true;
}
static const JSJitInfo getBoxQuads_methodinfo = {
{ (JSJitGetterOp)getBoxQuads },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
getBoxQuadsFromWindowOrigin(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.getBoxQuadsFromWindowOrigin");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getBoxQuadsFromWindowOrigin", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
binding_detail::FastBoxQuadOptions arg0;
if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", false)) {
return false;
}
FastErrorResult rv;
nsTArray<StrongPtrForMember<mozilla::dom::DOMQuad>> result;
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->GetBoxQuadsFromWindowOrigin(Constify(arg0), result, rv))>, "Should be returning void here");
MOZ_KnownLive(self)->GetBoxQuadsFromWindowOrigin(Constify(arg0), result, rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.getBoxQuadsFromWindowOrigin"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
uint32_t length = result.Length();
JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
if (!returnArray) {
return false;
}
// Scope for 'tmp'
{
JS::Rooted<JS::Value> tmp(cx);
for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
// Control block to let us common up the JS_DefineElement calls when there
// are different ways to succeed at wrapping the object.
do {
if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
break;
} while (false);
if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
JSPROP_ENUMERATE)) {
return false;
}
}
}
args.rval().setObject(*returnArray);
return true;
}
static const JSJitInfo getBoxQuadsFromWindowOrigin_methodinfo = {
{ (JSJitGetterOp)getBoxQuadsFromWindowOrigin },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
convertQuadFromNode(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.convertQuadFromNode");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "convertQuadFromNode", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.convertQuadFromNode", 2)) {
return false;
}
NonNull<mozilla::dom::DOMQuad> arg0;
if (args[0].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::DOMQuad, mozilla::dom::DOMQuad>(args[0], arg0, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "DOMQuad");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
return false;
}
TextOrElementOrDocument arg1;
if (!arg1.Init(cx, args[1], "Argument 2", false)) {
return false;
}
binding_detail::FastConvertCoordinateOptions arg2;
if (!arg2.Init(cx, (args.hasDefined(2)) ? args[2] : JS::NullHandleValue, "Argument 3", false)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::DOMQuad>(MOZ_KnownLive(self)->ConvertQuadFromNode(MOZ_KnownLive(NonNullHelper(arg0)), Constify(arg1), Constify(arg2), nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.convertQuadFromNode"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo convertQuadFromNode_methodinfo = {
{ (JSJitGetterOp)convertQuadFromNode },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
convertRectFromNode(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.convertRectFromNode");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "convertRectFromNode", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.convertRectFromNode", 2)) {
return false;
}
NonNull<mozilla::dom::DOMRectReadOnly> arg0;
if (args[0].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::DOMRectReadOnly, mozilla::dom::DOMRectReadOnly>(args[0], arg0, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "DOMRectReadOnly");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
return false;
}
TextOrElementOrDocument arg1;
if (!arg1.Init(cx, args[1], "Argument 2", false)) {
return false;
}
binding_detail::FastConvertCoordinateOptions arg2;
if (!arg2.Init(cx, (args.hasDefined(2)) ? args[2] : JS::NullHandleValue, "Argument 3", false)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::DOMQuad>(MOZ_KnownLive(self)->ConvertRectFromNode(MOZ_KnownLive(NonNullHelper(arg0)), Constify(arg1), Constify(arg2), nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.convertRectFromNode"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo convertRectFromNode_methodinfo = {
{ (JSJitGetterOp)convertRectFromNode },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
convertPointFromNode(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.convertPointFromNode");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "convertPointFromNode", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.convertPointFromNode", 2)) {
return false;
}
binding_detail::FastDOMPointInit arg0;
if (!arg0.Init(cx, args[0], "Argument 1", false)) {
return false;
}
TextOrElementOrDocument arg1;
if (!arg1.Init(cx, args[1], "Argument 2", false)) {
return false;
}
binding_detail::FastConvertCoordinateOptions arg2;
if (!arg2.Init(cx, (args.hasDefined(2)) ? args[2] : JS::NullHandleValue, "Argument 3", false)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::DOMPoint>(MOZ_KnownLive(self)->ConvertPointFromNode(Constify(arg0), Constify(arg1), Constify(arg2), nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.convertPointFromNode"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo convertPointFromNode_methodinfo = {
{ (JSJitGetterOp)convertPointFromNode },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
get_onabort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onabort", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnabort());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onabort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onabort", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnabort(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnabort(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onabort_getterinfo = {
{ get_onabort },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onabort_setterinfo = {
{ (JSJitGetterOp)set_onabort },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onblur(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onblur", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnblur());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onblur(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onblur", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnblur(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnblur(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onblur_getterinfo = {
{ get_onblur },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onblur_setterinfo = {
{ (JSJitGetterOp)set_onblur },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onfocus(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onfocus", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnfocus());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onfocus(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onfocus", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnfocus(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnfocus(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onfocus_getterinfo = {
{ get_onfocus },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onfocus_setterinfo = {
{ (JSJitGetterOp)set_onfocus },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_oncancel(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncancel", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOncancel());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_oncancel(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncancel", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOncancel(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOncancel(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo oncancel_getterinfo = {
{ get_oncancel },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 oncancel_setterinfo = {
{ (JSJitGetterOp)set_oncancel },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onauxclick(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onauxclick", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnauxclick());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onauxclick(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onauxclick", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnauxclick(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnauxclick(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onauxclick_getterinfo = {
{ get_onauxclick },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onauxclick_setterinfo = {
{ (JSJitGetterOp)set_onauxclick },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onbeforeinput(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onbeforeinput", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnbeforeinput());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onbeforeinput(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onbeforeinput", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnbeforeinput(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnbeforeinput(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onbeforeinput_getterinfo = {
{ get_onbeforeinput },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onbeforeinput_setterinfo = {
{ (JSJitGetterOp)set_onbeforeinput },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onbeforetoggle(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onbeforetoggle", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnbeforetoggle());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onbeforetoggle(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onbeforetoggle", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnbeforetoggle(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnbeforetoggle(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onbeforetoggle_getterinfo = {
{ get_onbeforetoggle },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onbeforetoggle_setterinfo = {
{ (JSJitGetterOp)set_onbeforetoggle },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_oncanplay(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncanplay", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOncanplay());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_oncanplay(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncanplay", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOncanplay(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOncanplay(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo oncanplay_getterinfo = {
{ get_oncanplay },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 oncanplay_setterinfo = {
{ (JSJitGetterOp)set_oncanplay },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_oncanplaythrough(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncanplaythrough", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOncanplaythrough());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_oncanplaythrough(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncanplaythrough", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOncanplaythrough(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOncanplaythrough(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo oncanplaythrough_getterinfo = {
{ get_oncanplaythrough },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 oncanplaythrough_setterinfo = {
{ (JSJitGetterOp)set_oncanplaythrough },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnchange());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnchange(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnchange(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onchange_getterinfo = {
{ get_onchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onchange_setterinfo = {
{ (JSJitGetterOp)set_onchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onclick(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onclick", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnclick());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onclick(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onclick", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnclick(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnclick(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onclick_getterinfo = {
{ get_onclick },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onclick_setterinfo = {
{ (JSJitGetterOp)set_onclick },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onclose(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onclose", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnclose());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onclose(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onclose", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnclose(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnclose(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onclose_getterinfo = {
{ get_onclose },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onclose_setterinfo = {
{ (JSJitGetterOp)set_onclose },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_oncontextlost(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncontextlost", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOncontextlost());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_oncontextlost(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncontextlost", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOncontextlost(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOncontextlost(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo oncontextlost_getterinfo = {
{ get_oncontextlost },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 oncontextlost_setterinfo = {
{ (JSJitGetterOp)set_oncontextlost },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_oncontextmenu(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncontextmenu", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOncontextmenu());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_oncontextmenu(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncontextmenu", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOncontextmenu(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOncontextmenu(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo oncontextmenu_getterinfo = {
{ get_oncontextmenu },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 oncontextmenu_setterinfo = {
{ (JSJitGetterOp)set_oncontextmenu },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_oncontextrestored(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncontextrestored", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOncontextrestored());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_oncontextrestored(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncontextrestored", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOncontextrestored(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOncontextrestored(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo oncontextrestored_getterinfo = {
{ get_oncontextrestored },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 oncontextrestored_setterinfo = {
{ (JSJitGetterOp)set_oncontextrestored },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_oncopy(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncopy", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOncopy());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_oncopy(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncopy", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOncopy(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOncopy(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo oncopy_getterinfo = {
{ get_oncopy },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 oncopy_setterinfo = {
{ (JSJitGetterOp)set_oncopy },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_oncuechange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncuechange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOncuechange());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_oncuechange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncuechange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOncuechange(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOncuechange(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo oncuechange_getterinfo = {
{ get_oncuechange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 oncuechange_setterinfo = {
{ (JSJitGetterOp)set_oncuechange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_oncut(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncut", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOncut());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_oncut(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oncut", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOncut(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOncut(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo oncut_getterinfo = {
{ get_oncut },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 oncut_setterinfo = {
{ (JSJitGetterOp)set_oncut },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ondblclick(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondblclick", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOndblclick());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ondblclick(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondblclick", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOndblclick(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOndblclick(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ondblclick_getterinfo = {
{ get_ondblclick },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ondblclick_setterinfo = {
{ (JSJitGetterOp)set_ondblclick },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ondrag(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondrag", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOndrag());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ondrag(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondrag", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOndrag(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOndrag(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ondrag_getterinfo = {
{ get_ondrag },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ondrag_setterinfo = {
{ (JSJitGetterOp)set_ondrag },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ondragend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondragend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOndragend());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ondragend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondragend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOndragend(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOndragend(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ondragend_getterinfo = {
{ get_ondragend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ondragend_setterinfo = {
{ (JSJitGetterOp)set_ondragend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ondragenter(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondragenter", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOndragenter());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ondragenter(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondragenter", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOndragenter(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOndragenter(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ondragenter_getterinfo = {
{ get_ondragenter },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ondragenter_setterinfo = {
{ (JSJitGetterOp)set_ondragenter },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ondragexit(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondragexit", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOndragexit());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ondragexit(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondragexit", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOndragexit(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOndragexit(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ondragexit_getterinfo = {
{ get_ondragexit },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ondragexit_setterinfo = {
{ (JSJitGetterOp)set_ondragexit },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ondragleave(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondragleave", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOndragleave());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ondragleave(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondragleave", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOndragleave(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOndragleave(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ondragleave_getterinfo = {
{ get_ondragleave },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ondragleave_setterinfo = {
{ (JSJitGetterOp)set_ondragleave },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ondragover(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondragover", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOndragover());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ondragover(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondragover", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOndragover(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOndragover(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ondragover_getterinfo = {
{ get_ondragover },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ondragover_setterinfo = {
{ (JSJitGetterOp)set_ondragover },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ondragstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondragstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOndragstart());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ondragstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondragstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOndragstart(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOndragstart(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ondragstart_getterinfo = {
{ get_ondragstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ondragstart_setterinfo = {
{ (JSJitGetterOp)set_ondragstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ondrop(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondrop", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOndrop());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ondrop(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondrop", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOndrop(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOndrop(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ondrop_getterinfo = {
{ get_ondrop },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ondrop_setterinfo = {
{ (JSJitGetterOp)set_ondrop },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ondurationchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondurationchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOndurationchange());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ondurationchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ondurationchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOndurationchange(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOndurationchange(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ondurationchange_getterinfo = {
{ get_ondurationchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ondurationchange_setterinfo = {
{ (JSJitGetterOp)set_ondurationchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onemptied(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onemptied", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnemptied());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onemptied(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onemptied", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnemptied(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnemptied(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onemptied_getterinfo = {
{ get_onemptied },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onemptied_setterinfo = {
{ (JSJitGetterOp)set_onemptied },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onended(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onended", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnended());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onended(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onended", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnended(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnended(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onended_getterinfo = {
{ get_onended },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onended_setterinfo = {
{ (JSJitGetterOp)set_onended },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onformdata(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onformdata", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnformdata());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onformdata(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onformdata", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnformdata(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnformdata(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onformdata_getterinfo = {
{ get_onformdata },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onformdata_setterinfo = {
{ (JSJitGetterOp)set_onformdata },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_oninput(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oninput", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOninput());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_oninput(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oninput", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOninput(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOninput(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo oninput_getterinfo = {
{ get_oninput },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 oninput_setterinfo = {
{ (JSJitGetterOp)set_oninput },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_oninvalid(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oninvalid", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOninvalid());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_oninvalid(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "oninvalid", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOninvalid(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOninvalid(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo oninvalid_getterinfo = {
{ get_oninvalid },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 oninvalid_setterinfo = {
{ (JSJitGetterOp)set_oninvalid },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onkeydown(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onkeydown", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnkeydown());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onkeydown(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onkeydown", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnkeydown(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnkeydown(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onkeydown_getterinfo = {
{ get_onkeydown },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onkeydown_setterinfo = {
{ (JSJitGetterOp)set_onkeydown },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onkeypress(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onkeypress", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnkeypress());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onkeypress(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onkeypress", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnkeypress(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnkeypress(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onkeypress_getterinfo = {
{ get_onkeypress },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onkeypress_setterinfo = {
{ (JSJitGetterOp)set_onkeypress },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onkeyup(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onkeyup", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnkeyup());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onkeyup(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onkeyup", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnkeyup(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnkeyup(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onkeyup_getterinfo = {
{ get_onkeyup },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onkeyup_setterinfo = {
{ (JSJitGetterOp)set_onkeyup },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onload(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onload", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnload());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onload(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onload", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnload(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnload(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onload_getterinfo = {
{ get_onload },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onload_setterinfo = {
{ (JSJitGetterOp)set_onload },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onloadeddata(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onloadeddata", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnloadeddata());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onloadeddata(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onloadeddata", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnloadeddata(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnloadeddata(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onloadeddata_getterinfo = {
{ get_onloadeddata },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onloadeddata_setterinfo = {
{ (JSJitGetterOp)set_onloadeddata },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onloadedmetadata(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onloadedmetadata", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnloadedmetadata());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onloadedmetadata(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onloadedmetadata", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnloadedmetadata(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnloadedmetadata(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onloadedmetadata_getterinfo = {
{ get_onloadedmetadata },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onloadedmetadata_setterinfo = {
{ (JSJitGetterOp)set_onloadedmetadata },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onloadstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onloadstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnloadstart());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onloadstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onloadstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnloadstart(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnloadstart(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onloadstart_getterinfo = {
{ get_onloadstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onloadstart_setterinfo = {
{ (JSJitGetterOp)set_onloadstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onmousedown(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmousedown", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnmousedown());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onmousedown(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmousedown", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnmousedown(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnmousedown(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onmousedown_getterinfo = {
{ get_onmousedown },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onmousedown_setterinfo = {
{ (JSJitGetterOp)set_onmousedown },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onmouseenter(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmouseenter", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnmouseenter());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onmouseenter(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmouseenter", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnmouseenter(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnmouseenter(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onmouseenter_getterinfo = {
{ get_onmouseenter },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onmouseenter_setterinfo = {
{ (JSJitGetterOp)set_onmouseenter },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onmouseleave(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmouseleave", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnmouseleave());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onmouseleave(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmouseleave", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnmouseleave(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnmouseleave(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onmouseleave_getterinfo = {
{ get_onmouseleave },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onmouseleave_setterinfo = {
{ (JSJitGetterOp)set_onmouseleave },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onmousemove(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmousemove", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnmousemove());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onmousemove(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmousemove", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnmousemove(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnmousemove(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onmousemove_getterinfo = {
{ get_onmousemove },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onmousemove_setterinfo = {
{ (JSJitGetterOp)set_onmousemove },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onmouseout(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmouseout", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnmouseout());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onmouseout(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmouseout", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnmouseout(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnmouseout(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onmouseout_getterinfo = {
{ get_onmouseout },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onmouseout_setterinfo = {
{ (JSJitGetterOp)set_onmouseout },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onmouseover(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmouseover", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnmouseover());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onmouseover(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmouseover", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnmouseover(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnmouseover(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onmouseover_getterinfo = {
{ get_onmouseover },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onmouseover_setterinfo = {
{ (JSJitGetterOp)set_onmouseover },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onmouseup(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmouseup", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnmouseup());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onmouseup(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmouseup", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnmouseup(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnmouseup(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onmouseup_getterinfo = {
{ get_onmouseup },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onmouseup_setterinfo = {
{ (JSJitGetterOp)set_onmouseup },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onwheel(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onwheel", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnwheel());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onwheel(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onwheel", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnwheel(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnwheel(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onwheel_getterinfo = {
{ get_onwheel },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onwheel_setterinfo = {
{ (JSJitGetterOp)set_onwheel },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onpaste(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpaste", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnpaste());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onpaste(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpaste", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnpaste(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnpaste(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onpaste_getterinfo = {
{ get_onpaste },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onpaste_setterinfo = {
{ (JSJitGetterOp)set_onpaste },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onpause(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpause", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnpause());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onpause(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpause", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnpause(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnpause(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onpause_getterinfo = {
{ get_onpause },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onpause_setterinfo = {
{ (JSJitGetterOp)set_onpause },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onplay(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onplay", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnplay());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onplay(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onplay", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnplay(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnplay(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onplay_getterinfo = {
{ get_onplay },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onplay_setterinfo = {
{ (JSJitGetterOp)set_onplay },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onplaying(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onplaying", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnplaying());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onplaying(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onplaying", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnplaying(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnplaying(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onplaying_getterinfo = {
{ get_onplaying },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onplaying_setterinfo = {
{ (JSJitGetterOp)set_onplaying },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onprogress(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onprogress", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnprogress());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onprogress(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onprogress", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnprogress(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnprogress(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onprogress_getterinfo = {
{ get_onprogress },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onprogress_setterinfo = {
{ (JSJitGetterOp)set_onprogress },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onratechange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onratechange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnratechange());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onratechange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onratechange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnratechange(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnratechange(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onratechange_getterinfo = {
{ get_onratechange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onratechange_setterinfo = {
{ (JSJitGetterOp)set_onratechange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onreset(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onreset", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnreset());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onreset(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onreset", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnreset(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnreset(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onreset_getterinfo = {
{ get_onreset },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onreset_setterinfo = {
{ (JSJitGetterOp)set_onreset },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onresize(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onresize", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnresize());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onresize(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onresize", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnresize(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnresize(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onresize_getterinfo = {
{ get_onresize },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onresize_setterinfo = {
{ (JSJitGetterOp)set_onresize },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onscroll(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onscroll", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnscroll());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onscroll(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onscroll", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnscroll(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnscroll(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onscroll_getterinfo = {
{ get_onscroll },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onscroll_setterinfo = {
{ (JSJitGetterOp)set_onscroll },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onscrollend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onscrollend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnscrollend());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onscrollend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onscrollend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnscrollend(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnscrollend(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onscrollend_getterinfo = {
{ get_onscrollend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onscrollend_setterinfo = {
{ (JSJitGetterOp)set_onscrollend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onsecuritypolicyviolation(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onsecuritypolicyviolation", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnsecuritypolicyviolation());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onsecuritypolicyviolation(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onsecuritypolicyviolation", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnsecuritypolicyviolation(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnsecuritypolicyviolation(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onsecuritypolicyviolation_getterinfo = {
{ get_onsecuritypolicyviolation },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onsecuritypolicyviolation_setterinfo = {
{ (JSJitGetterOp)set_onsecuritypolicyviolation },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onseeked(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onseeked", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnseeked());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onseeked(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onseeked", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnseeked(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnseeked(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onseeked_getterinfo = {
{ get_onseeked },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onseeked_setterinfo = {
{ (JSJitGetterOp)set_onseeked },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onseeking(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onseeking", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnseeking());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onseeking(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onseeking", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnseeking(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnseeking(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onseeking_getterinfo = {
{ get_onseeking },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onseeking_setterinfo = {
{ (JSJitGetterOp)set_onseeking },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onselect(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onselect", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnselect());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onselect(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onselect", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnselect(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnselect(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onselect_getterinfo = {
{ get_onselect },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onselect_setterinfo = {
{ (JSJitGetterOp)set_onselect },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onslotchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onslotchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnslotchange());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onslotchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onslotchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnslotchange(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnslotchange(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onslotchange_getterinfo = {
{ get_onslotchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onslotchange_setterinfo = {
{ (JSJitGetterOp)set_onslotchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onstalled(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onstalled", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnstalled());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onstalled(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onstalled", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnstalled(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnstalled(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onstalled_getterinfo = {
{ get_onstalled },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onstalled_setterinfo = {
{ (JSJitGetterOp)set_onstalled },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onsubmit(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onsubmit", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnsubmit());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onsubmit(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onsubmit", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnsubmit(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnsubmit(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onsubmit_getterinfo = {
{ get_onsubmit },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onsubmit_setterinfo = {
{ (JSJitGetterOp)set_onsubmit },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onsuspend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onsuspend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnsuspend());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onsuspend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onsuspend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnsuspend(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnsuspend(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onsuspend_getterinfo = {
{ get_onsuspend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onsuspend_setterinfo = {
{ (JSJitGetterOp)set_onsuspend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ontimeupdate(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontimeupdate", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOntimeupdate());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ontimeupdate(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontimeupdate", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOntimeupdate(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOntimeupdate(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ontimeupdate_getterinfo = {
{ get_ontimeupdate },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ontimeupdate_setterinfo = {
{ (JSJitGetterOp)set_ontimeupdate },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onvolumechange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onvolumechange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnvolumechange());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onvolumechange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onvolumechange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnvolumechange(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnvolumechange(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onvolumechange_getterinfo = {
{ get_onvolumechange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onvolumechange_setterinfo = {
{ (JSJitGetterOp)set_onvolumechange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onwaiting(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onwaiting", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnwaiting());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onwaiting(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onwaiting", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnwaiting(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnwaiting(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onwaiting_getterinfo = {
{ get_onwaiting },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onwaiting_setterinfo = {
{ (JSJitGetterOp)set_onwaiting },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onselectstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onselectstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnselectstart());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onselectstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onselectstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnselectstart(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnselectstart(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onselectstart_getterinfo = {
{ get_onselectstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onselectstart_setterinfo = {
{ (JSJitGetterOp)set_onselectstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onselectionchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onselectionchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnselectionchange());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onselectionchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onselectionchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnselectionchange(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnselectionchange(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onselectionchange_getterinfo = {
{ get_onselectionchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onselectionchange_setterinfo = {
{ (JSJitGetterOp)set_onselectionchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ontoggle(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontoggle", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOntoggle());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ontoggle(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontoggle", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOntoggle(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOntoggle(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ontoggle_getterinfo = {
{ get_ontoggle },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ontoggle_setterinfo = {
{ (JSJitGetterOp)set_ontoggle },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onpointercancel(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointercancel", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnpointercancel());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onpointercancel(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointercancel", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnpointercancel(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnpointercancel(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onpointercancel_getterinfo = {
{ get_onpointercancel },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onpointercancel_setterinfo = {
{ (JSJitGetterOp)set_onpointercancel },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onpointerdown(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerdown", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnpointerdown());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onpointerdown(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerdown", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnpointerdown(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnpointerdown(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onpointerdown_getterinfo = {
{ get_onpointerdown },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onpointerdown_setterinfo = {
{ (JSJitGetterOp)set_onpointerdown },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onpointerup(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerup", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnpointerup());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onpointerup(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerup", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnpointerup(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnpointerup(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onpointerup_getterinfo = {
{ get_onpointerup },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onpointerup_setterinfo = {
{ (JSJitGetterOp)set_onpointerup },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onpointermove(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointermove", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnpointermove());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onpointermove(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointermove", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnpointermove(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnpointermove(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onpointermove_getterinfo = {
{ get_onpointermove },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onpointermove_setterinfo = {
{ (JSJitGetterOp)set_onpointermove },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onpointerout(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerout", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnpointerout());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onpointerout(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerout", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnpointerout(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnpointerout(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onpointerout_getterinfo = {
{ get_onpointerout },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onpointerout_setterinfo = {
{ (JSJitGetterOp)set_onpointerout },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onpointerover(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerover", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnpointerover());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onpointerover(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerover", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnpointerover(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnpointerover(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onpointerover_getterinfo = {
{ get_onpointerover },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onpointerover_setterinfo = {
{ (JSJitGetterOp)set_onpointerover },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onpointerenter(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerenter", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnpointerenter());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onpointerenter(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerenter", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnpointerenter(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnpointerenter(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onpointerenter_getterinfo = {
{ get_onpointerenter },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onpointerenter_setterinfo = {
{ (JSJitGetterOp)set_onpointerenter },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onpointerleave(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerleave", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnpointerleave());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onpointerleave(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onpointerleave", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnpointerleave(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnpointerleave(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onpointerleave_getterinfo = {
{ get_onpointerleave },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onpointerleave_setterinfo = {
{ (JSJitGetterOp)set_onpointerleave },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ongotpointercapture(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ongotpointercapture", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOngotpointercapture());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ongotpointercapture(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ongotpointercapture", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOngotpointercapture(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOngotpointercapture(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ongotpointercapture_getterinfo = {
{ get_ongotpointercapture },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ongotpointercapture_setterinfo = {
{ (JSJitGetterOp)set_ongotpointercapture },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onlostpointercapture(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onlostpointercapture", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnlostpointercapture());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onlostpointercapture(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onlostpointercapture", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnlostpointercapture(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnlostpointercapture(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onlostpointercapture_getterinfo = {
{ get_onlostpointercapture },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onlostpointercapture_setterinfo = {
{ (JSJitGetterOp)set_onlostpointercapture },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onmozfullscreenchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmozfullscreenchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DeprecationWarning(cx, obj, DeprecatedOperations::eMozfullscreenchangeDeprecatedPrefix);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnmozfullscreenchange());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onmozfullscreenchange(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmozfullscreenchange", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DeprecationWarning(cx, obj, DeprecatedOperations::eMozfullscreenchangeDeprecatedPrefix);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnmozfullscreenchange(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnmozfullscreenchange(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onmozfullscreenchange_getterinfo = {
{ get_onmozfullscreenchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onmozfullscreenchange_setterinfo = {
{ (JSJitGetterOp)set_onmozfullscreenchange },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onmozfullscreenerror(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmozfullscreenerror", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DeprecationWarning(cx, obj, DeprecatedOperations::eMozfullscreenerrorDeprecatedPrefix);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnmozfullscreenerror());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onmozfullscreenerror(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onmozfullscreenerror", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
DeprecationWarning(cx, obj, DeprecatedOperations::eMozfullscreenerrorDeprecatedPrefix);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnmozfullscreenerror(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnmozfullscreenerror(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onmozfullscreenerror_getterinfo = {
{ get_onmozfullscreenerror },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onmozfullscreenerror_setterinfo = {
{ (JSJitGetterOp)set_onmozfullscreenerror },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onanimationcancel(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onanimationcancel", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnanimationcancel());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onanimationcancel(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onanimationcancel", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnanimationcancel(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnanimationcancel(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onanimationcancel_getterinfo = {
{ get_onanimationcancel },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onanimationcancel_setterinfo = {
{ (JSJitGetterOp)set_onanimationcancel },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onanimationend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onanimationend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnanimationend());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onanimationend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onanimationend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnanimationend(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnanimationend(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onanimationend_getterinfo = {
{ get_onanimationend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onanimationend_setterinfo = {
{ (JSJitGetterOp)set_onanimationend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onanimationiteration(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onanimationiteration", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnanimationiteration());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onanimationiteration(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onanimationiteration", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnanimationiteration(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnanimationiteration(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onanimationiteration_getterinfo = {
{ get_onanimationiteration },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onanimationiteration_setterinfo = {
{ (JSJitGetterOp)set_onanimationiteration },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onanimationstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onanimationstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnanimationstart());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onanimationstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onanimationstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnanimationstart(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnanimationstart(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onanimationstart_getterinfo = {
{ get_onanimationstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onanimationstart_setterinfo = {
{ (JSJitGetterOp)set_onanimationstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ontransitioncancel(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontransitioncancel", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOntransitioncancel());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ontransitioncancel(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontransitioncancel", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOntransitioncancel(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOntransitioncancel(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ontransitioncancel_getterinfo = {
{ get_ontransitioncancel },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ontransitioncancel_setterinfo = {
{ (JSJitGetterOp)set_ontransitioncancel },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ontransitionend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontransitionend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOntransitionend());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ontransitionend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontransitionend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOntransitionend(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOntransitionend(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ontransitionend_getterinfo = {
{ get_ontransitionend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ontransitionend_setterinfo = {
{ (JSJitGetterOp)set_ontransitionend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ontransitionrun(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontransitionrun", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOntransitionrun());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ontransitionrun(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontransitionrun", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOntransitionrun(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOntransitionrun(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ontransitionrun_getterinfo = {
{ get_ontransitionrun },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ontransitionrun_setterinfo = {
{ (JSJitGetterOp)set_ontransitionrun },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ontransitionstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontransitionstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOntransitionstart());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ontransitionstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontransitionstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOntransitionstart(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOntransitionstart(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ontransitionstart_getterinfo = {
{ get_ontransitionstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ontransitionstart_setterinfo = {
{ (JSJitGetterOp)set_ontransitionstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onwebkitanimationend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onwebkitanimationend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnwebkitAnimationEnd());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onwebkitanimationend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onwebkitanimationend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnwebkitAnimationEnd(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnwebkitAnimationEnd(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onwebkitanimationend_getterinfo = {
{ get_onwebkitanimationend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onwebkitanimationend_setterinfo = {
{ (JSJitGetterOp)set_onwebkitanimationend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onwebkitanimationiteration(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onwebkitanimationiteration", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnwebkitAnimationIteration());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onwebkitanimationiteration(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onwebkitanimationiteration", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnwebkitAnimationIteration(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnwebkitAnimationIteration(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onwebkitanimationiteration_getterinfo = {
{ get_onwebkitanimationiteration },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onwebkitanimationiteration_setterinfo = {
{ (JSJitGetterOp)set_onwebkitanimationiteration },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onwebkitanimationstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onwebkitanimationstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnwebkitAnimationStart());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onwebkitanimationstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onwebkitanimationstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnwebkitAnimationStart(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnwebkitAnimationStart(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onwebkitanimationstart_getterinfo = {
{ get_onwebkitanimationstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onwebkitanimationstart_setterinfo = {
{ (JSJitGetterOp)set_onwebkitanimationstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_onwebkittransitionend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onwebkittransitionend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnwebkitTransitionEnd());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onwebkittransitionend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onwebkittransitionend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnwebkitTransitionEnd(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnwebkitTransitionEnd(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onwebkittransitionend_getterinfo = {
{ get_onwebkittransitionend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onwebkittransitionend_setterinfo = {
{ (JSJitGetterOp)set_onwebkittransitionend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
getElementById(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getElementById", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.getElementById", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->GetElementById(NonNullHelper(Constify(arg0)))));
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::ArgType getElementById_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
static const JSTypedMethodJitInfo getElementById_methodinfo = {
{
{ (JSJitGetterOp)getElementById },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
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. */
true, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
},
getElementById_methodinfo_argTypes
};
MOZ_CAN_RUN_SCRIPT static bool
get_onerror(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onerror", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOnerror());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_onerror(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "onerror", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOnerror(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOnerror(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo onerror_getterinfo = {
{ get_onerror },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 onerror_setterinfo = {
{ (JSJitGetterOp)set_onerror },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_children(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "children", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->Children()));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo children_getterinfo = {
{ get_children },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Getter,
JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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_firstElementChild(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "firstElementChild", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->GetFirstElementChild()));
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 firstElementChild_getterinfo = {
{ get_firstElementChild },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_lastElementChild(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "lastElementChild", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->GetLastElementChild()));
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 lastElementChild_getterinfo = {
{ get_lastElementChild },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_childElementCount(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "childElementCount", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
uint32_t result(MOZ_KnownLive(self)->ChildElementCount());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setNumber(result);
return true;
}
static const JSJitInfo childElementCount_getterinfo = {
{ get_childElementCount },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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. */
};
MOZ_CAN_RUN_SCRIPT static bool
getElementsByAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getElementsByAttribute", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.getElementsByAttribute", 2)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
binding_detail::FakeString<char16_t> arg1;
if (!ConvertJSValueToString(cx, args[1], eEmpty, eStringify, arg1)) {
return false;
}
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->GetElementsByAttribute(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)))));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo getElementsByAttribute_methodinfo = {
{ (JSJitGetterOp)getElementsByAttribute },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
getElementsByAttributeNS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "getElementsByAttributeNS", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.getElementsByAttributeNS", 3)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
return false;
}
binding_detail::FakeString<char16_t> arg1;
if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
return false;
}
binding_detail::FakeString<char16_t> arg2;
if (!ConvertJSValueToString(cx, args[2], eEmpty, eStringify, arg2)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<nsIHTMLCollection>(MOZ_KnownLive(self)->GetElementsByAttributeNS(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), NonNullHelper(Constify(arg2)), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.getElementsByAttributeNS"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo getElementsByAttributeNS_methodinfo = {
{ (JSJitGetterOp)getElementsByAttributeNS },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
prepend(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.prepend");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "prepend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
AutoSequence<OwningNodeOrString> arg0;
if (args.length() > 0) {
if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
JS_ReportOutOfMemory(cx);
return false;
}
for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
// OK to do infallible append here, since we ensured capacity already.
OwningNodeOrString& slot = *arg0.AppendElement();
if (!slot.Init(cx, args[variadicArg], "Argument 1", false)) {
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)->Prepend(Constify(arg0), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->Prepend(Constify(arg0), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.prepend"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo prepend_methodinfo = {
{ (JSJitGetterOp)prepend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
append(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.append");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "append", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
AutoSequence<OwningNodeOrString> arg0;
if (args.length() > 0) {
if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
JS_ReportOutOfMemory(cx);
return false;
}
for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
// OK to do infallible append here, since we ensured capacity already.
OwningNodeOrString& slot = *arg0.AppendElement();
if (!slot.Init(cx, args[variadicArg], "Argument 1", false)) {
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)->Append(Constify(arg0), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->Append(Constify(arg0), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.append"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo append_methodinfo = {
{ (JSJitGetterOp)append },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
replaceChildren(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.replaceChildren");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "replaceChildren", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
AutoSequence<OwningNodeOrString> arg0;
if (args.length() > 0) {
if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
JS_ReportOutOfMemory(cx);
return false;
}
for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
// OK to do infallible append here, since we ensured capacity already.
OwningNodeOrString& slot = *arg0.AppendElement();
if (!slot.Init(cx, args[variadicArg], "Argument 1", false)) {
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)->ReplaceChildren(Constify(arg0), rv))>, "Should be returning void here");
MOZ_KnownLive(self)->ReplaceChildren(Constify(arg0), rv);
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.replaceChildren"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
args.rval().setUndefined();
return true;
}
static const JSJitInfo replaceChildren_methodinfo = {
{ (JSJitGetterOp)replaceChildren },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
querySelector(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "querySelector", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.querySelector", 1)) {
return false;
}
binding_detail::FakeString<char> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::Element>(MOZ_KnownLive(self)->QuerySelector(Constify(arg0), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.querySelector"))) {
return false;
}
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::ArgType querySelector_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
static const JSTypedMethodJitInfo querySelector_methodinfo = {
{
{ (JSJitGetterOp)querySelector },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasDOMSets, /* 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. */
true, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
},
querySelector_methodinfo_argTypes
};
MOZ_CAN_RUN_SCRIPT static bool
querySelectorAll(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "querySelectorAll", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.querySelectorAll", 1)) {
return false;
}
binding_detail::FakeString<char> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<nsINodeList>(MOZ_KnownLive(self)->QuerySelectorAll(Constify(arg0), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.querySelectorAll"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo::ArgType querySelectorAll_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
static const JSTypedMethodJitInfo querySelectorAll_methodinfo = {
{
{ (JSJitGetterOp)querySelectorAll },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasDOMSets, /* 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. */
true, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
},
querySelectorAll_methodinfo_argTypes
};
MOZ_CAN_RUN_SCRIPT static bool
get_ontouchstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontouchstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOntouchstart());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ontouchstart(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontouchstart", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOntouchstart(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOntouchstart(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ontouchstart_getterinfo = {
{ get_ontouchstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ontouchstart_setterinfo = {
{ (JSJitGetterOp)set_ontouchstart },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ontouchend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontouchend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOntouchend());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ontouchend(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontouchend", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOntouchend(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOntouchend(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ontouchend_getterinfo = {
{ get_ontouchend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ontouchend_setterinfo = {
{ (JSJitGetterOp)set_ontouchend },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ontouchmove(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontouchmove", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOntouchmove());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ontouchmove(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontouchmove", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOntouchmove(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOntouchmove(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ontouchmove_getterinfo = {
{ get_ontouchmove },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ontouchmove_setterinfo = {
{ (JSJitGetterOp)set_ontouchmove },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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_ontouchcancel(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontouchcancel", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RefPtr<EventHandlerNonNull> result(MOZ_KnownLive(self)->GetOntouchcancel());
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (result) {
args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
return false;
}
return true;
} else {
args.rval().setNull();
return true;
}
}
MOZ_CAN_RUN_SCRIPT static bool
set_ontouchcancel(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "ontouchcancel", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
if (args[0].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else {
arg0 = nullptr;
}
// NOTE: This assert does NOT call the function.
static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)->SetOntouchcancel(MOZ_KnownLive(Constify(arg0))))>, "Should be returning void here");
MOZ_KnownLive(self)->SetOntouchcancel(MOZ_KnownLive(Constify(arg0)));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
return true;
}
static const JSJitInfo ontouchcancel_getterinfo = {
{ get_ontouchcancel },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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 ontouchcancel_setterinfo = {
{ (JSJitGetterOp)set_ontouchcancel },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::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
createExpression(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.createExpression");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createExpression", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createExpression", 1)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
RootedCallback<RefPtr<binding_detail::FastXPathNSResolver>> arg1(cx);
if (args.hasDefined(1)) {
if (args[1].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg1 = new binding_detail::FastXPathNSResolver(&args[1].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else if (args[1].isNullOrUndefined()) {
arg1 = nullptr;
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
return false;
}
} else {
arg1 = nullptr;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::XPathExpression>(MOZ_KnownLive(self)->CreateExpression(NonNullHelper(Constify(arg0)), MOZ_KnownLive(Constify(arg1)), rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.createExpression"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo createExpression_methodinfo = {
{ (JSJitGetterOp)createExpression },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
MOZ_CAN_RUN_SCRIPT static bool
createNSResolver(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.createNSResolver");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "createNSResolver", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.createNSResolver", 1)) {
return false;
}
NonNull<nsINode> arg0;
if (args[0].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Node");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
return false;
}
auto result(StrongOrRawPtr<nsINode>(MOZ_KnownLive(self)->CreateNSResolver(MOZ_KnownLive(NonNullHelper(arg0)))));
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo::ArgType createNSResolver_methodinfo_argTypes[] = { JSJitInfo::Object, JSJitInfo::ArgTypeListEnd };
static const JSTypedMethodJitInfo createNSResolver_methodinfo = {
{
{ (JSJitGetterOp)createNSResolver },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* 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. */
true, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
},
createNSResolver_methodinfo_argTypes
};
MOZ_CAN_RUN_SCRIPT static bool
evaluate(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
{
BindingCallContext cx(cx_, "Document.evaluate");
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "evaluate", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
auto* self = static_cast<mozilla::dom::Document*>(void_self);
if (!args.requireAtLeast(cx, "Document.evaluate", 2)) {
return false;
}
binding_detail::FakeString<char16_t> arg0;
if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
return false;
}
NonNull<nsINode> arg1;
if (args[1].isObject()) {
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[1], arg1, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 2", "Node");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
return false;
}
RootedCallback<RefPtr<binding_detail::FastXPathNSResolver>> arg2(cx);
if (args.hasDefined(2)) {
if (args[2].isObject()) {
{ // scope for tempRoot and tempGlobalRoot if needed
arg2 = new binding_detail::FastXPathNSResolver(&args[2].toObject(), JS::CurrentGlobalOrNull(cx));
}
} else if (args[2].isNullOrUndefined()) {
arg2 = nullptr;
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 3");
return false;
}
} else {
arg2 = nullptr;
}
uint16_t arg3;
if (args.hasDefined(3)) {
if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[3], "Argument 4", &arg3)) {
return false;
}
} else {
arg3 = 0;
}
JS::Rooted<JSObject*> arg4(cx);
if (args.hasDefined(4)) {
if (args[4].isObject()) {
arg4 = &args[4].toObject();
} else if (args[4].isNullOrUndefined()) {
arg4 = nullptr;
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 5");
return false;
}
} else {
arg4 = nullptr;
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::XPathResult>(MOZ_KnownLive(self)->Evaluate(cx, NonNullHelper(Constify(arg0)), MOZ_KnownLive(NonNullHelper(arg1)), MOZ_KnownLive(Constify(arg2)), arg3, arg4, rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document.evaluate"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const JSJitInfo evaluate_methodinfo = {
{ (JSJitGetterOp)evaluate },
{ prototypes::id::Document },
{ PrototypeTraits<prototypes::id::Document>::Depth },
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
false, /* isInfallible. False in setters. */
false, /* isMovable. Not relevant for setters. */
false, /* isEliminatable. Not relevant for setters. */
false, /* isAlwaysInSlot. Only relevant for getters. */
false, /* isLazilyCachedInSlot. Only relevant for getters. */
false, /* isTypedMethod. Only relevant for methods. */
0 /* Reserved slot index, if we're stored in a slot, else 0. */
};
static bool
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
{
mozilla::dom::Document* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::Document>(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::Document* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::Document>(obj);
if (self) {
JS::SetReservedSlot(obj, DOM_OBJECT_SLOT, JS::UndefinedValue());
{
JS::Value val = JS::GetReservedSlot(obj, (DOM_INSTANCE_RESERVED_SLOTS + 0));
if (!val.isUndefined()) {
JSObject* obj = &val.toObject();
js::SetProxyReservedSlot(obj, OBSERVABLE_ARRAY_DOM_INTERFACE_SLOT, JS::UndefinedValue());
}
}
ClearWrapper(self, self, obj);
if (size_t mallocBytes = BindingJSObjectMallocBytes(self)) {
JS::RemoveAssociatedMemory(obj, mallocBytes,
JS::MemoryUse::DOMBinding);
}
AddForDeferredFinalization<mozilla::dom::Document>(self);
}
}
static nsWrapperCache*
_getWrapperCache(JS::Handle<JSObject*> obj)
{
mozilla::dom::Document* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::Document>(obj);
return self;
}
static size_t
_objectMoved(JSObject* obj, JSObject* old)
{
mozilla::dom::Document* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::Document>(obj);
if (self) {
UpdateWrapper(self, self, obj, old);
}
return 0;
}
static const JSFunctionSpec sStaticMethods_specs[] = {
JS_FNSPEC("parseHTMLUnsafe", parseHTMLUnsafe, nullptr, 1, JSPROP_ENUMERATE, nullptr),
JS_FS_END
};
static const PrefableDisablers sStaticMethods_disablers0 = {
WebIDLPrefIndex::dom_webcomponents_shadowdom_declarative_enabled, 0, false, OriginTrial(0), nullptr
};
static const Prefable<const JSFunctionSpec> sStaticMethods[] = {
{ &sStaticMethods_disablers0, &sStaticMethods_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(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
"We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
static const JSFunctionSpec sMethods_specs[] = {
JS_FNSPEC("getElementsByTagName", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementsByTagName_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("getElementsByTagNameNS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementsByTagNameNS_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("getElementsByClassName", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementsByClassName_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("createElement", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createElement_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("createElementNS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createElementNS_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("createDocumentFragment", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createDocumentFragment_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("createTextNode", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createTextNode_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("createComment", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createComment_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("createProcessingInstruction", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createProcessingInstruction_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("importNode", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&importNode_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("adoptNode", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&adoptNode_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("createEvent", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createEvent_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("createRange", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createRange_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("createNodeIterator", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createNodeIterator_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("createTreeWalker", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createTreeWalker_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("createCDATASection", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createCDATASection_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("createAttribute", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createAttribute_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("createAttributeNS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createAttributeNS_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("getElementsByName", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementsByName_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("open", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&open_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("close", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&close_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("write", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&write_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("writeln", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&writeln_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("hasFocus", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&hasFocus_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("execCommand", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&execCommand_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("queryCommandEnabled", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&queryCommandEnabled_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("queryCommandIndeterm", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&queryCommandIndeterm_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("queryCommandState", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&queryCommandState_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("queryCommandSupported", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&queryCommandSupported_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("queryCommandValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&queryCommandValue_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("releaseCapture", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&releaseCapture_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("mozSetImageElement", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&mozSetImageElement_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("clear", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&clear_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("captureEvents", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&captureEvents_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("releaseEvents", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&releaseEvents_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("exitFullscreen", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&exitFullscreen_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("mozCancelFullScreen", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&mozCancelFullScreen_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("exitPointerLock", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&exitPointerLock_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("addCertException", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&addCertException_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("reloadWithHttpsOnlyException", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&reloadWithHttpsOnlyException_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("getFailedCertSecurityInfo", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getFailedCertSecurityInfo_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("getNetErrorInfo", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getNetErrorInfo_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("enableStyleSheetsForSet", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&enableStyleSheetsForSet_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("caretPositionFromPoint", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&caretPositionFromPoint_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("createTouch", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createTouch_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("createTouchList", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createTouchList_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("blockUnblockOnload", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&blockUnblockOnload_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("getSelection", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getSelection_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("hasStorageAccess", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&hasStorageAccess_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("requestStorageAccess", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&requestStorageAccess_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("requestStorageAccessUnderSite", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&requestStorageAccessUnderSite_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("completeStorageAccessRequestFromSite", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&completeStorageAccessRequestFromSite_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("requestStorageAccessForOrigin", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&requestStorageAccessForOrigin_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("elementFromPoint", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&elementFromPoint_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("elementsFromPoint", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&elementsFromPoint_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("getAnimations", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getAnimations_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("getBoxQuads", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getBoxQuads_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("convertQuadFromNode", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&convertQuadFromNode_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("convertRectFromNode", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&convertRectFromNode_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("convertPointFromNode", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&convertPointFromNode_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("getElementById", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementById_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("prepend", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&prepend_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("append", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&append_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("replaceChildren", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&replaceChildren_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("querySelector", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&querySelector_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("querySelectorAll", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&querySelectorAll_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("createExpression", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createExpression_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("createNSResolver", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createNSResolver_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("evaluate", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&evaluate_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FS_END
};
static const PrefableDisablers sMethods_disablers4 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &IsNotUAWidget
};
static const PrefableDisablers sMethods_disablers9 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &IsNotUAWidget
};
static const PrefableDisablers sMethods_disablers14 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &IsNotUAWidget
};
static const PrefableDisablers sMethods_disablers37 = {
WebIDLPrefIndex::dom_mouse_capture_enabled, 0, false, OriginTrial(0), nullptr
};
static const PrefableDisablers sMethods_disablers47 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &Document::CallerIsTrustedAboutCertError
};
static const PrefableDisablers sMethods_disablers49 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &Document::CallerIsTrustedAboutHttpsOnlyError
};
static const PrefableDisablers sMethods_disablers51 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &Document::CallerIsTrustedAboutCertError
};
static const PrefableDisablers sMethods_disablers53 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &Document::CallerIsTrustedAboutNetError
};
static const PrefableDisablers sMethods_disablers58 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
};
static const PrefableDisablers sMethods_disablers61 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &nsContentUtils::IsSystemOrPDFJS
};
static const PrefableDisablers sMethods_disablers65 = {
WebIDLPrefIndex::dom_storage_access_enabled, 0, false, OriginTrial(0), nullptr
};
static const PrefableDisablers sMethods_disablers68 = {
WebIDLPrefIndex::dom_storage_access_forward_declared_enabled, 0, false, OriginTrial(0), nullptr
};
static const PrefableDisablers sMethods_disablers71 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &Document::CallerCanAccessPrivilegeSSA
};
static const PrefableDisablers sMethods_disablers77 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &nsINode::HasBoxQuadsSupport
};
static const PrefableDisablers sMethods_disablers79 = {
WebIDLPrefIndex::layout_css_convertFromNode_enabled, 0, false, OriginTrial(0), nullptr
};
static const Prefable<const JSFunctionSpec> sMethods[] = {
{ nullptr, &sMethods_specs[0] },
{ &sMethods_disablers4, &sMethods_specs[4] },
{ nullptr, &sMethods_specs[7] },
{ &sMethods_disablers9, &sMethods_specs[9] },
{ nullptr, &sMethods_specs[12] },
{ &sMethods_disablers14, &sMethods_specs[14] },
{ nullptr, &sMethods_specs[17] },
{ &sMethods_disablers37, &sMethods_specs[37] },
{ nullptr, &sMethods_specs[39] },
{ &sMethods_disablers47, &sMethods_specs[47] },
{ &sMethods_disablers49, &sMethods_specs[49] },
{ &sMethods_disablers51, &sMethods_specs[51] },
{ &sMethods_disablers53, &sMethods_specs[53] },
{ nullptr, &sMethods_specs[55] },
{ &sMethods_disablers58, &sMethods_specs[58] },
{ &sMethods_disablers61, &sMethods_specs[61] },
{ nullptr, &sMethods_specs[63] },
{ &sMethods_disablers65, &sMethods_specs[65] },
{ &sMethods_disablers68, &sMethods_specs[68] },
{ &sMethods_disablers71, &sMethods_specs[71] },
{ nullptr, &sMethods_specs[73] },
{ &sMethods_disablers77, &sMethods_specs[77] },
{ &sMethods_disablers79, &sMethods_specs[79] },
{ nullptr, &sMethods_specs[83] },
{ nullptr, nullptr }
};
static_assert(24 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
"We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
static_assert(19 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
"We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
static const JSFunctionSpec sChromeMethods_specs[] = {
JS_FNSPEC("createXULElement", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createXULElement_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("blockParsing", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&blockParsing_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("getConnectedShadowRoots", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getConnectedShadowRoots_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("insertAnonymousContent", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&insertAnonymousContent_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("removeAnonymousContent", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&removeAnonymousContent_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("notifyUserGestureActivation", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&notifyUserGestureActivation_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("clearUserGestureActivation", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&clearUserGestureActivation_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("consumeTransientUserGestureActivation", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&consumeTransientUserGestureActivation_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("setSuppressedEventListener", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&setSuppressedEventListener_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("setKeyPressEventModel", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&setKeyPressEventModel_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("userInteractionForTesting", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&userInteractionForTesting_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("setNotifyFetchSuccess", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&setNotifyFetchSuccess_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("setNotifyFormOrPasswordRemoved", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&setNotifyFormOrPasswordRemoved_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("getWireframe", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getWireframe_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("isActive", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isActive_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("nodeFromPoint", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&nodeFromPoint_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("nodesFromPoint", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&nodesFromPoint_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("getBoxQuadsFromWindowOrigin", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getBoxQuadsFromWindowOrigin_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
JS_FS_END,
JS_FNSPEC("getElementsByAttribute", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementsByAttribute_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
JS_FNSPEC("getElementsByAttributeNS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementsByAttributeNS_methodinfo), 3, JSPROP_ENUMERATE, nullptr),
JS_FS_END
};
static const PrefableDisablers sChromeMethods_disablers18 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &nsINode::HasBoxQuadsSupport
};
static const Prefable<const JSFunctionSpec> sChromeMethods[] = {
{ nullptr, &sChromeMethods_specs[0] },
{ &sChromeMethods_disablers18, &sChromeMethods_specs[18] },
{ nullptr, &sChromeMethods_specs[20] },
{ nullptr, nullptr }
};
static_assert(3 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
"We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
static_assert(17 <= 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("implementation", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &implementation_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("URL", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &URL_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("documentURI", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &documentURI_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("compatMode", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &compatMode_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("characterSet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &characterSet_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("charset", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &charset_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("inputEncoding", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &inputEncoding_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("contentType", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &contentType_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("doctype", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &doctype_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("documentElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &documentElement_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("domain", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &domain_getterinfo, GenericSetter<NormalThisPolicy>, &domain_setterinfo),
JSPropertySpec::nativeAccessors("referrer", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &referrer_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("cookie", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &cookie_getterinfo, GenericSetter<NormalThisPolicy>, &cookie_setterinfo),
JSPropertySpec::nativeAccessors("lastModified", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &lastModified_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("readyState", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readyState_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("title", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &title_getterinfo, GenericSetter<NormalThisPolicy>, &title_setterinfo),
JSPropertySpec::nativeAccessors("dir", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &dir_getterinfo, GenericSetter<NormalThisPolicy>, &dir_setterinfo),
JSPropertySpec::nativeAccessors("body", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &body_getterinfo, GenericSetter<NormalThisPolicy>, &body_setterinfo),
JSPropertySpec::nativeAccessors("head", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &head_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("images", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &images_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("embeds", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &embeds_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("plugins", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &plugins_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("links", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &links_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("forms", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &forms_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("scripts", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &scripts_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("defaultView", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &defaultView_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("designMode", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &designMode_getterinfo, GenericSetter<NormalThisPolicy>, &designMode_setterinfo),
JSPropertySpec::nativeAccessors("onreadystatechange", JSPROP_ENUMERATE, GenericGetter<LenientThisPolicy, ThrowExceptions>, &onreadystatechange_getterinfo, GenericSetter<LenientThisPolicy>, &onreadystatechange_setterinfo),
JSPropertySpec::nativeAccessors("onbeforescriptexecute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onbeforescriptexecute_getterinfo, GenericSetter<NormalThisPolicy>, &onbeforescriptexecute_setterinfo),
JSPropertySpec::nativeAccessors("onafterscriptexecute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onafterscriptexecute_getterinfo, GenericSetter<NormalThisPolicy>, &onafterscriptexecute_setterinfo),
JS_PS_END,
JSPropertySpec::nativeAccessors("mozSyntheticDocument", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &mozSyntheticDocument_getterinfo, nullptr, nullptr),
JS_PS_END,
JSPropertySpec::nativeAccessors("currentScript", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &currentScript_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("fgColor", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &fgColor_getterinfo, GenericSetter<NormalThisPolicy>, &fgColor_setterinfo),
JSPropertySpec::nativeAccessors("linkColor", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &linkColor_getterinfo, GenericSetter<NormalThisPolicy>, &linkColor_setterinfo),
JSPropertySpec::nativeAccessors("vlinkColor", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &vlinkColor_getterinfo, GenericSetter<NormalThisPolicy>, &vlinkColor_setterinfo),
JSPropertySpec::nativeAccessors("alinkColor", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &alinkColor_getterinfo, GenericSetter<NormalThisPolicy>, &alinkColor_setterinfo),
JSPropertySpec::nativeAccessors("bgColor", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &bgColor_getterinfo, GenericSetter<NormalThisPolicy>, &bgColor_setterinfo),
JSPropertySpec::nativeAccessors("anchors", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &anchors_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("applets", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &applets_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("all", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &all_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("fullscreen", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &fullscreen_getterinfo, GenericSetter<NormalThisPolicy>, &fullscreen_setterinfo),
JSPropertySpec::nativeAccessors("mozFullScreen", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &mozFullScreen_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("fullscreenEnabled", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &fullscreenEnabled_getterinfo, GenericSetter<NormalThisPolicy>, &fullscreenEnabled_setterinfo),
JSPropertySpec::nativeAccessors("mozFullScreenEnabled", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &mozFullScreenEnabled_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("onfullscreenchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onfullscreenchange_getterinfo, GenericSetter<NormalThisPolicy>, &onfullscreenchange_setterinfo),
JSPropertySpec::nativeAccessors("onfullscreenerror", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onfullscreenerror_getterinfo, GenericSetter<NormalThisPolicy>, &onfullscreenerror_setterinfo),
JSPropertySpec::nativeAccessors("onpointerlockchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerlockchange_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerlockchange_setterinfo),
JSPropertySpec::nativeAccessors("onpointerlockerror", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerlockerror_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerlockerror_setterinfo),
JSPropertySpec::nativeAccessors("hidden", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &hidden_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("visibilityState", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &visibilityState_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("onvisibilitychange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onvisibilitychange_getterinfo, GenericSetter<NormalThisPolicy>, &onvisibilitychange_setterinfo),
JSPropertySpec::nativeAccessors("selectedStyleSheetSet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &selectedStyleSheetSet_getterinfo, GenericSetter<NormalThisPolicy>, &selectedStyleSheetSet_setterinfo),
JSPropertySpec::nativeAccessors("lastStyleSheetSet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &lastStyleSheetSet_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("preferredStyleSheetSet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &preferredStyleSheetSet_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("styleSheetSets", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &styleSheetSets_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("scrollingElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &scrollingElement_getterinfo, nullptr, nullptr),
JS_PS_END,
JSPropertySpec::nativeAccessors("timeline", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &timeline_getterinfo, nullptr, nullptr),
JS_PS_END,
JSPropertySpec::nativeAccessors("rootElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &rootElement_getterinfo, nullptr, nullptr),
JS_PS_END,
JSPropertySpec::nativeAccessors("l10n", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &l10n_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("hasPendingL10nMutations", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &hasPendingL10nMutations_getterinfo, nullptr, nullptr),
JS_PS_END,
JSPropertySpec::nativeAccessors("featurePolicy", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &featurePolicy_getterinfo, nullptr, nullptr),
JS_PS_END,
JSPropertySpec::nativeAccessors("fragmentDirective", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &fragmentDirective_getterinfo, nullptr, nullptr),
JS_PS_END,
JSPropertySpec::nativeAccessors("activeElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &activeElement_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("styleSheets", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &styleSheets_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("pointerLockElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &pointerLockElement_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("fullscreenElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &fullscreenElement_getterinfo, GenericSetter<NormalThisPolicy>, &fullscreenElement_setterinfo),
JSPropertySpec::nativeAccessors("mozFullScreenElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &mozFullScreenElement_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("adoptedStyleSheets", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &adoptedStyleSheets_getterinfo, GenericSetter<NormalThisPolicy>, &adoptedStyleSheets_setterinfo),
JSPropertySpec::nativeAccessors("fonts", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &fonts_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("onabort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onabort_getterinfo, GenericSetter<NormalThisPolicy>, &onabort_setterinfo),
JSPropertySpec::nativeAccessors("onblur", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onblur_getterinfo, GenericSetter<NormalThisPolicy>, &onblur_setterinfo),
JSPropertySpec::nativeAccessors("onfocus", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onfocus_getterinfo, GenericSetter<NormalThisPolicy>, &onfocus_setterinfo),
JSPropertySpec::nativeAccessors("oncancel", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncancel_getterinfo, GenericSetter<NormalThisPolicy>, &oncancel_setterinfo),
JSPropertySpec::nativeAccessors("onauxclick", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onauxclick_getterinfo, GenericSetter<NormalThisPolicy>, &onauxclick_setterinfo),
JSPropertySpec::nativeAccessors("onbeforeinput", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onbeforeinput_getterinfo, GenericSetter<NormalThisPolicy>, &onbeforeinput_setterinfo),
JS_PS_END,
JSPropertySpec::nativeAccessors("onbeforetoggle", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onbeforetoggle_getterinfo, GenericSetter<NormalThisPolicy>, &onbeforetoggle_setterinfo),
JS_PS_END,
JSPropertySpec::nativeAccessors("oncanplay", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncanplay_getterinfo, GenericSetter<NormalThisPolicy>, &oncanplay_setterinfo),
JSPropertySpec::nativeAccessors("oncanplaythrough", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncanplaythrough_getterinfo, GenericSetter<NormalThisPolicy>, &oncanplaythrough_setterinfo),
JSPropertySpec::nativeAccessors("onchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onchange_getterinfo, GenericSetter<NormalThisPolicy>, &onchange_setterinfo),
JSPropertySpec::nativeAccessors("onclick", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onclick_getterinfo, GenericSetter<NormalThisPolicy>, &onclick_setterinfo),
JSPropertySpec::nativeAccessors("onclose", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onclose_getterinfo, GenericSetter<NormalThisPolicy>, &onclose_setterinfo),
JSPropertySpec::nativeAccessors("oncontextlost", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncontextlost_getterinfo, GenericSetter<NormalThisPolicy>, &oncontextlost_setterinfo),
JSPropertySpec::nativeAccessors("oncontextmenu", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncontextmenu_getterinfo, GenericSetter<NormalThisPolicy>, &oncontextmenu_setterinfo),
JSPropertySpec::nativeAccessors("oncontextrestored", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncontextrestored_getterinfo, GenericSetter<NormalThisPolicy>, &oncontextrestored_setterinfo),
JSPropertySpec::nativeAccessors("oncopy", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncopy_getterinfo, GenericSetter<NormalThisPolicy>, &oncopy_setterinfo),
JSPropertySpec::nativeAccessors("oncuechange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncuechange_getterinfo, GenericSetter<NormalThisPolicy>, &oncuechange_setterinfo),
JSPropertySpec::nativeAccessors("oncut", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncut_getterinfo, GenericSetter<NormalThisPolicy>, &oncut_setterinfo),
JSPropertySpec::nativeAccessors("ondblclick", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondblclick_getterinfo, GenericSetter<NormalThisPolicy>, &ondblclick_setterinfo),
JSPropertySpec::nativeAccessors("ondrag", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondrag_getterinfo, GenericSetter<NormalThisPolicy>, &ondrag_setterinfo),
JSPropertySpec::nativeAccessors("ondragend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondragend_getterinfo, GenericSetter<NormalThisPolicy>, &ondragend_setterinfo),
JSPropertySpec::nativeAccessors("ondragenter", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondragenter_getterinfo, GenericSetter<NormalThisPolicy>, &ondragenter_setterinfo),
JS_PS_END,
JSPropertySpec::nativeAccessors("ondragexit", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondragexit_getterinfo, GenericSetter<NormalThisPolicy>, &ondragexit_setterinfo),
JS_PS_END,
JSPropertySpec::nativeAccessors("ondragleave", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondragleave_getterinfo, GenericSetter<NormalThisPolicy>, &ondragleave_setterinfo),
JSPropertySpec::nativeAccessors("ondragover", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondragover_getterinfo, GenericSetter<NormalThisPolicy>, &ondragover_setterinfo),
JSPropertySpec::nativeAccessors("ondragstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondragstart_getterinfo, GenericSetter<NormalThisPolicy>, &ondragstart_setterinfo),
JSPropertySpec::nativeAccessors("ondrop", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondrop_getterinfo, GenericSetter<NormalThisPolicy>, &ondrop_setterinfo),
JSPropertySpec::nativeAccessors("ondurationchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondurationchange_getterinfo, GenericSetter<NormalThisPolicy>, &ondurationchange_setterinfo),
JSPropertySpec::nativeAccessors("onemptied", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onemptied_getterinfo, GenericSetter<NormalThisPolicy>, &onemptied_setterinfo),
JSPropertySpec::nativeAccessors("onended", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onended_getterinfo, GenericSetter<NormalThisPolicy>, &onended_setterinfo),
JSPropertySpec::nativeAccessors("onformdata", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onformdata_getterinfo, GenericSetter<NormalThisPolicy>, &onformdata_setterinfo),
JSPropertySpec::nativeAccessors("oninput", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oninput_getterinfo, GenericSetter<NormalThisPolicy>, &oninput_setterinfo),
JSPropertySpec::nativeAccessors("oninvalid", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oninvalid_getterinfo, GenericSetter<NormalThisPolicy>, &oninvalid_setterinfo),
JSPropertySpec::nativeAccessors("onkeydown", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onkeydown_getterinfo, GenericSetter<NormalThisPolicy>, &onkeydown_setterinfo),
JSPropertySpec::nativeAccessors("onkeypress", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onkeypress_getterinfo, GenericSetter<NormalThisPolicy>, &onkeypress_setterinfo),
JSPropertySpec::nativeAccessors("onkeyup", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onkeyup_getterinfo, GenericSetter<NormalThisPolicy>, &onkeyup_setterinfo),
JSPropertySpec::nativeAccessors("onload", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onload_getterinfo, GenericSetter<NormalThisPolicy>, &onload_setterinfo),
JSPropertySpec::nativeAccessors("onloadeddata", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onloadeddata_getterinfo, GenericSetter<NormalThisPolicy>, &onloadeddata_setterinfo),
JSPropertySpec::nativeAccessors("onloadedmetadata", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onloadedmetadata_getterinfo, GenericSetter<NormalThisPolicy>, &onloadedmetadata_setterinfo),
JSPropertySpec::nativeAccessors("onloadstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onloadstart_getterinfo, GenericSetter<NormalThisPolicy>, &onloadstart_setterinfo),
JSPropertySpec::nativeAccessors("onmousedown", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmousedown_getterinfo, GenericSetter<NormalThisPolicy>, &onmousedown_setterinfo),
JSPropertySpec::nativeAccessors("onmouseenter", JSPROP_ENUMERATE, GenericGetter<LenientThisPolicy, ThrowExceptions>, &onmouseenter_getterinfo, GenericSetter<LenientThisPolicy>, &onmouseenter_setterinfo),
JSPropertySpec::nativeAccessors("onmouseleave", JSPROP_ENUMERATE, GenericGetter<LenientThisPolicy, ThrowExceptions>, &onmouseleave_getterinfo, GenericSetter<LenientThisPolicy>, &onmouseleave_setterinfo),
JSPropertySpec::nativeAccessors("onmousemove", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmousemove_getterinfo, GenericSetter<NormalThisPolicy>, &onmousemove_setterinfo),
JSPropertySpec::nativeAccessors("onmouseout", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmouseout_getterinfo, GenericSetter<NormalThisPolicy>, &onmouseout_setterinfo),
JSPropertySpec::nativeAccessors("onmouseover", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmouseover_getterinfo, GenericSetter<NormalThisPolicy>, &onmouseover_setterinfo),
JSPropertySpec::nativeAccessors("onmouseup", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmouseup_getterinfo, GenericSetter<NormalThisPolicy>, &onmouseup_setterinfo),
JSPropertySpec::nativeAccessors("onwheel", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onwheel_getterinfo, GenericSetter<NormalThisPolicy>, &onwheel_setterinfo),
JSPropertySpec::nativeAccessors("onpaste", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpaste_getterinfo, GenericSetter<NormalThisPolicy>, &onpaste_setterinfo),
JSPropertySpec::nativeAccessors("onpause", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpause_getterinfo, GenericSetter<NormalThisPolicy>, &onpause_setterinfo),
JSPropertySpec::nativeAccessors("onplay", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onplay_getterinfo, GenericSetter<NormalThisPolicy>, &onplay_setterinfo),
JSPropertySpec::nativeAccessors("onplaying", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onplaying_getterinfo, GenericSetter<NormalThisPolicy>, &onplaying_setterinfo),
JSPropertySpec::nativeAccessors("onprogress", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onprogress_getterinfo, GenericSetter<NormalThisPolicy>, &onprogress_setterinfo),
JSPropertySpec::nativeAccessors("onratechange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onratechange_getterinfo, GenericSetter<NormalThisPolicy>, &onratechange_setterinfo),
JSPropertySpec::nativeAccessors("onreset", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onreset_getterinfo, GenericSetter<NormalThisPolicy>, &onreset_setterinfo),
JSPropertySpec::nativeAccessors("onresize", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onresize_getterinfo, GenericSetter<NormalThisPolicy>, &onresize_setterinfo),
JSPropertySpec::nativeAccessors("onscroll", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onscroll_getterinfo, GenericSetter<NormalThisPolicy>, &onscroll_setterinfo),
JSPropertySpec::nativeAccessors("onscrollend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onscrollend_getterinfo, GenericSetter<NormalThisPolicy>, &onscrollend_setterinfo),
JSPropertySpec::nativeAccessors("onsecuritypolicyviolation", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onsecuritypolicyviolation_getterinfo, GenericSetter<NormalThisPolicy>, &onsecuritypolicyviolation_setterinfo),
JSPropertySpec::nativeAccessors("onseeked", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onseeked_getterinfo, GenericSetter<NormalThisPolicy>, &onseeked_setterinfo),
JSPropertySpec::nativeAccessors("onseeking", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onseeking_getterinfo, GenericSetter<NormalThisPolicy>, &onseeking_setterinfo),
JSPropertySpec::nativeAccessors("onselect", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onselect_getterinfo, GenericSetter<NormalThisPolicy>, &onselect_setterinfo),
JSPropertySpec::nativeAccessors("onslotchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onslotchange_getterinfo, GenericSetter<NormalThisPolicy>, &onslotchange_setterinfo),
JSPropertySpec::nativeAccessors("onstalled", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onstalled_getterinfo, GenericSetter<NormalThisPolicy>, &onstalled_setterinfo),
JSPropertySpec::nativeAccessors("onsubmit", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onsubmit_getterinfo, GenericSetter<NormalThisPolicy>, &onsubmit_setterinfo),
JSPropertySpec::nativeAccessors("onsuspend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onsuspend_getterinfo, GenericSetter<NormalThisPolicy>, &onsuspend_setterinfo),
JSPropertySpec::nativeAccessors("ontimeupdate", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontimeupdate_getterinfo, GenericSetter<NormalThisPolicy>, &ontimeupdate_setterinfo),
JSPropertySpec::nativeAccessors("onvolumechange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onvolumechange_getterinfo, GenericSetter<NormalThisPolicy>, &onvolumechange_setterinfo),
JSPropertySpec::nativeAccessors("onwaiting", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onwaiting_getterinfo, GenericSetter<NormalThisPolicy>, &onwaiting_setterinfo),
JSPropertySpec::nativeAccessors("onselectstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onselectstart_getterinfo, GenericSetter<NormalThisPolicy>, &onselectstart_setterinfo),
JSPropertySpec::nativeAccessors("onselectionchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onselectionchange_getterinfo, GenericSetter<NormalThisPolicy>, &onselectionchange_setterinfo),
JSPropertySpec::nativeAccessors("ontoggle", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontoggle_getterinfo, GenericSetter<NormalThisPolicy>, &ontoggle_setterinfo),
JSPropertySpec::nativeAccessors("onpointercancel", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointercancel_getterinfo, GenericSetter<NormalThisPolicy>, &onpointercancel_setterinfo),
JSPropertySpec::nativeAccessors("onpointerdown", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerdown_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerdown_setterinfo),
JSPropertySpec::nativeAccessors("onpointerup", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerup_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerup_setterinfo),
JSPropertySpec::nativeAccessors("onpointermove", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointermove_getterinfo, GenericSetter<NormalThisPolicy>, &onpointermove_setterinfo),
JSPropertySpec::nativeAccessors("onpointerout", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerout_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerout_setterinfo),
JSPropertySpec::nativeAccessors("onpointerover", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerover_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerover_setterinfo),
JSPropertySpec::nativeAccessors("onpointerenter", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerenter_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerenter_setterinfo),
JSPropertySpec::nativeAccessors("onpointerleave", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerleave_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerleave_setterinfo),
JSPropertySpec::nativeAccessors("ongotpointercapture", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ongotpointercapture_getterinfo, GenericSetter<NormalThisPolicy>, &ongotpointercapture_setterinfo),
JSPropertySpec::nativeAccessors("onlostpointercapture", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onlostpointercapture_getterinfo, GenericSetter<NormalThisPolicy>, &onlostpointercapture_setterinfo),
JSPropertySpec::nativeAccessors("onmozfullscreenchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmozfullscreenchange_getterinfo, GenericSetter<NormalThisPolicy>, &onmozfullscreenchange_setterinfo),
JSPropertySpec::nativeAccessors("onmozfullscreenerror", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmozfullscreenerror_getterinfo, GenericSetter<NormalThisPolicy>, &onmozfullscreenerror_setterinfo),
JSPropertySpec::nativeAccessors("onanimationcancel", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onanimationcancel_getterinfo, GenericSetter<NormalThisPolicy>, &onanimationcancel_setterinfo),
JSPropertySpec::nativeAccessors("onanimationend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onanimationend_getterinfo, GenericSetter<NormalThisPolicy>, &onanimationend_setterinfo),
JSPropertySpec::nativeAccessors("onanimationiteration", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onanimationiteration_getterinfo, GenericSetter<NormalThisPolicy>, &onanimationiteration_setterinfo),
JSPropertySpec::nativeAccessors("onanimationstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onanimationstart_getterinfo, GenericSetter<NormalThisPolicy>, &onanimationstart_setterinfo),
JSPropertySpec::nativeAccessors("ontransitioncancel", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontransitioncancel_getterinfo, GenericSetter<NormalThisPolicy>, &ontransitioncancel_setterinfo),
JSPropertySpec::nativeAccessors("ontransitionend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontransitionend_getterinfo, GenericSetter<NormalThisPolicy>, &ontransitionend_setterinfo),
JSPropertySpec::nativeAccessors("ontransitionrun", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontransitionrun_getterinfo, GenericSetter<NormalThisPolicy>, &ontransitionrun_setterinfo),
JSPropertySpec::nativeAccessors("ontransitionstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontransitionstart_getterinfo, GenericSetter<NormalThisPolicy>, &ontransitionstart_setterinfo),
JSPropertySpec::nativeAccessors("onwebkitanimationend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onwebkitanimationend_getterinfo, GenericSetter<NormalThisPolicy>, &onwebkitanimationend_setterinfo),
JSPropertySpec::nativeAccessors("onwebkitanimationiteration", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onwebkitanimationiteration_getterinfo, GenericSetter<NormalThisPolicy>, &onwebkitanimationiteration_setterinfo),
JSPropertySpec::nativeAccessors("onwebkitanimationstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onwebkitanimationstart_getterinfo, GenericSetter<NormalThisPolicy>, &onwebkitanimationstart_setterinfo),
JSPropertySpec::nativeAccessors("onwebkittransitionend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onwebkittransitionend_getterinfo, GenericSetter<NormalThisPolicy>, &onwebkittransitionend_setterinfo),
JSPropertySpec::nativeAccessors("onerror", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onerror_getterinfo, GenericSetter<NormalThisPolicy>, &onerror_setterinfo),
JSPropertySpec::nativeAccessors("children", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &children_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("firstElementChild", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &firstElementChild_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("lastElementChild", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &lastElementChild_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("childElementCount", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &childElementCount_getterinfo, nullptr, nullptr),
JS_PS_END,
JSPropertySpec::nativeAccessors("ontouchstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontouchstart_getterinfo, GenericSetter<NormalThisPolicy>, &ontouchstart_setterinfo),
JSPropertySpec::nativeAccessors("ontouchend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontouchend_getterinfo, GenericSetter<NormalThisPolicy>, &ontouchend_setterinfo),
JSPropertySpec::nativeAccessors("ontouchmove", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontouchmove_getterinfo, GenericSetter<NormalThisPolicy>, &ontouchmove_setterinfo),
JSPropertySpec::nativeAccessors("ontouchcancel", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontouchcancel_getterinfo, GenericSetter<NormalThisPolicy>, &ontouchcancel_setterinfo),
JS_PS_END
};
static const PrefableDisablers sAttributes_disablers31 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &IsChromeOrUAWidget
};
static const PrefableDisablers sAttributes_disablers59 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &Document::AreWebAnimationsTimelinesEnabled
};
static const PrefableDisablers sAttributes_disablers63 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &Document::DocumentSupportsL10n
};
static const PrefableDisablers sAttributes_disablers66 = {
WebIDLPrefIndex::dom_security_featurePolicy_webidl_enabled, 0, false, OriginTrial(0), nullptr
};
static const PrefableDisablers sAttributes_disablers68 = {
WebIDLPrefIndex::dom_text_fragments_enabled, 0, false, OriginTrial(0), nullptr
};
static const PrefableDisablers sAttributes_disablers84 = {
WebIDLPrefIndex::dom_element_popover_enabled, 0, false, OriginTrial(0), nullptr
};
static const PrefableDisablers sAttributes_disablers102 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &Event::IsDragExitEnabled
};
static const PrefableDisablers sAttributes_disablers183 = {
WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
};
static const Prefable<const JSPropertySpec> sAttributes[] = {
{ nullptr, &sAttributes_specs[0] },
{ &sAttributes_disablers31, &sAttributes_specs[31] },
{ nullptr, &sAttributes_specs[33] },
{ &sAttributes_disablers59, &sAttributes_specs[59] },
{ nullptr, &sAttributes_specs[61] },
{ &sAttributes_disablers63, &sAttributes_specs[63] },
{ &sAttributes_disablers66, &sAttributes_specs[66] },
{ &sAttributes_disablers68, &sAttributes_specs[68] },
{ nullptr, &sAttributes_specs[70] },
{ &sAttributes_disablers84, &sAttributes_specs[84] },
{ nullptr, &sAttributes_specs[86] },
{ &sAttributes_disablers102, &sAttributes_specs[102] },
{ nullptr, &sAttributes_specs[104] },
{ &sAttributes_disablers183, &sAttributes_specs[183] },
{ nullptr, nullptr }
};
static_assert(14 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
"We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
static_assert(78 <= 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("documentURIObject", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &documentURIObject_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("referrerPolicy", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &referrerPolicy_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("referrerInfo", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &referrerInfo_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("loadedFromPrototype", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &loadedFromPrototype_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("effectiveStoragePrincipal", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &effectiveStoragePrincipal_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("partitionedPrincipal", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &partitionedPrincipal_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("cookieJarSettings", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &cookieJarSettings_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("styleSheetChangeEventsEnabled", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &styleSheetChangeEventsEnabled_getterinfo, GenericSetter<NormalThisPolicy>, &styleSheetChangeEventsEnabled_setterinfo),
JSPropertySpec::nativeAccessors("devToolsAnonymousAndShadowEventsEnabled", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &devToolsAnonymousAndShadowEventsEnabled_getterinfo, GenericSetter<NormalThisPolicy>, &devToolsAnonymousAndShadowEventsEnabled_setterinfo),
JSPropertySpec::nativeAccessors("contentLanguage", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &contentLanguage_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("documentLoadGroup", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &documentLoadGroup_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("mozDocumentURIIfNotForErrorPages", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &mozDocumentURIIfNotForErrorPages_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("documentReadyForIdle", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ConvertExceptionsToPromises>, &documentReadyForIdle_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("commandDispatcher", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &commandDispatcher_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("devToolsWatchingDOMMutations", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &devToolsWatchingDOMMutations_getterinfo, GenericSetter<NormalThisPolicy>, &devToolsWatchingDOMMutations_setterinfo),
JSPropertySpec::nativeAccessors("isSrcdocDocument", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &isSrcdocDocument_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("sandboxFlagsAsString", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &sandboxFlagsAsString_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("userHasInteracted", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &userHasInteracted_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("hasBeenUserGestureActivated", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &hasBeenUserGestureActivated_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("hasValidTransientUserGestureActivation", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &hasValidTransientUserGestureActivation_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("lastUserGestureTimeStamp", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &lastUserGestureTimeStamp_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("csp", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &csp_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("cspJSON", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &cspJSON_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("blockedNodeByClassifierCount", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &blockedNodeByClassifierCount_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("blockedNodesByClassifier", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &blockedNodesByClassifier_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("permDelegateHandler", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &permDelegateHandler_getterinfo, nullptr, nullptr),
JSPropertySpec::nativeAccessors("isInitialDocument", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &isInitialDocument_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(27 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
"We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
static const JSPropertySpec sUnforgeableAttributes_specs[] = {
JSPropertySpec::nativeAccessors("location", JSPROP_ENUMERATE | JSPROP_PERMANENT, GenericGetter<NormalThisPolicy, ThrowExceptions>, &location_getterinfo, GenericSetter<NormalThisPolicy>, &location_setterinfo),
JS_PS_END
};
static const Prefable<const JSPropertySpec> sUnforgeableAttributes[] = {
{ nullptr, &sUnforgeableAttributes_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(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
"We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
static const ConstantSpec sChromeConstants_specs[] = {
{ "KEYPRESS_EVENT_MODEL_DEFAULT", JS::Int32Value(0) },
{ "KEYPRESS_EVENT_MODEL_SPLIT", JS::Int32Value(1) },
{ "KEYPRESS_EVENT_MODEL_CONFLATED", JS::Int32Value(2) },
{ 0, JS::UndefinedValue() }
};
static const Prefable<const ConstantSpec> sChromeConstants[] = {
{ nullptr, &sChromeConstants_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(3 <= 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[245];
static PropertyInfo sNativeProperties_propertyInfos[245];
static const NativePropertiesN<4> sNativeProperties = {
true, 0 /* sStaticMethods */,
false, 0,
true, 1 /* sMethods */,
true, 2 /* sAttributes */,
false, 0,
true, 3 /* sUnforgeableAttributes */,
false, 0,
-1,
245,
sNativeProperties_sortedPropertyIndices,
{
{ sStaticMethods, &sNativeProperties_propertyInfos[0] },
{ sMethods, &sNativeProperties_propertyInfos[1] },
{ sAttributes, &sNativeProperties_propertyInfos[70] },
{ sUnforgeableAttributes, &sNativeProperties_propertyInfos[244] }
}
};
static_assert(245 < 1ull << (CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount)),
"We have a property info count that is oversized");
static uint16_t sChromeOnlyNativeProperties_sortedPropertyIndices[50];
static PropertyInfo sChromeOnlyNativeProperties_propertyInfos[50];
static const NativePropertiesN<3> sChromeOnlyNativeProperties = {
false, 0,
false, 0,
true, 0 /* sChromeMethods */,
true, 1 /* sChromeAttributes */,
false, 0,
false, 0,
true, 2 /* sChromeConstants */,
-1,
50,
sChromeOnlyNativeProperties_sortedPropertyIndices,
{
{ sChromeMethods, &sChromeOnlyNativeProperties_propertyInfos[0] },
{ sChromeAttributes, &sChromeOnlyNativeProperties_propertyInfos[20] },
{ sChromeConstants, &sChromeOnlyNativeProperties_propertyInfos[47] }
}
};
static_assert(50 < 1ull << (CHAR_BIT * sizeof(sChromeOnlyNativeProperties.propertyInfoCount)),
"We have a property info count that is oversized");
// This may allocate too many slots, because we only really need
// slots for our non-interface-typed members that we cache. But
// allocating slots only for those would make the slot index
// computations much more complicated, so let's do this the simple
// way for now.
DEFINE_XRAY_EXPANDO_CLASS(static, sXrayExpandoObjectClass, 1);
bool sNativePropertiesInited = false;
const NativePropertyHooks sNativePropertyHooks = {
nullptr,
{ sNativeProperties.Upcast(), sChromeOnlyNativeProperties.Upcast(), &sNativePropertiesInited },
prototypes::id::Document,
constructors::id::Document,
&sXrayExpandoObjectClass
};
static bool
_constructor(JSContext* cx, unsigned argc, JS::Value* vp)
{
AUTO_PROFILER_LABEL_DYNAMIC_FAST(
"Document", "constructor", DOM, cx,
uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS));
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::Rooted<JSObject*> obj(cx, &args.callee());
if (!args.isConstructing()) {
return ThrowConstructorWithoutNew(cx, "Document");
}
JS::Rooted<JSObject*> desiredProto(cx);
if (!GetDesiredProto(cx, args,
prototypes::id::Document,
CreateInterfaceObjects,
&desiredProto)) {
return false;
}
GlobalObject global(cx, obj);
if (global.Failed()) {
return false;
}
bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
Maybe<JSAutoRealm> ar;
if (objIsXray) {
// Since our object is an Xray, we can just CheckedUnwrapStatic:
// we know Xrays have no dynamic unwrap behavior.
obj = js::CheckedUnwrapStatic(obj);
if (!obj) {
return false;
}
ar.emplace(cx, obj);
if (!JS_WrapObject(cx, &desiredProto)) {
return false;
}
}
FastErrorResult rv;
auto result(StrongOrRawPtr<mozilla::dom::Document>(mozilla::dom::Document::Constructor(global, rv)));
if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Document constructor"))) {
return false;
}
MOZ_ASSERT(!JS_IsExceptionPending(cx));
static_assert(!std::is_pointer_v<decltype(result)>,
"NewObject implies that we need to keep the object alive with a strong reference.");
if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
return true;
}
static const DOMInterfaceInfo sInterfaceObjectInfo = {
{ _constructor, &sNativePropertyHooks },
Node_Binding::GetConstructorObject,
prototypes::id::Document,
PrototypeTraits<prototypes::id::Document>::Depth,
true,
};
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
{
"DocumentPrototype",
JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE + 1 /* slot for the JSObject holding the unforgeable properties */),
JS_NULL_CLASS_OPS,
JS_NULL_CLASS_SPEC,
JS_NULL_CLASS_EXT,
JS_NULL_OBJECT_OPS
},
eInterfacePrototype,
prototypes::id::Document,
PrototypeTraits<prototypes::id::Document>::Depth,
&sNativePropertyHooks,
Node_Binding::GetProtoObject
};
bool
CountMaybeMissingProperty(JS::Handle<JSObject*> proxy, JS::Handle<jsid> id)
{
MOZ_ASSERT(StaticPrefs::dom_missing_prop_counters_enabled() && id.isAtom());
Maybe<UseCounter> counter;
{
// Scope for our no-GC section, so we don't need to rely on SetUseCounter not GCing.
JS::AutoCheckCannotGC nogc;
JSLinearString* str = JS::AtomToLinearString(id.toAtom());
// Don't waste time fetching the chars until we've done the length switch.
switch (JS::GetLinearStringLength(str)) {
case 10: {
if (JS_LinearStringEqualsLiteral(str, "xmlVersion")) {
counter.emplace(eUseCounter_Document_xmlVersion);
}
break;
}
case 11: {
StringIdChars chars(nogc, str);
switch (chars[0]) {
case 'o': {
if (JS_LinearStringEqualsLiteral(str, "onbeforecut")) {
counter.emplace(eUseCounter_Document_onbeforecut);
}
break;
}
case 'x': {
if (JS_LinearStringEqualsLiteral(str, "xmlEncoding")) {
counter.emplace(eUseCounter_Document_xmlEncoding);
}
break;
}
}
break;
}
case 12: {
StringIdChars chars(nogc, str);
switch (chars[0]) {
case 'o': {
switch (chars[2]) {
case 'b': {
if (JS_LinearStringEqualsLiteral(str, "onbeforecopy")) {
counter.emplace(eUseCounter_Document_onbeforecopy);
}
break;
}
case 'm': {
if (JS_LinearStringEqualsLiteral(str, "onmousewheel")) {
counter.emplace(eUseCounter_Document_onmousewheel);
}
break;
}
}
break;
}
case 'w': {
switch (chars[1]) {
case 'a': {
if (JS_LinearStringEqualsLiteral(str, "wasDiscarded")) {
counter.emplace(eUseCounter_Document_wasDiscarded);
}
break;
}
case 'e': {
if (JS_LinearStringEqualsLiteral(str, "webkitHidden")) {
counter.emplace(eUseCounter_Document_webkitHidden);
}
break;
}
}
break;
}
}
break;
}
case 13: {
StringIdChars chars(nogc, str);
switch (chars[0]) {
case 'f': {
if (JS_LinearStringEqualsLiteral(str, "featurePolicy")) {
counter.emplace(eUseCounter_Document_featurePolicy);
}
break;
}
case 'o': {
if (JS_LinearStringEqualsLiteral(str, "onbeforepaste")) {
counter.emplace(eUseCounter_Document_onbeforepaste);
}
break;
}
case 'x': {
if (JS_LinearStringEqualsLiteral(str, "xmlStandalone")) {
counter.emplace(eUseCounter_Document_xmlStandalone);
}
break;
}
}
break;
}
case 15: {
if (JS_LinearStringEqualsLiteral(str, "registerElement")) {
counter.emplace(eUseCounter_Document_registerElement);
}
break;
}
case 18: {
if (JS_LinearStringEqualsLiteral(str, "webkitIsFullScreen")) {
counter.emplace(eUseCounter_Document_webkitIsFullScreen);
}
break;
}
case 19: {
if (JS_LinearStringEqualsLiteral(str, "caretRangeFromPoint")) {
counter.emplace(eUseCounter_Document_caretRangeFromPoint);
}
break;
}
case 20: {
StringIdChars chars(nogc, str);
switch (chars[0]) {
case 'e': {
if (JS_LinearStringEqualsLiteral(str, "exitPictureInPicture")) {
counter.emplace(eUseCounter_Document_exitPictureInPicture);
}
break;
}
case 'w': {
if (JS_LinearStringEqualsLiteral(str, "webkitExitFullscreen")) {
counter.emplace(eUseCounter_Document_webkitExitFullscreen);
}
break;
}
}
break;
}
case 21: {
if (JS_LinearStringEqualsLiteral(str, "webkitVisibilityState")) {
counter.emplace(eUseCounter_Document_webkitVisibilityState);
}
break;
}
case 22: {
if (JS_LinearStringEqualsLiteral(str, "webkitCancelFullScreen")) {
counter.emplace(eUseCounter_Document_webkitCancelFullScreen);
}
break;
}
case 23: {
StringIdChars chars(nogc, str);
switch (chars[0]) {
case 'o': {
if (JS_LinearStringEqualsLiteral(str, "onwebkitfullscreenerror")) {
counter.emplace(eUseCounter_Document_onwebkitfullscreenerror);
}
break;
}
case 'p': {
switch (chars[17]) {
case 'l': {
if (JS_LinearStringEqualsLiteral(str, "pictureInPictureElement")) {
counter.emplace(eUseCounter_Document_pictureInPictureElement);
}
break;
}
case 'n': {
if (JS_LinearStringEqualsLiteral(str, "pictureInPictureEnabled")) {
counter.emplace(eUseCounter_Document_pictureInPictureEnabled);
}
break;
}
}
break;
}
case 'w': {
switch (chars[17]) {
case 'l': {
if (JS_LinearStringEqualsLiteral(str, "webkitFullscreenElement")) {
counter.emplace(eUseCounter_Document_webkitFullscreenElement);
}
break;
}
case 'n': {
if (JS_LinearStringEqualsLiteral(str, "webkitFullscreenEnabled")) {
counter.emplace(eUseCounter_Document_webkitFullscreenEnabled);
}
break;
}
}
break;
}
}
break;
}
case 24: {
if (JS_LinearStringEqualsLiteral(str, "onwebkitfullscreenchange")) {
counter.emplace(eUseCounter_Document_onwebkitfullscreenchange);
}
break;
}
case 30: {
if (JS_LinearStringEqualsLiteral(str, "webkitCurrentFullScreenElement")) {
counter.emplace(eUseCounter_Document_webkitCurrentFullScreenElement);
}
break;
}
case 8: {
StringIdChars chars(nogc, str);
switch (chars[2]) {
case 'c': {
if (JS_LinearStringEqualsLiteral(str, "oncancel")) {
counter.emplace(eUseCounter_Document_oncancel);
}
break;
}
case 'f': {
if (JS_LinearStringEqualsLiteral(str, "onfreeze")) {
counter.emplace(eUseCounter_Document_onfreeze);
}
break;
}
case 'r': {
if (JS_LinearStringEqualsLiteral(str, "onresume")) {
counter.emplace(eUseCounter_Document_onresume);
}
break;
}
case 's': {
if (JS_LinearStringEqualsLiteral(str, "onsearch")) {
counter.emplace(eUseCounter_Document_onsearch);
}
break;
}
}
break;
}
}
}
if (counter) {
SetUseCounter(proxy, *counter);
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 = {
{ "Document",
JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(2),
&sClassOps,
JS_NULL_CLASS_SPEC,
&sClassExtension,
JS_NULL_OBJECT_OPS
},
{ prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Document, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
std::is_base_of_v<nsISupports, mozilla::dom::Document>,
&sNativePropertyHooks,
FindAssociatedGlobalForNative<mozilla::dom::Document>::Get,
GetProtoObjectHandle,
GetCCParticipant<mozilla::dom::Document>::Get(),
nullptr,
_getWrapperCache
};
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
"Must have the right minimal number of reserved slots.");
static_assert(2 >= 2,
"Must have enough reserved slots.");
bool
Wrap(JSContext* aCx, mozilla::dom::Document* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
{
static_assert(!std::is_base_of_v<NonRefcountedDOMObject, mozilla::dom::Document>,
"Shouldn't have wrappercached things that are not refcounted.");
static_assert(std::is_same_v<decltype(aObject), mozilla::dom::Document*>);
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::Document> creator(aCx);
creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
if (!aReflector) {
return false;
}
aCache->SetWrapper(aReflector);
// Important: do unforgeable property setup after we have handed
// over ownership of the C++ object to obj as needed, so that if
// we fail and it ends up GCed it won't have problems in the
// finalizer trying to drop its ownership of the C++ object.
JS::Rooted<JSObject*> unforgeableHolder(aCx,
&JS::GetReservedSlot(canonicalProto, DOM_INTERFACE_PROTO_SLOTS_BASE).toObject());
if (!JS_InitializePropertiesFromCompatibleNativeObject(aCx, aReflector, unforgeableHolder)) {
aCache->ReleaseWrapper(aObject);
aCache->ClearWrapper();
return false;
}
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
ClearCachedAdoptedStyleSheetsValue(mozilla::dom::Document* aObject)
{
JSObject* obj;
obj = aObject->GetWrapper();
if (!obj) {
return;
}
JS::SetReservedSlot(obj, (DOM_INSTANCE_RESERVED_SLOTS + 0), JS::UndefinedValue());
xpc::ClearXrayExpandoSlots(obj, (xpc::JSSLOT_EXPANDO_COUNT + 0));
}
static const char* const unscopableNames[] = {
"fullscreen",
"prepend",
"append",
"replaceChildren",
nullptr
};
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
{
JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::Document);
JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::Document);
JS::Handle<JSObject*> parentProto(Node_Binding::GetProtoObjectHandle(aCx));
if (!parentProto) {
return;
}
JS::Handle<JSObject*> constructorProto(Node_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(),
"Document", aDefineOnGlobal,
unscopableNames,
false,
nullptr);
JS::AssertObjectIsNotGray(*protoCache);
JS::Handle<JSObject*> proto = JS::Handle<JSObject*>::fromMarkedLocation(protoCache->address());
if (!proto) {
*protoCache = nullptr;
if (interfaceCache) {
*interfaceCache = nullptr;
}
return;
}
JS::Rooted<JSObject*> unforgeableHolder(
aCx, JS_NewObjectWithoutMetadata(aCx, sClass.ToJSClass(), proto));
if (!unforgeableHolder) {
*protoCache = nullptr;
if (interfaceCache) {
*interfaceCache = nullptr;
}
return;
}
if (!DefineLegacyUnforgeableAttributes(aCx, unforgeableHolder, sUnforgeableAttributes)) {
*protoCache = nullptr;
if (interfaceCache) {
*interfaceCache = nullptr;
}
return;
}
if (*protoCache) {
JS::SetReservedSlot(*protoCache, DOM_INTERFACE_PROTO_SLOTS_BASE,
JS::ObjectValue(*unforgeableHolder));
}
}
JSObject*
GetProtoObject(JSContext* aCx)
{
return GetProtoObjectHandle(aCx);
}
JSObject*
GetConstructorObject(JSContext* aCx)
{
return GetConstructorObjectHandle(aCx);
}
} // namespace Document_Binding
} // namespace dom
} // namespace mozilla