Bumping manifests a=b2g-bump
[gecko.git] / dom / svg / SVGFEImageElement.h
blob6ec31cea964de6ed9cb668e127b98cdd600a912c
1 /* -*- Mode: C++; tab-width: 2; 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/. */
6 #ifndef mozilla_dom_SVGFEImageElement_h
7 #define mozilla_dom_SVGFEImageElement_h
9 #include "nsSVGFilters.h"
10 #include "SVGAnimatedPreserveAspectRatio.h"
12 class SVGFEImageFrame;
14 nsresult NS_NewSVGFEImageElement(nsIContent **aResult,
15 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
17 namespace mozilla {
18 namespace dom {
20 typedef nsSVGFE SVGFEImageElementBase;
22 class SVGFEImageElement : public SVGFEImageElementBase,
23 public nsImageLoadingContent
25 friend class ::SVGFEImageFrame;
27 protected:
28 friend nsresult (::NS_NewSVGFEImageElement(nsIContent **aResult,
29 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
30 explicit SVGFEImageElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
31 virtual ~SVGFEImageElement();
32 virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE;
34 public:
35 virtual bool SubregionIsUnionOfRegions() MOZ_OVERRIDE { return false; }
37 // interfaces:
38 NS_DECL_ISUPPORTS_INHERITED
40 virtual FilterPrimitiveDescription
41 GetPrimitiveDescription(nsSVGFilterInstance* aInstance,
42 const IntRect& aFilterSubregion,
43 const nsTArray<bool>& aInputsAreTainted,
44 nsTArray<mozilla::RefPtr<SourceSurface>>& aInputImages) MOZ_OVERRIDE;
45 virtual bool AttributeAffectsRendering(
46 int32_t aNameSpaceID, nsIAtom* aAttribute) const MOZ_OVERRIDE;
47 virtual nsSVGString& GetResultImageName() MOZ_OVERRIDE { return mStringAttributes[RESULT]; }
48 virtual bool OutputIsTainted(const nsTArray<bool>& aInputsAreTainted,
49 nsIPrincipal* aReferencePrincipal) MOZ_OVERRIDE;
51 // nsIContent
52 NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
54 virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
56 virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
57 const nsAttrValue* aValue, bool aNotify) MOZ_OVERRIDE;
58 virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
59 nsIContent* aBindingParent,
60 bool aCompileEventHandlers) MOZ_OVERRIDE;
61 virtual void UnbindFromTree(bool aDeep, bool aNullParent) MOZ_OVERRIDE;
62 virtual EventStates IntrinsicState() const MOZ_OVERRIDE;
64 NS_IMETHODIMP Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData) MOZ_OVERRIDE;
66 void MaybeLoadSVGImage();
68 // WebIDL
69 already_AddRefed<SVGAnimatedString> Href();
70 already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
72 private:
73 // Invalidate users of the filter containing this element.
74 void Invalidate();
76 nsresult LoadSVGImage(bool aForce, bool aNotify);
78 protected:
79 virtual bool ProducesSRGB() MOZ_OVERRIDE { return true; }
81 virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio() MOZ_OVERRIDE;
82 virtual StringAttributesInfo GetStringInfo() MOZ_OVERRIDE;
84 enum { RESULT, HREF };
85 nsSVGString mStringAttributes[2];
86 static StringInfo sStringInfo[2];
88 SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
91 } // namespace dom
92 } // namespace mozilla
94 #endif