Bug 369753, remove nsIXMLContent, r+sr=bz

This commit is contained in:
Olli.Pettay%helsinki.fi 2007-02-09 00:15:14 +00:00
Родитель 2925d836e4
Коммит b4da895255
17 изменённых файлов: 40 добавлений и 41 удалений

Просмотреть файл

@ -59,11 +59,12 @@ class nsRuleWalker;
class nsAttrValue;
class nsAttrName;
class nsTextFragment;
class nsIDocShell;
// IID for the nsIContent interface
#define NS_ICONTENT_IID \
{ 0x43511041, 0xae82, 0x45aa, \
{ 0xb9, 0x48, 0xd6, 0x1d, 0x81, 0xc9, 0xc3, 0x25 } }
{ 0x53a5757c, 0xf602, 0x41ee, \
{ 0xac, 0x55, 0xfc, 0x3c, 0x89, 0x4e, 0xb8, 0x97 } }
// hack to make egcs / gcc 2.95.2 happy
@ -561,6 +562,26 @@ public:
*/
virtual PRBool IsLink(nsIURI** aURI) const = 0;
/**
* Give this element a chance to fire links that should be fired
* automatically when loaded. If the element was an autoloading link
* and it was successfully handled, we will throw special nsresult values.
*
* @param aShell the current doc shell (to possibly load the link on)
* @throws NS_OK if nothing happened
* @throws NS_XML_AUTOLINK_EMBED if the caller is loading the link embedded
* @throws NS_XML_AUTOLINK_NEW if the caller is loading the link in a new
* window
* @throws NS_XML_AUTOLINK_REPLACE if it is loading a link that will replace
* the current window (and thus the caller must stop parsing)
* @throws NS_XML_AUTOLINK_UNDEFINED if it is loading in any other way--in
* which case, the caller should stop parsing as well.
*/
virtual nsresult MaybeTriggerAutoLink(nsIDocShell *aShell)
{
return NS_OK;
}
/**
* This method is called when the parser finishes creating the element. This
* particularly means that it has done everything you would expect it to have

Просмотреть файл

@ -79,7 +79,6 @@
#include "nsIDocShell.h"
#include "nsIContent.h"
#include "nsIImageLoadingContent.h"
#include "nsIXMLContent.h"
#include "nsINameSpaceManager.h"
#include "nsUnicharUtils.h"
#include "nsIURL.h"

Просмотреть файл

@ -971,7 +971,7 @@ nsGenericElement::nsDOMSlots::~nsDOMSlots()
}
nsGenericElement::nsGenericElement(nsINodeInfo *aNodeInfo)
: nsIXMLContent(aNodeInfo)
: nsIContent(aNodeInfo)
{
// Set the default scriptID to JS - but skip SetScriptTypeID as it
// does extra work we know isn't necessary here...
@ -1940,12 +1940,6 @@ nsGenericElement::DispatchDOMEvent(nsEvent* aEvent,
aPresContext, aEventStatus);
}
NS_IMETHODIMP
nsGenericElement::MaybeTriggerAutoLink(nsIDocShell *aShell)
{
return NS_OK;
}
nsIAtom*
nsGenericElement::GetID() const
{

Просмотреть файл

@ -46,7 +46,7 @@
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsIXMLContent.h"
#include "nsIContent.h"
#include "nsIDOMElement.h"
#include "nsIDOMDocumentFragment.h"
#include "nsIDOMEventReceiver.h"
@ -368,7 +368,7 @@ private:
* A generic base class for DOM elements, implementing many nsIContent,
* nsIDOMNode and nsIDOMElement methods.
*/
class nsGenericElement : public nsIXMLContent
class nsGenericElement : public nsIContent
{
public:
nsGenericElement(nsINodeInfo *aNodeInfo);
@ -489,9 +489,6 @@ public:
const MappedAttributeEntry* const aMaps[],
PRUint32 aMapCount);
// nsIXMLContent interface methods
NS_IMETHOD MaybeTriggerAutoLink(nsIDocShell *aShell);
// nsIDOMNode method implementation
NS_IMETHOD GetNodeName(nsAString& aNodeName);
NS_IMETHOD GetLocalName(nsAString& aLocalName);

Просмотреть файл

@ -116,7 +116,6 @@ NS_IMPL_ADDREF_INHERITED(nsSVGElement,nsGenericElement)
NS_IMPL_RELEASE_INHERITED(nsSVGElement,nsGenericElement)
NS_INTERFACE_MAP_BEGIN(nsSVGElement)
NS_INTERFACE_MAP_ENTRY(nsIXMLContent)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
NS_INTERFACE_MAP_ENTRY(nsISVGContent)

Просмотреть файл

@ -58,7 +58,7 @@ class nsSVGCoordCtx;
class nsSVGLength2;
class nsSVGNumber2;
class nsSVGElement : public nsGenericElement, // :nsIXMLContent:nsIContent
class nsSVGElement : public nsGenericElement, // nsIContent
public nsISVGValueObserver,
public nsSupportsWeakReference, // :nsISupportsWeakReference
public nsISVGContent

Просмотреть файл

@ -42,7 +42,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src
DIRS = src
include $(topsrcdir)/config/rules.mk

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -81,8 +81,6 @@ nsXMLElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
inst = NS_STATIC_CAST(nsIDOMNode *, this);
} else if (aIID.Equals(NS_GET_IID(nsIDOMElement))) {
inst = NS_STATIC_CAST(nsIDOMElement *, this);
} else if (aIID.Equals(NS_GET_IID(nsIXMLContent))) {
inst = NS_STATIC_CAST(nsIXMLContent *, this);
} else if (aIID.Equals(NS_GET_IID(nsIClassInfo))) {
inst = nsContentUtils::GetClassInfoInstance(eDOMClassInfo_Element_id);
NS_ENSURE_TRUE(inst, NS_ERROR_OUT_OF_MEMORY);
@ -121,7 +119,7 @@ nsXMLElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
return PostHandleEventForLinks(aVisitor);
}
NS_IMETHODIMP
nsresult
nsXMLElement::MaybeTriggerAutoLink(nsIDocShell *aShell)
{
NS_ENSURE_ARG_POINTER(aShell);

Просмотреть файл

@ -40,7 +40,6 @@
#define nsXMLElement_h___
#include "nsIDOMElement.h"
#include "nsIXMLContent.h"
#include "nsGenericElement.h"
class nsIDocShell;
@ -64,11 +63,9 @@ public:
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
// nsIXMLContent
NS_IMETHOD MaybeTriggerAutoLink(nsIDocShell *aShell);
// nsIContent
virtual PRBool IsLink(nsIURI** aURI) const;
virtual nsresult MaybeTriggerAutoLink(nsIDocShell *aShell);
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull);
// nsGenericElement specializations

Просмотреть файл

@ -45,7 +45,7 @@
#include "nsIDOMDocumentType.h"
#include "nsIDOMDOMImplementation.h"
#include "nsIDOMNSDocument.h"
#include "nsIXMLContent.h"
#include "nsIContent.h"
#include "nsIURI.h"
#include "nsNetUtil.h"
#include "nsIDocShell.h"
@ -1433,15 +1433,12 @@ nsXMLContentSink::AddAttributes(const PRUnichar** aAtts,
// Give autoloading links a chance to fire
if (mDocShell && mAllowAutoXLinks) {
nsCOMPtr<nsIXMLContent> xmlcontent(do_QueryInterface(aContent));
if (xmlcontent) {
nsresult rv = xmlcontent->MaybeTriggerAutoLink(mDocShell);
if (rv == NS_XML_AUTOLINK_REPLACE ||
rv == NS_XML_AUTOLINK_UNDEFINED) {
// If we do not terminate the parse, we just keep generating link trigger
// events. We want to parse only up to the first replace link, and stop.
mParser->Terminate();
}
nsresult rv = aContent->MaybeTriggerAutoLink(mDocShell);
if (rv == NS_XML_AUTOLINK_REPLACE ||
rv == NS_XML_AUTOLINK_UNDEFINED) {
// If we do not terminate the parse, we just keep generating link trigger
// events. We want to parse only up to the first replace link, and stop.
mParser->Terminate();
}
}

Просмотреть файл

@ -40,7 +40,6 @@
#include "nsXMLDocument.h"
#include "nsParserCIID.h"
#include "nsIParser.h"
#include "nsIXMLContent.h"
#include "nsIXMLContentSink.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"

Просмотреть файл

@ -45,7 +45,7 @@
#include "nsIParser.h"
#include "nsIDocument.h"
#include "nsIDOMDocumentFragment.h"
#include "nsIXMLContent.h"
#include "nsIContent.h"
#include "nsGkAtoms.h"
#include "nsINodeInfo.h"
#include "nsNodeInfoManager.h"

Просмотреть файл

@ -48,7 +48,7 @@
#include "nsIParser.h"
#include "nsIRefreshURI.h"
#include "nsPIDOMWindow.h"
#include "nsIXMLContent.h"
#include "nsIContent.h"
#include "nsContentCID.h"
#include "nsNetUtil.h"
#include "nsUnicharUtils.h"

Просмотреть файл

@ -431,8 +431,6 @@ nsXULElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
inst = NS_STATIC_CAST(nsIDOMElement *, this);
} else if (aIID.Equals(NS_GET_IID(nsIDOMXULElement))) {
inst = NS_STATIC_CAST(nsIDOMXULElement *, this);
} else if (aIID.Equals(NS_GET_IID(nsIXMLContent))) {
inst = NS_STATIC_CAST(nsIXMLContent *, this);
} else if (aIID.Equals(NS_GET_IID(nsIScriptEventHandlerOwner))) {
inst = NS_STATIC_CAST(nsIScriptEventHandlerOwner*,
new nsXULElement::nsScriptEventHandlerOwnerTearoff(this));

Просмотреть файл

@ -44,7 +44,7 @@
#include "nsGkAtoms.h"
#include "nsILinkHandler.h"
#include "nsILink.h"
#include "nsIXMLContent.h"
#include "nsIContent.h"
#include "nsIDocument.h"
#include "nsINameSpaceManager.h"
#include "nsIURI.h"