static v8::Handle<v8::Value> getScreenCTMCallback(const v8::Arguments& args) { INC_STATS("DOM.SVGLocatable.getScreenCTM"); SVGLocatable* imp = V8SVGLocatable::toNative(args.Holder()); AffineTransform result = imp->getScreenCTM(); RefPtr<V8SVGPODTypeWrapper<AffineTransform> > wrapper = V8SVGStaticPODTypeWrapper<AffineTransform>::create(result); SVGElement* context = V8Proxy::svgContext(imp); V8Proxy::setSVGContext(wrapper.get(), context); return toV8(wrapper.release()); }
JSValue* jsSVGLocatablePrototypeFunctionGetBBox(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGLocatable::s_info)) return throwError(exec, TypeError); JSSVGLocatable* castedThisObj = static_cast<JSSVGLocatable*>(thisValue); SVGLocatable* imp = static_cast<SVGLocatable*>(castedThisObj->impl()); JSC::JSValue* result = toJS(exec, JSSVGStaticPODTypeWrapper<FloatRect>::create(imp->getBBox()).get(), castedThisObj->context()); return result; }
JSValue* JSSVGLocatable::getValueProperty(ExecState* exec, int token) const { switch (token) { case NearestViewportElementAttrNum: { SVGLocatable* imp = static_cast<SVGLocatable*>(impl()); return toJS(exec, WTF::getPtr(imp->nearestViewportElement())); } case FarthestViewportElementAttrNum: { SVGLocatable* imp = static_cast<SVGLocatable*>(impl()); return toJS(exec, WTF::getPtr(imp->farthestViewportElement())); } } return 0; }
static v8::Handle<v8::Value> getTransformToElementCallback(const v8::Arguments& args) { INC_STATS("DOM.SVGLocatable.getTransformToElement"); SVGLocatable* imp = V8SVGLocatable::toNative(args.Holder()); ExceptionCode ec = 0; { EXCEPTION_BLOCK(SVGElement*, element, V8SVGElement::HasInstance(args[0]) ? V8SVGElement::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0); AffineTransform result = imp->getTransformToElement(element, ec); if (UNLIKELY(ec)) goto fail; RefPtr<V8SVGPODTypeWrapper<AffineTransform> > wrapper = V8SVGStaticPODTypeWrapper<AffineTransform>::create(result); SVGElement* context = V8Proxy::svgContext(imp); V8Proxy::setSVGContext(wrapper.get(), context); return toV8(wrapper.release()); } fail: V8Proxy::setDOMException(ec); return v8::Handle<v8::Value>(); }
JSValue JSC_HOST_CALL jsSVGLocatablePrototypeFunctionGetScreenCTM(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.isObject(&JSSVGLocatable::s_info)) return throwError(exec, TypeError); JSSVGLocatable* castedThisObj = static_cast<JSSVGLocatable*>(asObject(thisValue)); SVGLocatable* imp = static_cast<SVGLocatable*>(castedThisObj->impl()); JSC::JSValue result = toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp->getScreenCTM()).get(), castedThisObj->context()); return result; }
JSValue* jsSVGLocatablePrototypeFunctionGetTransformToElement(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGLocatable::s_info)) return throwError(exec, TypeError); JSSVGLocatable* castedThisObj = static_cast<JSSVGLocatable*>(thisValue); SVGLocatable* imp = static_cast<SVGLocatable*>(castedThisObj->impl()); ExceptionCode ec = 0; SVGElement* element = toSVGElement(args.at(exec, 0)); JSC::JSValue* result = toJS(exec, JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp->getTransformToElement(element, ec)).get(), castedThisObj->context()); setDOMException(exec, ec); return result; }
static v8::Handle<v8::Value> farthestViewportElementAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.SVGLocatable.farthestViewportElement._get"); SVGLocatable* imp = V8SVGLocatable::toNative(info.Holder()); return toV8(imp->farthestViewportElement()); }