Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM InspectorUtils.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_INSPECTORUTILSBINDING_H_
#define DOM_INSPECTORUTILSBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/EnumTypeTraits.h"
#include "mozilla/Span.h"
#include "mozilla/css/Rule.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
namespace mozilla {
namespace css {
class Rule;
} // namespace css
namespace dom {
class InspectorCSSParser;
struct InspectorCSSPropertyDefinitionAtoms;
struct InspectorCSSTokenAtoms;
struct InspectorColorToResultAtoms;
class InspectorFontFace;
struct InspectorFontFeatureAtoms;
struct InspectorRGBATupleAtoms;
struct InspectorStyleSheetRuleCountAndAtRulesResultAtoms;
class InspectorUtils;
struct InspectorVariationAxisAtoms;
struct InspectorVariationInstanceAtoms;
struct InspectorVariationValue;
struct InspectorVariationValueAtoms;
struct NativePropertyHooks;
struct PropertyNamesOptionsAtoms;
struct PropertyPrefAtoms;
class ProtoAndIfaceCache;
struct SupportsOptionsAtoms;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class InspectorPropertyType : uint8_t {
Color,
Gradient,
Timing_function,
};
namespace binding_detail {
template <> struct EnumStrings<InspectorPropertyType> {
static constexpr nsLiteralCString Values[3] {
"color"_ns,
"gradient"_ns,
"timing-function"_ns,
};
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, InspectorPropertyType aArgument, JS::MutableHandle<JS::Value> aValue);
struct InspectorCSSPropertyDefinition : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR bool mFromJS;
MOZ_INIT_OUTSIDE_CTOR bool mInherits;
MOZ_INIT_OUTSIDE_CTOR nsCString mInitialValue;
MOZ_INIT_OUTSIDE_CTOR nsCString mName;
MOZ_INIT_OUTSIDE_CTOR nsCString mSyntax;
InspectorCSSPropertyDefinition();
explicit inline InspectorCSSPropertyDefinition(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
InspectorCSSPropertyDefinition(InspectorCSSPropertyDefinition&& aOther) = default;
explicit inline InspectorCSSPropertyDefinition(const InspectorCSSPropertyDefinition& 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);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
InspectorCSSPropertyDefinition&
operator=(const InspectorCSSPropertyDefinition& aOther);
private:
static bool
InitIds(JSContext* cx, InspectorCSSPropertyDefinitionAtoms* atomsCache);
};
namespace binding_detail {
struct FastInspectorCSSPropertyDefinition : public InspectorCSSPropertyDefinition
{
inline FastInspectorCSSPropertyDefinition()
: InspectorCSSPropertyDefinition(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct InspectorCSSToken : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Nullable<double> mNumber;
MOZ_INIT_OUTSIDE_CTOR nsCString mText;
MOZ_INIT_OUTSIDE_CTOR nsCString mTokenType;
MOZ_INIT_OUTSIDE_CTOR nsCString mUnit;
MOZ_INIT_OUTSIDE_CTOR nsCString mValue;
InspectorCSSToken();
explicit inline InspectorCSSToken(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
InspectorCSSToken(InspectorCSSToken&& aOther) = default;
explicit inline InspectorCSSToken(const InspectorCSSToken& 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);
InspectorCSSToken&
operator=(const InspectorCSSToken& aOther);
private:
static bool
InitIds(JSContext* cx, InspectorCSSTokenAtoms* atomsCache);
};
namespace binding_detail {
struct FastInspectorCSSToken : public InspectorCSSToken
{
inline FastInspectorCSSToken()
: InspectorCSSToken(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct InspectorColorToResult : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR bool mAdjusted;
MOZ_INIT_OUTSIDE_CTOR nsString mColor;
MOZ_INIT_OUTSIDE_CTOR Sequence<float> mComponents;
InspectorColorToResult();
explicit inline InspectorColorToResult(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
InspectorColorToResult(InspectorColorToResult&& aOther) = default;
explicit inline InspectorColorToResult(const InspectorColorToResult& 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);
InspectorColorToResult&
operator=(const InspectorColorToResult& aOther);
private:
static bool
InitIds(JSContext* cx, InspectorColorToResultAtoms* atomsCache);
};
namespace binding_detail {
struct FastInspectorColorToResult : public InspectorColorToResult
{
inline FastInspectorColorToResult()
: InspectorColorToResult(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct InspectorFontFeature : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR nsString mLanguageSystem;
MOZ_INIT_OUTSIDE_CTOR nsString mScript;
MOZ_INIT_OUTSIDE_CTOR nsString mTag;
InspectorFontFeature();
explicit inline InspectorFontFeature(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
InspectorFontFeature(InspectorFontFeature&& aOther) = default;
explicit inline InspectorFontFeature(const InspectorFontFeature& 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);
InspectorFontFeature&
operator=(const InspectorFontFeature& aOther);
private:
static bool
InitIds(JSContext* cx, InspectorFontFeatureAtoms* atomsCache);
};
namespace binding_detail {
struct FastInspectorFontFeature : public InspectorFontFeature
{
inline FastInspectorFontFeature()
: InspectorFontFeature(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct InspectorRGBATuple : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR double mA;
MOZ_INIT_OUTSIDE_CTOR double mB;
MOZ_INIT_OUTSIDE_CTOR double mG;
MOZ_INIT_OUTSIDE_CTOR double mR;
InspectorRGBATuple();
explicit inline InspectorRGBATuple(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
InspectorRGBATuple(InspectorRGBATuple&& aOther) = default;
explicit inline InspectorRGBATuple(const InspectorRGBATuple& 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);
InspectorRGBATuple&
operator=(const InspectorRGBATuple& aOther);
private:
static bool
InitIds(JSContext* cx, InspectorRGBATupleAtoms* atomsCache);
};
namespace binding_detail {
struct FastInspectorRGBATuple : public InspectorRGBATuple
{
inline FastInspectorRGBATuple()
: InspectorRGBATuple(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct InspectorStyleSheetRuleCountAndAtRulesResult : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Sequence<OwningNonNull<mozilla::css::Rule>> mAtRules;
MOZ_INIT_OUTSIDE_CTOR uint32_t mRuleCount;
InspectorStyleSheetRuleCountAndAtRulesResult();
explicit inline InspectorStyleSheetRuleCountAndAtRulesResult(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
InspectorStyleSheetRuleCountAndAtRulesResult(InspectorStyleSheetRuleCountAndAtRulesResult&& aOther) = default;
explicit inline InspectorStyleSheetRuleCountAndAtRulesResult(const InspectorStyleSheetRuleCountAndAtRulesResult& 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, mAtRules, "mAtRules", aFlags);
}
inline void
UnlinkForCC()
{
ImplCycleCollectionUnlink(mAtRules);
}
InspectorStyleSheetRuleCountAndAtRulesResult&
operator=(const InspectorStyleSheetRuleCountAndAtRulesResult& aOther);
private:
static bool
InitIds(JSContext* cx, InspectorStyleSheetRuleCountAndAtRulesResultAtoms* atomsCache);
};
namespace binding_detail {
struct FastInspectorStyleSheetRuleCountAndAtRulesResult : public InspectorStyleSheetRuleCountAndAtRulesResult
{
inline FastInspectorStyleSheetRuleCountAndAtRulesResult()
: InspectorStyleSheetRuleCountAndAtRulesResult(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct InspectorVariationAxis : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR float mDefaultValue;
MOZ_INIT_OUTSIDE_CTOR float mMaxValue;
MOZ_INIT_OUTSIDE_CTOR float mMinValue;
MOZ_INIT_OUTSIDE_CTOR nsString mName;
MOZ_INIT_OUTSIDE_CTOR nsString mTag;
InspectorVariationAxis();
explicit inline InspectorVariationAxis(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
InspectorVariationAxis(InspectorVariationAxis&& aOther) = default;
explicit inline InspectorVariationAxis(const InspectorVariationAxis& 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);
InspectorVariationAxis&
operator=(const InspectorVariationAxis& aOther);
private:
static bool
InitIds(JSContext* cx, InspectorVariationAxisAtoms* atomsCache);
};
namespace binding_detail {
struct FastInspectorVariationAxis : public InspectorVariationAxis
{
inline FastInspectorVariationAxis()
: InspectorVariationAxis(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct InspectorVariationValue : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR nsString mAxis;
MOZ_INIT_OUTSIDE_CTOR float mValue;
InspectorVariationValue();
explicit inline InspectorVariationValue(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
InspectorVariationValue(InspectorVariationValue&& aOther) = default;
explicit inline InspectorVariationValue(const InspectorVariationValue& 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);
InspectorVariationValue&
operator=(const InspectorVariationValue& aOther);
private:
static bool
InitIds(JSContext* cx, InspectorVariationValueAtoms* atomsCache);
};
namespace binding_detail {
struct FastInspectorVariationValue : public InspectorVariationValue
{
inline FastInspectorVariationValue()
: InspectorVariationValue(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct PropertyNamesOptions : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR bool mIncludeAliases;
MOZ_INIT_OUTSIDE_CTOR bool mIncludeExperimentals;
MOZ_INIT_OUTSIDE_CTOR bool mIncludeShorthands;
PropertyNamesOptions();
explicit inline PropertyNamesOptions(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
PropertyNamesOptions(PropertyNamesOptions&& aOther) = default;
explicit inline PropertyNamesOptions(const PropertyNamesOptions& 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);
PropertyNamesOptions&
operator=(const PropertyNamesOptions& aOther);
private:
static bool
InitIds(JSContext* cx, PropertyNamesOptionsAtoms* atomsCache);
};
namespace binding_detail {
struct FastPropertyNamesOptions : public PropertyNamesOptions
{
inline FastPropertyNamesOptions()
: PropertyNamesOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct PropertyPref : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR nsString mName;
MOZ_INIT_OUTSIDE_CTOR nsString mPref;
PropertyPref();
explicit inline PropertyPref(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
PropertyPref(PropertyPref&& aOther) = default;
explicit inline PropertyPref(const PropertyPref& 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);
PropertyPref&
operator=(const PropertyPref& aOther);
private:
static bool
InitIds(JSContext* cx, PropertyPrefAtoms* atomsCache);
};
namespace binding_detail {
struct FastPropertyPref : public PropertyPref
{
inline FastPropertyPref()
: PropertyPref(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct SupportsOptions : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR bool mChrome;
MOZ_INIT_OUTSIDE_CTOR bool mQuirks;
MOZ_INIT_OUTSIDE_CTOR bool mUserAgent;
SupportsOptions();
explicit inline SupportsOptions(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
SupportsOptions(SupportsOptions&& aOther) = default;
explicit inline SupportsOptions(const SupportsOptions& 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);
SupportsOptions&
operator=(const SupportsOptions& aOther);
private:
static bool
InitIds(JSContext* cx, SupportsOptionsAtoms* atomsCache);
};
namespace binding_detail {
struct FastSupportsOptions : public SupportsOptions
{
inline FastSupportsOptions()
: SupportsOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct InspectorVariationInstance : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR nsString mName;
MOZ_INIT_OUTSIDE_CTOR Sequence<InspectorVariationValue> mValues;
InspectorVariationInstance();
explicit inline InspectorVariationInstance(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
InspectorVariationInstance(InspectorVariationInstance&& aOther) = default;
explicit inline InspectorVariationInstance(const InspectorVariationInstance& 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);
InspectorVariationInstance&
operator=(const InspectorVariationInstance& aOther);
private:
static bool
InitIds(JSContext* cx, InspectorVariationInstanceAtoms* atomsCache);
};
namespace binding_detail {
struct FastInspectorVariationInstance : public InspectorVariationInstance
{
inline FastInspectorVariationInstance()
: InspectorVariationInstance(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace InspectorCSSParser_Binding {
typedef mozilla::dom::InspectorCSSParser NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::dom::InspectorCSSParser* aObject, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
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::InspectorCSSParser,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace InspectorCSSParser_Binding
namespace InspectorFontFace_Binding {
typedef mozilla::dom::InspectorFontFace NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::dom::InspectorFontFace* aObject, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
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::InspectorFontFace,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace InspectorFontFace_Binding
namespace InspectorUtils_Binding {
typedef mozilla::dom::InspectorUtils NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
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::InspectorUtils,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace InspectorUtils_Binding
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::InspectorPropertyType>
{
static constexpr dom::InspectorPropertyType value = dom::InspectorPropertyType::Timing_function;
static_assert(static_cast<uint8_t>(dom::InspectorPropertyType::Color) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(std::size(dom::binding_detail::EnumStrings<dom::InspectorPropertyType>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_INSPECTORUTILSBINDING_H_