Make nsXULElement inherit directly from nsXMLElement and remove dead internal code ((Get|Set)NameSpacePrefix from nsIXMLContent.h, nsIXULContent.h, nsXMLElement.h, nsGenericXMLElement.(h|cpp) and nsXULElement.(h|cpp). Hints & tips by jst (thanks!), r=jst, a=brendan.

This commit is contained in:
disttsc%bart.nl 2000-09-06 20:39:29 +00:00
parent 2b709b2b57
commit 3c25610d65
12 changed files with 18 additions and 100 deletions

View File

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Peter Annema <disttsc@bart.nl>
*/
#ifndef nsIXMLContent_h___
@ -44,9 +45,6 @@ public:
NS_IMETHOD SetContainingNameSpace(nsINameSpace* aNameSpace) = 0;
NS_IMETHOD GetContainingNameSpace(nsINameSpace*& aNameSpace) const = 0;
NS_IMETHOD SetNameSpacePrefix(nsIAtom* aNameSpace) = 0;
NS_IMETHOD GetNameSpacePrefix(nsIAtom*& aNameSpace) const = 0;
/**
* Give this element a change to fire its links that should be fired
* automatically when loaded. If the element was an autoloading link

View File

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Peter Annema <disttsc@bart.nl>
*/
#ifndef nsXMLElement_h___
@ -213,12 +214,6 @@ public:
NS_IMETHOD GetContainingNameSpace(nsINameSpace*& aNameSpace) const {
return mInner.GetContainingNameSpace(aNameSpace);
}
NS_IMETHOD SetNameSpacePrefix(nsIAtom* aNameSpace) {
return mInner.SetNameSpacePrefix(aNameSpace);
}
NS_IMETHOD GetNameSpacePrefix(nsIAtom*& aNameSpace) const {
return mInner.GetNameSpacePrefix(aNameSpace);
}
NS_IMETHOD MaybeTriggerAutoLink(nsIWebShell *aShell);
// nsIStyledContent

View File

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Peter Annema <disttsc@bart.nl>
*/
/*
@ -29,7 +30,7 @@
#ifndef nsIXULContent_h__
#define nsIXULContent_h__
#include "nsISupports.h"
#include "nsIXMLContent.h"
class nsIAtom;
class nsIRDFCompositeDataSource;
class nsIXULTemplateBuilder;
@ -40,7 +41,7 @@ class nsString;
{ 0x39c5ecc0, 0x5c47, 0x11d3, { 0xbe, 0x36, 0x0, 0x10, 0x4b, 0xde, 0x60, 0x48 } }
class nsIXULContent : public nsISupports
class nsIXULContent : public nsIXMLContent
{
public:
static const nsIID& GetIID() { static nsIID iid = NS_IXULCONTENT_IID; return iid; }

View File

@ -22,6 +22,7 @@
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
* Peter Annema <disttsc@bart.nl>
*
*
* This Original Code has been modified by IBM Corporation.
@ -91,7 +92,6 @@
#include "nsIStyledContent.h"
#include "nsISupportsArray.h"
#include "nsIURL.h"
#include "nsIXMLContent.h"
#include "nsIXULContent.h"
#include "nsIXULContentUtils.h"
#include "nsIXULDocument.h"
@ -1605,28 +1605,6 @@ nsXULElement::GetContainingNameSpace(nsINameSpace*& aNameSpace) const
return NS_OK;
}
NS_IMETHODIMP
nsXULElement::SetNameSpacePrefix(nsIAtom* aNameSpacePrefix)
{
nsresult rv;
rv = EnsureSlots();
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsINodeInfo> newNodeInfo;
mSlots->mNodeInfo->PrefixChanged(aNameSpacePrefix,
*getter_AddRefs(newNodeInfo));
mSlots->mNodeInfo = newNodeInfo;
return NS_OK;
}
NS_IMETHODIMP
nsXULElement::GetNameSpacePrefix(nsIAtom*& aNameSpacePrefix) const
{
return NodeInfo()->GetPrefixAtom(aNameSpacePrefix);
}
NS_IMETHODIMP
nsXULElement::MaybeTriggerAutoLink(nsIWebShell *aShell)
{

View File

@ -21,6 +21,7 @@
* Chris Waterson <waterson@netscape.com>
*
* Contributor(s):
* Peter Annema <disttsc@bart.nl>
*/
/*
@ -56,7 +57,6 @@
#include "nsIBindingManager.h"
#include "nsIXBLBinding.h"
#include "nsIURI.h"
#include "nsIXMLContent.h"
#include "nsIXULContent.h"
#include "nsIBoxObject.h"
#include "nsXULAttributes.h"
@ -311,8 +311,7 @@ public:
*/
class nsXULElement : public nsIXMLContent,
public nsIXULContent,
class nsXULElement : public nsIXULContent,
public nsIDOMXULElement,
public nsIDOMEventReceiver,
public nsIScriptEventHandlerOwner,
@ -393,8 +392,6 @@ public:
// nsIXMLContent
NS_IMETHOD SetContainingNameSpace(nsINameSpace* aNameSpace);
NS_IMETHOD GetContainingNameSpace(nsINameSpace*& aNameSpace) const;
NS_IMETHOD SetNameSpacePrefix(nsIAtom* aNameSpace);
NS_IMETHOD GetNameSpacePrefix(nsIAtom*& aNameSpace) const;
NS_IMETHOD MaybeTriggerAutoLink(nsIWebShell *aShell);
// nsIStyledContent

View File

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Peter Annema <disttsc@bart.nl>
*/
#ifndef nsIXMLContent_h___
@ -44,9 +45,6 @@ public:
NS_IMETHOD SetContainingNameSpace(nsINameSpace* aNameSpace) = 0;
NS_IMETHOD GetContainingNameSpace(nsINameSpace*& aNameSpace) const = 0;
NS_IMETHOD SetNameSpacePrefix(nsIAtom* aNameSpace) = 0;
NS_IMETHOD GetNameSpacePrefix(nsIAtom*& aNameSpace) const = 0;
/**
* Give this element a change to fire its links that should be fired
* automatically when loaded. If the element was an autoloading link

View File

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Peter Annema <disttsc@bart.nl>
*/
#include "nsGenericXMLElement.h"
@ -175,26 +176,6 @@ nsGenericXMLElement::GetScriptObject(nsIScriptContext* aContext,
return res;
}
nsresult
nsGenericXMLElement::SetNameSpacePrefix(nsIAtom* aNameSpacePrefix)
{
nsINodeInfo *newNodeInfo;
nsresult rv = mNodeInfo->PrefixChanged(aNameSpacePrefix, newNodeInfo);
NS_ENSURE_SUCCESS(rv, rv);
NS_RELEASE(mNodeInfo);
mNodeInfo = newNodeInfo;
return NS_OK;
}
nsresult
nsGenericXMLElement::GetNameSpacePrefix(nsIAtom*& aNameSpacePrefix) const
{
return mNodeInfo->GetPrefixAtom(aNameSpacePrefix);
}
nsresult
nsGenericXMLElement::GetNameSpaceID(PRInt32& aNameSpaceID) const
{

View File

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Peter Annema <disttsc@bart.nl>
*/
#ifndef nsGenericXMLElement_h___
#define nsGenericXMLElement_h___
@ -85,8 +86,6 @@ public:
nsresult SetContainingNameSpace(nsINameSpace* aNameSpace);
nsresult GetContainingNameSpace(nsINameSpace*& aNameSpace) const;
nsresult SetNameSpacePrefix(nsIAtom* aNameSpace);
nsresult GetNameSpacePrefix(nsIAtom*& aNameSpace) const;
nsresult GetNameSpaceID(PRInt32& aNameSpaceID) const;
nsresult MaybeTriggerAutoLink(nsIWebShell *aShell);

View File

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Peter Annema <disttsc@bart.nl>
*/
#ifndef nsXMLElement_h___
@ -213,12 +214,6 @@ public:
NS_IMETHOD GetContainingNameSpace(nsINameSpace*& aNameSpace) const {
return mInner.GetContainingNameSpace(aNameSpace);
}
NS_IMETHOD SetNameSpacePrefix(nsIAtom* aNameSpace) {
return mInner.SetNameSpacePrefix(aNameSpace);
}
NS_IMETHOD GetNameSpacePrefix(nsIAtom*& aNameSpace) const {
return mInner.GetNameSpacePrefix(aNameSpace);
}
NS_IMETHOD MaybeTriggerAutoLink(nsIWebShell *aShell);
// nsIStyledContent

View File

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Peter Annema <disttsc@bart.nl>
*/
/*
@ -29,7 +30,7 @@
#ifndef nsIXULContent_h__
#define nsIXULContent_h__
#include "nsISupports.h"
#include "nsIXMLContent.h"
class nsIAtom;
class nsIRDFCompositeDataSource;
class nsIXULTemplateBuilder;
@ -40,7 +41,7 @@ class nsString;
{ 0x39c5ecc0, 0x5c47, 0x11d3, { 0xbe, 0x36, 0x0, 0x10, 0x4b, 0xde, 0x60, 0x48 } }
class nsIXULContent : public nsISupports
class nsIXULContent : public nsIXMLContent
{
public:
static const nsIID& GetIID() { static nsIID iid = NS_IXULCONTENT_IID; return iid; }

View File

@ -22,6 +22,7 @@
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
* Peter Annema <disttsc@bart.nl>
*
*
* This Original Code has been modified by IBM Corporation.
@ -91,7 +92,6 @@
#include "nsIStyledContent.h"
#include "nsISupportsArray.h"
#include "nsIURL.h"
#include "nsIXMLContent.h"
#include "nsIXULContent.h"
#include "nsIXULContentUtils.h"
#include "nsIXULDocument.h"
@ -1605,28 +1605,6 @@ nsXULElement::GetContainingNameSpace(nsINameSpace*& aNameSpace) const
return NS_OK;
}
NS_IMETHODIMP
nsXULElement::SetNameSpacePrefix(nsIAtom* aNameSpacePrefix)
{
nsresult rv;
rv = EnsureSlots();
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsINodeInfo> newNodeInfo;
mSlots->mNodeInfo->PrefixChanged(aNameSpacePrefix,
*getter_AddRefs(newNodeInfo));
mSlots->mNodeInfo = newNodeInfo;
return NS_OK;
}
NS_IMETHODIMP
nsXULElement::GetNameSpacePrefix(nsIAtom*& aNameSpacePrefix) const
{
return NodeInfo()->GetPrefixAtom(aNameSpacePrefix);
}
NS_IMETHODIMP
nsXULElement::MaybeTriggerAutoLink(nsIWebShell *aShell)
{

View File

@ -21,6 +21,7 @@
* Chris Waterson <waterson@netscape.com>
*
* Contributor(s):
* Peter Annema <disttsc@bart.nl>
*/
/*
@ -56,7 +57,6 @@
#include "nsIBindingManager.h"
#include "nsIXBLBinding.h"
#include "nsIURI.h"
#include "nsIXMLContent.h"
#include "nsIXULContent.h"
#include "nsIBoxObject.h"
#include "nsXULAttributes.h"
@ -311,8 +311,7 @@ public:
*/
class nsXULElement : public nsIXMLContent,
public nsIXULContent,
class nsXULElement : public nsIXULContent,
public nsIDOMXULElement,
public nsIDOMEventReceiver,
public nsIScriptEventHandlerOwner,
@ -393,8 +392,6 @@ public:
// nsIXMLContent
NS_IMETHOD SetContainingNameSpace(nsINameSpace* aNameSpace);
NS_IMETHOD GetContainingNameSpace(nsINameSpace*& aNameSpace) const;
NS_IMETHOD SetNameSpacePrefix(nsIAtom* aNameSpace);
NS_IMETHOD GetNameSpacePrefix(nsIAtom*& aNameSpace) const;
NS_IMETHOD MaybeTriggerAutoLink(nsIWebShell *aShell);
// nsIStyledContent