2 * Copyright (C) 2005 Alexander Kellett <lypanov@kde.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef SVGMaskElement_h
21 #define SVGMaskElement_h
24 #include "core/svg/SVGAnimatedBoolean.h"
25 #include "core/svg/SVGAnimatedEnumeration.h"
26 #include "core/svg/SVGAnimatedLength.h"
27 #include "core/svg/SVGElement.h"
28 #include "core/svg/SVGTests.h"
29 #include "core/svg/SVGUnitTypes.h"
33 class SVGMaskElement FINAL : public SVGElement,
36 static PassRefPtr<SVGMaskElement> create(Document&);
38 SVGAnimatedLength* x() const { return m_x.get(); }
39 SVGAnimatedLength* y() const { return m_y.get(); }
40 SVGAnimatedLength* width() const { return m_width.get(); }
41 SVGAnimatedLength* height() const { return m_height.get(); }
44 explicit SVGMaskElement(Document&);
46 virtual bool isValid() const OVERRIDE { return SVGTests::isValid(); }
47 virtual bool needsPendingResourceHandling() const OVERRIDE { return false; }
49 bool isSupportedAttribute(const QualifiedName&);
50 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
51 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
52 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE;
54 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
56 virtual bool selfHasRelativeLengths() const OVERRIDE;
58 RefPtr<SVGAnimatedLength> m_x;
59 RefPtr<SVGAnimatedLength> m_y;
60 RefPtr<SVGAnimatedLength> m_width;
61 RefPtr<SVGAnimatedLength> m_height;
62 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGMaskElement)
63 DECLARE_ANIMATED_ENUMERATION(MaskUnits, maskUnits, SVGUnitTypes::SVGUnitType)
64 DECLARE_ANIMATED_ENUMERATION(MaskContentUnits, maskContentUnits, SVGUnitTypes::SVGUnitType)
65 END_DECLARE_ANIMATED_PROPERTIES
68 virtual void synchronizeRequiredFeatures() OVERRIDE { SVGTests::synchronizeRequiredFeatures(this); }
69 virtual void synchronizeRequiredExtensions() OVERRIDE { SVGTests::synchronizeRequiredExtensions(this); }
70 virtual void synchronizeSystemLanguage() OVERRIDE { SVGTests::synchronizeSystemLanguage(this); }
73 DEFINE_NODE_TYPE_CASTS(SVGMaskElement, hasTagName(SVGNames::maskTag));