/* THIS FILE IS AUTOGENERATED FROM ViewTimeline.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_VIEWTIMELINEBINDING_H_
#define DOM_VIEWTIMELINEBINDING_H_
#include "ScrollTimelineBinding.h"
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
#include "mozilla/dom/UnionMember.h"
#include "nsCycleCollectionParticipant.h"
namespace mozilla {
namespace dom {
class CSSKeywordValue;
class CSSNumericValue;
class Element;
struct NativePropertyHooks;
class OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue;
class OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence;
class ProtoAndIfaceCache;
class UTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence;
class ViewTimeline;
struct ViewTimelineOptionsAtoms;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
void
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback, OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue& aUnion, const char* aName, uint32_t aFlags = 0);
void
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback, OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence& aUnion, const char* aName, uint32_t aFlags = 0);
void
ImplCycleCollectionUnlink(OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue& aUnion);
void
ImplCycleCollectionUnlink(OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence& aUnion);
class MOZ_EMPTY_BASES UTF8StringOrCSSKeywordValueOrCSSNumericValue : public AllUnionBase
{
enum TypeOrUninit
{
eUninitialized,
eUTF8String,
eCSSKeywordValue,
eCSSNumericValue
};
public:
enum class Type
{
eUTF8String = TypeOrUninit::eUTF8String,
eCSSKeywordValue = TypeOrUninit::eCSSKeywordValue,
eCSSNumericValue = TypeOrUninit::eCSSNumericValue
};
private:
union Value
{
UnionMember<nsAutoCString > mUTF8String;
UnionMember<NonNull<mozilla::dom::CSSKeywordValue> > mCSSKeywordValue;
UnionMember<NonNull<mozilla::dom::CSSNumericValue> > mCSSNumericValue;
};
TypeOrUninit mType;
Value mValue;
UTF8StringOrCSSKeywordValueOrCSSNumericValue(const UTF8StringOrCSSKeywordValueOrCSSNumericValue&) = delete;
UTF8StringOrCSSKeywordValueOrCSSNumericValue& operator=(const UTF8StringOrCSSKeywordValueOrCSSNumericValue&) = delete;
public:
explicit inline UTF8StringOrCSSKeywordValueOrCSSNumericValue()
: mType(eUninitialized)
{
}
inline ~UTF8StringOrCSSKeywordValueOrCSSNumericValue()
{
Uninit();
}
[[nodiscard]] inline nsAutoCString&
RawSetAsUTF8String()
{
if (mType == eUTF8String) {
return mValue.mUTF8String.Value();
}
MOZ_ASSERT(mType == eUninitialized);
mType = eUTF8String;
return mValue.mUTF8String.SetValue();
}
[[nodiscard]] inline nsAutoCString&
SetAsUTF8String()
{
if (mType == eUTF8String) {
return mValue.mUTF8String.Value();
}
Uninit();
mType = eUTF8String;
return mValue.mUTF8String.SetValue();
}
template <int N>
inline void
SetStringLiteral(const nsCString::char_type (&aData)[N])
{
RawSetAsUTF8String().AssignLiteral(aData);
}
inline bool
IsUTF8String() const
{
return mType == eUTF8String;
}
inline nsAutoCString&
GetAsUTF8String()
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
return mValue.mUTF8String.Value();
}
inline const nsACString&
GetAsUTF8String() const
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
return mValue.mUTF8String.Value();
}
[[nodiscard]] inline NonNull<mozilla::dom::CSSKeywordValue>&
RawSetAsCSSKeywordValue()
{
if (mType == eCSSKeywordValue) {
return mValue.mCSSKeywordValue.Value();
}
MOZ_ASSERT(mType == eUninitialized);
mType = eCSSKeywordValue;
return mValue.mCSSKeywordValue.SetValue();
}
[[nodiscard]] inline NonNull<mozilla::dom::CSSKeywordValue>&
SetAsCSSKeywordValue()
{
if (mType == eCSSKeywordValue) {
return mValue.mCSSKeywordValue.Value();
}
Uninit();
mType = eCSSKeywordValue;
return mValue.mCSSKeywordValue.SetValue();
}
inline bool
IsCSSKeywordValue() const
{
return mType == eCSSKeywordValue;
}
inline NonNull<mozilla::dom::CSSKeywordValue>&
GetAsCSSKeywordValue()
{
MOZ_RELEASE_ASSERT(IsCSSKeywordValue(), "Wrong type!");
return mValue.mCSSKeywordValue.Value();
}
inline mozilla::dom::CSSKeywordValue&
GetAsCSSKeywordValue() const
{
MOZ_RELEASE_ASSERT(IsCSSKeywordValue(), "Wrong type!");
return mValue.mCSSKeywordValue.Value();
}
[[nodiscard]] inline NonNull<mozilla::dom::CSSNumericValue>&
RawSetAsCSSNumericValue()
{
if (mType == eCSSNumericValue) {
return mValue.mCSSNumericValue.Value();
}
MOZ_ASSERT(mType == eUninitialized);
mType = eCSSNumericValue;
return mValue.mCSSNumericValue.SetValue();
}
[[nodiscard]] inline NonNull<mozilla::dom::CSSNumericValue>&
SetAsCSSNumericValue()
{
if (mType == eCSSNumericValue) {
return mValue.mCSSNumericValue.Value();
}
Uninit();
mType = eCSSNumericValue;
return mValue.mCSSNumericValue.SetValue();
}
inline bool
IsCSSNumericValue() const
{
return mType == eCSSNumericValue;
}
inline NonNull<mozilla::dom::CSSNumericValue>&
GetAsCSSNumericValue()
{
MOZ_RELEASE_ASSERT(IsCSSNumericValue(), "Wrong type!");
return mValue.mCSSNumericValue.Value();
}
inline mozilla::dom::CSSNumericValue&
GetAsCSSNumericValue() const
{
MOZ_RELEASE_ASSERT(IsCSSNumericValue(), "Wrong type!");
return mValue.mCSSNumericValue.Value();
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> value, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> value, const char* sourceDescription = "Value", bool passedToJSImpl = false);
inline void
Uninit()
{
switch (mType) {
case eUninitialized: {
break;
}
case eUTF8String: {
DestroyUTF8String();
break;
}
case eCSSKeywordValue: {
DestroyCSSKeywordValue();
break;
}
case eCSSNumericValue: {
DestroyCSSNumericValue();
break;
}
}
}
bool
ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
private:
bool
TrySetToUTF8String(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
inline void
DestroyUTF8String()
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
mValue.mUTF8String.Destroy();
mType = eUninitialized;
}
bool
TrySetToCSSKeywordValue(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToCSSKeywordValue(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
inline void
DestroyCSSKeywordValue()
{
MOZ_RELEASE_ASSERT(IsCSSKeywordValue(), "Wrong type!");
mValue.mCSSKeywordValue.Destroy();
mType = eUninitialized;
}
bool
TrySetToCSSNumericValue(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToCSSNumericValue(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
inline void
DestroyCSSNumericValue()
{
MOZ_RELEASE_ASSERT(IsCSSNumericValue(), "Wrong type!");
mValue.mCSSNumericValue.Destroy();
mType = eUninitialized;
}
};
class MOZ_EMPTY_BASES OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue : public AllOwningUnionBase
{
friend void ImplCycleCollectionUnlink(OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue& aUnion);
enum TypeOrUninit
{
eUninitialized,
eUTF8String,
eCSSKeywordValue,
eCSSNumericValue
};
public:
enum class Type
{
eUTF8String = TypeOrUninit::eUTF8String,
eCSSKeywordValue = TypeOrUninit::eCSSKeywordValue,
eCSSNumericValue = TypeOrUninit::eCSSNumericValue
};
private:
union Value
{
UnionMember<nsCString > mUTF8String;
UnionMember<OwningNonNull<mozilla::dom::CSSKeywordValue> > mCSSKeywordValue;
UnionMember<OwningNonNull<mozilla::dom::CSSNumericValue> > mCSSNumericValue;
};
TypeOrUninit mType;
Value mValue;
public:
explicit inline OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue()
: mType(eUninitialized)
{
}
OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue(OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue&& aOther);
explicit inline OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue(const OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue& aOther)
: mType(eUninitialized)
{
*this = aOther;
}
inline ~OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue()
{
Uninit();
}
[[nodiscard]] nsCString&
RawSetAsUTF8String();
[[nodiscard]] nsCString&
SetAsUTF8String();
template <int N>
inline void
SetStringLiteral(const nsCString::char_type (&aData)[N])
{
RawSetAsUTF8String().AssignLiteral(aData);
}
inline bool
IsUTF8String() const
{
return mType == eUTF8String;
}
inline nsCString&
GetAsUTF8String()
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
return mValue.mUTF8String.Value();
}
inline nsCString const &
GetAsUTF8String() const
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
return mValue.mUTF8String.Value();
}
[[nodiscard]] OwningNonNull<mozilla::dom::CSSKeywordValue>&
RawSetAsCSSKeywordValue();
[[nodiscard]] OwningNonNull<mozilla::dom::CSSKeywordValue>&
SetAsCSSKeywordValue();
inline bool
IsCSSKeywordValue() const
{
return mType == eCSSKeywordValue;
}
inline OwningNonNull<mozilla::dom::CSSKeywordValue>&
GetAsCSSKeywordValue()
{
MOZ_RELEASE_ASSERT(IsCSSKeywordValue(), "Wrong type!");
return mValue.mCSSKeywordValue.Value();
}
inline OwningNonNull<mozilla::dom::CSSKeywordValue> const &
GetAsCSSKeywordValue() const
{
MOZ_RELEASE_ASSERT(IsCSSKeywordValue(), "Wrong type!");
return mValue.mCSSKeywordValue.Value();
}
[[nodiscard]] OwningNonNull<mozilla::dom::CSSNumericValue>&
RawSetAsCSSNumericValue();
[[nodiscard]] OwningNonNull<mozilla::dom::CSSNumericValue>&
SetAsCSSNumericValue();
inline bool
IsCSSNumericValue() const
{
return mType == eCSSNumericValue;
}
inline OwningNonNull<mozilla::dom::CSSNumericValue>&
GetAsCSSNumericValue()
{
MOZ_RELEASE_ASSERT(IsCSSNumericValue(), "Wrong type!");
return mValue.mCSSNumericValue.Value();
}
inline OwningNonNull<mozilla::dom::CSSNumericValue> const &
GetAsCSSNumericValue() const
{
MOZ_RELEASE_ASSERT(IsCSSNumericValue(), "Wrong type!");
return mValue.mCSSNumericValue.Value();
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> value, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> value, const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
Uninit();
bool
ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue&
operator=(OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue&& aOther);
inline Type
GetType() const
{
MOZ_RELEASE_ASSERT(mType != eUninitialized);
return static_cast<Type>(mType);
}
OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue&
operator=(const OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue& aOther);
private:
bool
TrySetToUTF8String(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
void
DestroyUTF8String();
bool
TrySetToCSSKeywordValue(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToCSSKeywordValue(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
void
DestroyCSSKeywordValue();
bool
TrySetToCSSNumericValue(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToCSSNumericValue(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
void
DestroyCSSNumericValue();
};
class MOZ_EMPTY_BASES UTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence : public AllUnionBase
{
enum TypeOrUninit
{
eUninitialized,
eUTF8String,
eUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence
};
public:
enum class Type
{
eUTF8String = TypeOrUninit::eUTF8String,
eUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence = TypeOrUninit::eUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence
};
private:
union Value
{
UnionMember<nsAutoCString > mUTF8String;
UnionMember<binding_detail::AutoSequence<OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue> > mUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence;
};
TypeOrUninit mType;
Value mValue;
UTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence(const UTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence&) = delete;
UTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence& operator=(const UTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence&) = delete;
public:
explicit inline UTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence()
: mType(eUninitialized)
{
}
inline ~UTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence()
{
Uninit();
}
[[nodiscard]] inline nsAutoCString&
RawSetAsUTF8String()
{
if (mType == eUTF8String) {
return mValue.mUTF8String.Value();
}
MOZ_ASSERT(mType == eUninitialized);
mType = eUTF8String;
return mValue.mUTF8String.SetValue();
}
[[nodiscard]] inline nsAutoCString&
SetAsUTF8String()
{
if (mType == eUTF8String) {
return mValue.mUTF8String.Value();
}
Uninit();
mType = eUTF8String;
return mValue.mUTF8String.SetValue();
}
template <int N>
inline void
SetStringLiteral(const nsCString::char_type (&aData)[N])
{
RawSetAsUTF8String().AssignLiteral(aData);
}
inline bool
IsUTF8String() const
{
return mType == eUTF8String;
}
inline nsAutoCString&
GetAsUTF8String()
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
return mValue.mUTF8String.Value();
}
inline const nsACString&
GetAsUTF8String() const
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
return mValue.mUTF8String.Value();
}
[[nodiscard]] inline binding_detail::AutoSequence<OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue>&
RawSetAsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence()
{
if (mType == eUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence) {
return mValue.mUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence.Value();
}
MOZ_ASSERT(mType == eUninitialized);
mType = eUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence;
return mValue.mUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence.SetValue();
}
[[nodiscard]] inline binding_detail::AutoSequence<OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue>&
SetAsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence()
{
if (mType == eUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence) {
return mValue.mUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence.Value();
}
Uninit();
mType = eUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence;
return mValue.mUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence.SetValue();
}
inline bool
IsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence() const
{
return mType == eUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence;
}
inline binding_detail::AutoSequence<OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue>&
GetAsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence()
{
MOZ_RELEASE_ASSERT(IsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence(), "Wrong type!");
return mValue.mUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence.Value();
}
inline const Sequence<OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue>&
GetAsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence() const
{
MOZ_RELEASE_ASSERT(IsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence(), "Wrong type!");
return mValue.mUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence.Value();
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> value, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> value, const char* sourceDescription = "Value", bool passedToJSImpl = false);
inline void
Uninit()
{
switch (mType) {
case eUninitialized: {
break;
}
case eUTF8String: {
DestroyUTF8String();
break;
}
case eUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence: {
DestroyUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence();
break;
}
}
}
bool
ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
private:
bool
TrySetToUTF8String(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
inline void
DestroyUTF8String()
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
mValue.mUTF8String.Destroy();
mType = eUninitialized;
}
bool
TrySetToUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
inline void
DestroyUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence()
{
MOZ_RELEASE_ASSERT(IsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence(), "Wrong type!");
mValue.mUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence.Destroy();
mType = eUninitialized;
}
};
class MOZ_EMPTY_BASES OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence : public AllOwningUnionBase
{
friend void ImplCycleCollectionUnlink(OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence& aUnion);
enum TypeOrUninit
{
eUninitialized,
eUTF8String,
eUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence
};
public:
enum class Type
{
eUTF8String = TypeOrUninit::eUTF8String,
eUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence = TypeOrUninit::eUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence
};
private:
union Value
{
UnionMember<nsCString > mUTF8String;
UnionMember<Sequence<OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue> > mUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence;
};
TypeOrUninit mType;
Value mValue;
public:
explicit inline OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence()
: mType(eUninitialized)
{
}
OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence(OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence&& aOther);
explicit inline OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence(const OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence& aOther)
: mType(eUninitialized)
{
*this = aOther;
}
inline ~OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence()
{
Uninit();
}
[[nodiscard]] nsCString&
RawSetAsUTF8String();
[[nodiscard]] nsCString&
SetAsUTF8String();
template <int N>
inline void
SetStringLiteral(const nsCString::char_type (&aData)[N])
{
RawSetAsUTF8String().AssignLiteral(aData);
}
inline bool
IsUTF8String() const
{
return mType == eUTF8String;
}
inline nsCString&
GetAsUTF8String()
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
return mValue.mUTF8String.Value();
}
inline nsCString const &
GetAsUTF8String() const
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
return mValue.mUTF8String.Value();
}
[[nodiscard]] Sequence<OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue>&
RawSetAsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence();
[[nodiscard]] Sequence<OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue>&
SetAsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence();
inline bool
IsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence() const
{
return mType == eUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence;
}
inline Sequence<OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue>&
GetAsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence()
{
MOZ_RELEASE_ASSERT(IsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence(), "Wrong type!");
return mValue.mUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence.Value();
}
inline Sequence<OwningUTF8StringOrCSSKeywordValueOrCSSNumericValue> const &
GetAsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence() const
{
MOZ_RELEASE_ASSERT(IsUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence(), "Wrong type!");
return mValue.mUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence.Value();
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> value, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> value, const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
Uninit();
bool
ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence&
operator=(OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence&& aOther);
inline Type
GetType() const
{
MOZ_RELEASE_ASSERT(mType != eUninitialized);
return static_cast<Type>(mType);
}
OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence&
operator=(const OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence& aOther);
private:
bool
TrySetToUTF8String(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
void
DestroyUTF8String();
bool
TrySetToUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
void
DestroyUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence();
};
struct MOZ_EMPTY_BASES ViewTimelineOptions : public MaybeEmptyDictionaryBase
{
ScrollAxis mAxis = {};
MOZ_INIT_OUTSIDE_CTOR OwningUTF8StringOrUTF8StringOrCSSKeywordValueOrCSSNumericValueSequence mInset;
MOZ_INIT_OUTSIDE_CTOR OwningNonNull<mozilla::dom::Element> mSubject;
ViewTimelineOptions();
explicit inline ViewTimelineOptions(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
ViewTimelineOptions(ViewTimelineOptions&& aOther) = default;
explicit inline ViewTimelineOptions(const ViewTimelineOptions& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
TraceDictionary(JSTracer* trc);
inline void
TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags)
{
ImplCycleCollectionTraverse(aCallback, mInset, "mInset", aFlags);
ImplCycleCollectionTraverse(aCallback, mSubject, "mSubject", aFlags);
}
inline void
UnlinkForCC()
{
ImplCycleCollectionUnlink(mInset);
ImplCycleCollectionUnlink(mSubject);
}
ViewTimelineOptions&
operator=(const ViewTimelineOptions& aOther);
private:
static bool
InitIds(JSContext* cx, ViewTimelineOptionsAtoms* atomsCache);
};
namespace binding_detail {
struct MOZ_EMPTY_BASES FastViewTimelineOptions : public ViewTimelineOptions
{
inline FastViewTimelineOptions()
: ViewTimelineOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace ViewTimeline_Binding {
typedef mozilla::dom::ViewTimeline NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::dom::ViewTimeline* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
template <class T>
inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
{
JS::Rooted<JSObject*> reflector(aCx);
return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
}
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal);
JS::Handle<JSObject*>
GetConstructorObjectHandle(JSContext* aCx);
inline bool CreateAndDefineOnGlobal(JSContext* aCx)
{
// Get the interface or namespace object for this class. This will
// create the object as needed and always define the properties for
// it on the global. The caller should make sure the interface or
// namespace is exposed on the global before calling this.
return GetPerInterfaceObjectHandle(aCx, constructors::id::ViewTimeline,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace ViewTimeline_Binding
} // namespace mozilla::dom
#endif // DOM_VIEWTIMELINEBINDING_H_