Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM TreeBoxObject.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #include "AtomList.h"
4 : #include "BoxObjectBinding.h"
5 : #include "TreeBoxObjectBinding.h"
6 : #include "WrapperFactory.h"
7 : #include "mozilla/OwningNonNull.h"
8 : #include "mozilla/dom/BindingUtils.h"
9 : #include "mozilla/dom/DOMJSClass.h"
10 : #include "mozilla/dom/DOMRect.h"
11 : #include "mozilla/dom/Element.h"
12 : #include "mozilla/dom/NonRefcountedDOMObject.h"
13 : #include "mozilla/dom/Nullable.h"
14 : #include "mozilla/dom/PrimitiveConversions.h"
15 : #include "mozilla/dom/ScriptSettings.h"
16 : #include "mozilla/dom/TreeBoxObject.h"
17 : #include "mozilla/dom/XrayExpandoClass.h"
18 : #include "nsIScriptableRegion.h"
19 : #include "nsITreeView.h"
20 : #include "nsTreeColumns.h"
21 :
22 : namespace mozilla {
23 : namespace dom {
24 :
25 :
26 0 : TreeCellInfo::TreeCellInfo()
27 : {
28 : // Safe to pass a null context if we pass a null value
29 0 : Init(nullptr, JS::NullHandleValue);
30 0 : }
31 :
32 :
33 :
34 : bool
35 0 : TreeCellInfo::InitIds(JSContext* cx, TreeCellInfoAtoms* atomsCache)
36 : {
37 0 : MOZ_ASSERT(!*reinterpret_cast<jsid**>(atomsCache));
38 :
39 : // Initialize these in reverse order so that any failure leaves the first one
40 : // uninitialized.
41 0 : if (!atomsCache->row_id.init(cx, "row") ||
42 0 : !atomsCache->col_id.init(cx, "col") ||
43 0 : !atomsCache->childElt_id.init(cx, "childElt")) {
44 0 : return false;
45 : }
46 0 : return true;
47 : }
48 :
49 : bool
50 0 : TreeCellInfo::Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
51 : {
52 : // Passing a null JSContext is OK only if we're initing from null,
53 : // Since in that case we will not have to do any property gets
54 : // Also evaluate isNullOrUndefined in order to avoid false-positive
55 : // checkers by static analysis tools
56 0 : MOZ_ASSERT_IF(!cx, val.isNull() && val.isNullOrUndefined());
57 0 : TreeCellInfoAtoms* atomsCache = nullptr;
58 0 : if (cx) {
59 0 : atomsCache = GetAtomCache<TreeCellInfoAtoms>(cx);
60 0 : if (!*reinterpret_cast<jsid**>(atomsCache) && !InitIds(cx, atomsCache)) {
61 0 : return false;
62 : }
63 : }
64 :
65 0 : if (!IsConvertibleToDictionary(val)) {
66 0 : return ThrowErrorMessage(cx, MSG_NOT_DICTIONARY, sourceDescription);
67 : }
68 :
69 0 : bool isNull = val.isNullOrUndefined();
70 : // We only need these if !isNull, in which case we have |cx|.
71 0 : Maybe<JS::Rooted<JSObject *> > object;
72 0 : Maybe<JS::Rooted<JS::Value> > temp;
73 0 : if (!isNull) {
74 0 : MOZ_ASSERT(cx);
75 0 : object.emplace(cx, &val.toObject());
76 0 : temp.emplace(cx);
77 : }
78 0 : if (!isNull) {
79 0 : if (!JS_GetPropertyById(cx, *object, atomsCache->childElt_id, temp.ptr())) {
80 0 : return false;
81 : }
82 : }
83 0 : if (!isNull && !temp->isUndefined()) {
84 0 : if (!ConvertJSValueToString(cx, temp.ref(), eStringify, eStringify, mChildElt)) {
85 0 : return false;
86 : }
87 : } else {
88 : static const char16_t data[] = { 0 };
89 0 : mChildElt.Rebind(data, ArrayLength(data) - 1);
90 : }
91 0 : mIsAnyMemberPresent = true;
92 :
93 0 : if (!isNull) {
94 0 : if (!JS_GetPropertyById(cx, *object, atomsCache->col_id, temp.ptr())) {
95 0 : return false;
96 : }
97 : }
98 0 : if (!isNull && !temp->isUndefined()) {
99 0 : if (temp.ref().isObject()) {
100 : static_assert(IsRefcounted<nsTreeColumn>::value, "We can only store refcounted classes.");{
101 0 : nsresult rv = UnwrapObject<prototypes::id::TreeColumn, nsTreeColumn>(temp.ptr(), mCol);
102 0 : if (NS_FAILED(rv)) {
103 0 : ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "'col' member of TreeCellInfo", "TreeColumn");
104 0 : return false;
105 : }
106 : }
107 0 : } else if (temp.ref().isNullOrUndefined()) {
108 0 : mCol = nullptr;
109 : } else {
110 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "'col' member of TreeCellInfo");
111 0 : return false;
112 : }
113 : } else {
114 0 : mCol = nullptr;
115 : }
116 0 : mIsAnyMemberPresent = true;
117 :
118 0 : if (!isNull) {
119 0 : if (!JS_GetPropertyById(cx, *object, atomsCache->row_id, temp.ptr())) {
120 0 : return false;
121 : }
122 : }
123 0 : if (!isNull && !temp->isUndefined()) {
124 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, temp.ref(), &mRow)) {
125 0 : return false;
126 : }
127 : } else {
128 0 : mRow = 0;
129 : }
130 0 : mIsAnyMemberPresent = true;
131 0 : return true;
132 : }
133 :
134 : bool
135 0 : TreeCellInfo::ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const
136 : {
137 0 : TreeCellInfoAtoms* atomsCache = GetAtomCache<TreeCellInfoAtoms>(cx);
138 0 : if (!*reinterpret_cast<jsid**>(atomsCache) && !InitIds(cx, atomsCache)) {
139 0 : return false;
140 : }
141 :
142 0 : JS::Rooted<JSObject*> obj(cx, JS_NewPlainObject(cx));
143 0 : if (!obj) {
144 0 : return false;
145 : }
146 0 : rval.set(JS::ObjectValue(*obj));
147 :
148 : do {
149 : // block for our 'break' successCode and scope for 'temp' and 'currentValue'
150 0 : JS::Rooted<JS::Value> temp(cx);
151 0 : nsString const & currentValue = mChildElt;
152 0 : if (!xpc::NonVoidStringToJsval(cx, currentValue, &temp)) {
153 0 : return false;
154 : }
155 0 : if (!JS_DefinePropertyById(cx, obj, atomsCache->childElt_id, temp, JSPROP_ENUMERATE)) {
156 0 : return false;
157 : }
158 0 : break;
159 : } while(0);
160 :
161 : do {
162 : // block for our 'break' successCode and scope for 'temp' and 'currentValue'
163 0 : JS::Rooted<JS::Value> temp(cx);
164 0 : RefPtr<nsTreeColumn> const & currentValue = mCol;
165 0 : if (!currentValue) {
166 0 : temp.setNull();
167 0 : if (!JS_DefinePropertyById(cx, obj, atomsCache->col_id, temp, JSPROP_ENUMERATE)) {
168 0 : return false;
169 : }
170 0 : break;
171 : }
172 0 : if (!GetOrCreateDOMReflector(cx, currentValue, &temp)) {
173 0 : MOZ_ASSERT(true || JS_IsExceptionPending(cx));
174 0 : return false;
175 : }
176 0 : if (!JS_DefinePropertyById(cx, obj, atomsCache->col_id, temp, JSPROP_ENUMERATE)) {
177 0 : return false;
178 : }
179 0 : break;
180 : } while(0);
181 :
182 : do {
183 : // block for our 'break' successCode and scope for 'temp' and 'currentValue'
184 0 : JS::Rooted<JS::Value> temp(cx);
185 0 : int32_t const & currentValue = mRow;
186 0 : temp.setInt32(int32_t(currentValue));
187 0 : if (!JS_DefinePropertyById(cx, obj, atomsCache->row_id, temp, JSPROP_ENUMERATE)) {
188 0 : return false;
189 : }
190 0 : break;
191 : } while(0);
192 :
193 0 : return true;
194 : }
195 :
196 : void
197 0 : TreeCellInfo::TraceDictionary(JSTracer* trc)
198 : {
199 0 : }
200 :
201 : TreeCellInfo&
202 0 : TreeCellInfo::operator=(const TreeCellInfo& aOther)
203 : {
204 0 : mChildElt = aOther.mChildElt;
205 0 : mCol = aOther.mCol;
206 0 : mRow = aOther.mRow;
207 0 : return *this;
208 : }
209 :
210 : namespace binding_detail {
211 : } // namespace binding_detail
212 :
213 :
214 : namespace TreeBoxObjectBinding {
215 :
216 : static_assert(IsRefcounted<NativeType>::value == IsRefcounted<BoxObjectBinding::NativeType>::value,
217 : "Can't inherit from an interface with a different ownership model.");
218 :
219 : static bool
220 0 : get_columns(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, JSJitGetterCallArgs args)
221 : {
222 0 : auto result(StrongOrRawPtr<nsTreeColumns>(self->GetColumns()));
223 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
224 0 : if (!result) {
225 0 : args.rval().setNull();
226 0 : return true;
227 : }
228 0 : if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
229 0 : MOZ_ASSERT(true || JS_IsExceptionPending(cx));
230 0 : return false;
231 : }
232 0 : return true;
233 : }
234 :
235 : static const JSJitInfo columns_getterinfo = {
236 : { (JSJitGetterOp)get_columns },
237 : { prototypes::id::TreeBoxObject },
238 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
239 : JSJitInfo::Getter,
240 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
241 : JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
242 : false, /* isInfallible. False in setters. */
243 : false, /* isMovable. Not relevant for setters. */
244 : false, /* isEliminatable. Not relevant for setters. */
245 : false, /* isAlwaysInSlot. Only relevant for getters. */
246 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
247 : false, /* isTypedMethod. Only relevant for methods. */
248 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
249 : };
250 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
251 : static_assert(0 < 1, "There is no slot for us");
252 :
253 : static bool
254 0 : get_view(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, JSJitGetterCallArgs args)
255 : {
256 0 : auto result(StrongOrRawPtr<nsITreeView>(self->GetView()));
257 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
258 0 : if (!result) {
259 0 : args.rval().setNull();
260 0 : return true;
261 : }
262 0 : if (!WrapObject(cx, result, &NS_GET_IID(nsITreeView), args.rval())) {
263 0 : return false;
264 : }
265 0 : return true;
266 : }
267 :
268 : static bool
269 0 : set_view(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, JSJitSetterCallArgs args)
270 : {
271 : nsITreeView* arg0;
272 0 : RefPtr<nsITreeView> arg0_holder;
273 0 : if (args[0].isObject()) {
274 0 : JS::Rooted<JSObject*> source(cx, &args[0].toObject());
275 0 : if (NS_FAILED(UnwrapArg<nsITreeView>(cx, source, getter_AddRefs(arg0_holder)))) {
276 0 : ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Value being assigned to TreeBoxObject.view", "MozTreeView");
277 0 : return false;
278 : }
279 0 : MOZ_ASSERT(arg0_holder);
280 0 : arg0 = arg0_holder;
281 0 : } else if (args[0].isNullOrUndefined()) {
282 0 : arg0 = nullptr;
283 : } else {
284 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Value being assigned to TreeBoxObject.view");
285 0 : return false;
286 : }
287 0 : binding_detail::FastErrorResult rv;
288 0 : self->SetView(Constify(arg0), rv);
289 0 : if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
290 0 : return false;
291 : }
292 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
293 :
294 0 : return true;
295 : }
296 :
297 : static const JSJitInfo view_getterinfo = {
298 : { (JSJitGetterOp)get_view },
299 : { prototypes::id::TreeBoxObject },
300 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
301 : JSJitInfo::Getter,
302 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
303 : JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
304 : false, /* isInfallible. False in setters. */
305 : false, /* isMovable. Not relevant for setters. */
306 : false, /* isEliminatable. Not relevant for setters. */
307 : false, /* isAlwaysInSlot. Only relevant for getters. */
308 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
309 : false, /* isTypedMethod. Only relevant for methods. */
310 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
311 : };
312 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
313 : static_assert(0 < 1, "There is no slot for us");
314 : static const JSJitInfo view_setterinfo = {
315 : { (JSJitGetterOp)set_view },
316 : { prototypes::id::TreeBoxObject },
317 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
318 : JSJitInfo::Setter,
319 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
320 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
321 : false, /* isInfallible. False in setters. */
322 : false, /* isMovable. Not relevant for setters. */
323 : false, /* isEliminatable. Not relevant for setters. */
324 : false, /* isAlwaysInSlot. Only relevant for getters. */
325 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
326 : false, /* isTypedMethod. Only relevant for methods. */
327 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
328 : };
329 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
330 : static_assert(0 < 1, "There is no slot for us");
331 :
332 : static bool
333 0 : get_focused(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, JSJitGetterCallArgs args)
334 : {
335 0 : bool result(self->Focused());
336 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
337 0 : args.rval().setBoolean(result);
338 0 : return true;
339 : }
340 :
341 : static bool
342 0 : set_focused(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, JSJitSetterCallArgs args)
343 : {
344 : bool arg0;
345 0 : if (!ValueToPrimitive<bool, eDefault>(cx, args[0], &arg0)) {
346 0 : return false;
347 : }
348 0 : self->SetFocused(arg0);
349 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
350 :
351 0 : return true;
352 : }
353 :
354 : static const JSJitInfo focused_getterinfo = {
355 : { (JSJitGetterOp)get_focused },
356 : { prototypes::id::TreeBoxObject },
357 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
358 : JSJitInfo::Getter,
359 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
360 : JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
361 : true, /* isInfallible. False in setters. */
362 : false, /* isMovable. Not relevant for setters. */
363 : false, /* isEliminatable. Not relevant for setters. */
364 : false, /* isAlwaysInSlot. Only relevant for getters. */
365 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
366 : false, /* isTypedMethod. Only relevant for methods. */
367 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
368 : };
369 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
370 : static_assert(0 < 1, "There is no slot for us");
371 : static const JSJitInfo focused_setterinfo = {
372 : { (JSJitGetterOp)set_focused },
373 : { prototypes::id::TreeBoxObject },
374 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
375 : JSJitInfo::Setter,
376 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
377 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
378 : false, /* isInfallible. False in setters. */
379 : false, /* isMovable. Not relevant for setters. */
380 : false, /* isEliminatable. Not relevant for setters. */
381 : false, /* isAlwaysInSlot. Only relevant for getters. */
382 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
383 : false, /* isTypedMethod. Only relevant for methods. */
384 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
385 : };
386 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
387 : static_assert(0 < 1, "There is no slot for us");
388 :
389 : static bool
390 0 : get_treeBody(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, JSJitGetterCallArgs args)
391 : {
392 0 : auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetTreeBody()));
393 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
394 0 : if (!result) {
395 0 : args.rval().setNull();
396 0 : return true;
397 : }
398 0 : if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
399 0 : MOZ_ASSERT(true || JS_IsExceptionPending(cx));
400 0 : return false;
401 : }
402 0 : return true;
403 : }
404 :
405 : static const JSJitInfo treeBody_getterinfo = {
406 : { (JSJitGetterOp)get_treeBody },
407 : { prototypes::id::TreeBoxObject },
408 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
409 : JSJitInfo::Getter,
410 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
411 : JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
412 : false, /* isInfallible. False in setters. */
413 : false, /* isMovable. Not relevant for setters. */
414 : false, /* isEliminatable. Not relevant for setters. */
415 : false, /* isAlwaysInSlot. Only relevant for getters. */
416 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
417 : false, /* isTypedMethod. Only relevant for methods. */
418 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
419 : };
420 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
421 : static_assert(0 < 1, "There is no slot for us");
422 :
423 : static bool
424 0 : get_rowHeight(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, JSJitGetterCallArgs args)
425 : {
426 0 : int32_t result(self->RowHeight());
427 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
428 0 : args.rval().setInt32(int32_t(result));
429 0 : return true;
430 : }
431 :
432 : static const JSJitInfo rowHeight_getterinfo = {
433 : { (JSJitGetterOp)get_rowHeight },
434 : { prototypes::id::TreeBoxObject },
435 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
436 : JSJitInfo::Getter,
437 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
438 : JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
439 : true, /* isInfallible. False in setters. */
440 : false, /* isMovable. Not relevant for setters. */
441 : false, /* isEliminatable. Not relevant for setters. */
442 : false, /* isAlwaysInSlot. Only relevant for getters. */
443 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
444 : false, /* isTypedMethod. Only relevant for methods. */
445 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
446 : };
447 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
448 : static_assert(0 < 1, "There is no slot for us");
449 :
450 : static bool
451 0 : get_rowWidth(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, JSJitGetterCallArgs args)
452 : {
453 0 : int32_t result(self->RowWidth());
454 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
455 0 : args.rval().setInt32(int32_t(result));
456 0 : return true;
457 : }
458 :
459 : static const JSJitInfo rowWidth_getterinfo = {
460 : { (JSJitGetterOp)get_rowWidth },
461 : { prototypes::id::TreeBoxObject },
462 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
463 : JSJitInfo::Getter,
464 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
465 : JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
466 : true, /* isInfallible. False in setters. */
467 : false, /* isMovable. Not relevant for setters. */
468 : false, /* isEliminatable. Not relevant for setters. */
469 : false, /* isAlwaysInSlot. Only relevant for getters. */
470 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
471 : false, /* isTypedMethod. Only relevant for methods. */
472 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
473 : };
474 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
475 : static_assert(0 < 1, "There is no slot for us");
476 :
477 : static bool
478 0 : get_horizontalPosition(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, JSJitGetterCallArgs args)
479 : {
480 0 : int32_t result(self->HorizontalPosition());
481 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
482 0 : args.rval().setInt32(int32_t(result));
483 0 : return true;
484 : }
485 :
486 : static const JSJitInfo horizontalPosition_getterinfo = {
487 : { (JSJitGetterOp)get_horizontalPosition },
488 : { prototypes::id::TreeBoxObject },
489 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
490 : JSJitInfo::Getter,
491 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
492 : JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
493 : true, /* isInfallible. False in setters. */
494 : false, /* isMovable. Not relevant for setters. */
495 : false, /* isEliminatable. Not relevant for setters. */
496 : false, /* isAlwaysInSlot. Only relevant for getters. */
497 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
498 : false, /* isTypedMethod. Only relevant for methods. */
499 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
500 : };
501 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
502 : static_assert(0 < 1, "There is no slot for us");
503 :
504 : static bool
505 0 : get_selectionRegion(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, JSJitGetterCallArgs args)
506 : {
507 0 : auto result(StrongOrRawPtr<nsIScriptableRegion>(self->SelectionRegion()));
508 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
509 0 : if (!WrapObject(cx, result, &NS_GET_IID(nsIScriptableRegion), args.rval())) {
510 0 : return false;
511 : }
512 0 : return true;
513 : }
514 :
515 : static const JSJitInfo selectionRegion_getterinfo = {
516 : { (JSJitGetterOp)get_selectionRegion },
517 : { prototypes::id::TreeBoxObject },
518 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
519 : JSJitInfo::Getter,
520 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
521 : JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
522 : false, /* isInfallible. False in setters. */
523 : false, /* isMovable. Not relevant for setters. */
524 : false, /* isEliminatable. Not relevant for setters. */
525 : false, /* isAlwaysInSlot. Only relevant for getters. */
526 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
527 : false, /* isTypedMethod. Only relevant for methods. */
528 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
529 : };
530 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
531 : static_assert(0 < 1, "There is no slot for us");
532 :
533 : static bool
534 0 : getFirstVisibleRow(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
535 : {
536 0 : int32_t result(self->GetFirstVisibleRow());
537 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
538 0 : args.rval().setInt32(int32_t(result));
539 0 : return true;
540 : }
541 :
542 : static const JSJitInfo getFirstVisibleRow_methodinfo = {
543 : { (JSJitGetterOp)getFirstVisibleRow },
544 : { prototypes::id::TreeBoxObject },
545 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
546 : JSJitInfo::Method,
547 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
548 : JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
549 : true, /* isInfallible. False in setters. */
550 : false, /* isMovable. Not relevant for setters. */
551 : false, /* isEliminatable. Not relevant for setters. */
552 : false, /* isAlwaysInSlot. Only relevant for getters. */
553 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
554 : false, /* isTypedMethod. Only relevant for methods. */
555 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
556 : };
557 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
558 : static_assert(0 < 1, "There is no slot for us");
559 :
560 : static bool
561 0 : getLastVisibleRow(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
562 : {
563 0 : int32_t result(self->GetLastVisibleRow());
564 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
565 0 : args.rval().setInt32(int32_t(result));
566 0 : return true;
567 : }
568 :
569 : static const JSJitInfo getLastVisibleRow_methodinfo = {
570 : { (JSJitGetterOp)getLastVisibleRow },
571 : { prototypes::id::TreeBoxObject },
572 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
573 : JSJitInfo::Method,
574 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
575 : JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
576 : true, /* isInfallible. False in setters. */
577 : false, /* isMovable. Not relevant for setters. */
578 : false, /* isEliminatable. Not relevant for setters. */
579 : false, /* isAlwaysInSlot. Only relevant for getters. */
580 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
581 : false, /* isTypedMethod. Only relevant for methods. */
582 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
583 : };
584 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
585 : static_assert(0 < 1, "There is no slot for us");
586 :
587 : static bool
588 0 : getPageLength(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
589 : {
590 0 : int32_t result(self->GetPageLength());
591 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
592 0 : args.rval().setInt32(int32_t(result));
593 0 : return true;
594 : }
595 :
596 : static const JSJitInfo getPageLength_methodinfo = {
597 : { (JSJitGetterOp)getPageLength },
598 : { prototypes::id::TreeBoxObject },
599 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
600 : JSJitInfo::Method,
601 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
602 : JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
603 : true, /* isInfallible. False in setters. */
604 : false, /* isMovable. Not relevant for setters. */
605 : false, /* isEliminatable. Not relevant for setters. */
606 : false, /* isAlwaysInSlot. Only relevant for getters. */
607 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
608 : false, /* isTypedMethod. Only relevant for methods. */
609 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
610 : };
611 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
612 : static_assert(0 < 1, "There is no slot for us");
613 :
614 : static bool
615 0 : ensureRowIsVisible(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
616 : {
617 0 : if (MOZ_UNLIKELY(args.length() < 1)) {
618 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.ensureRowIsVisible");
619 : }
620 : int32_t arg0;
621 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
622 0 : return false;
623 : }
624 0 : self->EnsureRowIsVisible(arg0);
625 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
626 0 : args.rval().setUndefined();
627 0 : return true;
628 : }
629 :
630 : static const JSJitInfo ensureRowIsVisible_methodinfo = {
631 : { (JSJitGetterOp)ensureRowIsVisible },
632 : { prototypes::id::TreeBoxObject },
633 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
634 : JSJitInfo::Method,
635 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
636 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
637 : false, /* isInfallible. False in setters. */
638 : false, /* isMovable. Not relevant for setters. */
639 : false, /* isEliminatable. Not relevant for setters. */
640 : false, /* isAlwaysInSlot. Only relevant for getters. */
641 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
642 : false, /* isTypedMethod. Only relevant for methods. */
643 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
644 : };
645 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
646 : static_assert(0 < 1, "There is no slot for us");
647 :
648 : static bool
649 0 : ensureCellIsVisible(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
650 : {
651 0 : if (MOZ_UNLIKELY(args.length() < 2)) {
652 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.ensureCellIsVisible");
653 : }
654 : int32_t arg0;
655 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
656 0 : return false;
657 : }
658 : nsTreeColumn* arg1;
659 0 : if (args[1].isObject()) {
660 : {
661 0 : nsresult rv = UnwrapObject<prototypes::id::TreeColumn, nsTreeColumn>(args[1], arg1);
662 0 : if (NS_FAILED(rv)) {
663 0 : ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of TreeBoxObject.ensureCellIsVisible", "TreeColumn");
664 0 : return false;
665 : }
666 : }
667 0 : } else if (args[1].isNullOrUndefined()) {
668 0 : arg1 = nullptr;
669 : } else {
670 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of TreeBoxObject.ensureCellIsVisible");
671 0 : return false;
672 : }
673 0 : self->EnsureCellIsVisible(arg0, Constify(arg1));
674 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
675 0 : args.rval().setUndefined();
676 0 : return true;
677 : }
678 :
679 : static const JSJitInfo ensureCellIsVisible_methodinfo = {
680 : { (JSJitGetterOp)ensureCellIsVisible },
681 : { prototypes::id::TreeBoxObject },
682 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
683 : JSJitInfo::Method,
684 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
685 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
686 : false, /* isInfallible. False in setters. */
687 : false, /* isMovable. Not relevant for setters. */
688 : false, /* isEliminatable. Not relevant for setters. */
689 : false, /* isAlwaysInSlot. Only relevant for getters. */
690 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
691 : false, /* isTypedMethod. Only relevant for methods. */
692 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
693 : };
694 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
695 : static_assert(0 < 1, "There is no slot for us");
696 :
697 : static bool
698 0 : scrollToRow(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
699 : {
700 0 : if (MOZ_UNLIKELY(args.length() < 1)) {
701 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.scrollToRow");
702 : }
703 : int32_t arg0;
704 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
705 0 : return false;
706 : }
707 0 : self->ScrollToRow(arg0);
708 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
709 0 : args.rval().setUndefined();
710 0 : return true;
711 : }
712 :
713 : static const JSJitInfo scrollToRow_methodinfo = {
714 : { (JSJitGetterOp)scrollToRow },
715 : { prototypes::id::TreeBoxObject },
716 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
717 : JSJitInfo::Method,
718 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
719 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
720 : false, /* isInfallible. False in setters. */
721 : false, /* isMovable. Not relevant for setters. */
722 : false, /* isEliminatable. Not relevant for setters. */
723 : false, /* isAlwaysInSlot. Only relevant for getters. */
724 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
725 : false, /* isTypedMethod. Only relevant for methods. */
726 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
727 : };
728 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
729 : static_assert(0 < 1, "There is no slot for us");
730 :
731 : static bool
732 0 : scrollByLines(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
733 : {
734 0 : if (MOZ_UNLIKELY(args.length() < 1)) {
735 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.scrollByLines");
736 : }
737 : int32_t arg0;
738 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
739 0 : return false;
740 : }
741 0 : self->ScrollByLines(arg0);
742 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
743 0 : args.rval().setUndefined();
744 0 : return true;
745 : }
746 :
747 : static const JSJitInfo scrollByLines_methodinfo = {
748 : { (JSJitGetterOp)scrollByLines },
749 : { prototypes::id::TreeBoxObject },
750 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
751 : JSJitInfo::Method,
752 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
753 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
754 : false, /* isInfallible. False in setters. */
755 : false, /* isMovable. Not relevant for setters. */
756 : false, /* isEliminatable. Not relevant for setters. */
757 : false, /* isAlwaysInSlot. Only relevant for getters. */
758 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
759 : false, /* isTypedMethod. Only relevant for methods. */
760 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
761 : };
762 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
763 : static_assert(0 < 1, "There is no slot for us");
764 :
765 : static bool
766 0 : scrollByPages(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
767 : {
768 0 : if (MOZ_UNLIKELY(args.length() < 1)) {
769 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.scrollByPages");
770 : }
771 : int32_t arg0;
772 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
773 0 : return false;
774 : }
775 0 : self->ScrollByPages(arg0);
776 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
777 0 : args.rval().setUndefined();
778 0 : return true;
779 : }
780 :
781 : static const JSJitInfo scrollByPages_methodinfo = {
782 : { (JSJitGetterOp)scrollByPages },
783 : { prototypes::id::TreeBoxObject },
784 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
785 : JSJitInfo::Method,
786 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
787 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
788 : false, /* isInfallible. False in setters. */
789 : false, /* isMovable. Not relevant for setters. */
790 : false, /* isEliminatable. Not relevant for setters. */
791 : false, /* isAlwaysInSlot. Only relevant for getters. */
792 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
793 : false, /* isTypedMethod. Only relevant for methods. */
794 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
795 : };
796 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
797 : static_assert(0 < 1, "There is no slot for us");
798 :
799 : static bool
800 0 : scrollToCell(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
801 : {
802 0 : if (MOZ_UNLIKELY(args.length() < 2)) {
803 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.scrollToCell");
804 : }
805 : int32_t arg0;
806 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
807 0 : return false;
808 : }
809 : nsTreeColumn* arg1;
810 0 : if (args[1].isObject()) {
811 : {
812 0 : nsresult rv = UnwrapObject<prototypes::id::TreeColumn, nsTreeColumn>(args[1], arg1);
813 0 : if (NS_FAILED(rv)) {
814 0 : ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of TreeBoxObject.scrollToCell", "TreeColumn");
815 0 : return false;
816 : }
817 : }
818 0 : } else if (args[1].isNullOrUndefined()) {
819 0 : arg1 = nullptr;
820 : } else {
821 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of TreeBoxObject.scrollToCell");
822 0 : return false;
823 : }
824 0 : self->ScrollToCell(arg0, Constify(arg1));
825 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
826 0 : args.rval().setUndefined();
827 0 : return true;
828 : }
829 :
830 : static const JSJitInfo scrollToCell_methodinfo = {
831 : { (JSJitGetterOp)scrollToCell },
832 : { prototypes::id::TreeBoxObject },
833 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
834 : JSJitInfo::Method,
835 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
836 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
837 : false, /* isInfallible. False in setters. */
838 : false, /* isMovable. Not relevant for setters. */
839 : false, /* isEliminatable. Not relevant for setters. */
840 : false, /* isAlwaysInSlot. Only relevant for getters. */
841 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
842 : false, /* isTypedMethod. Only relevant for methods. */
843 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
844 : };
845 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
846 : static_assert(0 < 1, "There is no slot for us");
847 :
848 : static bool
849 0 : scrollToColumn(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
850 : {
851 0 : if (MOZ_UNLIKELY(args.length() < 1)) {
852 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.scrollToColumn");
853 : }
854 : nsTreeColumn* arg0;
855 0 : if (args[0].isObject()) {
856 : {
857 0 : nsresult rv = UnwrapObject<prototypes::id::TreeColumn, nsTreeColumn>(args[0], arg0);
858 0 : if (NS_FAILED(rv)) {
859 0 : ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of TreeBoxObject.scrollToColumn", "TreeColumn");
860 0 : return false;
861 : }
862 : }
863 0 : } else if (args[0].isNullOrUndefined()) {
864 0 : arg0 = nullptr;
865 : } else {
866 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of TreeBoxObject.scrollToColumn");
867 0 : return false;
868 : }
869 0 : self->ScrollToColumn(Constify(arg0));
870 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
871 0 : args.rval().setUndefined();
872 0 : return true;
873 : }
874 :
875 : static const JSJitInfo scrollToColumn_methodinfo = {
876 : { (JSJitGetterOp)scrollToColumn },
877 : { prototypes::id::TreeBoxObject },
878 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
879 : JSJitInfo::Method,
880 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
881 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
882 : false, /* isInfallible. False in setters. */
883 : false, /* isMovable. Not relevant for setters. */
884 : false, /* isEliminatable. Not relevant for setters. */
885 : false, /* isAlwaysInSlot. Only relevant for getters. */
886 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
887 : false, /* isTypedMethod. Only relevant for methods. */
888 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
889 : };
890 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
891 : static_assert(0 < 1, "There is no slot for us");
892 :
893 : static bool
894 0 : scrollToHorizontalPosition(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
895 : {
896 0 : if (MOZ_UNLIKELY(args.length() < 1)) {
897 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.scrollToHorizontalPosition");
898 : }
899 : int32_t arg0;
900 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
901 0 : return false;
902 : }
903 0 : self->ScrollToHorizontalPosition(arg0);
904 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
905 0 : args.rval().setUndefined();
906 0 : return true;
907 : }
908 :
909 : static const JSJitInfo scrollToHorizontalPosition_methodinfo = {
910 : { (JSJitGetterOp)scrollToHorizontalPosition },
911 : { prototypes::id::TreeBoxObject },
912 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
913 : JSJitInfo::Method,
914 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
915 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
916 : false, /* isInfallible. False in setters. */
917 : false, /* isMovable. Not relevant for setters. */
918 : false, /* isEliminatable. Not relevant for setters. */
919 : false, /* isAlwaysInSlot. Only relevant for getters. */
920 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
921 : false, /* isTypedMethod. Only relevant for methods. */
922 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
923 : };
924 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
925 : static_assert(0 < 1, "There is no slot for us");
926 :
927 : static bool
928 0 : invalidate(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
929 : {
930 0 : self->Invalidate();
931 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
932 0 : args.rval().setUndefined();
933 0 : return true;
934 : }
935 :
936 : static const JSJitInfo invalidate_methodinfo = {
937 : { (JSJitGetterOp)invalidate },
938 : { prototypes::id::TreeBoxObject },
939 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
940 : JSJitInfo::Method,
941 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
942 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
943 : true, /* isInfallible. False in setters. */
944 : false, /* isMovable. Not relevant for setters. */
945 : false, /* isEliminatable. Not relevant for setters. */
946 : false, /* isAlwaysInSlot. Only relevant for getters. */
947 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
948 : false, /* isTypedMethod. Only relevant for methods. */
949 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
950 : };
951 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
952 : static_assert(0 < 1, "There is no slot for us");
953 :
954 : static bool
955 0 : invalidateColumn(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
956 : {
957 0 : if (MOZ_UNLIKELY(args.length() < 1)) {
958 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.invalidateColumn");
959 : }
960 : nsTreeColumn* arg0;
961 0 : if (args[0].isObject()) {
962 : {
963 0 : nsresult rv = UnwrapObject<prototypes::id::TreeColumn, nsTreeColumn>(args[0], arg0);
964 0 : if (NS_FAILED(rv)) {
965 0 : ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of TreeBoxObject.invalidateColumn", "TreeColumn");
966 0 : return false;
967 : }
968 : }
969 0 : } else if (args[0].isNullOrUndefined()) {
970 0 : arg0 = nullptr;
971 : } else {
972 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of TreeBoxObject.invalidateColumn");
973 0 : return false;
974 : }
975 0 : self->InvalidateColumn(Constify(arg0));
976 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
977 0 : args.rval().setUndefined();
978 0 : return true;
979 : }
980 :
981 : static const JSJitInfo invalidateColumn_methodinfo = {
982 : { (JSJitGetterOp)invalidateColumn },
983 : { prototypes::id::TreeBoxObject },
984 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
985 : JSJitInfo::Method,
986 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
987 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
988 : false, /* isInfallible. False in setters. */
989 : false, /* isMovable. Not relevant for setters. */
990 : false, /* isEliminatable. Not relevant for setters. */
991 : false, /* isAlwaysInSlot. Only relevant for getters. */
992 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
993 : false, /* isTypedMethod. Only relevant for methods. */
994 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
995 : };
996 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
997 : static_assert(0 < 1, "There is no slot for us");
998 :
999 : static bool
1000 0 : invalidateRow(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
1001 : {
1002 0 : if (MOZ_UNLIKELY(args.length() < 1)) {
1003 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.invalidateRow");
1004 : }
1005 : int32_t arg0;
1006 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
1007 0 : return false;
1008 : }
1009 0 : self->InvalidateRow(arg0);
1010 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1011 0 : args.rval().setUndefined();
1012 0 : return true;
1013 : }
1014 :
1015 : static const JSJitInfo invalidateRow_methodinfo = {
1016 : { (JSJitGetterOp)invalidateRow },
1017 : { prototypes::id::TreeBoxObject },
1018 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
1019 : JSJitInfo::Method,
1020 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1021 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1022 : false, /* isInfallible. False in setters. */
1023 : false, /* isMovable. Not relevant for setters. */
1024 : false, /* isEliminatable. Not relevant for setters. */
1025 : false, /* isAlwaysInSlot. Only relevant for getters. */
1026 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
1027 : false, /* isTypedMethod. Only relevant for methods. */
1028 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1029 : };
1030 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1031 : static_assert(0 < 1, "There is no slot for us");
1032 :
1033 : static bool
1034 0 : invalidateCell(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
1035 : {
1036 0 : if (MOZ_UNLIKELY(args.length() < 2)) {
1037 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.invalidateCell");
1038 : }
1039 : int32_t arg0;
1040 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
1041 0 : return false;
1042 : }
1043 : nsTreeColumn* arg1;
1044 0 : if (args[1].isObject()) {
1045 : {
1046 0 : nsresult rv = UnwrapObject<prototypes::id::TreeColumn, nsTreeColumn>(args[1], arg1);
1047 0 : if (NS_FAILED(rv)) {
1048 0 : ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of TreeBoxObject.invalidateCell", "TreeColumn");
1049 0 : return false;
1050 : }
1051 : }
1052 0 : } else if (args[1].isNullOrUndefined()) {
1053 0 : arg1 = nullptr;
1054 : } else {
1055 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of TreeBoxObject.invalidateCell");
1056 0 : return false;
1057 : }
1058 0 : self->InvalidateCell(arg0, Constify(arg1));
1059 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1060 0 : args.rval().setUndefined();
1061 0 : return true;
1062 : }
1063 :
1064 : static const JSJitInfo invalidateCell_methodinfo = {
1065 : { (JSJitGetterOp)invalidateCell },
1066 : { prototypes::id::TreeBoxObject },
1067 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
1068 : JSJitInfo::Method,
1069 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1070 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1071 : false, /* isInfallible. False in setters. */
1072 : false, /* isMovable. Not relevant for setters. */
1073 : false, /* isEliminatable. Not relevant for setters. */
1074 : false, /* isAlwaysInSlot. Only relevant for getters. */
1075 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
1076 : false, /* isTypedMethod. Only relevant for methods. */
1077 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1078 : };
1079 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1080 : static_assert(0 < 1, "There is no slot for us");
1081 :
1082 : static bool
1083 0 : invalidateRange(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
1084 : {
1085 0 : if (MOZ_UNLIKELY(args.length() < 2)) {
1086 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.invalidateRange");
1087 : }
1088 : int32_t arg0;
1089 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
1090 0 : return false;
1091 : }
1092 : int32_t arg1;
1093 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) {
1094 0 : return false;
1095 : }
1096 0 : self->InvalidateRange(arg0, arg1);
1097 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1098 0 : args.rval().setUndefined();
1099 0 : return true;
1100 : }
1101 :
1102 : static const JSJitInfo invalidateRange_methodinfo = {
1103 : { (JSJitGetterOp)invalidateRange },
1104 : { prototypes::id::TreeBoxObject },
1105 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
1106 : JSJitInfo::Method,
1107 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1108 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1109 : false, /* isInfallible. False in setters. */
1110 : false, /* isMovable. Not relevant for setters. */
1111 : false, /* isEliminatable. Not relevant for setters. */
1112 : false, /* isAlwaysInSlot. Only relevant for getters. */
1113 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
1114 : false, /* isTypedMethod. Only relevant for methods. */
1115 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1116 : };
1117 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1118 : static_assert(0 < 1, "There is no slot for us");
1119 :
1120 : static bool
1121 0 : invalidateColumnRange(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
1122 : {
1123 0 : if (MOZ_UNLIKELY(args.length() < 3)) {
1124 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.invalidateColumnRange");
1125 : }
1126 : int32_t arg0;
1127 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
1128 0 : return false;
1129 : }
1130 : int32_t arg1;
1131 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) {
1132 0 : return false;
1133 : }
1134 : nsTreeColumn* arg2;
1135 0 : if (args[2].isObject()) {
1136 : {
1137 0 : nsresult rv = UnwrapObject<prototypes::id::TreeColumn, nsTreeColumn>(args[2], arg2);
1138 0 : if (NS_FAILED(rv)) {
1139 0 : ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 3 of TreeBoxObject.invalidateColumnRange", "TreeColumn");
1140 0 : return false;
1141 : }
1142 : }
1143 0 : } else if (args[2].isNullOrUndefined()) {
1144 0 : arg2 = nullptr;
1145 : } else {
1146 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 3 of TreeBoxObject.invalidateColumnRange");
1147 0 : return false;
1148 : }
1149 0 : self->InvalidateColumnRange(arg0, arg1, Constify(arg2));
1150 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1151 0 : args.rval().setUndefined();
1152 0 : return true;
1153 : }
1154 :
1155 : static const JSJitInfo invalidateColumnRange_methodinfo = {
1156 : { (JSJitGetterOp)invalidateColumnRange },
1157 : { prototypes::id::TreeBoxObject },
1158 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
1159 : JSJitInfo::Method,
1160 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1161 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1162 : false, /* isInfallible. False in setters. */
1163 : false, /* isMovable. Not relevant for setters. */
1164 : false, /* isEliminatable. Not relevant for setters. */
1165 : false, /* isAlwaysInSlot. Only relevant for getters. */
1166 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
1167 : false, /* isTypedMethod. Only relevant for methods. */
1168 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1169 : };
1170 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1171 : static_assert(0 < 1, "There is no slot for us");
1172 :
1173 : static bool
1174 0 : getRowAt(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
1175 : {
1176 0 : if (MOZ_UNLIKELY(args.length() < 2)) {
1177 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.getRowAt");
1178 : }
1179 : int32_t arg0;
1180 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
1181 0 : return false;
1182 : }
1183 : int32_t arg1;
1184 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) {
1185 0 : return false;
1186 : }
1187 0 : int32_t result(self->GetRowAt(arg0, arg1));
1188 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1189 0 : args.rval().setInt32(int32_t(result));
1190 0 : return true;
1191 : }
1192 :
1193 : static const JSJitInfo getRowAt_methodinfo = {
1194 : { (JSJitGetterOp)getRowAt },
1195 : { prototypes::id::TreeBoxObject },
1196 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
1197 : JSJitInfo::Method,
1198 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1199 : JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1200 : false, /* isInfallible. False in setters. */
1201 : false, /* isMovable. Not relevant for setters. */
1202 : false, /* isEliminatable. Not relevant for setters. */
1203 : false, /* isAlwaysInSlot. Only relevant for getters. */
1204 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
1205 : false, /* isTypedMethod. Only relevant for methods. */
1206 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1207 : };
1208 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1209 : static_assert(0 < 1, "There is no slot for us");
1210 :
1211 : static bool
1212 0 : getCellAt(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
1213 : {
1214 0 : unsigned argcount = std::min(args.length(), 5u);
1215 0 : switch (argcount) {
1216 : case 2: {
1217 : int32_t arg0;
1218 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
1219 0 : return false;
1220 : }
1221 : int32_t arg1;
1222 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) {
1223 0 : return false;
1224 : }
1225 0 : binding_detail::FastErrorResult rv;
1226 0 : TreeCellInfo result;
1227 0 : self->GetCellAt(arg0, arg1, result, rv);
1228 0 : if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1229 0 : return false;
1230 : }
1231 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1232 0 : if (!result.ToObjectInternal(cx, args.rval())) {
1233 0 : return false;
1234 : }
1235 0 : return true;
1236 : break;
1237 : }
1238 : case 5: {
1239 : int32_t arg0;
1240 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
1241 0 : return false;
1242 : }
1243 : int32_t arg1;
1244 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) {
1245 0 : return false;
1246 : }
1247 0 : JS::Rooted<JSObject*> arg2(cx);
1248 0 : if (args[2].isObject()) {
1249 0 : arg2 = &args[2].toObject();
1250 : } else {
1251 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 3 of TreeBoxObject.getCellAt");
1252 0 : return false;
1253 : }
1254 0 : JS::Rooted<JSObject*> arg3(cx);
1255 0 : if (args[3].isObject()) {
1256 0 : arg3 = &args[3].toObject();
1257 : } else {
1258 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 4 of TreeBoxObject.getCellAt");
1259 0 : return false;
1260 : }
1261 0 : JS::Rooted<JSObject*> arg4(cx);
1262 0 : if (args[4].isObject()) {
1263 0 : arg4 = &args[4].toObject();
1264 : } else {
1265 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 5 of TreeBoxObject.getCellAt");
1266 0 : return false;
1267 : }
1268 0 : binding_detail::FastErrorResult rv;
1269 0 : self->GetCellAt(cx, arg0, arg1, arg2, arg3, arg4, rv);
1270 0 : if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1271 0 : return false;
1272 : }
1273 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1274 0 : args.rval().setUndefined();
1275 0 : return true;
1276 : break;
1277 : }
1278 : default: {
1279 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.getCellAt");
1280 : break;
1281 : }
1282 : }
1283 : MOZ_CRASH("We have an always-returning default case");
1284 : return false;
1285 : }
1286 :
1287 : static const JSJitInfo getCellAt_methodinfo = {
1288 : { (JSJitGetterOp)getCellAt },
1289 : { prototypes::id::TreeBoxObject },
1290 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
1291 : JSJitInfo::Method,
1292 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1293 : JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
1294 : false, /* isInfallible. False in setters. */
1295 : false, /* isMovable. Not relevant for setters. */
1296 : false, /* isEliminatable. Not relevant for setters. */
1297 : false, /* isAlwaysInSlot. Only relevant for getters. */
1298 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
1299 : false, /* isTypedMethod. Only relevant for methods. */
1300 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1301 : };
1302 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1303 : static_assert(0 < 1, "There is no slot for us");
1304 :
1305 : static bool
1306 0 : getCoordsForCellItem(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
1307 : {
1308 0 : unsigned argcount = std::min(args.length(), 7u);
1309 0 : switch (argcount) {
1310 : case 3: {
1311 : int32_t arg0;
1312 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
1313 0 : return false;
1314 : }
1315 0 : NonNull<nsTreeColumn> arg1;
1316 0 : if (args[1].isObject()) {
1317 : {
1318 0 : nsresult rv = UnwrapObject<prototypes::id::TreeColumn, nsTreeColumn>(args[1], arg1);
1319 0 : if (NS_FAILED(rv)) {
1320 0 : ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of TreeBoxObject.getCoordsForCellItem", "TreeColumn");
1321 0 : return false;
1322 : }
1323 : }
1324 : } else {
1325 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of TreeBoxObject.getCoordsForCellItem");
1326 0 : return false;
1327 : }
1328 0 : binding_detail::FakeString arg2;
1329 0 : if (!ConvertJSValueToString(cx, args[2], eStringify, eStringify, arg2)) {
1330 0 : return false;
1331 : }
1332 0 : binding_detail::FastErrorResult rv;
1333 0 : auto result(StrongOrRawPtr<mozilla::dom::DOMRect>(self->GetCoordsForCellItem(arg0, NonNullHelper(arg1), NonNullHelper(Constify(arg2)), rv)));
1334 0 : if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1335 0 : return false;
1336 : }
1337 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1338 0 : if (!result) {
1339 0 : args.rval().setNull();
1340 0 : return true;
1341 : }
1342 0 : if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1343 0 : MOZ_ASSERT(true || JS_IsExceptionPending(cx));
1344 0 : return false;
1345 : }
1346 0 : return true;
1347 : break;
1348 : }
1349 : case 7: {
1350 : int32_t arg0;
1351 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
1352 0 : return false;
1353 : }
1354 0 : NonNull<nsTreeColumn> arg1;
1355 0 : if (args[1].isObject()) {
1356 : {
1357 0 : nsresult rv = UnwrapObject<prototypes::id::TreeColumn, nsTreeColumn>(args[1], arg1);
1358 0 : if (NS_FAILED(rv)) {
1359 0 : ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of TreeBoxObject.getCoordsForCellItem", "TreeColumn");
1360 0 : return false;
1361 : }
1362 : }
1363 : } else {
1364 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of TreeBoxObject.getCoordsForCellItem");
1365 0 : return false;
1366 : }
1367 0 : binding_detail::FakeString arg2;
1368 0 : if (!ConvertJSValueToString(cx, args[2], eStringify, eStringify, arg2)) {
1369 0 : return false;
1370 : }
1371 0 : JS::Rooted<JSObject*> arg3(cx);
1372 0 : if (args[3].isObject()) {
1373 0 : arg3 = &args[3].toObject();
1374 : } else {
1375 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 4 of TreeBoxObject.getCoordsForCellItem");
1376 0 : return false;
1377 : }
1378 0 : JS::Rooted<JSObject*> arg4(cx);
1379 0 : if (args[4].isObject()) {
1380 0 : arg4 = &args[4].toObject();
1381 : } else {
1382 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 5 of TreeBoxObject.getCoordsForCellItem");
1383 0 : return false;
1384 : }
1385 0 : JS::Rooted<JSObject*> arg5(cx);
1386 0 : if (args[5].isObject()) {
1387 0 : arg5 = &args[5].toObject();
1388 : } else {
1389 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 6 of TreeBoxObject.getCoordsForCellItem");
1390 0 : return false;
1391 : }
1392 0 : JS::Rooted<JSObject*> arg6(cx);
1393 0 : if (args[6].isObject()) {
1394 0 : arg6 = &args[6].toObject();
1395 : } else {
1396 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 7 of TreeBoxObject.getCoordsForCellItem");
1397 0 : return false;
1398 : }
1399 0 : binding_detail::FastErrorResult rv;
1400 0 : self->GetCoordsForCellItem(cx, arg0, NonNullHelper(arg1), NonNullHelper(Constify(arg2)), arg3, arg4, arg5, arg6, rv);
1401 0 : if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1402 0 : return false;
1403 : }
1404 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1405 0 : args.rval().setUndefined();
1406 0 : return true;
1407 : break;
1408 : }
1409 : default: {
1410 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.getCoordsForCellItem");
1411 : break;
1412 : }
1413 : }
1414 : MOZ_CRASH("We have an always-returning default case");
1415 : return false;
1416 : }
1417 :
1418 : static const JSJitInfo getCoordsForCellItem_methodinfo = {
1419 : { (JSJitGetterOp)getCoordsForCellItem },
1420 : { prototypes::id::TreeBoxObject },
1421 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
1422 : JSJitInfo::Method,
1423 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1424 : JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
1425 : false, /* isInfallible. False in setters. */
1426 : false, /* isMovable. Not relevant for setters. */
1427 : false, /* isEliminatable. Not relevant for setters. */
1428 : false, /* isAlwaysInSlot. Only relevant for getters. */
1429 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
1430 : false, /* isTypedMethod. Only relevant for methods. */
1431 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1432 : };
1433 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1434 : static_assert(0 < 1, "There is no slot for us");
1435 :
1436 : static bool
1437 0 : isCellCropped(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
1438 : {
1439 0 : if (MOZ_UNLIKELY(args.length() < 2)) {
1440 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.isCellCropped");
1441 : }
1442 : int32_t arg0;
1443 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
1444 0 : return false;
1445 : }
1446 : nsTreeColumn* arg1;
1447 0 : if (args[1].isObject()) {
1448 : {
1449 0 : nsresult rv = UnwrapObject<prototypes::id::TreeColumn, nsTreeColumn>(args[1], arg1);
1450 0 : if (NS_FAILED(rv)) {
1451 0 : ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of TreeBoxObject.isCellCropped", "TreeColumn");
1452 0 : return false;
1453 : }
1454 : }
1455 0 : } else if (args[1].isNullOrUndefined()) {
1456 0 : arg1 = nullptr;
1457 : } else {
1458 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of TreeBoxObject.isCellCropped");
1459 0 : return false;
1460 : }
1461 0 : binding_detail::FastErrorResult rv;
1462 0 : bool result(self->IsCellCropped(arg0, Constify(arg1), rv));
1463 0 : if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1464 0 : return false;
1465 : }
1466 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1467 0 : args.rval().setBoolean(result);
1468 0 : return true;
1469 : }
1470 :
1471 : static const JSJitInfo isCellCropped_methodinfo = {
1472 : { (JSJitGetterOp)isCellCropped },
1473 : { prototypes::id::TreeBoxObject },
1474 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
1475 : JSJitInfo::Method,
1476 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1477 : JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
1478 : false, /* isInfallible. False in setters. */
1479 : false, /* isMovable. Not relevant for setters. */
1480 : false, /* isEliminatable. Not relevant for setters. */
1481 : false, /* isAlwaysInSlot. Only relevant for getters. */
1482 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
1483 : false, /* isTypedMethod. Only relevant for methods. */
1484 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1485 : };
1486 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1487 : static_assert(0 < 1, "There is no slot for us");
1488 :
1489 : static bool
1490 0 : rowCountChanged(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
1491 : {
1492 0 : if (MOZ_UNLIKELY(args.length() < 2)) {
1493 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.rowCountChanged");
1494 : }
1495 : int32_t arg0;
1496 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
1497 0 : return false;
1498 : }
1499 : int32_t arg1;
1500 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) {
1501 0 : return false;
1502 : }
1503 0 : self->RowCountChanged(arg0, arg1);
1504 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1505 0 : args.rval().setUndefined();
1506 0 : return true;
1507 : }
1508 :
1509 : static const JSJitInfo rowCountChanged_methodinfo = {
1510 : { (JSJitGetterOp)rowCountChanged },
1511 : { prototypes::id::TreeBoxObject },
1512 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
1513 : JSJitInfo::Method,
1514 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1515 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1516 : false, /* isInfallible. False in setters. */
1517 : false, /* isMovable. Not relevant for setters. */
1518 : false, /* isEliminatable. Not relevant for setters. */
1519 : false, /* isAlwaysInSlot. Only relevant for getters. */
1520 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
1521 : false, /* isTypedMethod. Only relevant for methods. */
1522 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1523 : };
1524 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1525 : static_assert(0 < 1, "There is no slot for us");
1526 :
1527 : static bool
1528 0 : beginUpdateBatch(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
1529 : {
1530 0 : self->BeginUpdateBatch();
1531 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1532 0 : args.rval().setUndefined();
1533 0 : return true;
1534 : }
1535 :
1536 : static const JSJitInfo beginUpdateBatch_methodinfo = {
1537 : { (JSJitGetterOp)beginUpdateBatch },
1538 : { prototypes::id::TreeBoxObject },
1539 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
1540 : JSJitInfo::Method,
1541 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1542 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1543 : true, /* isInfallible. False in setters. */
1544 : false, /* isMovable. Not relevant for setters. */
1545 : false, /* isEliminatable. Not relevant for setters. */
1546 : false, /* isAlwaysInSlot. Only relevant for getters. */
1547 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
1548 : false, /* isTypedMethod. Only relevant for methods. */
1549 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1550 : };
1551 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1552 : static_assert(0 < 1, "There is no slot for us");
1553 :
1554 : static bool
1555 0 : endUpdateBatch(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
1556 : {
1557 0 : self->EndUpdateBatch();
1558 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1559 0 : args.rval().setUndefined();
1560 0 : return true;
1561 : }
1562 :
1563 : static const JSJitInfo endUpdateBatch_methodinfo = {
1564 : { (JSJitGetterOp)endUpdateBatch },
1565 : { prototypes::id::TreeBoxObject },
1566 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
1567 : JSJitInfo::Method,
1568 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1569 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1570 : true, /* isInfallible. False in setters. */
1571 : false, /* isMovable. Not relevant for setters. */
1572 : false, /* isEliminatable. Not relevant for setters. */
1573 : false, /* isAlwaysInSlot. Only relevant for getters. */
1574 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
1575 : false, /* isTypedMethod. Only relevant for methods. */
1576 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1577 : };
1578 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1579 : static_assert(0 < 1, "There is no slot for us");
1580 :
1581 : static bool
1582 0 : clearStyleAndImageCaches(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
1583 : {
1584 0 : self->ClearStyleAndImageCaches();
1585 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1586 0 : args.rval().setUndefined();
1587 0 : return true;
1588 : }
1589 :
1590 : static const JSJitInfo clearStyleAndImageCaches_methodinfo = {
1591 : { (JSJitGetterOp)clearStyleAndImageCaches },
1592 : { prototypes::id::TreeBoxObject },
1593 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
1594 : JSJitInfo::Method,
1595 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1596 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1597 : true, /* isInfallible. False in setters. */
1598 : false, /* isMovable. Not relevant for setters. */
1599 : false, /* isEliminatable. Not relevant for setters. */
1600 : false, /* isAlwaysInSlot. Only relevant for getters. */
1601 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
1602 : false, /* isTypedMethod. Only relevant for methods. */
1603 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1604 : };
1605 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1606 : static_assert(0 < 1, "There is no slot for us");
1607 :
1608 : static bool
1609 0 : removeImageCacheEntry(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TreeBoxObject* self, const JSJitMethodCallArgs& args)
1610 : {
1611 0 : if (MOZ_UNLIKELY(args.length() < 2)) {
1612 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "TreeBoxObject.removeImageCacheEntry");
1613 : }
1614 : int32_t arg0;
1615 0 : if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
1616 0 : return false;
1617 : }
1618 0 : NonNull<nsTreeColumn> arg1;
1619 0 : if (args[1].isObject()) {
1620 : {
1621 0 : nsresult rv = UnwrapObject<prototypes::id::TreeColumn, nsTreeColumn>(args[1], arg1);
1622 0 : if (NS_FAILED(rv)) {
1623 0 : ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of TreeBoxObject.removeImageCacheEntry", "TreeColumn");
1624 0 : return false;
1625 : }
1626 : }
1627 : } else {
1628 0 : ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of TreeBoxObject.removeImageCacheEntry");
1629 0 : return false;
1630 : }
1631 0 : binding_detail::FastErrorResult rv;
1632 0 : self->RemoveImageCacheEntry(arg0, NonNullHelper(arg1), rv);
1633 0 : if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1634 0 : return false;
1635 : }
1636 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
1637 0 : args.rval().setUndefined();
1638 0 : return true;
1639 : }
1640 :
1641 : static const JSJitInfo removeImageCacheEntry_methodinfo = {
1642 : { (JSJitGetterOp)removeImageCacheEntry },
1643 : { prototypes::id::TreeBoxObject },
1644 : { PrototypeTraits<prototypes::id::TreeBoxObject>::Depth },
1645 : JSJitInfo::Method,
1646 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1647 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1648 : false, /* isInfallible. False in setters. */
1649 : false, /* isMovable. Not relevant for setters. */
1650 : false, /* isEliminatable. Not relevant for setters. */
1651 : false, /* isAlwaysInSlot. Only relevant for getters. */
1652 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
1653 : false, /* isTypedMethod. Only relevant for methods. */
1654 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1655 : };
1656 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1657 : static_assert(0 < 1, "There is no slot for us");
1658 :
1659 : static bool
1660 0 : _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
1661 : {
1662 0 : mozilla::dom::TreeBoxObject* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TreeBoxObject>(obj);
1663 : // We don't want to preserve if we don't have a wrapper, and we
1664 : // obviously can't preserve if we're not initialized.
1665 0 : if (self && self->GetWrapperPreserveColor()) {
1666 0 : PreserveWrapper(self);
1667 : }
1668 0 : return true;
1669 : }
1670 :
1671 : static void
1672 0 : _finalize(js::FreeOp* fop, JSObject* obj)
1673 : {
1674 0 : mozilla::dom::TreeBoxObject* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TreeBoxObject>(obj);
1675 0 : if (self) {
1676 0 : ClearWrapper(self, self, obj);
1677 0 : AddForDeferredFinalization<mozilla::dom::TreeBoxObject>(self);
1678 : }
1679 0 : }
1680 :
1681 : static void
1682 0 : _objectMoved(JSObject* obj, const JSObject* old)
1683 : {
1684 0 : mozilla::dom::TreeBoxObject* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TreeBoxObject>(obj);
1685 0 : if (self) {
1686 0 : UpdateWrapper(self, self, obj, old);
1687 : }
1688 0 : }
1689 :
1690 : // We deliberately use brace-elision to make Visual Studio produce better initalization code.
1691 : #if defined(__clang__)
1692 : #pragma clang diagnostic push
1693 : #pragma clang diagnostic ignored "-Wmissing-braces"
1694 : #endif
1695 : static const JSFunctionSpec sMethods_specs[] = {
1696 : JS_FNSPEC("getFirstVisibleRow", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&getFirstVisibleRow_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
1697 : JS_FNSPEC("getLastVisibleRow", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&getLastVisibleRow_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
1698 : JS_FNSPEC("getPageLength", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&getPageLength_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
1699 : JS_FNSPEC("ensureRowIsVisible", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&ensureRowIsVisible_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
1700 : JS_FNSPEC("ensureCellIsVisible", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&ensureCellIsVisible_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
1701 : JS_FNSPEC("scrollToRow", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&scrollToRow_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
1702 : JS_FNSPEC("scrollByLines", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&scrollByLines_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
1703 : JS_FNSPEC("scrollByPages", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&scrollByPages_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
1704 : JS_FNSPEC("scrollToCell", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&scrollToCell_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
1705 : JS_FNSPEC("scrollToColumn", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&scrollToColumn_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
1706 : JS_FNSPEC("scrollToHorizontalPosition", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&scrollToHorizontalPosition_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
1707 : JS_FNSPEC("invalidate", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&invalidate_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
1708 : JS_FNSPEC("invalidateColumn", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&invalidateColumn_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
1709 : JS_FNSPEC("invalidateRow", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&invalidateRow_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
1710 : JS_FNSPEC("invalidateCell", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&invalidateCell_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
1711 : JS_FNSPEC("invalidateRange", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&invalidateRange_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
1712 : JS_FNSPEC("invalidateColumnRange", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&invalidateColumnRange_methodinfo), 3, JSPROP_ENUMERATE, nullptr),
1713 : JS_FNSPEC("getRowAt", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&getRowAt_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
1714 : JS_FNSPEC("getCellAt", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&getCellAt_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
1715 : JS_FNSPEC("getCoordsForCellItem", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&getCoordsForCellItem_methodinfo), 3, JSPROP_ENUMERATE, nullptr),
1716 : JS_FNSPEC("isCellCropped", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&isCellCropped_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
1717 : JS_FNSPEC("rowCountChanged", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&rowCountChanged_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
1718 : JS_FNSPEC("beginUpdateBatch", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&beginUpdateBatch_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
1719 : JS_FNSPEC("endUpdateBatch", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&endUpdateBatch_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
1720 : JS_FNSPEC("clearStyleAndImageCaches", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&clearStyleAndImageCaches_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
1721 : JS_FNSPEC("removeImageCacheEntry", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&removeImageCacheEntry_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
1722 : JS_FS_END
1723 : };
1724 : #if defined(__clang__)
1725 : #pragma clang diagnostic pop
1726 : #endif
1727 :
1728 :
1729 : // Can't be const because the pref-enabled boolean needs to be writable
1730 : static Prefable<const JSFunctionSpec> sMethods[] = {
1731 : { nullptr, &sMethods_specs[0] },
1732 : { nullptr, nullptr }
1733 : };
1734 :
1735 : static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
1736 : "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
1737 : static_assert(26 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
1738 : "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
1739 :
1740 : // We deliberately use brace-elision to make Visual Studio produce better initalization code.
1741 : #if defined(__clang__)
1742 : #pragma clang diagnostic push
1743 : #pragma clang diagnostic ignored "-Wmissing-braces"
1744 : #endif
1745 : static const JSPropertySpec sAttributes_specs[] = {
1746 : { "columns", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &columns_getterinfo, nullptr, nullptr },
1747 : { "view", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &view_getterinfo, GenericBindingSetter, &view_setterinfo },
1748 : { "focused", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &focused_getterinfo, GenericBindingSetter, &focused_setterinfo },
1749 : { "treeBody", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &treeBody_getterinfo, nullptr, nullptr },
1750 : { "rowHeight", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &rowHeight_getterinfo, nullptr, nullptr },
1751 : { "rowWidth", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &rowWidth_getterinfo, nullptr, nullptr },
1752 : { "horizontalPosition", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &horizontalPosition_getterinfo, nullptr, nullptr },
1753 : { "selectionRegion", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &selectionRegion_getterinfo, nullptr, nullptr },
1754 : { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
1755 : };
1756 : #if defined(__clang__)
1757 : #pragma clang diagnostic pop
1758 : #endif
1759 :
1760 :
1761 : // Can't be const because the pref-enabled boolean needs to be writable
1762 : static Prefable<const JSPropertySpec> sAttributes[] = {
1763 : { nullptr, &sAttributes_specs[0] },
1764 : { nullptr, nullptr }
1765 : };
1766 :
1767 : static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
1768 : "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
1769 : static_assert(8 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
1770 : "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
1771 :
1772 :
1773 : static uint16_t sNativeProperties_sortedPropertyIndices[34];
1774 : static PropertyInfo sNativeProperties_propertyInfos[34];
1775 :
1776 : static const NativePropertiesN<2> sNativeProperties = {
1777 : false, 0,
1778 : false, 0,
1779 : true, 0 /* sMethods */,
1780 : true, 1 /* sAttributes */,
1781 : false, 0,
1782 : false, 0,
1783 : false, 0,
1784 : -1,
1785 : 34,
1786 : sNativeProperties_sortedPropertyIndices,
1787 : {
1788 : { sMethods, &sNativeProperties_propertyInfos[0] },
1789 : { sAttributes, &sNativeProperties_propertyInfos[26] }
1790 : }
1791 : };
1792 : static_assert(34 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
1793 : "We have a property info count that is oversized");
1794 :
1795 : static const DOMIfaceAndProtoJSClass sPrototypeClass = {
1796 : {
1797 : "TreeBoxObjectPrototype",
1798 : JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
1799 : JS_NULL_CLASS_OPS,
1800 : JS_NULL_CLASS_SPEC,
1801 : JS_NULL_CLASS_EXT,
1802 : JS_NULL_OBJECT_OPS
1803 : },
1804 : eInterfacePrototype,
1805 : false,
1806 : prototypes::id::TreeBoxObject,
1807 : PrototypeTraits<prototypes::id::TreeBoxObject>::Depth,
1808 : sNativePropertyHooks,
1809 : "[object TreeBoxObjectPrototype]",
1810 : BoxObjectBinding::GetProtoObject
1811 : };
1812 :
1813 : static const js::ClassOps sClassOps = {
1814 : _addProperty, /* addProperty */
1815 : nullptr, /* delProperty */
1816 : nullptr, /* getProperty */
1817 : nullptr, /* setProperty */
1818 : nullptr, /* enumerate */
1819 : nullptr, /* newEnumerate */
1820 : nullptr, /* resolve */
1821 : nullptr, /* mayResolve */
1822 : _finalize, /* finalize */
1823 : nullptr, /* call */
1824 : nullptr, /* hasInstance */
1825 : nullptr, /* construct */
1826 : nullptr, /* trace */
1827 : };
1828 :
1829 : static const js::ClassExtension sClassExtension = {
1830 : nullptr, /* weakmapKeyDelegateOp */
1831 : _objectMoved /* objectMovedOp */
1832 : };
1833 :
1834 : static const DOMJSClass sClass = {
1835 : { "TreeBoxObject",
1836 : JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
1837 : &sClassOps,
1838 : JS_NULL_CLASS_SPEC,
1839 : &sClassExtension,
1840 : JS_NULL_OBJECT_OPS
1841 : },
1842 : { prototypes::id::BoxObject, prototypes::id::TreeBoxObject, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
1843 : IsBaseOf<nsISupports, mozilla::dom::TreeBoxObject >::value,
1844 : sNativePropertyHooks,
1845 : FindAssociatedGlobalForNative<mozilla::dom::TreeBoxObject>::Get,
1846 : GetProtoObjectHandle,
1847 : GetCCParticipant<mozilla::dom::TreeBoxObject>::Get()
1848 : };
1849 : static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
1850 : "Must have the right minimal number of reserved slots.");
1851 : static_assert(1 >= 1,
1852 : "Must have enough reserved slots.");
1853 :
1854 : const JSClass*
1855 0 : GetJSClass()
1856 : {
1857 0 : return sClass.ToJSClass();
1858 : }
1859 :
1860 : bool
1861 0 : Wrap(JSContext* aCx, mozilla::dom::TreeBoxObject* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
1862 : {
1863 : MOZ_ASSERT(static_cast<mozilla::dom::TreeBoxObject*>(aObject) ==
1864 : reinterpret_cast<mozilla::dom::TreeBoxObject*>(aObject),
1865 : "Multiple inheritance for mozilla::dom::TreeBoxObject is broken.");
1866 : MOZ_ASSERT(static_cast<mozilla::dom::BoxObject*>(aObject) ==
1867 : reinterpret_cast<mozilla::dom::BoxObject*>(aObject),
1868 : "Multiple inheritance for mozilla::dom::BoxObject is broken.");
1869 0 : MOZ_ASSERT(ToSupportsIsCorrect(aObject));
1870 0 : MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
1871 0 : MOZ_ASSERT(!aCache->GetWrapper(),
1872 : "You should probably not be using Wrap() directly; use "
1873 : "GetOrCreateDOMReflector instead");
1874 :
1875 0 : MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
1876 : "nsISupports must be on our primary inheritance chain");
1877 :
1878 0 : JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
1879 0 : if (!global) {
1880 0 : return false;
1881 : }
1882 0 : MOZ_ASSERT(JS_IsGlobalObject(global));
1883 0 : MOZ_ASSERT(JS::ObjectIsNotGray(global));
1884 :
1885 : // That might have ended up wrapping us already, due to the wonders
1886 : // of XBL. Check for that, and bail out as needed.
1887 0 : aReflector.set(aCache->GetWrapper());
1888 0 : if (aReflector) {
1889 : #ifdef DEBUG
1890 0 : binding_detail::AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
1891 : #endif // DEBUG
1892 0 : return true;
1893 : }
1894 :
1895 0 : JSAutoCompartment ac(aCx, global);
1896 0 : JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
1897 0 : if (!canonicalProto) {
1898 0 : return false;
1899 : }
1900 0 : JS::Rooted<JSObject*> proto(aCx);
1901 0 : if (aGivenProto) {
1902 0 : proto = aGivenProto;
1903 : // Unfortunately, while aGivenProto was in the compartment of aCx
1904 : // coming in, we changed compartments to that of "parent" so may need
1905 : // to wrap the proto here.
1906 0 : if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
1907 0 : if (!JS_WrapObject(aCx, &proto)) {
1908 0 : return false;
1909 : }
1910 : }
1911 : } else {
1912 0 : proto = canonicalProto;
1913 : }
1914 :
1915 0 : BindingJSObjectCreator<mozilla::dom::TreeBoxObject> creator(aCx);
1916 0 : creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
1917 0 : if (!aReflector) {
1918 0 : return false;
1919 : }
1920 :
1921 0 : aCache->SetWrapper(aReflector);
1922 0 : creator.InitializationSucceeded();
1923 :
1924 0 : MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
1925 : aCache->GetWrapperPreserveColor() == aReflector);
1926 : // If proto != canonicalProto, we have to preserve our wrapper;
1927 : // otherwise we won't be able to properly recreate it later, since
1928 : // we won't know what proto to use. Note that we don't check
1929 : // aGivenProto here, since it's entirely possible (and even
1930 : // somewhat common) to have a non-null aGivenProto which is the
1931 : // same as canonicalProto.
1932 0 : if (proto != canonicalProto) {
1933 0 : PreserveWrapper(aObject);
1934 : }
1935 :
1936 0 : return true;
1937 : }
1938 :
1939 : const NativePropertyHooks sNativePropertyHooks[] = { {
1940 : nullptr,
1941 : nullptr,
1942 : nullptr,
1943 : { sNativeProperties.Upcast(), nullptr },
1944 : prototypes::id::TreeBoxObject,
1945 : constructors::id::_ID_Count,
1946 : BoxObjectBinding::sNativePropertyHooks,
1947 : &DefaultXrayExpandoObjectClass
1948 : } };
1949 :
1950 : void
1951 0 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
1952 : {
1953 0 : JS::Handle<JSObject*> parentProto(BoxObjectBinding::GetProtoObjectHandle(aCx));
1954 0 : if (!parentProto) {
1955 0 : return;
1956 : }
1957 :
1958 : static bool sIdsInited = false;
1959 0 : if (!sIdsInited && NS_IsMainThread()) {
1960 0 : if (!InitIds(aCx, sNativeProperties.Upcast())) {
1961 0 : return;
1962 : }
1963 0 : sIdsInited = true;
1964 : }
1965 :
1966 0 : JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::TreeBoxObject);
1967 0 : JS::Heap<JSObject*>* interfaceCache = nullptr;
1968 0 : dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
1969 : &sPrototypeClass.mBase, protoCache,
1970 : nullptr, nullptr, 0, nullptr,
1971 : interfaceCache,
1972 : sNativeProperties.Upcast(),
1973 : nullptr,
1974 : nullptr, aDefineOnGlobal,
1975 : nullptr,
1976 0 : false);
1977 : }
1978 :
1979 : JS::Handle<JSObject*>
1980 0 : GetProtoObjectHandle(JSContext* aCx)
1981 : {
1982 : /* Get the interface prototype object for this class. This will create the
1983 : object as needed. */
1984 0 : bool aDefineOnGlobal = true;
1985 :
1986 : /* Make sure our global is sane. Hopefully we can remove this sometime */
1987 0 : JSObject* global = JS::CurrentGlobalOrNull(aCx);
1988 0 : if (!(js::GetObjectClass(global)->flags & JSCLASS_DOM_GLOBAL)) {
1989 0 : return nullptr;
1990 : }
1991 :
1992 : /* Check to see whether the interface objects are already installed */
1993 0 : ProtoAndIfaceCache& protoAndIfaceCache = *GetProtoAndIfaceCache(global);
1994 0 : if (!protoAndIfaceCache.HasEntryInSlot(prototypes::id::TreeBoxObject)) {
1995 0 : JS::Rooted<JSObject*> rootedGlobal(aCx, global);
1996 0 : CreateInterfaceObjects(aCx, rootedGlobal, protoAndIfaceCache, aDefineOnGlobal);
1997 : }
1998 :
1999 : /*
2000 : * The object might _still_ be null, but that's OK.
2001 : *
2002 : * Calling fromMarkedLocation() is safe because protoAndIfaceCache is
2003 : * traced by TraceProtoAndIfaceCache() and its contents are never
2004 : * changed after they have been set.
2005 : *
2006 : * Calling address() avoids the read read barrier that does gray
2007 : * unmarking, but it's not possible for the object to be gray here.
2008 : */
2009 :
2010 0 : const JS::Heap<JSObject*>& entrySlot = protoAndIfaceCache.EntrySlotMustExist(prototypes::id::TreeBoxObject);
2011 0 : MOZ_ASSERT(JS::ObjectIsNotGray(entrySlot));
2012 0 : return JS::Handle<JSObject*>::fromMarkedLocation(entrySlot.address());
2013 : }
2014 :
2015 : } // namespace TreeBoxObjectBinding
2016 :
2017 :
2018 :
2019 : } // namespace dom
2020 : } // namespace mozilla
|