summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGGraphicsElement.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/svg/SVGGraphicsElement.h')
-rw-r--r--Source/WebCore/svg/SVGGraphicsElement.h70
1 files changed, 44 insertions, 26 deletions
diff --git a/Source/WebCore/svg/SVGGraphicsElement.h b/Source/WebCore/svg/SVGGraphicsElement.h
index 6ea9213b4..7523cfc19 100644
--- a/Source/WebCore/svg/SVGGraphicsElement.h
+++ b/Source/WebCore/svg/SVGGraphicsElement.h
@@ -18,10 +18,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGGraphicsElement_h
-#define SVGGraphicsElement_h
+#pragma once
-#if ENABLE(SVG)
#include "SVGAnimatedTransformList.h"
#include "SVGElement.h"
#include "SVGTests.h"
@@ -31,55 +29,75 @@ namespace WebCore {
class AffineTransform;
class Path;
+class SVGRect;
+class SVGMatrix;
class SVGGraphicsElement : public SVGElement, public SVGTransformable, public SVGTests {
public:
virtual ~SVGGraphicsElement();
- virtual AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate) override;
- virtual AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate) override;
- virtual SVGElement* nearestViewportElement() const override;
- virtual SVGElement* farthestViewportElement() const override;
+ Ref<SVGMatrix> getCTMForBindings();
+ AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate) override;
- virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const override { return SVGTransformable::localCoordinateSpaceTransform(mode); }
- virtual AffineTransform animatedLocalTransform() const override;
- virtual AffineTransform* supplementalTransform() override;
+ Ref<SVGMatrix> getScreenCTMForBindings();
+ AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate) override;
- virtual FloatRect getBBox(StyleUpdateStrategy = AllowStyleUpdate) override;
+ SVGElement* nearestViewportElement() const override;
+ SVGElement* farthestViewportElement() const override;
+
+ AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const override { return SVGTransformable::localCoordinateSpaceTransform(mode); }
+ AffineTransform animatedLocalTransform() const override;
+ AffineTransform* supplementalTransform() override;
+
+ Ref<SVGRect> getBBoxForBindings();
+ FloatRect getBBox(StyleUpdateStrategy = AllowStyleUpdate) override;
+
+ bool shouldIsolateBlending() const { return m_shouldIsolateBlending; }
+ void setShouldIsolateBlending(bool isolate) { m_shouldIsolateBlending = isolate; }
// "base class" methods for all the elements which render as paths
virtual void toClipPath(Path&);
- virtual RenderPtr<RenderElement> createElementRenderer(PassRef<RenderStyle>) override;
+ RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
+
+ size_t approximateMemoryCost() const override { return sizeof(*this); }
+
+ // SVGTests
+ Ref<SVGStringList> requiredFeatures();
+ Ref<SVGStringList> requiredExtensions();
+ Ref<SVGStringList> systemLanguage();
protected:
SVGGraphicsElement(const QualifiedName&, Document&);
- bool isSupportedAttribute(const QualifiedName&);
- virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
- virtual void svgAttributeChanged(const QualifiedName&) override;
+ bool supportsFocus() const override { return Element::supportsFocus() || hasFocusEventListeners(); }
+
+ void parseAttribute(const QualifiedName&, const AtomicString&) override;
+ void svgAttributeChanged(const QualifiedName&) override;
BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGGraphicsElement)
DECLARE_ANIMATED_TRANSFORM_LIST(Transform, transform)
END_DECLARE_ANIMATED_PROPERTIES
private:
- virtual bool isSVGGraphicsElement() const override { return true; }
+ bool isSVGGraphicsElement() const override { return true; }
+
+ static bool isSupportedAttribute(const QualifiedName&);
// SVGTests
- virtual void synchronizeRequiredFeatures() override { SVGTests::synchronizeRequiredFeatures(this); }
- virtual void synchronizeRequiredExtensions() override { SVGTests::synchronizeRequiredExtensions(this); }
- virtual void synchronizeSystemLanguage() override { SVGTests::synchronizeSystemLanguage(this); }
+ void synchronizeRequiredFeatures() final { SVGTests::synchronizeRequiredFeatures(*this); }
+ void synchronizeRequiredExtensions() final { SVGTests::synchronizeRequiredExtensions(*this); }
+ void synchronizeSystemLanguage() final { SVGTests::synchronizeSystemLanguage(*this); }
// Used by <animateMotion>
std::unique_ptr<AffineTransform> m_supplementalTransform;
-};
-void isSVGGraphicsElement(const SVGGraphicsElement&); // Catch unnecessary runtime check of type known at compile time.
-inline bool isSVGGraphicsElement(const SVGElement& element) { return element.isSVGGraphicsElement(); }
-inline bool isSVGGraphicsElement(const Node& node) { return node.isSVGElement() && toSVGElement(node).isSVGGraphicsElement(); }
-NODE_TYPE_CASTS(SVGGraphicsElement)
+ // Used to isolate blend operations caused by masking.
+ bool m_shouldIsolateBlending;
+};
} // namespace WebCore
-#endif // ENABLE(SVG)
-#endif // SVGGraphicsElement_h
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::SVGGraphicsElement)
+ static bool isType(const WebCore::SVGElement& element) { return element.isSVGGraphicsElement(); }
+ static bool isType(const WebCore::Node& node) { return is<WebCore::SVGElement>(node) && isType(downcast<WebCore::SVGElement>(node)); }
+SPECIALIZE_TYPE_TRAITS_END()