Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM Range.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_RANGEBINDING_H_
#define DOM_RANGEBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/DOMRect.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
class nsRange;
namespace mozilla {
namespace dom {
struct ClientRectsAndTextsAtoms;
class DOMRectList;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
struct ClientRectsAndTexts : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR OwningNonNull<mozilla::dom::DOMRectList> mRectList;
MOZ_INIT_OUTSIDE_CTOR Sequence<nsString> mTextList;
ClientRectsAndTexts();
explicit inline ClientRectsAndTexts(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
ClientRectsAndTexts(ClientRectsAndTexts&& aOther) = default;
explicit inline ClientRectsAndTexts(const ClientRectsAndTexts& aOther)
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
inline void
TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags)
{
ImplCycleCollectionTraverse(aCallback, mRectList, "mRectList", aFlags);
}
inline void
UnlinkForCC()
{
ImplCycleCollectionUnlink(mRectList);
}
ClientRectsAndTexts&
operator=(const ClientRectsAndTexts& aOther);
private:
static bool
InitIds(JSContext* cx, ClientRectsAndTextsAtoms* atomsCache);
};
namespace binding_detail {
struct FastClientRectsAndTexts : public ClientRectsAndTexts
{
inline FastClientRectsAndTexts()
: ClientRectsAndTexts(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace Range_Binding {
typedef nsRange NativeType;
static const uint16_t START_TO_START = 0;
static const uint16_t START_TO_END = 1;
static const uint16_t END_TO_END = 2;
static const uint16_t END_TO_START = 3;
bool
Wrap(JSContext* aCx, nsRange* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::Range,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::Range,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace Range_Binding
} // namespace mozilla::dom
#endif // DOM_RANGEBINDING_H_