2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
23 #if ENABLE(MUTATION_OBSERVERS)
25 #include "JSMutationRecord.h"
28 #include "JSNodeList.h"
30 #include "MutationRecord.h"
31 #include "NameNodeList.h"
34 #include <runtime/JSString.h>
35 #include <wtf/GetPtr.h>
41 ASSERT_CLASS_FITS_IN_CELL(JSMutationRecord);
45 #define THUNK_GENERATOR(generator) , generator
47 #define THUNK_GENERATOR(generator)
50 #define INTRINSIC(intrinsic) , intrinsic
52 #define INTRINSIC(intrinsic)
55 static const HashTableValue JSMutationRecordTableValues[] =
57 { "type", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationRecordType), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58 { "target", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationRecordTarget), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59 { "addedNodes", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationRecordAddedNodes), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
60 { "removedNodes", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationRecordRemovedNodes), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
61 { "previousSibling", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationRecordPreviousSibling), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
62 { "nextSibling", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationRecordNextSibling), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
63 { "attributeName", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationRecordAttributeName), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
64 { "attributeNamespace", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationRecordAttributeNamespace), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
65 { "oldValue", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationRecordOldValue), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
66 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationRecordConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
67 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
70 #undef THUNK_GENERATOR
71 static const HashTable JSMutationRecordTable = { 33, 31, JSMutationRecordTableValues, 0 };
72 /* Hash table for constructor */
74 #define THUNK_GENERATOR(generator) , generator
76 #define THUNK_GENERATOR(generator)
79 #define INTRINSIC(intrinsic) , intrinsic
81 #define INTRINSIC(intrinsic)
84 static const HashTableValue JSMutationRecordConstructorTableValues[] =
86 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
89 #undef THUNK_GENERATOR
90 static const HashTable JSMutationRecordConstructorTable = { 1, 0, JSMutationRecordConstructorTableValues, 0 };
91 const ClassInfo JSMutationRecordConstructor::s_info = { "MutationRecordConstructor", &DOMConstructorObject::s_info, &JSMutationRecordConstructorTable, 0, CREATE_METHOD_TABLE(JSMutationRecordConstructor) };
93 JSMutationRecordConstructor::JSMutationRecordConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
94 : DOMConstructorObject(structure, globalObject)
98 void JSMutationRecordConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
100 Base::finishCreation(exec->globalData());
101 ASSERT(inherits(&s_info));
102 putDirect(exec->globalData(), exec->propertyNames().prototype, JSMutationRecordPrototype::self(exec, globalObject), DontDelete | ReadOnly);
105 bool JSMutationRecordConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
107 return getStaticValueSlot<JSMutationRecordConstructor, JSDOMWrapper>(exec, &JSMutationRecordConstructorTable, static_cast<JSMutationRecordConstructor*>(cell), propertyName, slot);
110 bool JSMutationRecordConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
112 return getStaticValueDescriptor<JSMutationRecordConstructor, JSDOMWrapper>(exec, &JSMutationRecordConstructorTable, static_cast<JSMutationRecordConstructor*>(object), propertyName, descriptor);
115 /* Hash table for prototype */
117 #define THUNK_GENERATOR(generator) , generator
119 #define THUNK_GENERATOR(generator)
122 #define INTRINSIC(intrinsic) , intrinsic
124 #define INTRINSIC(intrinsic)
127 static const HashTableValue JSMutationRecordPrototypeTableValues[] =
129 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
132 #undef THUNK_GENERATOR
133 static const HashTable JSMutationRecordPrototypeTable = { 1, 0, JSMutationRecordPrototypeTableValues, 0 };
134 const ClassInfo JSMutationRecordPrototype::s_info = { "MutationRecordPrototype", &JSC::JSNonFinalObject::s_info, &JSMutationRecordPrototypeTable, 0, CREATE_METHOD_TABLE(JSMutationRecordPrototype) };
136 JSObject* JSMutationRecordPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
138 return getDOMPrototype<JSMutationRecord>(exec, globalObject);
141 const ClassInfo JSMutationRecord::s_info = { "MutationRecord", &JSDOMWrapper::s_info, &JSMutationRecordTable, 0 , CREATE_METHOD_TABLE(JSMutationRecord) };
143 JSMutationRecord::JSMutationRecord(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<MutationRecord> impl)
144 : JSDOMWrapper(structure, globalObject)
145 , m_impl(impl.leakRef())
149 void JSMutationRecord::finishCreation(JSGlobalData& globalData)
151 Base::finishCreation(globalData);
152 ASSERT(inherits(&s_info));
155 JSObject* JSMutationRecord::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
157 return JSMutationRecordPrototype::create(exec->globalData(), globalObject, JSMutationRecordPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
160 bool JSMutationRecord::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
162 JSMutationRecord* thisObject = jsCast<JSMutationRecord*>(cell);
163 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
164 return getStaticValueSlot<JSMutationRecord, Base>(exec, &JSMutationRecordTable, thisObject, propertyName, slot);
167 bool JSMutationRecord::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
169 JSMutationRecord* thisObject = jsCast<JSMutationRecord*>(object);
170 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
171 return getStaticValueDescriptor<JSMutationRecord, Base>(exec, &JSMutationRecordTable, thisObject, propertyName, descriptor);
174 JSValue jsMutationRecordType(ExecState* exec, JSValue slotBase, const Identifier&)
176 JSMutationRecord* castedThis = static_cast<JSMutationRecord*>(asObject(slotBase));
178 MutationRecord* imp = static_cast<MutationRecord*>(castedThis->impl());
179 JSValue result = jsString(exec, imp->type());
184 JSValue jsMutationRecordTarget(ExecState* exec, JSValue slotBase, const Identifier&)
186 JSMutationRecord* castedThis = static_cast<JSMutationRecord*>(asObject(slotBase));
188 MutationRecord* imp = static_cast<MutationRecord*>(castedThis->impl());
189 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->target()));
194 JSValue jsMutationRecordAddedNodes(ExecState* exec, JSValue slotBase, const Identifier&)
196 JSMutationRecord* castedThis = static_cast<JSMutationRecord*>(asObject(slotBase));
198 MutationRecord* imp = static_cast<MutationRecord*>(castedThis->impl());
199 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->addedNodes()));
204 JSValue jsMutationRecordRemovedNodes(ExecState* exec, JSValue slotBase, const Identifier&)
206 JSMutationRecord* castedThis = static_cast<JSMutationRecord*>(asObject(slotBase));
208 MutationRecord* imp = static_cast<MutationRecord*>(castedThis->impl());
209 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->removedNodes()));
214 JSValue jsMutationRecordPreviousSibling(ExecState* exec, JSValue slotBase, const Identifier&)
216 JSMutationRecord* castedThis = static_cast<JSMutationRecord*>(asObject(slotBase));
218 MutationRecord* imp = static_cast<MutationRecord*>(castedThis->impl());
219 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->previousSibling()));
224 JSValue jsMutationRecordNextSibling(ExecState* exec, JSValue slotBase, const Identifier&)
226 JSMutationRecord* castedThis = static_cast<JSMutationRecord*>(asObject(slotBase));
228 MutationRecord* imp = static_cast<MutationRecord*>(castedThis->impl());
229 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->nextSibling()));
234 JSValue jsMutationRecordAttributeName(ExecState* exec, JSValue slotBase, const Identifier&)
236 JSMutationRecord* castedThis = static_cast<JSMutationRecord*>(asObject(slotBase));
238 MutationRecord* imp = static_cast<MutationRecord*>(castedThis->impl());
239 JSValue result = jsString(exec, imp->attributeName());
244 JSValue jsMutationRecordAttributeNamespace(ExecState* exec, JSValue slotBase, const Identifier&)
246 JSMutationRecord* castedThis = static_cast<JSMutationRecord*>(asObject(slotBase));
248 MutationRecord* imp = static_cast<MutationRecord*>(castedThis->impl());
249 JSValue result = jsStringOrNull(exec, imp->attributeNamespace());
254 JSValue jsMutationRecordOldValue(ExecState* exec, JSValue slotBase, const Identifier&)
256 JSMutationRecord* castedThis = static_cast<JSMutationRecord*>(asObject(slotBase));
258 MutationRecord* imp = static_cast<MutationRecord*>(castedThis->impl());
259 JSValue result = jsStringOrNull(exec, imp->oldValue());
264 JSValue jsMutationRecordConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
266 JSMutationRecord* domObject = static_cast<JSMutationRecord*>(asObject(slotBase));
267 return JSMutationRecord::getConstructor(exec, domObject->globalObject());
270 JSValue JSMutationRecord::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
272 return getDOMConstructor<JSMutationRecordConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
275 static inline bool isObservable(JSMutationRecord* jsMutationRecord)
277 if (jsMutationRecord->hasCustomProperties())
282 bool JSMutationRecordOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
284 JSMutationRecord* jsMutationRecord = static_cast<JSMutationRecord*>(handle.get().asCell());
285 if (!isObservable(jsMutationRecord))
287 UNUSED_PARAM(visitor);
291 void JSMutationRecordOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
293 JSMutationRecord* jsMutationRecord = static_cast<JSMutationRecord*>(handle.get().asCell());
294 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
295 uncacheWrapper(world, jsMutationRecord->impl(), jsMutationRecord);
296 jsMutationRecord->releaseImpl();
299 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, MutationRecord* impl)
301 return wrap<JSMutationRecord>(exec, globalObject, impl);
304 MutationRecord* toMutationRecord(JSC::JSValue value)
306 return value.inherits(&JSMutationRecord::s_info) ? static_cast<JSMutationRecord*>(asObject(value))->impl() : 0;
311 #endif // ENABLE(MUTATION_OBSERVERS)