JSValue* JSSVGRectElementPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args) { if (!thisObj->inherits(&JSSVGRectElement::info)) return throwError(exec, TypeError); JSSVGRectElement* castedThisObj = static_cast<JSSVGRectElement*>(thisObj); SVGRectElement* imp = static_cast<SVGRectElement*>(castedThisObj->impl()); switch (id) { case JSSVGRectElement::HasExtensionFuncNum: { String extension = args[0]->toString(exec); KJS::JSValue* result = jsBoolean(imp->hasExtension(extension)); return result; } case JSSVGRectElement::GetPresentationAttributeFuncNum: { String name = args[0]->toString(exec); KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->getPresentationAttribute(name))); return result; } case JSSVGRectElement::GetBBoxFuncNum: { KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapperCreatorReadOnly<FloatRect>(imp->getBBox()), imp); return result; } case JSSVGRectElement::GetCTMFuncNum: { KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapperCreatorReadOnly<AffineTransform>(imp->getCTM()), imp); return result; } case JSSVGRectElement::GetScreenCTMFuncNum: { KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapperCreatorReadOnly<AffineTransform>(imp->getScreenCTM()), imp); return result; } case JSSVGRectElement::GetTransformToElementFuncNum: { ExceptionCode ec = 0; SVGElement* element = toSVGElement(args[0]); KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapperCreatorReadOnly<AffineTransform>(imp->getTransformToElement(element, ec)), imp); setDOMException(exec, ec); return result; } } return 0; }
JSValue JSC_HOST_CALL jsSVGRectElementPrototypeFunctionHasExtension(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.isObject(&JSSVGRectElement::s_info)) return throwError(exec, TypeError); JSSVGRectElement* castedThisObj = static_cast<JSSVGRectElement*>(asObject(thisValue)); SVGRectElement* imp = static_cast<SVGRectElement*>(castedThisObj->impl()); const UString& extension = args.at(0).toString(exec); JSC::JSValue result = jsBoolean(imp->hasExtension(extension)); return result; }
EncodedJSValue JSC_HOST_CALL jsSVGRectElementPrototypeFunctionHasExtension(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSSVGRectElement::s_info)) return throwVMTypeError(exec); JSSVGRectElement* castedThis = static_cast<JSSVGRectElement*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGRectElement::s_info); SVGRectElement* imp = static_cast<SVGRectElement*>(castedThis->impl()); const String& extension(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = jsBoolean(imp->hasExtension(extension)); return JSValue::encode(result); }