static v8::Handle<v8::Value> meetOrSliceAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    SVGPropertyTearOff<SVGPreserveAspectRatio>* wrapper = V8SVGPreserveAspectRatio::toNative(info.Holder());
    SVGPreserveAspectRatio& impInstance = wrapper->propertyReference();
    SVGPreserveAspectRatio* imp = &impInstance;
    return v8Integer(imp->meetOrSlice(), info.GetIsolate());
}
Esempio n. 2
0
static v8::Handle<v8::Value> cAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGMatrix.c._get");
    SVGPropertyTearOff<SVGMatrix>* wrapper = V8SVGMatrix::toNative(info.Holder());
    SVGMatrix& impInstance = wrapper->propertyReference();
    SVGMatrix* imp = &impInstance;
    return v8::Number::New(imp->c());
}
void V8SVGLength::valueAttrGetterCustom(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
    SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
    SVGLength& imp = wrapper->propertyReference();
    ExceptionState es(info.GetIsolate());
    SVGLengthContext lengthContext(wrapper->contextElement());
    float value = imp.value(lengthContext, es);
    if (es.throwIfNeeded())
        return;
    v8SetReturnValue(info, value);
}
Esempio n. 4
0
v8::Handle<v8::Value> V8SVGLength::valueAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGLength.value._get");
    SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
    SVGLength& imp = wrapper->propertyReference();
    ExceptionCode ec = 0;
    SVGLengthContext lengthContext(wrapper->contextElement());
    float value = imp.value(lengthContext, ec);
    if (UNLIKELY(ec))
        return V8Proxy::setDOMException(ec, info.GetIsolate());
    return v8::Number::New(value);
}
Esempio n. 5
0
static void bAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGMatrix.b._set");
    SVGPropertyTearOff<SVGMatrix>* wrapper = V8SVGMatrix::toNative(info.Holder());
    if (wrapper->role() == AnimValRole) {
        V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR);
        return;
    }
    SVGMatrix& impInstance = wrapper->propertyReference();
    SVGMatrix* imp = &impInstance;
    double v = static_cast<double>(value->NumberValue());
    imp->setB(v);
    wrapper->commitChange();
    return;
}
static void meetOrSliceAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    SVGPropertyTearOff<SVGPreserveAspectRatio>* wrapper = V8SVGPreserveAspectRatio::toNative(info.Holder());
    if (wrapper->isReadOnly()) {
        setDOMException(NO_MODIFICATION_ALLOWED_ERR, info.GetIsolate());
        return;
    }
    SVGPreserveAspectRatio& impInstance = wrapper->propertyReference();
    SVGPreserveAspectRatio* imp = &impInstance;
    int v = toUInt32(value);
    ExceptionCode ec = 0;
    imp->setMeetOrSlice(v, ec);
    if (UNLIKELY(ec))
        setDOMException(ec, info.GetIsolate());
    if (!ec)
        wrapper->commitChange();
    return;
}
void V8SVGLength::valueAttrSetterCustom(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
{
    SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
    if (wrapper->isReadOnly()) {
        setDOMException(NoModificationAllowedError, info.GetIsolate());
        return;
    }

    if (!isUndefinedOrNull(value) && !value->IsNumber() && !value->IsBoolean()) {
        throwTypeError(info.GetIsolate());
        return;
    }

    SVGLength& imp = wrapper->propertyReference();
    ExceptionState es(info.GetIsolate());
    SVGLengthContext lengthContext(wrapper->contextElement());
    imp.setValue(static_cast<float>(value->NumberValue()), lengthContext, es);
    if (es.throwIfNeeded())
        return;
    wrapper->commitChange();
}
Esempio n. 8
0
v8::Handle<v8::Value> V8SVGLength::convertToSpecifiedUnitsCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.SVGLength.convertToSpecifiedUnits");
    SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(args.Holder());
    if (wrapper->role() == AnimValRole)
        return V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, args.GetIsolate());

    if (args.Length() < 1)
        return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());

    SVGLength& imp = wrapper->propertyReference();
    ExceptionCode ec = 0;
    EXCEPTION_BLOCK(int, unitType, toUInt32(args[0]));
    SVGLengthContext lengthContext(wrapper->contextElement());
    imp.convertToSpecifiedUnits(unitType, lengthContext, ec);
    if (UNLIKELY(ec))
        return V8Proxy::setDOMException(ec, args.GetIsolate());

    wrapper->commitChange();
    return v8::Handle<v8::Value>();
}
void V8SVGLength::valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGLength.value._set");
    SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
    if (wrapper->role() == AnimValRole) {
        V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR);
        return;
    }

    if (!isUndefinedOrNull(value) && !value->IsNumber() && !value->IsBoolean()) {
        V8Proxy::throwTypeError();
        return;
    }

    SVGLength& imp = wrapper->propertyReference();
    ExceptionCode ec = 0;
    imp.setValue(static_cast<float>(value->NumberValue()), wrapper->contextElement(), ec);
    if (UNLIKELY(ec))
        V8Proxy::setDOMException(ec);
    else
        wrapper->commitChange();
}
void V8SVGLength::convertToSpecifiedUnitsMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
{
    SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(args.Holder());
    if (wrapper->isReadOnly()) {
        setDOMException(NoModificationAllowedError, args.GetIsolate());
        return;
    }

    if (args.Length() < 1) {
        throwNotEnoughArgumentsError(args.GetIsolate());
        return;
    }

    SVGLength& imp = wrapper->propertyReference();
    ExceptionState es(args.GetIsolate());
    V8TRYCATCH_VOID(int, unitType, toUInt32(args[0]));
    SVGLengthContext lengthContext(wrapper->contextElement());
    imp.convertToSpecifiedUnits(unitType, lengthContext, es);
    if (es.throwIfNeeded())
        return;
    wrapper->commitChange();
}
Esempio n. 11
0
void V8SVGLength::convertToSpecifiedUnitsMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
    if (wrapper->isReadOnly()) {
        setDOMException(NoModificationAllowedError, info.GetIsolate());
        return;
    }

    if (info.Length() < 1) {
        throwTypeError(ExceptionMessages::failedToExecute("convertToSpecifiedUnits", "SVGLength", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
        return;
    }

    SVGLength& imp = wrapper->propertyReference();
    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
    V8TRYCATCH_VOID(int, unitType, toUInt32(info[0]));
    SVGLengthContext lengthContext(wrapper->contextElement());
    imp.convertToSpecifiedUnits(unitType, lengthContext, exceptionState);
    if (exceptionState.throwIfNeeded())
        return;
    wrapper->commitChange();
}