Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM CustomElementRegistry.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_CustomElementRegistryBinding_h
4 : #define mozilla_dom_CustomElementRegistryBinding_h
5 :
6 : #include "js/RootingAPI.h"
7 : #include "jspubtd.h"
8 : #include "mozilla/ErrorResult.h"
9 : #include "mozilla/dom/BindingDeclarations.h"
10 : #include "mozilla/dom/Nullable.h"
11 :
12 : namespace mozilla {
13 : namespace dom {
14 :
15 : class CustomElementRegistry;
16 : struct CustomElementRegistryAtoms;
17 : struct ElementDefinitionOptionsAtoms;
18 : struct NativePropertyHooks;
19 : class ProtoAndIfaceCache;
20 :
21 : } // namespace dom
22 : } // namespace mozilla
23 :
24 : namespace mozilla {
25 : namespace dom {
26 :
27 0 : struct ElementDefinitionOptions : public DictionaryBase
28 : {
29 : MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mExtends;
30 :
31 : ElementDefinitionOptions();
32 :
33 0 : explicit inline ElementDefinitionOptions(const FastDictionaryInitializer& )
34 0 : {
35 : // Do nothing here; this is used by our "Fast" subclass
36 0 : }
37 :
38 : explicit inline ElementDefinitionOptions(const ElementDefinitionOptions& aOther)
39 : {
40 : *this = aOther;
41 : }
42 :
43 : bool
44 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
45 :
46 : bool
47 : Init(const nsAString& aJSON);
48 :
49 : bool
50 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
51 :
52 : bool
53 : ToJSON(nsAString& aJSON) const;
54 :
55 : void
56 : TraceDictionary(JSTracer* trc);
57 :
58 : ElementDefinitionOptions&
59 : operator=(const ElementDefinitionOptions& aOther);
60 :
61 : private:
62 : static bool
63 : InitIds(JSContext* cx, ElementDefinitionOptionsAtoms* atomsCache);
64 : };
65 :
66 : namespace binding_detail {
67 0 : struct FastElementDefinitionOptions : public ElementDefinitionOptions
68 : {
69 0 : inline FastElementDefinitionOptions()
70 0 : : ElementDefinitionOptions(FastDictionaryInitializer())
71 : {
72 : // Doesn't matter what int we pass to the parent constructor
73 0 : }
74 : };
75 : } // namespace binding_detail
76 :
77 :
78 : namespace CustomElementRegistryBinding {
79 :
80 : typedef mozilla::dom::CustomElementRegistry NativeType;
81 :
82 : bool
83 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
84 :
85 : JSObject*
86 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
87 :
88 : const JSClass*
89 : GetJSClass();
90 :
91 : bool
92 : Wrap(JSContext* aCx, mozilla::dom::CustomElementRegistry* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
93 :
94 : template <class T>
95 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
96 : {
97 0 : JS::Rooted<JSObject*> reflector(aCx);
98 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
99 : }
100 :
101 : // We declare this as an array so that retrieving a pointer to this
102 : // binding's property hooks only requires compile/link-time resolvable
103 : // address arithmetic. Declaring it as a pointer instead would require
104 : // doing a run-time load to fetch a pointer to this binding's property
105 : // hooks. And then structures which embedded a pointer to this structure
106 : // would require a run-time load for proper initialization, which would
107 : // then induce static constructors. Lots of static constructors.
108 : extern const NativePropertyHooks sNativePropertyHooks[];
109 :
110 : void
111 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
112 :
113 : JS::Handle<JSObject*>
114 : GetProtoObjectHandle(JSContext* aCx);
115 :
116 : JS::Handle<JSObject*>
117 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
118 :
119 : JSObject*
120 : GetConstructorObject(JSContext* aCx);
121 :
122 : } // namespace CustomElementRegistryBinding
123 :
124 :
125 :
126 : } // namespace dom
127 : } // namespace mozilla
128 :
129 : #endif // mozilla_dom_CustomElementRegistryBinding_h
|