зеркало из https://github.com/mozilla/gecko-dev.git
210451 - Implement getting Node.textContent (see the DOM3 WD)
r+sr=jst@netscape.com
This commit is contained in:
Родитель
04e84a9763
Коммит
fd98991136
|
@ -647,15 +647,78 @@ nsDOMAttribute::IsSameNode(nsIDOMNode* aOther,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::LookupNamespacePrefix(const nsAString& aNamespaceURI,
|
||||
nsDOMAttribute::IsEqualNode(nsIDOMNode* aOther,
|
||||
PRBool* aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocument::IsEqualNode()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::IsDefaultNamespace(const nsAString& aNamespaceURI,
|
||||
PRBool* aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDOMAttribute::IsDefaultNamespace()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::GetTextContent(nsAString &aTextContent)
|
||||
{
|
||||
return GetNodeValue(aTextContent);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::SetTextContent(const nsAString& aTextContent)
|
||||
{
|
||||
return SetNodeValue(aTextContent);
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::GetFeature(const nsAString& aFeature,
|
||||
const nsAString& aVersion,
|
||||
nsISupports** aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocument::GetFeature()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::SetUserData(const nsAString& aKey,
|
||||
nsIVariant* aData,
|
||||
nsIDOMUserDataHandler* aHandler,
|
||||
nsIVariant** aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocument::SetUserData()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::GetUserData(const nsAString& aKey,
|
||||
nsIVariant** aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocument::GetUserData()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::LookupPrefix(const nsAString& aNamespaceURI,
|
||||
nsAString& aPrefix)
|
||||
{
|
||||
aPrefix.Truncate();
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
nsCOMPtr<nsIDOM3Node> node(do_QueryInterface(mContent));
|
||||
if (node)
|
||||
rv = node->LookupNamespacePrefix(aNamespaceURI, aPrefix);
|
||||
return rv;
|
||||
if (node) {
|
||||
return node->LookupPrefix(aNamespaceURI, aPrefix);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -3413,6 +3413,21 @@ nsDocument::GetBaseURI(nsAString &aURI)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::GetTextContent(nsAString &aTextContent)
|
||||
{
|
||||
SetDOMStringToNull(aTextContent);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::SetTextContent(const nsAString& aTextContent)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::CompareDocumentPosition(nsIDOMNode* aOther, PRUint16* aReturn)
|
||||
{
|
||||
|
@ -3500,7 +3515,55 @@ nsDocument::IsSameNode(nsIDOMNode* aOther, PRBool* aReturn)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::LookupNamespacePrefix(const nsAString& aNamespaceURI,
|
||||
nsDocument::IsEqualNode(nsIDOMNode* aOther, PRBool* aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocument::IsEqualNode()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::IsDefaultNamespace(const nsAString& aNamespaceURI,
|
||||
PRBool* aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocument::IsDefaultNamespace()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::GetFeature(const nsAString& aFeature,
|
||||
const nsAString& aVersion,
|
||||
nsISupports** aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocument::GetFeature()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::SetUserData(const nsAString& aKey,
|
||||
nsIVariant* aData,
|
||||
nsIDOMUserDataHandler* aHandler,
|
||||
nsIVariant** aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocument::SetUserData()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::GetUserData(const nsAString& aKey,
|
||||
nsIVariant** aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocument::GetUserData()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::LookupPrefix(const nsAString& aNamespaceURI,
|
||||
nsAString& aPrefix)
|
||||
{
|
||||
aPrefix.Truncate();
|
||||
|
|
|
@ -124,19 +124,7 @@ public:
|
|||
aReturn); }
|
||||
|
||||
// nsIDOM3Node
|
||||
NS_IMETHOD GetBaseURI(nsAString& aURI)
|
||||
{ aURI.Truncate(); return NS_OK; }
|
||||
NS_IMETHOD CompareDocumentPosition(nsIDOMNode *aOther,
|
||||
PRUint16* aReturn);
|
||||
NS_IMETHOD IsSameNode(nsIDOMNode *aOther, PRBool* aReturn);
|
||||
NS_IMETHOD LookupNamespacePrefix(const nsAString& aNamespaceURI,
|
||||
nsAString& aPrefix) {
|
||||
aPrefix.Truncate(); return NS_OK;
|
||||
}
|
||||
NS_IMETHOD LookupNamespaceURI(const nsAString& aNamespacePrefix,
|
||||
nsAString& aNamespaceURI) {
|
||||
aNamespaceURI.Truncate(); return NS_OK;
|
||||
}
|
||||
NS_DECL_NSIDOM3NODE
|
||||
|
||||
// nsIContent
|
||||
NS_IMETHOD SetParent(nsIContent* aParent)
|
||||
|
@ -386,6 +374,41 @@ nsDocumentFragment::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
return CallQueryInterface(newFragment, aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentFragment::GetBaseURI(nsAString& aURI)
|
||||
{
|
||||
aURI.Truncate();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentFragment::LookupPrefix(const nsAString& aNamespaceURI,
|
||||
nsAString& aPrefix)
|
||||
{
|
||||
aPrefix.Truncate();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentFragment::LookupNamespaceURI(const nsAString& aNamespacePrefix,
|
||||
nsAString& aNamespaceURI)
|
||||
{
|
||||
aNamespaceURI.Truncate();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentFragment::IsDefaultNamespace(const nsAString& aNamespaceURI,
|
||||
PRBool* aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocumentFragment::IsDefaultNamespace()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentFragment::CompareDocumentPosition(nsIDOMNode* aOther,
|
||||
PRUint16* aReturn)
|
||||
|
@ -455,3 +478,61 @@ nsDocumentFragment::IsSameNode(nsIDOMNode* aOther,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentFragment::IsEqualNode(nsIDOMNode* aOther, PRBool* aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocumentFragment::IsEqualNode()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentFragment::GetFeature(const nsAString& aFeature,
|
||||
const nsAString& aVersion,
|
||||
nsISupports** aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocumentFragment::GetFeature()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentFragment::SetUserData(const nsAString& aKey,
|
||||
nsIVariant* aData,
|
||||
nsIDOMUserDataHandler* aHandler,
|
||||
nsIVariant** aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocumentFragment::SetUserData()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentFragment::GetUserData(const nsAString& aKey,
|
||||
nsIVariant** aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsDocumentFragment::GetUserData()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentFragment::GetTextContent(nsAString &aTextContent)
|
||||
{
|
||||
if (mOwnerDocument) {
|
||||
return nsNode3Tearoff::GetTextContent(mOwnerDocument,
|
||||
this,
|
||||
aTextContent);
|
||||
}
|
||||
|
||||
SetDOMStringToNull(aTextContent);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentFragment::SetTextContent(const nsAString& aTextContent)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -309,7 +309,7 @@ nsGenericDOMDataNode::GetBaseURI(nsAString& aURI)
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsGenericDOMDataNode::LookupNamespacePrefix(const nsAString& aNamespaceURI,
|
||||
nsGenericDOMDataNode::LookupPrefix(const nsAString& aNamespaceURI,
|
||||
nsAString& aPrefix)
|
||||
{
|
||||
aPrefix.Truncate();
|
||||
|
@ -318,9 +318,8 @@ nsGenericDOMDataNode::LookupNamespacePrefix(const nsAString& aNamespaceURI,
|
|||
|
||||
// DOM Data Node passes the query on to its parent
|
||||
nsCOMPtr<nsIDOM3Node> node(do_QueryInterface(parent_weak));
|
||||
|
||||
if (node) {
|
||||
return node->LookupNamespacePrefix(aNamespaceURI, aPrefix);
|
||||
return node->LookupPrefix(aNamespaceURI, aPrefix);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -150,7 +150,7 @@ public:
|
|||
const nsAString& aVersion,
|
||||
PRBool* aReturn);
|
||||
nsresult GetBaseURI(nsAString& aURI);
|
||||
nsresult LookupNamespacePrefix(const nsAString& aNamespaceURI,
|
||||
nsresult LookupPrefix(const nsAString& aNamespaceURI,
|
||||
nsAString& aPrefix);
|
||||
nsresult LookupNamespaceURI(const nsAString& aNamespacePrefix,
|
||||
nsAString& aNamespaceURI);
|
||||
|
@ -392,9 +392,9 @@ private:
|
|||
NS_IMETHOD GetBaseURI(nsAString& aURI) { \
|
||||
return nsGenericDOMDataNode::GetBaseURI(aURI); \
|
||||
} \
|
||||
NS_IMETHOD LookupNamespacePrefix(const nsAString& aNamespaceURI, \
|
||||
NS_IMETHOD LookupPrefix(const nsAString& aNamespaceURI, \
|
||||
nsAString& aPrefix) { \
|
||||
return nsGenericDOMDataNode::LookupNamespacePrefix(aNamespaceURI, \
|
||||
return nsGenericDOMDataNode::LookupPrefix(aNamespaceURI, \
|
||||
aPrefix); \
|
||||
} \
|
||||
NS_IMETHOD LookupNamespaceURI(const nsAString& aNamespacePrefix, \
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "nsIAtom.h"
|
||||
#include "nsINodeInfo.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMRange.h"
|
||||
|
@ -234,6 +235,71 @@ nsNode3Tearoff::GetBaseURI(nsAString& aURI)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNode3Tearoff::GetTextContent(nsAString &aTextContent)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(mContent));
|
||||
NS_ASSERTION(node, "We have an nsIContent which doesn't support nsIDOMNode");
|
||||
|
||||
PRUint16 nodeType;
|
||||
node->GetNodeType(&nodeType);
|
||||
if (nodeType == nsIDOMNode::DOCUMENT_TYPE_NODE ||
|
||||
nodeType == nsIDOMNode::NOTATION_NODE) {
|
||||
SetDOMStringToNull(aTextContent);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (nodeType == nsIDOMNode::TEXT_NODE ||
|
||||
nodeType == nsIDOMNode::CDATA_SECTION_NODE ||
|
||||
nodeType == nsIDOMNode::COMMENT_NODE ||
|
||||
nodeType == nsIDOMNode::PROCESSING_INSTRUCTION_NODE) {
|
||||
return node->GetNodeValue(aTextContent);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
mContent->GetDocument(getter_AddRefs(doc));
|
||||
if (!doc) {
|
||||
NS_ERROR("Need a document to do text serialization");
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
return GetTextContent(doc, node, aTextContent);
|
||||
}
|
||||
|
||||
// static
|
||||
nsresult
|
||||
nsNode3Tearoff::GetTextContent(nsIDocument *aDocument,
|
||||
nsIDOMNode *aNode,
|
||||
nsAString &aTextContent)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocument);
|
||||
NS_ENSURE_ARG_POINTER(aNode);
|
||||
|
||||
nsCOMPtr<nsIDocumentEncoder> docEncoder =
|
||||
do_CreateInstance(NS_DOC_ENCODER_CONTRACTID_BASE "text/plain");
|
||||
|
||||
if (!docEncoder) {
|
||||
NS_ERROR("Could not get a document encoder.");
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
docEncoder->Init(aDocument, NS_LITERAL_STRING("text/plain"),
|
||||
nsIDocumentEncoder::OutputRaw);
|
||||
|
||||
docEncoder->SetNode(aNode);
|
||||
|
||||
return docEncoder->EncodeToString(aTextContent);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNode3Tearoff::SetTextContent(const nsAString &aTextContent)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNode3Tearoff::CompareDocumentPosition(nsIDOMNode* aOther,
|
||||
PRUint16* aReturn)
|
||||
|
@ -310,7 +376,45 @@ nsNode3Tearoff::IsSameNode(nsIDOMNode* aOther,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNode3Tearoff::LookupNamespacePrefix(const nsAString& aNamespaceURI,
|
||||
nsNode3Tearoff::IsEqualNode(nsIDOMNode* aOther, PRBool* aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsNode3Tearoff::IsEqualNode()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNode3Tearoff::GetFeature(const nsAString& aFeature,
|
||||
const nsAString& aVersion,
|
||||
nsISupports** aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsNode3Tearoff::GetFeature()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNode3Tearoff::SetUserData(const nsAString& aKey,
|
||||
nsIVariant* aData,
|
||||
nsIDOMUserDataHandler* aHandler,
|
||||
nsIVariant** aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsNode3Tearoff::SetUserData()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNode3Tearoff::GetUserData(const nsAString& aKey,
|
||||
nsIVariant** aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsNode3Tearoff::GetUserData()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNode3Tearoff::LookupPrefix(const nsAString& aNamespaceURI,
|
||||
nsAString& aPrefix)
|
||||
{
|
||||
SetDOMStringToNull(aPrefix);
|
||||
|
@ -395,6 +499,14 @@ nsNode3Tearoff::LookupNamespaceURI(const nsAString& aNamespacePrefix,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNode3Tearoff::IsDefaultNamespace(const nsAString& aNamespaceURI,
|
||||
PRBool* aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsNode3Tearoff::IsDefaultNamespace()");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
nsDOMEventRTTearoff *
|
||||
nsDOMEventRTTearoff::mCachedEventTearoff[NS_EVENT_TEAROFF_CACHE_SIZE];
|
||||
|
|
|
@ -230,6 +230,7 @@ public:
|
|||
*/
|
||||
class nsNode3Tearoff : public nsIDOM3Node
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_DECL_NSIDOM3NODE
|
||||
|
@ -237,6 +238,12 @@ class nsNode3Tearoff : public nsIDOM3Node
|
|||
nsNode3Tearoff(nsIContent *aContent) : mContent(aContent)
|
||||
{
|
||||
}
|
||||
|
||||
static nsresult GetTextContent(nsIDocument *aDoc,
|
||||
nsIDOMNode *aNode,
|
||||
nsAString &aTextContent);
|
||||
|
||||
protected:
|
||||
virtual ~nsNode3Tearoff() {};
|
||||
|
||||
private:
|
||||
|
|
|
@ -1871,42 +1871,9 @@ nsHTMLDocument::GetBaseURI(nsAString &aURI)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocument::CompareDocumentPosition(nsIDOMNode* aOther,
|
||||
PRUint16* aReturn)
|
||||
{
|
||||
return nsDocument::CompareDocumentPosition(aOther, aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocument::IsSameNode(nsIDOMNode* aOther,
|
||||
PRBool* aReturn)
|
||||
{
|
||||
return nsDocument::IsSameNode(aOther, aReturn);
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocument::LookupNamespacePrefix(const nsAString& aNamespaceURI,
|
||||
nsAString& aPrefix)
|
||||
{
|
||||
return nsDocument::LookupNamespacePrefix(aNamespaceURI, aPrefix);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocument::LookupNamespaceURI(const nsAString& aNamespacePrefix,
|
||||
nsAString& aNamespaceURI)
|
||||
{
|
||||
return nsDocument::LookupNamespaceURI(aNamespacePrefix, aNamespaceURI);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// nsIDOMHTMLDocument interface implementation
|
||||
//
|
||||
// see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html#ID-1006298752
|
||||
// for full specification.
|
||||
//
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocument::GetTitle(nsAString& aTitle)
|
||||
{
|
||||
|
|
|
@ -163,7 +163,7 @@ public:
|
|||
NS_DECL_NSIDOMNODE
|
||||
|
||||
// nsIDOM3Node interface
|
||||
NS_DECL_NSIDOM3NODE
|
||||
NS_IMETHOD GetBaseURI(nsAString& aBaseURI);
|
||||
|
||||
// nsIDOMHTMLDocument interface
|
||||
NS_IMETHOD GetTitle(nsAString & aTitle);
|
||||
|
|
|
@ -193,7 +193,6 @@ nsXULAttribute::Create(nsIContent* aContent,
|
|||
NS_INTERFACE_MAP_BEGIN(nsXULAttribute)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMAttr)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNode)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOM3Node)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMAttr)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(XULAttr)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
@ -391,49 +390,6 @@ nsXULAttribute::IsSupported(const nsAString& aFeature,
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
// nsIDOM3Node interface
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULAttribute::GetBaseURI(nsAString &aURI)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULAttribute::CompareDocumentPosition(nsIDOMNode* aOther,
|
||||
PRUint16* aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULAttribute::IsSameNode(nsIDOMNode* aOther,
|
||||
PRBool* aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULAttribute::LookupNamespacePrefix(const nsAString& aNamespaceURI,
|
||||
nsAString& aPrefix)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULAttribute::LookupNamespaceURI(const nsAString& aNamespacePrefix,
|
||||
nsAString& aNamespaceURI)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
// nsIDOMAttr interface
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
#include "nsIAtom.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsXULAttributeValue.h"
|
||||
#include "nsIDOM3Node.h"
|
||||
|
||||
class nsIURI;
|
||||
class nsINodeInfo;
|
||||
|
@ -111,8 +110,7 @@ public:
|
|||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class nsXULAttribute : public nsIDOMAttr,
|
||||
public nsIDOM3Node
|
||||
class nsXULAttribute : public nsIDOMAttr
|
||||
{
|
||||
protected:
|
||||
nsXULAttribute(nsIContent* aContent,
|
||||
|
@ -134,9 +132,6 @@ public:
|
|||
// nsIDOMNode interface
|
||||
NS_DECL_NSIDOMNODE
|
||||
|
||||
// nsIDOM3Node interface
|
||||
NS_DECL_NSIDOM3NODE
|
||||
|
||||
// nsIDOMAttr interface
|
||||
NS_DECL_NSIDOMATTR
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ XPIDLSRCS = \
|
|||
nsIDOM3Node.idl \
|
||||
nsIDOMNSDocument.idl \
|
||||
nsIDOMXMLDocument.idl \
|
||||
nsIDOMUserDataHandler.idl \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -40,14 +40,15 @@
|
|||
|
||||
#include "domstubs.idl"
|
||||
|
||||
interface nsIVariant;
|
||||
interface nsIDOMUserDataHandler;
|
||||
|
||||
|
||||
[scriptable, uuid(29fb2a18-1dd2-11b2-8dd9-a6fd5d5ad12f)]
|
||||
interface nsIDOM3Node : nsISupports
|
||||
{
|
||||
// Introduced in DOM Level 3:
|
||||
readonly attribute DOMString baseURI;
|
||||
unsigned short compareDocumentPosition(in nsIDOMNode other);
|
||||
boolean isSameNode(in nsIDOMNode other);
|
||||
DOMString lookupNamespacePrefix(in DOMString namespaceURI);
|
||||
DOMString lookupNamespaceURI(in DOMString prefix);
|
||||
|
||||
// DocumentPosition
|
||||
const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
|
||||
|
@ -56,4 +57,32 @@ interface nsIDOM3Node : nsISupports
|
|||
const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
|
||||
const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
|
||||
const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
|
||||
|
||||
// Introduced in DOM Level 3:
|
||||
unsigned short compareDocumentPosition(in nsIDOMNode other)
|
||||
raises(DOMException);
|
||||
// Introduced in DOM Level 3:
|
||||
attribute DOMString textContent;
|
||||
// raises(DOMException) on setting
|
||||
// raises(DOMException) on retrieval
|
||||
|
||||
// Introduced in DOM Level 3:
|
||||
boolean isSameNode(in nsIDOMNode other);
|
||||
// Introduced in DOM Level 3:
|
||||
DOMString lookupPrefix(in DOMString namespaceURI);
|
||||
// Introduced in DOM Level 3:
|
||||
boolean isDefaultNamespace(in DOMString namespaceURI);
|
||||
// Introduced in DOM Level 3:
|
||||
DOMString lookupNamespaceURI(in DOMString prefix);
|
||||
// Introduced in DOM Level 3:
|
||||
boolean isEqualNode(in nsIDOMNode arg);
|
||||
// Introduced in DOM Level 3:
|
||||
nsISupports getFeature(in DOMString feature,
|
||||
in DOMString version);
|
||||
// Introduced in DOM Level 3:
|
||||
nsIVariant setUserData(in DOMString key,
|
||||
in nsIVariant data,
|
||||
in nsIDOMUserDataHandler handler);
|
||||
// Introduced in DOM Level 3:
|
||||
nsIVariant getUserData(in DOMString key);
|
||||
};
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org Code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Christopher A. Aillon <christopher@aillon.com> (Original Author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "domstubs.idl"
|
||||
#include "nsIVariant.idl"
|
||||
|
||||
|
||||
// Introduced in DOM Level 3:
|
||||
|
||||
[scriptable, function, uuid(5470deff-03c9-41b7-a824-e3225266b343)]
|
||||
interface nsIDOMUserDataHandler
|
||||
{
|
||||
// OperationType
|
||||
const unsigned short NODE_CLONED = 1;
|
||||
const unsigned short NODE_IMPORTED = 2;
|
||||
const unsigned short NODE_DELETED = 3;
|
||||
const unsigned short NODE_RENAMED = 4;
|
||||
|
||||
void handle(in unsigned short operation,
|
||||
in DOMString key,
|
||||
in nsIVariant data,
|
||||
in nsIDOMNode src,
|
||||
in nsIDOMNode dst);
|
||||
};
|
Загрузка…
Ссылка в новой задаче