SVGForeignObjectElement.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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_SVGForeignObjectElement_h
  6. #define mozilla_dom_SVGForeignObjectElement_h
  7. #include "mozilla/dom/SVGGraphicsElement.h"
  8. #include "nsSVGLength2.h"
  9. nsresult NS_NewSVGForeignObjectElement(nsIContent **aResult,
  10. already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
  11. class nsSVGForeignObjectFrame;
  12. namespace mozilla {
  13. namespace dom {
  14. class SVGForeignObjectElement final : public SVGGraphicsElement
  15. {
  16. friend class ::nsSVGForeignObjectFrame;
  17. protected:
  18. friend nsresult (::NS_NewSVGForeignObjectElement(nsIContent **aResult,
  19. already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
  20. explicit SVGForeignObjectElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
  21. virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
  22. public:
  23. // nsSVGElement specializations:
  24. virtual gfxMatrix PrependLocalTransformsTo(
  25. const gfxMatrix &aMatrix,
  26. SVGTransformTypes aWhich = eAllTransforms) const override;
  27. virtual bool HasValidDimensions() const override;
  28. // nsIContent interface
  29. virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
  30. nsIContent* aBindingParent,
  31. bool aCompileEventHandlers) override;
  32. NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* name) const override;
  33. virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
  34. // WebIDL
  35. already_AddRefed<SVGAnimatedLength> X();
  36. already_AddRefed<SVGAnimatedLength> Y();
  37. already_AddRefed<SVGAnimatedLength> Width();
  38. already_AddRefed<SVGAnimatedLength> Height();
  39. protected:
  40. virtual LengthAttributesInfo GetLengthInfo() override;
  41. enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
  42. nsSVGLength2 mLengthAttributes[4];
  43. static LengthInfo sLengthInfo[4];
  44. };
  45. } // namespace dom
  46. } // namespace mozilla
  47. #endif // mozilla_dom_SVGForeignObjectElement_h