/work/obj-fuzz/dist/include/mozilla/dom/NodeBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM Node.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_NodeBinding_h |
4 | | #define mozilla_dom_NodeBinding_h |
5 | | |
6 | | #include "GeckoProfiler.h" |
7 | | #include "js/RootingAPI.h" |
8 | | #include "jspubtd.h" |
9 | | #include "mozilla/ErrorResult.h" |
10 | | #include "mozilla/dom/BindingDeclarations.h" |
11 | | #include "mozilla/dom/Nullable.h" |
12 | | #include "mozilla/dom/PrototypeList.h" |
13 | | |
14 | | class nsINode; |
15 | | struct nsINodeAtoms; |
16 | | |
17 | | namespace mozilla { |
18 | | namespace dom { |
19 | | |
20 | | struct GetRootNodeOptionsAtoms; |
21 | | struct NativePropertyHooks; |
22 | | class ProtoAndIfaceCache; |
23 | | |
24 | | } // namespace dom |
25 | | } // namespace mozilla |
26 | | |
27 | | namespace mozilla { |
28 | | namespace dom { |
29 | | |
30 | | struct GetRootNodeOptions : public DictionaryBase |
31 | | { |
32 | | MOZ_INIT_OUTSIDE_CTOR bool mComposed; |
33 | | |
34 | | GetRootNodeOptions(); |
35 | | |
36 | | explicit inline GetRootNodeOptions(const FastDictionaryInitializer& ) |
37 | 0 | { |
38 | 0 | // Do nothing here; this is used by our "Fast" subclass |
39 | 0 | } |
40 | | |
41 | | explicit inline GetRootNodeOptions(const GetRootNodeOptions& aOther) |
42 | 0 | { |
43 | 0 | *this = aOther; |
44 | 0 | } |
45 | | |
46 | | bool |
47 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
48 | | |
49 | | bool |
50 | | Init(const nsAString& aJSON); |
51 | | |
52 | | bool |
53 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
54 | | |
55 | | bool |
56 | | ToJSON(nsAString& aJSON) const; |
57 | | |
58 | | void |
59 | | TraceDictionary(JSTracer* trc); |
60 | | |
61 | | GetRootNodeOptions& |
62 | | operator=(const GetRootNodeOptions& aOther); |
63 | | |
64 | | private: |
65 | | static bool |
66 | | InitIds(JSContext* cx, GetRootNodeOptionsAtoms* atomsCache); |
67 | | }; |
68 | | |
69 | | namespace binding_detail { |
70 | | struct FastGetRootNodeOptions : public GetRootNodeOptions |
71 | | { |
72 | | inline FastGetRootNodeOptions() |
73 | | : GetRootNodeOptions(FastDictionaryInitializer()) |
74 | 0 | { |
75 | 0 | // Doesn't matter what int we pass to the parent constructor |
76 | 0 | } |
77 | | }; |
78 | | } // namespace binding_detail |
79 | | |
80 | | |
81 | | namespace Node_Binding { |
82 | | |
83 | | typedef nsINode NativeType; |
84 | | |
85 | | static const uint16_t ELEMENT_NODE = 1; |
86 | | static const uint16_t ATTRIBUTE_NODE = 2; |
87 | | static const uint16_t TEXT_NODE = 3; |
88 | | static const uint16_t CDATA_SECTION_NODE = 4; |
89 | | static const uint16_t ENTITY_REFERENCE_NODE = 5; |
90 | | static const uint16_t ENTITY_NODE = 6; |
91 | | static const uint16_t PROCESSING_INSTRUCTION_NODE = 7; |
92 | | static const uint16_t COMMENT_NODE = 8; |
93 | | static const uint16_t DOCUMENT_NODE = 9; |
94 | | static const uint16_t DOCUMENT_TYPE_NODE = 10; |
95 | | static const uint16_t DOCUMENT_FRAGMENT_NODE = 11; |
96 | | static const uint16_t NOTATION_NODE = 12; |
97 | | static const uint16_t DOCUMENT_POSITION_DISCONNECTED = 1; |
98 | | static const uint16_t DOCUMENT_POSITION_PRECEDING = 2; |
99 | | static const uint16_t DOCUMENT_POSITION_FOLLOWING = 4; |
100 | | static const uint16_t DOCUMENT_POSITION_CONTAINS = 8; |
101 | | static const uint16_t DOCUMENT_POSITION_CONTAINED_BY = 16; |
102 | | static const uint16_t DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32; |
103 | | // We declare this as an array so that retrieving a pointer to this |
104 | | // binding's property hooks only requires compile/link-time resolvable |
105 | | // address arithmetic. Declaring it as a pointer instead would require |
106 | | // doing a run-time load to fetch a pointer to this binding's property |
107 | | // hooks. And then structures which embedded a pointer to this structure |
108 | | // would require a run-time load for proper initialization, which would |
109 | | // then induce static constructors. Lots of static constructors. |
110 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
111 | | |
112 | | void |
113 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
114 | | |
115 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
116 | 0 | { |
117 | 0 | /* Get the interface prototype object for this class. This will create the |
118 | 0 | object as needed. */ |
119 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::Node, |
120 | 0 | &CreateInterfaceObjects, |
121 | 0 | /* aDefineOnGlobal = */ true); |
122 | 0 |
|
123 | 0 | } |
124 | | |
125 | | JSObject* |
126 | | GetProtoObject(JSContext* aCx); |
127 | | |
128 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
129 | 0 | { |
130 | 0 | /* Get the interface object for this class. This will create the object as |
131 | 0 | needed. */ |
132 | 0 |
|
133 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::Node, |
134 | 0 | &CreateInterfaceObjects, |
135 | 0 | aDefineOnGlobal); |
136 | 0 | } |
137 | | |
138 | | JSObject* |
139 | | GetConstructorObject(JSContext* aCx); |
140 | | |
141 | | } // namespace Node_Binding |
142 | | |
143 | | |
144 | | |
145 | | } // namespace dom |
146 | | } // namespace mozilla |
147 | | |
148 | | #endif // mozilla_dom_NodeBinding_h |