Landing fix for bug 198533. Patch by smaug@welho.com. Making nsXULElement inherit nsGenericElement. r=bugmail@sicking.cc, sr=jst@mozilla.org

This commit is contained in:
jst%mozilla.jstenback.com 2005-01-14 19:30:55 +00:00
Родитель 030c226593
Коммит 6b7d6cec73
6 изменённых файлов: 316 добавлений и 1088 удалений

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

@ -1296,7 +1296,14 @@ nsGenericElement::GetAttribute(const nsAString& aName,
const nsAttrName* name = InternalGetExistingAttrNameFromQName(aName);
if (!name) {
SetDOMStringToNull(aReturn);
if (mNodeInfo->NamespaceID() == kNameSpaceID_XUL) {
// XXX should be SetDOMStringToNull(aReturn);
// See bug 232598
aReturn.Truncate();
}
else {
SetDOMStringToNull(aReturn);
}
return NS_OK;
}

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

@ -63,6 +63,7 @@ class nsDOMAttributeMap;
class nsIURI;
class nsVoidArray;
class nsINodeInfo;
class nsIControllers;
typedef unsigned long PtrBits;
@ -88,8 +89,11 @@ typedef unsigned long PtrBits;
/** Whether this content has had any properties set on it */
#define GENERIC_ELEMENT_HAS_PROPERTIES 0x00000010U
/** Three bits are element type specific. */
#define ELEMENT_TYPE_SPECIFIC_BITS_OFFSET 5
/** The number of bits to shift the bit field to get at the content ID */
#define GENERIC_ELEMENT_CONTENT_ID_BITS_OFFSET 5
#define GENERIC_ELEMENT_CONTENT_ID_BITS_OFFSET 8
/** This mask masks out the bits that are used for the content ID */
#define GENERIC_ELEMENT_CONTENT_ID_MASK \
@ -168,11 +172,18 @@ public:
*/
nsRefPtr<nsDOMAttributeMap> mAttributeMap;
/**
* The nearest enclosing content node with a binding that created us.
* @see nsGenericElement::GetBindingParent
*/
nsIContent* mBindingParent; // [Weak]
union {
/**
* The nearest enclosing content node with a binding that created us.
* @see nsGenericElement::GetBindingParent
*/
nsIContent* mBindingParent; // [Weak]
/**
* The controllers of the XUL Element.
*/
nsIControllers* mControllers; // [OWNER]
};
// DEPRECATED, DON'T USE THIS
PRUint32 mContentID;

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

@ -67,6 +67,7 @@
#include "nsIURI.h"
#include "nsIIOService.h"
#include "nsNetUtil.h"
#include "nsIProgressEventSink.h"
#include "nsIContentViewerContainer.h"
#include "nsIContentViewer.h"
#include "nsIMarkupDocumentViewer.h"
@ -3451,6 +3452,16 @@ nsHTMLDocument::CreateAndAddWyciwygChannel(void)
rv = loadGroup->AddRequest(mWyciwygChannel, nsnull);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to add request to load group.");
/*
nsCOMPtr<nsIInterfaceRequestor> interfaceRequestor;
loadGroup->GetNotificationCallbacks(getter_AddRefs(interfaceRequestor));
nsCOMPtr<nsIProgressEventSink> progressSink =
do_GetInterface(interfaceRequestor);
progressSink->OnProgress(mWyciwygChannel, nsnull, 1, -1);
*/
}
return rv;

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

@ -51,12 +51,12 @@ class nsIRDFCompositeDataSource;
class nsIXULTemplateBuilder;
class nsString;
// {39C5ECC0-5C47-11d3-BE36-00104BDE6048}
// {da87924c-2638-4249-8297-4cf814d52d47}
#define NS_IXULCONTENT_IID \
{ 0x316f8e9d, 0x8d1e, 0x433d, { 0xa2, 0xdd, 0xb5, 0xc0, 0x83, 0xb3, 0x56, 0x13 } }
{ 0xda87924c, 0x2638, 0x4249, { 0x82, 0x97, 0x4c, 0xf8, 0x14, 0xd5, 0x2d, 0x47 } }
class nsIXULContent : public nsIXMLContent
class nsIXULContent : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IXULCONTENT_IID)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -400,7 +400,8 @@ public:
*/
class nsXULElement : public nsIXULContent,
class nsXULElement : public nsGenericElement,
public nsIXULContent,
public nsIDOMXULElement,
public nsIScriptEventHandlerOwner,
public nsIChromeEventHandler
@ -429,24 +430,11 @@ public:
PRBool aIsScriptable, nsIContent** aResult);
// nsISupports
NS_DECL_ISUPPORTS
NS_DECL_ISUPPORTS_INHERITED
// nsIContent (from nsIStyledContent)
nsIDocument *GetDocument() const
{
return mDocument;
}
// nsIContent
virtual void SetDocument(nsIDocument* aDocument, PRBool aDeep,
PRBool aCompileEventHandlers);
PRBool IsInDoc() const
{
return !!mDocument;
}
nsIDocument *GetOwnerDoc() const
{
return mDocument ? mDocument : NodeInfo()->GetDocument();
}
virtual void SetParent(nsIContent* aParent);
virtual PRBool IsNativeAnonymous() const;
virtual void SetNativeAnonymous(PRBool aAnonymous);
virtual PRUint32 GetChildCount() const;
@ -457,9 +445,6 @@ public:
virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify,
PRBool aDeepSetDocument);
virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify);
virtual PRInt32 GetNameSpaceID() const;
virtual nsIAtom *Tag() const;
virtual nsINodeInfo *GetNodeInfo() const;
virtual nsIAtom *GetIDAttributeName() const;
virtual nsIAtom *GetClassAttributeName() const;
virtual already_AddRefed<nsINodeInfo> GetExistingAttrNameFromQName(const nsAString& aStr) const;
@ -502,17 +487,8 @@ public:
virtual nsIContent *GetBindingParent() const;
virtual nsresult SetBindingParent(nsIContent* aParent);
virtual PRBool IsContentOfType(PRUint32 aFlags) const;
virtual already_AddRefed<nsIURI> GetBaseURI() const;
virtual nsresult GetListenerManager(nsIEventListenerManager** aResult);
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull);
virtual void* GetProperty(nsIAtom *aPropertyName,
nsresult *aStatus = nsnull) const;
virtual nsresult SetProperty(nsIAtom *aPropertyName,
void *aValue,
NSPropertyDtorFunc aDtor);
virtual nsresult DeleteProperty(nsIAtom *aPropertyName);
virtual void* UnsetProperty(nsIAtom *aPropertyName,
nsresult *aStatus = nsnull);
// nsIXMLContent
NS_IMETHOD MaybeTriggerAutoLink(nsIDocShell *aShell);
@ -536,11 +512,11 @@ public:
NS_IMETHOD GetLazyState(LazyState aFlag, PRBool& aValue);
NS_IMETHOD AddScriptEventListener(nsIAtom* aName, const nsAString& aValue);
// nsIDOMNode (from nsIDOMElement)
NS_DECL_NSIDOMNODE
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericElement::)
// nsIDOMElement
NS_DECL_NSIDOMELEMENT
NS_FORWARD_NSIDOMELEMENT(nsGenericElement::)
// nsIDOMXULElement
NS_DECL_NSIDOMXULELEMENT
@ -560,7 +536,7 @@ public:
protected:
nsXULElement();
nsXULElement(nsINodeInfo* aNodeInfo);
nsresult Init();
virtual ~nsXULElement(void);
@ -580,18 +556,9 @@ protected:
nsresult AddPopupListener(nsIAtom* aName);
nsIContent* GetParent() const {
// Override nsIContent::GetParent to be more efficient internally,
// we don't use the low 2 bits of mParentPtrBits for anything.
return NS_REINTERPRET_CAST(nsIContent *, mParentPtrBits);
}
protected:
// Required fields
nsXULPrototypeElement* mPrototype;
nsIDocument* mDocument;
nsAttrAndChildArray mAttrsAndChildren; // [OWNER]
nsCOMPtr<nsIEventListenerManager> mListenerManager; // [OWNER]
/**
@ -600,32 +567,6 @@ protected:
*/
nsIContent* mBindingParent;
/**
* Lazily instantiated if/when object is mutated. mAttributes are
* lazily copied from the prototype when changed.
*/
struct Slots {
Slots();
~Slots();
nsCOMPtr<nsINodeInfo> mNodeInfo; // [OWNER]
nsCOMPtr<nsIControllers> mControllers; // [OWNER]
nsRefPtr<nsDOMCSSDeclaration> mDOMStyle; // [OWNER]
nsRefPtr<nsDOMAttributeMap> mAttributeMap; // [OWNER]
nsRefPtr<nsChildContentList> mChildNodes; // [OWNER]
unsigned mLazyState : 3;
unsigned mHasProperties : 1;
};
friend struct Slots;
Slots* mSlots;
/**
* Ensure that we've got an mSlots object, creating a Slots object
* if necessary.
*/
nsresult EnsureSlots();
/**
* Abandon our prototype linkage, and copy all attributes locally
*/
@ -662,11 +603,12 @@ protected:
const nsAttrName* InternalGetExistingAttrNameFromQName(const nsAString& aStr) const;
protected:
// Internal accessors. These shadow the 'Slots', and return
// appropriate default values if there are no slots defined in the
// delegate.
nsINodeInfo *NodeInfo() const { return mSlots ? mSlots->mNodeInfo : mPrototype->mNodeInfo; }
nsIControllers *Controllers() const { return mSlots ? mSlots->mControllers.get() : nsnull; }
// Internal accessor. This shadows the 'Slots', and returns
// appropriate value.
nsIControllers *Controllers() {
nsDOMSlots* slots = GetExistingDOMSlots();
return slots ? slots->mControllers : nsnull;
}
void UnregisterAccessKey(const nsAString& aOldValue);