Index: Source/core/svg/SVGGraphicsElement.cpp |
diff --git a/Source/core/svg/SVGStyledTransformableElement.cpp b/Source/core/svg/SVGGraphicsElement.cpp |
similarity index 72% |
rename from Source/core/svg/SVGStyledTransformableElement.cpp |
rename to Source/core/svg/SVGGraphicsElement.cpp |
index 7304c61e2d4da603dad3dffe0e1e8f0ee7724d2c..ab14dc6f618aa25a5ca67206837f5da69367795a 100644 |
--- a/Source/core/svg/SVGStyledTransformableElement.cpp |
+++ b/Source/core/svg/SVGGraphicsElement.cpp |
@@ -20,7 +20,7 @@ |
#include "config.h" |
-#include "core/svg/SVGStyledTransformableElement.h" |
+#include "core/svg/SVGGraphicsElement.h" |
#include "SVGNames.h" |
#include "core/platform/graphics/transforms/AffineTransform.h" |
@@ -32,34 +32,35 @@ |
namespace WebCore { |
// Animated property definitions |
-DEFINE_ANIMATED_TRANSFORM_LIST(SVGStyledTransformableElement, SVGNames::transformAttr, Transform, transform) |
+DEFINE_ANIMATED_TRANSFORM_LIST(SVGGraphicsElement, SVGNames::transformAttr, Transform, transform) |
-BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGStyledTransformableElement) |
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGGraphicsElement) |
REGISTER_LOCAL_ANIMATED_PROPERTY(transform) |
- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledLocatableElement) |
+ REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement) |
+ REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) |
END_REGISTER_ANIMATED_PROPERTIES |
-SVGStyledTransformableElement::SVGStyledTransformableElement(const QualifiedName& tagName, Document* document, ConstructionType constructionType) |
+SVGGraphicsElement::SVGGraphicsElement(const QualifiedName& tagName, Document* document, ConstructionType constructionType) |
: SVGStyledLocatableElement(tagName, document, constructionType) |
{ |
- registerAnimatedPropertiesForSVGStyledTransformableElement(); |
+ registerAnimatedPropertiesForSVGGraphicsElement(); |
} |
-SVGStyledTransformableElement::~SVGStyledTransformableElement() |
+SVGGraphicsElement::~SVGGraphicsElement() |
{ |
} |
-AffineTransform SVGStyledTransformableElement::getCTM(StyleUpdateStrategy styleUpdateStrategy) |
+AffineTransform SVGGraphicsElement::getCTM(StyleUpdateStrategy styleUpdateStrategy) |
{ |
return SVGLocatable::computeCTM(this, SVGLocatable::NearestViewportScope, styleUpdateStrategy); |
} |
-AffineTransform SVGStyledTransformableElement::getScreenCTM(StyleUpdateStrategy styleUpdateStrategy) |
+AffineTransform SVGGraphicsElement::getScreenCTM(StyleUpdateStrategy styleUpdateStrategy) |
{ |
return SVGLocatable::computeCTM(this, SVGLocatable::ScreenScope, styleUpdateStrategy); |
} |
-AffineTransform SVGStyledTransformableElement::animatedLocalTransform() const |
+AffineTransform SVGGraphicsElement::animatedLocalTransform() const |
{ |
AffineTransform matrix; |
RenderStyle* style = renderer() ? renderer()->style() : 0; |
@@ -73,22 +74,23 @@ AffineTransform SVGStyledTransformableElement::animatedLocalTransform() const |
// Flatten any 3D transform. |
matrix = transform.toAffineTransform(); |
- } else |
+ } else { |
transform().concatenate(matrix); |
+ } |
if (m_supplementalTransform) |
return *m_supplementalTransform * matrix; |
return matrix; |
} |
-AffineTransform* SVGStyledTransformableElement::supplementalTransform() |
+AffineTransform* SVGGraphicsElement::supplementalTransform() |
{ |
if (!m_supplementalTransform) |
m_supplementalTransform = adoptPtr(new AffineTransform); |
return m_supplementalTransform.get(); |
} |
-bool SVGStyledTransformableElement::isSupportedAttribute(const QualifiedName& attrName) |
+bool SVGGraphicsElement::isSupportedAttribute(const QualifiedName& attrName) |
{ |
DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
if (supportedAttributes.isEmpty()) |
@@ -96,7 +98,7 @@ bool SVGStyledTransformableElement::isSupportedAttribute(const QualifiedName& at |
return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
} |
-void SVGStyledTransformableElement::parseAttribute(const QualifiedName& name, const AtomicString& value) |
+void SVGGraphicsElement::parseAttribute(const QualifiedName& name, const AtomicString& value) |
{ |
if (!isSupportedAttribute(name)) { |
SVGStyledLocatableElement::parseAttribute(name, value); |
@@ -114,7 +116,7 @@ void SVGStyledTransformableElement::parseAttribute(const QualifiedName& name, co |
ASSERT_NOT_REACHED(); |
} |
-void SVGStyledTransformableElement::svgAttributeChanged(const QualifiedName& attrName) |
+void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName) |
{ |
if (!isSupportedAttribute(attrName)) { |
SVGStyledLocatableElement::svgAttributeChanged(attrName); |
@@ -136,28 +138,28 @@ void SVGStyledTransformableElement::svgAttributeChanged(const QualifiedName& att |
ASSERT_NOT_REACHED(); |
} |
-SVGElement* SVGStyledTransformableElement::nearestViewportElement() const |
+SVGElement* SVGGraphicsElement::nearestViewportElement() const |
{ |
return SVGTransformable::nearestViewportElement(this); |
} |
-SVGElement* SVGStyledTransformableElement::farthestViewportElement() const |
+SVGElement* SVGGraphicsElement::farthestViewportElement() const |
{ |
return SVGTransformable::farthestViewportElement(this); |
} |
-FloatRect SVGStyledTransformableElement::getBBox(StyleUpdateStrategy styleUpdateStrategy) |
+FloatRect SVGGraphicsElement::getBBox(StyleUpdateStrategy styleUpdateStrategy) |
{ |
return SVGTransformable::getBBox(this, styleUpdateStrategy); |
} |
-RenderObject* SVGStyledTransformableElement::createRenderer(RenderStyle*) |
+RenderObject* SVGGraphicsElement::createRenderer(RenderStyle*) |
{ |
// By default, any subclass is expected to do path-based drawing |
return new (document()->renderArena()) RenderSVGPath(this); |
} |
-void SVGStyledTransformableElement::toClipPath(Path& path) |
+void SVGGraphicsElement::toClipPath(Path& path) |
{ |
updatePathFromGraphicsElement(this, path); |
// FIXME: How do we know the element has done a layout? |