summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGGraphicsElement.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-05-20 09:56:07 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-05-20 09:56:07 +0000
commit41386e9cb918eed93b3f13648cbef387e371e451 (patch)
treea97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/WebCore/svg/SVGGraphicsElement.cpp
parente15dd966d523731101f70ccf768bba12435a0208 (diff)
downloadWebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/WebCore/svg/SVGGraphicsElement.cpp')
-rw-r--r--Source/WebCore/svg/SVGGraphicsElement.cpp41
1 files changed, 22 insertions, 19 deletions
diff --git a/Source/WebCore/svg/SVGGraphicsElement.cpp b/Source/WebCore/svg/SVGGraphicsElement.cpp
index 82905ad4e..53ba8db0b 100644
--- a/Source/WebCore/svg/SVGGraphicsElement.cpp
+++ b/Source/WebCore/svg/SVGGraphicsElement.cpp
@@ -19,14 +19,17 @@
*/
#include "config.h"
+
+#if ENABLE(SVG)
#include "SVGGraphicsElement.h"
#include "AffineTransform.h"
+#include "Attribute.h"
#include "RenderSVGPath.h"
#include "RenderSVGResource.h"
+#include "SVGElementInstance.h"
#include "SVGNames.h"
#include "SVGPathData.h"
-#include <wtf/NeverDestroyed.h>
namespace WebCore {
@@ -41,7 +44,6 @@ END_REGISTER_ANIMATED_PROPERTIES
SVGGraphicsElement::SVGGraphicsElement(const QualifiedName& tagName, Document& document)
: SVGElement(tagName, document)
- , m_shouldIsolateBlending(false)
{
registerAnimatedPropertiesForSVGGraphicsElement();
}
@@ -74,14 +76,6 @@ AffineTransform SVGGraphicsElement::animatedLocalTransform() const
// Flatten any 3D transform.
matrix = transform.toAffineTransform();
- // CSS bakes the zoom factor into lengths, including translation components.
- // In order to align CSS & SVG transforms, we need to invert this operation.
- float zoom = style->effectiveZoom();
- if (zoom != 1) {
- matrix.setE(matrix.e() / zoom);
- matrix.setF(matrix.f() / zoom);
- }
-
} else
transform().concatenate(matrix);
@@ -99,16 +93,21 @@ AffineTransform* SVGGraphicsElement::supplementalTransform()
bool SVGGraphicsElement::isSupportedAttribute(const QualifiedName& attrName)
{
- static NeverDestroyed<HashSet<QualifiedName>> supportedAttributes;
- if (supportedAttributes.get().isEmpty()) {
+ DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
+ if (supportedAttributes.isEmpty()) {
SVGTests::addSupportedAttributes(supportedAttributes);
- supportedAttributes.get().add(SVGNames::transformAttr);
+ supportedAttributes.add(SVGNames::transformAttr);
}
- return supportedAttributes.get().contains<SVGAttributeHashTranslator>(attrName);
+ return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
}
void SVGGraphicsElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
+ if (!isSupportedAttribute(name)) {
+ SVGElement::parseAttribute(name, value);
+ return;
+ }
+
if (name == SVGNames::transformAttr) {
SVGTransformList newList;
newList.parse(value);
@@ -117,8 +116,10 @@ void SVGGraphicsElement::parseAttribute(const QualifiedName& name, const AtomicS
return;
}
- SVGElement::parseAttribute(name, value);
- SVGTests::parseAttribute(name, value);
+ if (SVGTests::parseAttribute(name, value))
+ return;
+
+ ASSERT_NOT_REACHED();
}
void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName)
@@ -128,7 +129,7 @@ void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName)
return;
}
- InstanceInvalidationGuard guard(*this);
+ SVGElementInstance::InvalidationGuard invalidationGuard(this);
if (SVGTests::handleAttributeChange(this, attrName))
return;
@@ -161,10 +162,10 @@ FloatRect SVGGraphicsElement::getBBox(StyleUpdateStrategy styleUpdateStrategy)
return SVGTransformable::getBBox(this, styleUpdateStrategy);
}
-RenderPtr<RenderElement> SVGGraphicsElement::createElementRenderer(Ref<RenderStyle>&& style, const RenderTreePosition&)
+RenderPtr<RenderElement> SVGGraphicsElement::createElementRenderer(PassRef<RenderStyle> style)
{
// By default, any subclass is expected to do path-based drawing
- return createRenderer<RenderSVGPath>(*this, WTF::move(style));
+ return createRenderer<RenderSVGPath>(*this, std::move(style));
}
void SVGGraphicsElement::toClipPath(Path& path)
@@ -175,3 +176,5 @@ void SVGGraphicsElement::toClipPath(Path& path)
}
}
+
+#endif // ENABLE(SVG)