SVGClipPathElement.h (1740B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef DOM_SVG_SVGCLIPPATHELEMENT_H_ 8 #define DOM_SVG_SVGCLIPPATHELEMENT_H_ 9 10 #include "SVGAnimatedEnumeration.h" 11 #include "mozilla/dom/SVGTransformableElement.h" 12 13 nsresult NS_NewSVGClipPathElement( 14 nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); 15 16 namespace mozilla { 17 class SVGClipPathFrame; 18 19 namespace dom { 20 21 using SVGClipPathElementBase = SVGTransformableElement; 22 23 class SVGClipPathElement final : public SVGClipPathElementBase { 24 friend class mozilla::SVGClipPathFrame; 25 26 protected: 27 friend nsresult(::NS_NewSVGClipPathElement( 28 nsIContent** aResult, 29 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)); 30 explicit SVGClipPathElement( 31 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); 32 JSObject* WrapNode(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override; 33 34 public: 35 nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; 36 37 // WebIDL 38 already_AddRefed<DOMSVGAnimatedEnumeration> ClipPathUnits(); 39 40 // This is an internal method that does not flush style, and thus 41 // the answer may be out of date if there's a pending style flush. 42 bool IsUnitsObjectBoundingBox() const; 43 44 protected: 45 enum { CLIPPATHUNITS }; 46 SVGAnimatedEnumeration mEnumAttributes[1]; 47 static EnumInfo sEnumInfo[1]; 48 49 EnumAttributesInfo GetEnumInfo() override; 50 }; 51 52 } // namespace dom 53 } // namespace mozilla 54 55 #endif // DOM_SVG_SVGCLIPPATHELEMENT_H_