JSValue jsSVGDocumentRootElement(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGDocument* castedThis = static_cast<JSSVGDocument*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGDocument* imp = static_cast<SVGDocument*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->rootElement())); return result; }
EncodedJSValue JSC_HOST_CALL jsSVGDocumentPrototypeFunctionCreateEvent(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSSVGDocument::s_info)) return throwVMTypeError(exec); JSSVGDocument* castedThis = static_cast<JSSVGDocument*>(asObject(thisValue)); SVGDocument* imp = static_cast<SVGDocument*>(castedThis->impl()); ExceptionCode ec = 0; const String& eventType(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createEvent(eventType, ec))); setDOMException(exec, ec); return JSValue::encode(result); }
JSValue* JSSVGDocumentPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args) { if (!thisObj->inherits(&JSSVGDocument::info)) return throwError(exec, TypeError); JSSVGDocument* castedThisObj = static_cast<JSSVGDocument*>(thisObj); SVGDocument* imp = static_cast<SVGDocument*>(castedThisObj->impl()); switch (id) { case JSSVGDocument::CreateEventFuncNum: { ExceptionCode ec = 0; String eventType = args[0]->toString(exec); KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createEvent(eventType, ec))); setDOMException(exec, ec); return result; } } return 0; }