24 #include "wtf/Platform.h"
31 #include "RenderPath.h"
37 SVGLocatable::SVGLocatable()
41 SVGLocatable::~SVGLocatable()
45 SVGElement* SVGLocatable::nearestViewportElement(
const SVGStyledElement* e)
65 SVGElement* SVGLocatable::farthestViewportElement(
const SVGStyledElement* e)
72 SVGElement* farthest = 0;
91 FloatRect SVGLocatable::getBBox(
const SVGStyledElement* e)
106 AffineTransform SVGLocatable::getCTM(
const SVGElement* element)
109 return AffineTransform();
113 Node* parent = element->parentNode();
114 if (parent && parent->isSVGElement()) {
115 SVGElement* parentElement =
static_cast<SVGElement*
>(parent);
116 if (parentElement && parentElement->isStyledLocatable()) {
117 AffineTransform parentCTM =
static_cast<SVGStyledLocatableElement*
>(parentElement)->getCTM();
118 ctm = parentCTM * ctm;
125 AffineTransform SVGLocatable::getScreenCTM(
const SVGElement* element)
128 return AffineTransform();
132 Node* parent = element->parentNode();
133 if (parent && parent->isSVGElement()) {
134 SVGElement* parentElement =
static_cast<SVGElement*
>(parent);
135 if (parentElement && parentElement->isStyledLocatable()) {
136 AffineTransform parentCTM =
static_cast<SVGStyledLocatableElement*
>(parentElement)->getScreenCTM();
137 ctm = parentCTM * ctm;
144 AffineTransform SVGLocatable::getTransformToElement(SVGElement* target, ExceptionCode& ec)
const
147 AffineTransform ctm = getCTM();
149 if (target && target->isStyledLocatable()) {
150 AffineTransform targetCTM =
static_cast<SVGStyledLocatableElement*
>(target)->getCTM();
151 if (!targetCTM.isInvertible()) {
155 ctm *= targetCTM.inverse();
163 #endif // ENABLE(SVG)