SVGMatrix *SVGStyledTransformableElement::getScreenCTM() const { SVGMatrix *ctm = SVGLocatable::getScreenCTM(this); if(m_localMatrix) ctm->multiply(m_localMatrix.get()); return ctm; }
SVGMatrix *SVGPatternElement::getCTM() const { SVGMatrix *mat = SVGSVGElement::createSVGMatrix(); if (mat) { RefPtr<SVGMatrix> viewBox = viewBoxToViewTransform(width()->baseVal()->value(), height()->baseVal()->value()); mat->multiply(viewBox.get()); } return mat; }
SVGMatrix *SVGSVGElement::getScreenCTM() const { SVGMatrix *mat = SVGStyledLocatableElement::getScreenCTM(); if(mat) { mat->translate(x()->baseVal()->value(), y()->baseVal()->value()); if(attributes()->getNamedItem(SVGNames::viewBoxAttr)) { RefPtr<SVGMatrix> viewBox = viewBoxToViewTransform(width()->baseVal()->value(), height()->baseVal()->value()); mat->multiply(viewBox.get()); } } return mat; }
static v8::Handle<v8::Value> multiplyCallback(const v8::Arguments& args) { INC_STATS("DOM.SVGMatrix.multiply"); if (args.Length() < 1) return throwError("Not enough arguments", V8Proxy::TypeError); RefPtr<SVGPropertyTearOff<SVGMatrix> > wrapper = V8SVGMatrix::toNative(args.Holder()); if (wrapper->role() == AnimValRole) { V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR); return v8::Handle<v8::Value>(); } SVGMatrix& impInstance = wrapper->propertyReference(); SVGMatrix* imp = &impInstance; if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8SVGMatrix::HasInstance(args[0])) { V8Proxy::throwTypeError(); return notHandledByInterceptor(); } EXCEPTION_BLOCK(RefPtr<SVGPropertyTearOff<SVGMatrix> >, secondMatrix, V8SVGMatrix::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8SVGMatrix::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0); if (!secondMatrix) { V8Proxy::setDOMException(WebCore::TYPE_MISMATCH_ERR); return v8::Handle<v8::Value>(); } return toV8(WTF::getPtr(SVGPropertyTearOff<SVGMatrix>::create(imp->multiply(secondMatrix->propertyReference())))); }