mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1018658 - Convert XPathNSResolver to WebIDL bindings, remove nsIDOMXPathNSResolver. r=bz.
--HG-- extra : rebase_source : ea2b29ebafb830717bedee2ce80f46c92b270804
This commit is contained in:
parent
d4024294cf
commit
aa5bf14a5d
@ -23,7 +23,6 @@
|
||||
#include "nsAttrAndChildArray.h"
|
||||
#include "mozFlushType.h"
|
||||
#include "nsDOMAttributeMap.h"
|
||||
#include "nsIDOMXPathNSResolver.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "mozilla/CORSMode.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "nsAttrAndChildArray.h" // member
|
||||
#include "nsCycleCollectionParticipant.h" // NS_DECL_CYCLE_*
|
||||
#include "nsIContent.h" // base class
|
||||
#include "nsIDOMXPathNSResolver.h" // base class
|
||||
#include "nsINodeList.h" // base class
|
||||
#include "nsIWeakReference.h" // base class
|
||||
#include "nsNodeUtils.h" // class member nsNodeUtils::CloneNodeImpl
|
||||
@ -83,29 +82,6 @@ private:
|
||||
nsINode* mNode;
|
||||
};
|
||||
|
||||
/**
|
||||
* A tearoff class for FragmentOrElement to implement additional interfaces
|
||||
*/
|
||||
class nsNode3Tearoff : public nsIDOMXPathNSResolver
|
||||
{
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(nsNode3Tearoff)
|
||||
|
||||
NS_DECL_NSIDOMXPATHNSRESOLVER
|
||||
|
||||
explicit nsNode3Tearoff(nsINode *aNode) : mNode(aNode)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~nsNode3Tearoff() {}
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsINode> mNode;
|
||||
};
|
||||
|
||||
/**
|
||||
* A class that implements nsIWeakReference
|
||||
*/
|
||||
|
@ -50,7 +50,6 @@ class nsIDOMDocumentType;
|
||||
class nsIDOMElement;
|
||||
class nsIDOMNodeFilter;
|
||||
class nsIDOMNodeList;
|
||||
class nsIDOMXPathNSResolver;
|
||||
class nsIHTMLCollection;
|
||||
class nsILayoutHistoryState;
|
||||
class nsILoadContext;
|
||||
|
@ -106,8 +106,6 @@ NS_INTERFACE_TABLE_HEAD(Attr)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(Attr)
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsISupportsWeakReference,
|
||||
new nsNodeSupportsWeakRefTearoff(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMXPathNSResolver,
|
||||
new nsNode3Tearoff(this))
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(Attr)
|
||||
|
@ -448,23 +448,6 @@ nsChildContentList::IndexOf(nsIContent* aContent)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION(nsNode3Tearoff, mNode)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsNode3Tearoff)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMXPathNSResolver)
|
||||
NS_INTERFACE_MAP_END_AGGREGATED(mNode)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsNode3Tearoff)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsNode3Tearoff)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNode3Tearoff::LookupNamespaceURI(const nsAString& aNamespacePrefix,
|
||||
nsAString& aNamespaceURI)
|
||||
{
|
||||
mNode->LookupNamespaceURI(aNamespacePrefix, aNamespaceURI);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIHTMLCollection*
|
||||
FragmentOrElement::Children()
|
||||
{
|
||||
@ -1962,8 +1945,6 @@ NS_INTERFACE_MAP_BEGIN(FragmentOrElement)
|
||||
NS_INTERFACE_MAP_ENTRY(mozilla::dom::EventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsISupportsWeakReference,
|
||||
new nsNodeSupportsWeakRefTearoff(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMXPathNSResolver,
|
||||
new nsNode3Tearoff(this))
|
||||
// DOM bindings depend on the identity pointer being the
|
||||
// same as nsINode (which nsIContent inherits).
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContent)
|
||||
|
@ -99,7 +99,6 @@
|
||||
|
||||
#include "nsBidiUtils.h"
|
||||
|
||||
#include "nsIDOMXPathNSResolver.h"
|
||||
#include "nsIParserService.h"
|
||||
#include "nsContentCreatorFunctions.h"
|
||||
|
||||
@ -1779,8 +1778,6 @@ NS_INTERFACE_TABLE_HEAD(nsDocument)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMXPathEvaluator)
|
||||
NS_INTERFACE_TABLE_END
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsDocument)
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMXPathNSResolver,
|
||||
new nsNode3Tearoff(this))
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
|
@ -50,7 +50,6 @@
|
||||
#include "nsAttrAndChildArray.h"
|
||||
#include "nsDOMAttributeMap.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsIDOMXPathNSResolver.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsILoadContext.h"
|
||||
#include "nsIProgressEventSink.h"
|
||||
|
@ -130,8 +130,6 @@ NS_INTERFACE_MAP_BEGIN(nsGenericDOMDataNode)
|
||||
NS_INTERFACE_MAP_ENTRY(mozilla::dom::EventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsISupportsWeakReference,
|
||||
new nsNodeSupportsWeakRefTearoff(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMXPathNSResolver,
|
||||
new nsNode3Tearoff(this))
|
||||
// DOM bindings depend on the identity pointer being the
|
||||
// same as nsINode (which nsIContent inherits).
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContent)
|
||||
|
@ -91,7 +91,6 @@
|
||||
#include "nsITreeView.h"
|
||||
#include "nsIXULTemplateBuilder.h"
|
||||
#endif
|
||||
#include "nsIDOMXPathNSResolver.h"
|
||||
|
||||
#include "nsIEventListenerService.h"
|
||||
#include "nsIMessageManager.h"
|
||||
@ -247,9 +246,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSSupportsRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(XPathNSResolver, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(MozSmsMessage, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
@ -694,10 +690,6 @@ nsDOMClassInfo::Init()
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSSupportsRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(XPathNSResolver, nsIDOMXPathNSResolver)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathNSResolver)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(MozSmsMessage, nsIDOMMozSmsMessage)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozSmsMessage)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
@ -32,9 +32,6 @@ DOMCI_CLASS(XULTreeBuilder)
|
||||
DOMCI_CLASS(CSSMozDocumentRule)
|
||||
DOMCI_CLASS(CSSSupportsRule)
|
||||
|
||||
// DOM Level 3 XPath objects
|
||||
DOMCI_CLASS(XPathNSResolver)
|
||||
|
||||
DOMCI_CLASS(MozSmsMessage)
|
||||
DOMCI_CLASS(MozMmsMessage)
|
||||
DOMCI_CLASS(MozMobileMessageThread)
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMXPathEvaluator.idl',
|
||||
'nsIDOMXPathNSResolver.idl',
|
||||
'nsIDOMXPathResult.idl',
|
||||
]
|
||||
|
||||
|
@ -1,16 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/**
|
||||
* Corresponds to http://www.w3.org/TR/2002/WD-DOM-Level-3-XPath-20020208
|
||||
*/
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
[scriptable, function, uuid(75506f83-b504-11d5-a7f2-ca108ab8b6fc)]
|
||||
interface nsIDOMXPathNSResolver : nsISupports
|
||||
{
|
||||
DOMString lookupNamespaceURI(in DOMString prefix);
|
||||
};
|
@ -8,7 +8,6 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "mozilla/dom/XPathExpression.h"
|
||||
#include "nsXPathNSResolver.h"
|
||||
#include "XPathResult.h"
|
||||
#include "nsContentCID.h"
|
||||
#include "txExpr.h"
|
||||
|
@ -11,7 +11,6 @@ EXPORTS.mozilla.dom += [
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'nsXPathNSResolver.cpp',
|
||||
'txBooleanExpr.cpp',
|
||||
'txBooleanResult.cpp',
|
||||
'txCoreFunctionCall.cpp',
|
||||
|
@ -1,44 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsXPathNSResolver.h"
|
||||
#include "nsDOMClassInfoID.h"
|
||||
#include "nsDOMString.h"
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION(nsXPathNSResolver, mNode)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsXPathNSResolver)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsXPathNSResolver)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsXPathNSResolver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMXPathNSResolver)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMXPathNSResolver)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(XPathNSResolver)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
nsXPathNSResolver::nsXPathNSResolver(nsIDOMNode* aNode)
|
||||
: mNode(aNode)
|
||||
{
|
||||
NS_ASSERTION(mNode, "Need a node to resolve namespaces.");
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXPathNSResolver::LookupNamespaceURI(const nsAString & aPrefix,
|
||||
nsAString & aResult)
|
||||
{
|
||||
if (aPrefix.EqualsLiteral("xml")) {
|
||||
aResult.AssignLiteral("http://www.w3.org/XML/1998/namespace");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!mNode) {
|
||||
SetDOMStringToNull(aResult);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return mNode->LookupNamespaceURI(aPrefix, aResult);
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef nsXPathNSResolver_h__
|
||||
#define nsXPathNSResolver_h__
|
||||
|
||||
#include "nsIDOMXPathNSResolver.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
/**
|
||||
* A class for evaluating an XPath expression string
|
||||
*/
|
||||
class nsXPathNSResolver MOZ_FINAL : public nsIDOMXPathNSResolver
|
||||
{
|
||||
~nsXPathNSResolver() {}
|
||||
|
||||
public:
|
||||
explicit nsXPathNSResolver(nsIDOMNode* aNode);
|
||||
|
||||
// nsISupports interface
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(nsXPathNSResolver)
|
||||
|
||||
// nsIDOMXPathNSResolver interface
|
||||
NS_DECL_NSIDOMXPATHNSRESOLVER
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIDOMNode> mNode;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user