SVGClipPathElement.h 1.7 KB

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