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(); }
v8::Handle<v8::Value> V8SVGLength::convertToSpecifiedUnitsCallback(const v8::Arguments& args) { INC_STATS("DOM.SVGLength.convertToSpecifiedUnits"); SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(args.Holder()); if (wrapper->isReadOnly()) 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 v8Undefined(); }
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(); }
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(); }
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->isReadOnly()) { V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, info.GetIsolate()); return; } if (!isUndefinedOrNull(value) && !value->IsNumber() && !value->IsBoolean()) { V8Proxy::throwTypeError(0, info.GetIsolate()); return; } SVGLength& imp = wrapper->propertyReference(); ExceptionCode ec = 0; SVGLengthContext lengthContext(wrapper->contextElement()); imp.setValue(static_cast<float>(value->NumberValue()), lengthContext, ec); if (UNLIKELY(ec)) V8Proxy::setDOMException(ec, info.GetIsolate()); else wrapper->commitChange(); }