2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
23 #include "SVGAnimatedBoolean.h"
24 #include "SVGAnimatedEnumeration.h"
25 #include "SVGAnimatedLength.h"
26 #include "SVGAnimatedPreserveAspectRatio.h"
27 #include "SVGAnimatedRect.h"
28 #include "SVGAnimatedTransformList.h"
29 #include "SVGElement.h"
30 #include "SVGExternalResourcesRequired.h"
31 #include "SVGFitToViewBox.h"
34 #include "SVGURIReference.h"
35 #include "SVGUnitTypes.h"
39 struct PatternAttributes;
41 class SVGPatternElement final : public SVGElement,
42 public SVGURIReference,
44 public SVGExternalResourcesRequired,
45 public SVGFitToViewBox {
47 static Ref<SVGPatternElement> create(const QualifiedName&, Document&);
49 void collectPatternAttributes(PatternAttributes&) const;
51 AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const final;
54 SVGPatternElement(const QualifiedName&, Document&);
56 bool isValid() const final { return SVGTests::isValid(); }
57 bool needsPendingResourceHandling() const final { return false; }
59 static bool isSupportedAttribute(const QualifiedName&);
60 void parseAttribute(const QualifiedName&, const AtomicString&) final;
61 void svgAttributeChanged(const QualifiedName&) final;
62 void childrenChanged(const ChildChange&) final;
64 RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
66 bool selfHasRelativeLengths() const final { return true; }
68 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPatternElement)
69 DECLARE_ANIMATED_LENGTH(X, x)
70 DECLARE_ANIMATED_LENGTH(Y, y)
71 DECLARE_ANIMATED_LENGTH(Width, width)
72 DECLARE_ANIMATED_LENGTH(Height, height)
73 DECLARE_ANIMATED_ENUMERATION(PatternUnits, patternUnits, SVGUnitTypes::SVGUnitType)
74 DECLARE_ANIMATED_ENUMERATION(PatternContentUnits, patternContentUnits, SVGUnitTypes::SVGUnitType)
75 DECLARE_ANIMATED_TRANSFORM_LIST(PatternTransform, patternTransform)
76 DECLARE_ANIMATED_STRING_OVERRIDE(Href, href)
77 DECLARE_ANIMATED_BOOLEAN_OVERRIDE(ExternalResourcesRequired, externalResourcesRequired)
78 DECLARE_ANIMATED_RECT(ViewBox, viewBox)
79 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
80 END_DECLARE_ANIMATED_PROPERTIES
83 void synchronizeRequiredFeatures() final { SVGTests::synchronizeRequiredFeatures(this); }
84 void synchronizeRequiredExtensions() final { SVGTests::synchronizeRequiredExtensions(this); }
85 void synchronizeSystemLanguage() final { SVGTests::synchronizeSystemLanguage(this); }
88 } // namespace WebCore