1/* 2 * Copyright (C) 2005 Alexander Kellett <lypanov@kde.org> 3 * 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. 8 * 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. 13 * 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. 18 */ 19 20#ifndef SVGMaskElement_h 21#define SVGMaskElement_h 22 23#include "SVGAnimatedBoolean.h" 24#include "SVGAnimatedEnumeration.h" 25#include "SVGAnimatedLength.h" 26#include "SVGElement.h" 27#include "SVGExternalResourcesRequired.h" 28#include "SVGNames.h" 29#include "SVGTests.h" 30#include "SVGUnitTypes.h" 31 32namespace WebCore { 33 34class SVGMaskElement final : public SVGElement, 35 public SVGTests, 36 public SVGExternalResourcesRequired { 37public: 38 static PassRefPtr<SVGMaskElement> create(const QualifiedName&, Document&); 39 40private: 41 SVGMaskElement(const QualifiedName&, Document&); 42 43 virtual bool isValid() const override { return SVGTests::isValid(); } 44 virtual bool needsPendingResourceHandling() const override { return false; } 45 46 bool isSupportedAttribute(const QualifiedName&); 47 virtual void parseAttribute(const QualifiedName&, const AtomicString&) override; 48 virtual void svgAttributeChanged(const QualifiedName&) override; 49 virtual void childrenChanged(const ChildChange&) override; 50 51 virtual RenderPtr<RenderElement> createElementRenderer(PassRef<RenderStyle>) override; 52 53 virtual bool selfHasRelativeLengths() const override; 54 55 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGMaskElement) 56 DECLARE_ANIMATED_ENUMERATION(MaskUnits, maskUnits, SVGUnitTypes::SVGUnitType) 57 DECLARE_ANIMATED_ENUMERATION(MaskContentUnits, maskContentUnits, SVGUnitTypes::SVGUnitType) 58 DECLARE_ANIMATED_LENGTH(X, x) 59 DECLARE_ANIMATED_LENGTH(Y, y) 60 DECLARE_ANIMATED_LENGTH(Width, width) 61 DECLARE_ANIMATED_LENGTH(Height, height) 62 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired) 63 END_DECLARE_ANIMATED_PROPERTIES 64 65 // SVGTests 66 virtual void synchronizeRequiredFeatures() override { SVGTests::synchronizeRequiredFeatures(this); } 67 virtual void synchronizeRequiredExtensions() override { SVGTests::synchronizeRequiredExtensions(this); } 68 virtual void synchronizeSystemLanguage() override { SVGTests::synchronizeSystemLanguage(this); } 69}; 70 71NODE_TYPE_CASTS(SVGMaskElement) 72 73} 74 75#endif 76