Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / core / svg / SVGPatternElement.h
blob779256be72fed8c455cd571b443bffeabb40e625
1 /*
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.
21 #ifndef SVGPatternElement_h
22 #define SVGPatternElement_h
24 #include "core/SVGNames.h"
25 #include "core/svg/SVGAnimatedEnumeration.h"
26 #include "core/svg/SVGAnimatedLength.h"
27 #include "core/svg/SVGAnimatedTransformList.h"
28 #include "core/svg/SVGElement.h"
29 #include "core/svg/SVGFitToViewBox.h"
30 #include "core/svg/SVGTests.h"
31 #include "core/svg/SVGURIReference.h"
32 #include "core/svg/SVGUnitTypes.h"
33 #include "platform/heap/Handle.h"
35 namespace blink {
37 class PatternAttributes;
39 class SVGPatternElement final : public SVGElement,
40 public SVGURIReference,
41 public SVGTests,
42 public SVGFitToViewBox {
43 DEFINE_WRAPPERTYPEINFO();
44 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SVGPatternElement);
45 public:
46 DECLARE_NODE_FACTORY(SVGPatternElement);
48 void collectPatternAttributes(PatternAttributes&) const;
50 AffineTransform localCoordinateSpaceTransform(SVGElement::CTMScope) const override;
52 SVGAnimatedLength* x() const { return m_x.get(); }
53 SVGAnimatedLength* y() const { return m_y.get(); }
54 SVGAnimatedLength* width() const { return m_width.get(); }
55 SVGAnimatedLength* height() const { return m_height.get(); }
56 SVGAnimatedTransformList* patternTransform() { return m_patternTransform.get(); }
57 const SVGAnimatedTransformList* patternTransform() const { return m_patternTransform.get(); }
58 SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>* patternUnits() { return m_patternUnits.get(); }
59 SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>* patternContentUnits() { return m_patternContentUnits.get(); }
60 const SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>* patternUnits() const { return m_patternUnits.get(); }
61 const SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>* patternContentUnits() const { return m_patternContentUnits.get(); }
63 DECLARE_VIRTUAL_TRACE();
65 private:
66 explicit SVGPatternElement(Document&);
68 bool isValid() const override { return SVGTests::isValid(document()); }
69 bool needsPendingResourceHandling() const override { return false; }
71 void svgAttributeChanged(const QualifiedName&) override;
72 void childrenChanged(const ChildrenChange&) override;
74 LayoutObject* createLayoutObject(const ComputedStyle&) override;
76 bool selfHasRelativeLengths() const override;
78 RefPtrWillBeMember<SVGAnimatedLength> m_x;
79 RefPtrWillBeMember<SVGAnimatedLength> m_y;
80 RefPtrWillBeMember<SVGAnimatedLength> m_width;
81 RefPtrWillBeMember<SVGAnimatedLength> m_height;
82 RefPtrWillBeMember<SVGAnimatedTransformList> m_patternTransform;
83 RefPtrWillBeMember<SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>> m_patternUnits;
84 RefPtrWillBeMember<SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>> m_patternContentUnits;
87 } // namespace blink
89 #endif // SVGPatternElement_h