Example #1
0
JSValue* JSSVGMarkerElementPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
{
    if (!thisObj->inherits(&JSSVGMarkerElement::info))
      return throwError(exec, TypeError);

    JSSVGMarkerElement* castedThisObj = static_cast<JSSVGMarkerElement*>(thisObj);
    SVGMarkerElement* imp = static_cast<SVGMarkerElement*>(castedThisObj->impl());

    switch (id) {
    case JSSVGMarkerElement::SetOrientToAutoFuncNum: {

        imp->setOrientToAuto();
        return jsUndefined();
    }
    case JSSVGMarkerElement::SetOrientToAngleFuncNum: {
        SVGAngle* angle = toSVGAngle(args[0]);

        imp->setOrientToAngle(angle);
        return jsUndefined();
    }
    case JSSVGMarkerElement::GetPresentationAttributeFuncNum: {
        String name = args[0]->toString(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->getPresentationAttribute(name)));
        return result;
    }
    }
    return 0;
}
JSValue* jsSVGMarkerElementPrototypeFunctionSetOrientToAngle(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
    if (!thisValue->isObject(&JSSVGMarkerElement::s_info))
        return throwError(exec, TypeError);
    JSSVGMarkerElement* castedThisObj = static_cast<JSSVGMarkerElement*>(thisValue);
    SVGMarkerElement* imp = static_cast<SVGMarkerElement*>(castedThisObj->impl());
    SVGAngle* angle = toSVGAngle(args.at(exec, 0));

    imp->setOrientToAngle(angle);
    return jsUndefined();
}
JSValue JSC_HOST_CALL jsSVGMarkerElementPrototypeFunctionSetOrientToAngle(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
    UNUSED_PARAM(args);
    if (!thisValue.inherits(&JSSVGMarkerElement::s_info))
        return throwError(exec, TypeError);
    JSSVGMarkerElement* castedThisObj = static_cast<JSSVGMarkerElement*>(asObject(thisValue));
    SVGMarkerElement* imp = static_cast<SVGMarkerElement*>(castedThisObj->impl());
    SVGAngle angle = toSVGAngle(args.at(0));

    imp->setOrientToAngle(angle);
    return jsUndefined();
}
Example #4
0
static v8::Handle<v8::Value> setOrientToAngleCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.SVGMarkerElement.setOrientToAngle");
    SVGMarkerElement* imp = V8SVGMarkerElement::toNative(args.Holder());
    EXCEPTION_BLOCK(RefPtr<SVGPropertyTearOff<SVGAngle> >, angle, V8SVGAngle::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8SVGAngle::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
    if (!angle) {
        V8Proxy::setDOMException(WebCore::TYPE_MISMATCH_ERR);
        return v8::Handle<v8::Value>();
    }
    imp->setOrientToAngle(angle->propertyReference());
    return v8::Handle<v8::Value>();
}