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.
25 #include "JSXSLTProcessor.h"
28 #include "DocumentFragment.h"
29 #include "ExceptionCode.h"
30 #include "JSDOMBinding.h"
31 #include "NodeFilter.h"
32 #include "XSLTProcessor.h"
33 #include <runtime/Error.h>
34 #include <wtf/GetPtr.h>
40 ASSERT_CLASS_FITS_IN_CELL(JSXSLTProcessor);
44 #define THUNK_GENERATOR(generator) , generator
46 #define THUNK_GENERATOR(generator)
49 #define INTRINSIC(intrinsic) , intrinsic
51 #define INTRINSIC(intrinsic)
54 static const HashTableValue JSXSLTProcessorTableValues[] =
56 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXSLTProcessorConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
60 #undef THUNK_GENERATOR
61 static const HashTable JSXSLTProcessorTable = { 2, 1, JSXSLTProcessorTableValues, 0 };
62 /* Hash table for constructor */
64 #define THUNK_GENERATOR(generator) , generator
66 #define THUNK_GENERATOR(generator)
69 #define INTRINSIC(intrinsic) , intrinsic
71 #define INTRINSIC(intrinsic)
74 static const HashTableValue JSXSLTProcessorConstructorTableValues[] =
76 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
79 #undef THUNK_GENERATOR
80 static const HashTable JSXSLTProcessorConstructorTable = { 1, 0, JSXSLTProcessorConstructorTableValues, 0 };
81 const ClassInfo JSXSLTProcessorConstructor::s_info = { "XSLTProcessorConstructor", &DOMConstructorObject::s_info, &JSXSLTProcessorConstructorTable, 0, CREATE_METHOD_TABLE(JSXSLTProcessorConstructor) };
83 JSXSLTProcessorConstructor::JSXSLTProcessorConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
84 : DOMConstructorObject(structure, globalObject)
88 void JSXSLTProcessorConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
90 Base::finishCreation(exec->globalData());
91 ASSERT(inherits(&s_info));
92 putDirect(exec->globalData(), exec->propertyNames().prototype, JSXSLTProcessorPrototype::self(exec, globalObject), DontDelete | ReadOnly);
95 bool JSXSLTProcessorConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
97 return getStaticValueSlot<JSXSLTProcessorConstructor, JSDOMWrapper>(exec, &JSXSLTProcessorConstructorTable, static_cast<JSXSLTProcessorConstructor*>(cell), propertyName, slot);
100 bool JSXSLTProcessorConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
102 return getStaticValueDescriptor<JSXSLTProcessorConstructor, JSDOMWrapper>(exec, &JSXSLTProcessorConstructorTable, static_cast<JSXSLTProcessorConstructor*>(object), propertyName, descriptor);
105 EncodedJSValue JSC_HOST_CALL JSXSLTProcessorConstructor::constructJSXSLTProcessor(ExecState* exec)
107 JSXSLTProcessorConstructor* jsConstructor = static_cast<JSXSLTProcessorConstructor*>(exec->callee());
108 RefPtr<XSLTProcessor> object = XSLTProcessor::create();
109 return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), object.get())));
112 ConstructType JSXSLTProcessorConstructor::getConstructData(JSCell*, ConstructData& constructData)
114 constructData.native.function = constructJSXSLTProcessor;
115 return ConstructTypeHost;
118 /* Hash table for prototype */
120 #define THUNK_GENERATOR(generator) , generator
122 #define THUNK_GENERATOR(generator)
125 #define INTRINSIC(intrinsic) , intrinsic
127 #define INTRINSIC(intrinsic)
130 static const HashTableValue JSXSLTProcessorPrototypeTableValues[] =
132 { "importStylesheet", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsXSLTProcessorPrototypeFunctionImportStylesheet), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
133 { "transformToFragment", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsXSLTProcessorPrototypeFunctionTransformToFragment), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
134 { "transformToDocument", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsXSLTProcessorPrototypeFunctionTransformToDocument), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
135 { "setParameter", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsXSLTProcessorPrototypeFunctionSetParameter), (intptr_t)3 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
136 { "getParameter", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsXSLTProcessorPrototypeFunctionGetParameter), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
137 { "removeParameter", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsXSLTProcessorPrototypeFunctionRemoveParameter), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
138 { "clearParameters", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsXSLTProcessorPrototypeFunctionClearParameters), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
139 { "reset", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsXSLTProcessorPrototypeFunctionReset), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
140 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
143 #undef THUNK_GENERATOR
144 static const HashTable JSXSLTProcessorPrototypeTable = { 17, 15, JSXSLTProcessorPrototypeTableValues, 0 };
145 const ClassInfo JSXSLTProcessorPrototype::s_info = { "XSLTProcessorPrototype", &JSC::JSNonFinalObject::s_info, &JSXSLTProcessorPrototypeTable, 0, CREATE_METHOD_TABLE(JSXSLTProcessorPrototype) };
147 JSObject* JSXSLTProcessorPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
149 return getDOMPrototype<JSXSLTProcessor>(exec, globalObject);
152 bool JSXSLTProcessorPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
154 JSXSLTProcessorPrototype* thisObject = jsCast<JSXSLTProcessorPrototype*>(cell);
155 return getStaticFunctionSlot<JSObject>(exec, &JSXSLTProcessorPrototypeTable, thisObject, propertyName, slot);
158 bool JSXSLTProcessorPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
160 JSXSLTProcessorPrototype* thisObject = jsCast<JSXSLTProcessorPrototype*>(object);
161 return getStaticFunctionDescriptor<JSObject>(exec, &JSXSLTProcessorPrototypeTable, thisObject, propertyName, descriptor);
164 const ClassInfo JSXSLTProcessor::s_info = { "XSLTProcessor", &JSDOMWrapper::s_info, &JSXSLTProcessorTable, 0 , CREATE_METHOD_TABLE(JSXSLTProcessor) };
166 JSXSLTProcessor::JSXSLTProcessor(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<XSLTProcessor> impl)
167 : JSDOMWrapper(structure, globalObject)
168 , m_impl(impl.leakRef())
172 void JSXSLTProcessor::finishCreation(JSGlobalData& globalData)
174 Base::finishCreation(globalData);
175 ASSERT(inherits(&s_info));
178 JSObject* JSXSLTProcessor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
180 return JSXSLTProcessorPrototype::create(exec->globalData(), globalObject, JSXSLTProcessorPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
183 bool JSXSLTProcessor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
185 JSXSLTProcessor* thisObject = jsCast<JSXSLTProcessor*>(cell);
186 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
187 return getStaticValueSlot<JSXSLTProcessor, Base>(exec, &JSXSLTProcessorTable, thisObject, propertyName, slot);
190 bool JSXSLTProcessor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
192 JSXSLTProcessor* thisObject = jsCast<JSXSLTProcessor*>(object);
193 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
194 return getStaticValueDescriptor<JSXSLTProcessor, Base>(exec, &JSXSLTProcessorTable, thisObject, propertyName, descriptor);
197 JSValue jsXSLTProcessorConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
199 JSXSLTProcessor* domObject = static_cast<JSXSLTProcessor*>(asObject(slotBase));
200 return JSXSLTProcessor::getConstructor(exec, domObject->globalObject());
203 JSValue JSXSLTProcessor::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
205 return getDOMConstructor<JSXSLTProcessorConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
208 EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionImportStylesheet(ExecState* exec)
210 JSValue thisValue = exec->hostThisValue();
211 if (!thisValue.inherits(&JSXSLTProcessor::s_info))
212 return throwVMTypeError(exec);
213 JSXSLTProcessor* castedThis = static_cast<JSXSLTProcessor*>(asObject(thisValue));
214 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSXSLTProcessor::s_info);
215 return JSValue::encode(castedThis->importStylesheet(exec));
218 EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionTransformToFragment(ExecState* exec)
220 JSValue thisValue = exec->hostThisValue();
221 if (!thisValue.inherits(&JSXSLTProcessor::s_info))
222 return throwVMTypeError(exec);
223 JSXSLTProcessor* castedThis = static_cast<JSXSLTProcessor*>(asObject(thisValue));
224 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSXSLTProcessor::s_info);
225 return JSValue::encode(castedThis->transformToFragment(exec));
228 EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionTransformToDocument(ExecState* exec)
230 JSValue thisValue = exec->hostThisValue();
231 if (!thisValue.inherits(&JSXSLTProcessor::s_info))
232 return throwVMTypeError(exec);
233 JSXSLTProcessor* castedThis = static_cast<JSXSLTProcessor*>(asObject(thisValue));
234 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSXSLTProcessor::s_info);
235 return JSValue::encode(castedThis->transformToDocument(exec));
238 EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionSetParameter(ExecState* exec)
240 JSValue thisValue = exec->hostThisValue();
241 if (!thisValue.inherits(&JSXSLTProcessor::s_info))
242 return throwVMTypeError(exec);
243 JSXSLTProcessor* castedThis = static_cast<JSXSLTProcessor*>(asObject(thisValue));
244 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSXSLTProcessor::s_info);
245 return JSValue::encode(castedThis->setParameter(exec));
248 EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionGetParameter(ExecState* exec)
250 JSValue thisValue = exec->hostThisValue();
251 if (!thisValue.inherits(&JSXSLTProcessor::s_info))
252 return throwVMTypeError(exec);
253 JSXSLTProcessor* castedThis = static_cast<JSXSLTProcessor*>(asObject(thisValue));
254 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSXSLTProcessor::s_info);
255 return JSValue::encode(castedThis->getParameter(exec));
258 EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionRemoveParameter(ExecState* exec)
260 JSValue thisValue = exec->hostThisValue();
261 if (!thisValue.inherits(&JSXSLTProcessor::s_info))
262 return throwVMTypeError(exec);
263 JSXSLTProcessor* castedThis = static_cast<JSXSLTProcessor*>(asObject(thisValue));
264 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSXSLTProcessor::s_info);
265 return JSValue::encode(castedThis->removeParameter(exec));
268 EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionClearParameters(ExecState* exec)
270 JSValue thisValue = exec->hostThisValue();
271 if (!thisValue.inherits(&JSXSLTProcessor::s_info))
272 return throwVMTypeError(exec);
273 JSXSLTProcessor* castedThis = static_cast<JSXSLTProcessor*>(asObject(thisValue));
274 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSXSLTProcessor::s_info);
275 XSLTProcessor* imp = static_cast<XSLTProcessor*>(castedThis->impl());
276 imp->clearParameters();
277 return JSValue::encode(jsUndefined());
280 EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionReset(ExecState* exec)
282 JSValue thisValue = exec->hostThisValue();
283 if (!thisValue.inherits(&JSXSLTProcessor::s_info))
284 return throwVMTypeError(exec);
285 JSXSLTProcessor* castedThis = static_cast<JSXSLTProcessor*>(asObject(thisValue));
286 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSXSLTProcessor::s_info);
287 XSLTProcessor* imp = static_cast<XSLTProcessor*>(castedThis->impl());
289 return JSValue::encode(jsUndefined());
292 static inline bool isObservable(JSXSLTProcessor* jsXSLTProcessor)
294 if (jsXSLTProcessor->hasCustomProperties())
299 bool JSXSLTProcessorOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
301 JSXSLTProcessor* jsXSLTProcessor = static_cast<JSXSLTProcessor*>(handle.get().asCell());
302 if (!isObservable(jsXSLTProcessor))
304 UNUSED_PARAM(visitor);
308 void JSXSLTProcessorOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
310 JSXSLTProcessor* jsXSLTProcessor = static_cast<JSXSLTProcessor*>(handle.get().asCell());
311 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
312 uncacheWrapper(world, jsXSLTProcessor->impl(), jsXSLTProcessor);
313 jsXSLTProcessor->releaseImpl();
316 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, XSLTProcessor* impl)
318 return wrap<JSXSLTProcessor>(exec, globalObject, impl);
321 XSLTProcessor* toXSLTProcessor(JSC::JSValue value)
323 return value.inherits(&JSXSLTProcessor::s_info) ? static_cast<JSXSLTProcessor*>(asObject(value))->impl() : 0;
328 #endif // ENABLE(XSLT)