Bumping manifests a=b2g-bump
[gecko.git] / dom / xml / ProcessingInstruction.h
blob6448bd46b08ee8480a4896ae564841070732ea11
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_ProcessingInstruction_h
7 #define mozilla_dom_ProcessingInstruction_h
9 #include "mozilla/Attributes.h"
10 #include "nsIDOMProcessingInstruction.h"
11 #include "nsGenericDOMDataNode.h"
12 #include "nsAString.h"
14 namespace mozilla {
15 namespace dom {
17 class ProcessingInstruction : public nsGenericDOMDataNode,
18 public nsIDOMProcessingInstruction
20 public:
21 ProcessingInstruction(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
22 const nsAString& aData);
24 // nsISupports
25 NS_DECL_ISUPPORTS_INHERITED
27 // nsIDOMNode
28 NS_FORWARD_NSIDOMNODE_TO_NSINODE
30 // nsIDOMCharacterData
31 NS_FORWARD_NSIDOMCHARACTERDATA(nsGenericDOMDataNode::)
32 using nsGenericDOMDataNode::SetData; // Prevent hiding overloaded virtual function.
34 // nsIDOMProcessingInstruction
35 NS_DECL_NSIDOMPROCESSINGINSTRUCTION
37 // nsINode
38 virtual bool IsNodeOfType(uint32_t aFlags) const;
40 virtual nsGenericDOMDataNode* CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
41 bool aCloneText) const MOZ_OVERRIDE;
43 #ifdef DEBUG
44 virtual void List(FILE* out, int32_t aIndent) const MOZ_OVERRIDE;
45 virtual void DumpContent(FILE* out, int32_t aIndent, bool aDumpAll) const MOZ_OVERRIDE;
46 #endif
48 virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
50 // WebIDL API
51 void GetTarget(nsString& aTarget)
53 aTarget = NodeName();
55 protected:
56 virtual ~ProcessingInstruction();
58 /**
59 * This will parse the content of the PI, to extract the value of the pseudo
60 * attribute with the name specified in aName. See
61 * http://www.w3.org/TR/xml-stylesheet/#NT-StyleSheetPI for the specification
62 * which is used to parse the content of the PI.
64 * @param aName the name of the attribute to get the value for
65 * @param aValue [out] the value for the attribute with name specified in
66 * aAttribute. Empty if the attribute isn't present.
68 bool GetAttrValue(nsIAtom *aName, nsAString& aValue);
70 virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE;
73 } // namespace dom
74 } // namespace mozilla
76 /**
77 * aNodeInfoManager must not be null.
79 already_AddRefed<mozilla::dom::ProcessingInstruction>
80 NS_NewXMLProcessingInstruction(nsNodeInfoManager *aNodeInfoManager,
81 const nsAString& aTarget,
82 const nsAString& aData);
84 #endif // mozilla_dom_ProcessingInstruction_h