1 | /* |
2 | This file is part of the WebKit open source project. |
3 | This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
4 | |
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. |
9 | |
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. |
14 | |
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. |
19 | */ |
20 | |
21 | #include "config.h" |
22 | |
23 | #if ENABLE(XSLT) |
24 | |
25 | #include "JSXSLTProcessor.h" |
26 | |
27 | #include "JSDOMBinding.h" |
28 | #include "JSDOMConstructor.h" |
29 | #include "JSDOMConvertInterface.h" |
30 | #include "JSDOMConvertNullable.h" |
31 | #include "JSDOMConvertStrings.h" |
32 | #include "JSDOMExceptionHandling.h" |
33 | #include "JSDOMGlobalObject.h" |
34 | #include "JSDOMOperation.h" |
35 | #include "JSDOMWrapperCache.h" |
36 | #include "JSDocument.h" |
37 | #include "JSDocumentFragment.h" |
38 | #include "JSNode.h" |
39 | #include "ScriptExecutionContext.h" |
40 | #include <JavaScriptCore/FunctionPrototype.h> |
41 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
42 | #include <JavaScriptCore/JSCInlines.h> |
43 | #include <wtf/GetPtr.h> |
44 | #include <wtf/PointerPreparations.h> |
45 | #include <wtf/URL.h> |
46 | |
47 | |
48 | namespace WebCore { |
49 | using namespace JSC; |
50 | |
51 | // Functions |
52 | |
53 | JSC::EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionImportStylesheet(JSC::ExecState*); |
54 | JSC::EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionTransformToFragment(JSC::ExecState*); |
55 | JSC::EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionTransformToDocument(JSC::ExecState*); |
56 | JSC::EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionSetParameter(JSC::ExecState*); |
57 | JSC::EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionGetParameter(JSC::ExecState*); |
58 | JSC::EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionRemoveParameter(JSC::ExecState*); |
59 | JSC::EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionClearParameters(JSC::ExecState*); |
60 | JSC::EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionReset(JSC::ExecState*); |
61 | |
62 | // Attributes |
63 | |
64 | JSC::EncodedJSValue jsXSLTProcessorConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
65 | bool setJSXSLTProcessorConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
66 | |
67 | class JSXSLTProcessorPrototype : public JSC::JSNonFinalObject { |
68 | public: |
69 | using Base = JSC::JSNonFinalObject; |
70 | static JSXSLTProcessorPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
71 | { |
72 | JSXSLTProcessorPrototype* ptr = new (NotNull, JSC::allocateCell<JSXSLTProcessorPrototype>(vm.heap)) JSXSLTProcessorPrototype(vm, globalObject, structure); |
73 | ptr->finishCreation(vm); |
74 | return ptr; |
75 | } |
76 | |
77 | DECLARE_INFO; |
78 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
79 | { |
80 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
81 | } |
82 | |
83 | private: |
84 | JSXSLTProcessorPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
85 | : JSC::JSNonFinalObject(vm, structure) |
86 | { |
87 | } |
88 | |
89 | void finishCreation(JSC::VM&); |
90 | }; |
91 | |
92 | using JSXSLTProcessorConstructor = JSDOMConstructor<JSXSLTProcessor>; |
93 | |
94 | template<> EncodedJSValue JSC_HOST_CALL JSXSLTProcessorConstructor::construct(ExecState* state) |
95 | { |
96 | VM& vm = state->vm(); |
97 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
98 | UNUSED_PARAM(throwScope); |
99 | auto* castedThis = jsCast<JSXSLTProcessorConstructor*>(state->jsCallee()); |
100 | ASSERT(castedThis); |
101 | auto object = XSLTProcessor::create(); |
102 | return JSValue::encode(toJSNewlyCreated<IDLInterface<XSLTProcessor>>(*state, *castedThis->globalObject(), WTFMove(object))); |
103 | } |
104 | |
105 | template<> JSValue JSXSLTProcessorConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
106 | { |
107 | UNUSED_PARAM(vm); |
108 | return globalObject.functionPrototype(); |
109 | } |
110 | |
111 | template<> void JSXSLTProcessorConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
112 | { |
113 | putDirect(vm, vm.propertyNames->prototype, JSXSLTProcessor::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
114 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("XSLTProcessor"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
115 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
116 | } |
117 | |
118 | template<> const ClassInfo JSXSLTProcessorConstructor::s_info = { "XSLTProcessor" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSXSLTProcessorConstructor) }; |
119 | |
120 | /* Hash table for prototype */ |
121 | |
122 | static const HashTableValue JSXSLTProcessorPrototypeTableValues[] = |
123 | { |
124 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXSLTProcessorConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSXSLTProcessorConstructor) } }, |
125 | { "importStylesheet" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsXSLTProcessorPrototypeFunctionImportStylesheet), (intptr_t) (0) } }, |
126 | { "transformToFragment" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsXSLTProcessorPrototypeFunctionTransformToFragment), (intptr_t) (0) } }, |
127 | { "transformToDocument" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsXSLTProcessorPrototypeFunctionTransformToDocument), (intptr_t) (0) } }, |
128 | { "setParameter" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsXSLTProcessorPrototypeFunctionSetParameter), (intptr_t) (3) } }, |
129 | { "getParameter" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsXSLTProcessorPrototypeFunctionGetParameter), (intptr_t) (2) } }, |
130 | { "removeParameter" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsXSLTProcessorPrototypeFunctionRemoveParameter), (intptr_t) (2) } }, |
131 | { "clearParameters" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsXSLTProcessorPrototypeFunctionClearParameters), (intptr_t) (0) } }, |
132 | { "reset" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsXSLTProcessorPrototypeFunctionReset), (intptr_t) (0) } }, |
133 | }; |
134 | |
135 | const ClassInfo JSXSLTProcessorPrototype::s_info = { "XSLTProcessorPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSXSLTProcessorPrototype) }; |
136 | |
137 | void JSXSLTProcessorPrototype::finishCreation(VM& vm) |
138 | { |
139 | Base::finishCreation(vm); |
140 | reifyStaticProperties(vm, JSXSLTProcessor::info(), JSXSLTProcessorPrototypeTableValues, *this); |
141 | } |
142 | |
143 | const ClassInfo JSXSLTProcessor::s_info = { "XSLTProcessor" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSXSLTProcessor) }; |
144 | |
145 | JSXSLTProcessor::JSXSLTProcessor(Structure* structure, JSDOMGlobalObject& globalObject, Ref<XSLTProcessor>&& impl) |
146 | : JSDOMWrapper<XSLTProcessor>(structure, globalObject, WTFMove(impl)) |
147 | { |
148 | } |
149 | |
150 | void JSXSLTProcessor::finishCreation(VM& vm) |
151 | { |
152 | Base::finishCreation(vm); |
153 | ASSERT(inherits(vm, info())); |
154 | |
155 | } |
156 | |
157 | JSObject* JSXSLTProcessor::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
158 | { |
159 | return JSXSLTProcessorPrototype::create(vm, &globalObject, JSXSLTProcessorPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
160 | } |
161 | |
162 | JSObject* JSXSLTProcessor::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
163 | { |
164 | return getDOMPrototype<JSXSLTProcessor>(vm, globalObject); |
165 | } |
166 | |
167 | JSValue JSXSLTProcessor::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
168 | { |
169 | return getDOMConstructor<JSXSLTProcessorConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
170 | } |
171 | |
172 | void JSXSLTProcessor::destroy(JSC::JSCell* cell) |
173 | { |
174 | JSXSLTProcessor* thisObject = static_cast<JSXSLTProcessor*>(cell); |
175 | thisObject->JSXSLTProcessor::~JSXSLTProcessor(); |
176 | } |
177 | |
178 | template<> inline JSXSLTProcessor* IDLOperation<JSXSLTProcessor>::cast(ExecState& state) |
179 | { |
180 | return jsDynamicCast<JSXSLTProcessor*>(state.vm(), state.thisValue()); |
181 | } |
182 | |
183 | EncodedJSValue jsXSLTProcessorConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
184 | { |
185 | VM& vm = state->vm(); |
186 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
187 | auto* prototype = jsDynamicCast<JSXSLTProcessorPrototype*>(vm, JSValue::decode(thisValue)); |
188 | if (UNLIKELY(!prototype)) |
189 | return throwVMTypeError(state, throwScope); |
190 | return JSValue::encode(JSXSLTProcessor::getConstructor(state->vm(), prototype->globalObject())); |
191 | } |
192 | |
193 | bool setJSXSLTProcessorConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
194 | { |
195 | VM& vm = state->vm(); |
196 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
197 | auto* prototype = jsDynamicCast<JSXSLTProcessorPrototype*>(vm, JSValue::decode(thisValue)); |
198 | if (UNLIKELY(!prototype)) { |
199 | throwVMTypeError(state, throwScope); |
200 | return false; |
201 | } |
202 | // Shadowing a built-in constructor |
203 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
204 | } |
205 | |
206 | static inline JSC::EncodedJSValue jsXSLTProcessorPrototypeFunctionImportStylesheetBody(JSC::ExecState* state, typename IDLOperation<JSXSLTProcessor>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
207 | { |
208 | UNUSED_PARAM(state); |
209 | UNUSED_PARAM(throwScope); |
210 | auto& impl = castedThis->wrapped(); |
211 | auto stylesheet = convert<IDLNullable<IDLInterface<Node>>>(*state, state->argument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "stylesheet" , "XSLTProcessor" , "importStylesheet" , "Node" ); }); |
212 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
213 | impl.importStylesheet(WTFMove(stylesheet)); |
214 | return JSValue::encode(jsUndefined()); |
215 | } |
216 | |
217 | EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionImportStylesheet(ExecState* state) |
218 | { |
219 | return IDLOperation<JSXSLTProcessor>::call<jsXSLTProcessorPrototypeFunctionImportStylesheetBody>(*state, "importStylesheet" ); |
220 | } |
221 | |
222 | static inline JSC::EncodedJSValue jsXSLTProcessorPrototypeFunctionTransformToFragmentBody(JSC::ExecState* state, typename IDLOperation<JSXSLTProcessor>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
223 | { |
224 | UNUSED_PARAM(state); |
225 | UNUSED_PARAM(throwScope); |
226 | auto& impl = castedThis->wrapped(); |
227 | auto source = convert<IDLNullable<IDLInterface<Node>>>(*state, state->argument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "source" , "XSLTProcessor" , "transformToFragment" , "Node" ); }); |
228 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
229 | auto docVal = convert<IDLNullable<IDLInterface<Document>>>(*state, state->argument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 1, "docVal" , "XSLTProcessor" , "transformToFragment" , "Document" ); }); |
230 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
231 | return JSValue::encode(toJS<IDLInterface<DocumentFragment>>(*state, *castedThis->globalObject(), impl.transformToFragment(WTFMove(source), WTFMove(docVal)))); |
232 | } |
233 | |
234 | EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionTransformToFragment(ExecState* state) |
235 | { |
236 | return IDLOperation<JSXSLTProcessor>::call<jsXSLTProcessorPrototypeFunctionTransformToFragmentBody>(*state, "transformToFragment" ); |
237 | } |
238 | |
239 | static inline JSC::EncodedJSValue jsXSLTProcessorPrototypeFunctionTransformToDocumentBody(JSC::ExecState* state, typename IDLOperation<JSXSLTProcessor>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
240 | { |
241 | UNUSED_PARAM(state); |
242 | UNUSED_PARAM(throwScope); |
243 | auto& impl = castedThis->wrapped(); |
244 | auto source = convert<IDLNullable<IDLInterface<Node>>>(*state, state->argument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "source" , "XSLTProcessor" , "transformToDocument" , "Node" ); }); |
245 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
246 | return JSValue::encode(toJS<IDLInterface<Document>>(*state, *castedThis->globalObject(), impl.transformToDocument(WTFMove(source)))); |
247 | } |
248 | |
249 | EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionTransformToDocument(ExecState* state) |
250 | { |
251 | return IDLOperation<JSXSLTProcessor>::call<jsXSLTProcessorPrototypeFunctionTransformToDocumentBody>(*state, "transformToDocument" ); |
252 | } |
253 | |
254 | static inline JSC::EncodedJSValue jsXSLTProcessorPrototypeFunctionSetParameterBody(JSC::ExecState* state, typename IDLOperation<JSXSLTProcessor>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
255 | { |
256 | UNUSED_PARAM(state); |
257 | UNUSED_PARAM(throwScope); |
258 | auto& impl = castedThis->wrapped(); |
259 | if (UNLIKELY(state->argumentCount() < 3)) |
260 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
261 | auto namespaceURI = convert<IDLNullable<IDLDOMString>>(*state, state->uncheckedArgument(0)); |
262 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
263 | auto localName = convert<IDLNullable<IDLDOMString>>(*state, state->uncheckedArgument(1)); |
264 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
265 | auto value = convert<IDLNullable<IDLDOMString>>(*state, state->uncheckedArgument(2)); |
266 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
267 | impl.setParameter(WTFMove(namespaceURI), WTFMove(localName), WTFMove(value)); |
268 | return JSValue::encode(jsUndefined()); |
269 | } |
270 | |
271 | EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionSetParameter(ExecState* state) |
272 | { |
273 | return IDLOperation<JSXSLTProcessor>::call<jsXSLTProcessorPrototypeFunctionSetParameterBody>(*state, "setParameter" ); |
274 | } |
275 | |
276 | static inline JSC::EncodedJSValue jsXSLTProcessorPrototypeFunctionGetParameterBody(JSC::ExecState* state, typename IDLOperation<JSXSLTProcessor>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
277 | { |
278 | UNUSED_PARAM(state); |
279 | UNUSED_PARAM(throwScope); |
280 | auto& impl = castedThis->wrapped(); |
281 | if (UNLIKELY(state->argumentCount() < 2)) |
282 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
283 | auto namespaceURI = convert<IDLNullable<IDLDOMString>>(*state, state->uncheckedArgument(0)); |
284 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
285 | auto localName = convert<IDLNullable<IDLDOMString>>(*state, state->uncheckedArgument(1)); |
286 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
287 | return JSValue::encode(toJS<IDLNullable<IDLDOMString>>(*state, impl.getParameter(WTFMove(namespaceURI), WTFMove(localName)))); |
288 | } |
289 | |
290 | EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionGetParameter(ExecState* state) |
291 | { |
292 | return IDLOperation<JSXSLTProcessor>::call<jsXSLTProcessorPrototypeFunctionGetParameterBody>(*state, "getParameter" ); |
293 | } |
294 | |
295 | static inline JSC::EncodedJSValue jsXSLTProcessorPrototypeFunctionRemoveParameterBody(JSC::ExecState* state, typename IDLOperation<JSXSLTProcessor>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
296 | { |
297 | UNUSED_PARAM(state); |
298 | UNUSED_PARAM(throwScope); |
299 | auto& impl = castedThis->wrapped(); |
300 | if (UNLIKELY(state->argumentCount() < 2)) |
301 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
302 | auto namespaceURI = convert<IDLNullable<IDLDOMString>>(*state, state->uncheckedArgument(0)); |
303 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
304 | auto localName = convert<IDLNullable<IDLDOMString>>(*state, state->uncheckedArgument(1)); |
305 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
306 | impl.removeParameter(WTFMove(namespaceURI), WTFMove(localName)); |
307 | return JSValue::encode(jsUndefined()); |
308 | } |
309 | |
310 | EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionRemoveParameter(ExecState* state) |
311 | { |
312 | return IDLOperation<JSXSLTProcessor>::call<jsXSLTProcessorPrototypeFunctionRemoveParameterBody>(*state, "removeParameter" ); |
313 | } |
314 | |
315 | static inline JSC::EncodedJSValue jsXSLTProcessorPrototypeFunctionClearParametersBody(JSC::ExecState* state, typename IDLOperation<JSXSLTProcessor>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
316 | { |
317 | UNUSED_PARAM(state); |
318 | UNUSED_PARAM(throwScope); |
319 | auto& impl = castedThis->wrapped(); |
320 | impl.clearParameters(); |
321 | return JSValue::encode(jsUndefined()); |
322 | } |
323 | |
324 | EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionClearParameters(ExecState* state) |
325 | { |
326 | return IDLOperation<JSXSLTProcessor>::call<jsXSLTProcessorPrototypeFunctionClearParametersBody>(*state, "clearParameters" ); |
327 | } |
328 | |
329 | static inline JSC::EncodedJSValue jsXSLTProcessorPrototypeFunctionResetBody(JSC::ExecState* state, typename IDLOperation<JSXSLTProcessor>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
330 | { |
331 | UNUSED_PARAM(state); |
332 | UNUSED_PARAM(throwScope); |
333 | auto& impl = castedThis->wrapped(); |
334 | impl.reset(); |
335 | return JSValue::encode(jsUndefined()); |
336 | } |
337 | |
338 | EncodedJSValue JSC_HOST_CALL jsXSLTProcessorPrototypeFunctionReset(ExecState* state) |
339 | { |
340 | return IDLOperation<JSXSLTProcessor>::call<jsXSLTProcessorPrototypeFunctionResetBody>(*state, "reset" ); |
341 | } |
342 | |
343 | void JSXSLTProcessor::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
344 | { |
345 | auto* thisObject = jsCast<JSXSLTProcessor*>(cell); |
346 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
347 | if (thisObject->scriptExecutionContext()) |
348 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
349 | Base::heapSnapshot(cell, builder); |
350 | } |
351 | |
352 | bool JSXSLTProcessorOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) |
353 | { |
354 | UNUSED_PARAM(handle); |
355 | UNUSED_PARAM(visitor); |
356 | UNUSED_PARAM(reason); |
357 | return false; |
358 | } |
359 | |
360 | void JSXSLTProcessorOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
361 | { |
362 | auto* jsXSLTProcessor = static_cast<JSXSLTProcessor*>(handle.slot()->asCell()); |
363 | auto& world = *static_cast<DOMWrapperWorld*>(context); |
364 | uncacheWrapper(world, &jsXSLTProcessor->wrapped(), jsXSLTProcessor); |
365 | } |
366 | |
367 | JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<XSLTProcessor>&& impl) |
368 | { |
369 | // If you hit this failure the interface definition has the ImplementationLacksVTable |
370 | // attribute. You should remove that attribute. If the class has subclasses |
371 | // that may be passed through this toJS() function you should use the SkipVTableValidation |
372 | // attribute to XSLTProcessor. |
373 | static_assert(!std::is_polymorphic<XSLTProcessor>::value, "XSLTProcessor is polymorphic but the IDL claims it is not" ); |
374 | return createWrapper<XSLTProcessor>(globalObject, WTFMove(impl)); |
375 | } |
376 | |
377 | JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, XSLTProcessor& impl) |
378 | { |
379 | return wrap(state, globalObject, impl); |
380 | } |
381 | |
382 | XSLTProcessor* JSXSLTProcessor::toWrapped(JSC::VM& vm, JSC::JSValue value) |
383 | { |
384 | if (auto* wrapper = jsDynamicCast<JSXSLTProcessor*>(vm, value)) |
385 | return &wrapper->wrapped(); |
386 | return nullptr; |
387 | } |
388 | |
389 | } |
390 | |
391 | #endif // ENABLE(XSLT) |
392 | |