зеркало из https://github.com/mozilla/pjs.git
Removing static IID's (NS_DEFINE_IID()) and replace the static IID's with NS_GET_IID(), this cleans things up and simplifies my fix for nsbeta3+ bug 7515. r=pollmann@netscape.com
This commit is contained in:
Родитель
a40a166b5e
Коммит
585c9cdc89
|
@ -33,6 +33,8 @@ class nsIStyleSheet;
|
|||
|
||||
class nsIStyleSheetLinkingElement : public nsISupports {
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISTYLESHEETLINKINGELEMENT_IID)
|
||||
|
||||
/**
|
||||
* Used to make the association between a style sheet and
|
||||
* the element that linked it to the document.
|
||||
|
|
|
@ -33,10 +33,6 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsIDOMRange.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMCommentIID, NS_IDOMCOMMENT_IID);
|
||||
static NS_DEFINE_IID(kIEnumeratorIID, NS_IENUMERATOR_IID);
|
||||
static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);
|
||||
|
||||
class nsCommentNode : public nsIDOMComment,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsITextContent
|
||||
|
@ -242,7 +238,7 @@ NS_NewCommentNode(nsIContent** aInstancePtrResult)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIContentIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIContent), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsCommentNode::nsCommentNode()
|
||||
|
@ -263,13 +259,13 @@ NS_IMETHODIMP
|
|||
nsCommentNode::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_DOM_DATA_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMCommentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMComment))) {
|
||||
nsIDOMComment* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kITextContentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsITextContent))) {
|
||||
nsITextContent* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -311,7 +307,7 @@ nsCommentNode::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
// XXX Increment the ref count before calling any
|
||||
// methods. If they do a QI and then a Release()
|
||||
// the instance will be deleted.
|
||||
result = it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
result = it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
if (NS_FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
|
@ -338,7 +334,7 @@ nsCommentNode::CloneContent(PRBool aCloneText, nsITextContent** aReturn)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
result = it->QueryInterface(kITextContentIID, (void**) aReturn);
|
||||
result = it->QueryInterface(NS_GET_IID(nsITextContent), (void**) aReturn);
|
||||
if (NS_FAILED(result) || !aCloneText) {
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -112,30 +112,27 @@ nsContentList::~nsContentList()
|
|||
}
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLCollectionIID, NS_IDOMHTMLCOLLECTION_IID);
|
||||
|
||||
nsresult nsContentList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
if (nsnull == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kIDOMNodeListIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMNodeList))) {
|
||||
*aInstancePtr = (void*)(nsIDOMNodeList*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMHTMLCollectionIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLCollection))) {
|
||||
*aInstancePtr = (void*)(nsIDOMHTMLCollection*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
|
||||
*aInstancePtr = (void*)(nsIScriptObjectOwner*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsISupports))) {
|
||||
*aInstancePtr = (void*)(nsISupports*)(nsIDOMNodeList*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -169,7 +166,7 @@ nsContentList::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
|
|||
nsISupports *element = (nsISupports *)mContent.ElementAt(aIndex);
|
||||
|
||||
if (nsnull != element) {
|
||||
result = element->QueryInterface(kIDOMNodeIID, (void **)aReturn);
|
||||
result = element->QueryInterface(NS_GET_IID(nsIDOMNode), (void **)aReturn);
|
||||
}
|
||||
else {
|
||||
*aReturn = nsnull;
|
||||
|
@ -200,7 +197,7 @@ nsContentList::NamedItem(const nsAReadableString& aName, nsIDOMNode** aReturn)
|
|||
(aName.Equals(name))) ||
|
||||
((content->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::id, name) == NS_CONTENT_ATTR_HAS_VALUE) &&
|
||||
(aName.Equals(name)))) {
|
||||
return content->QueryInterface(kIDOMNodeIID, (void **)aReturn);
|
||||
return content->QueryInterface(NS_GET_IID(nsIDOMNode), (void **)aReturn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,11 +28,6 @@
|
|||
#include "nsINameSpaceManager.h"
|
||||
#include "nsDOMError.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMAttrIID, NS_IDOMATTR_IID);
|
||||
static NS_DEFINE_IID(kIDOMAttributePrivateIID, NS_IDOMATTRIBUTEPRIVATE_IID);
|
||||
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsDOMAttribute::nsDOMAttribute(nsIContent* aContent,
|
||||
|
@ -63,31 +58,31 @@ nsDOMAttribute::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kIDOMAttrIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMAttr))) {
|
||||
nsIDOMAttr* tmp = this;
|
||||
*aInstancePtr = (void*)tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
|
||||
nsIScriptObjectOwner* tmp = this;
|
||||
*aInstancePtr = (void*)tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMAttributePrivateIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMAttributePrivate))) {
|
||||
nsIDOMAttributePrivate* tmp = this;
|
||||
*aInstancePtr = (void*)tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMNodeIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMNode))) {
|
||||
nsIDOMNode* tmp = this;
|
||||
*aInstancePtr = (void*)tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsISupports))) {
|
||||
nsIDOMAttr* tmp1 = this;
|
||||
nsISupports* tmp2 = tmp1;
|
||||
*aInstancePtr = (void*)tmp2;
|
||||
|
@ -293,7 +288,7 @@ nsDOMAttribute::GetChildNodes(nsIDOMNodeList** aChildNodes)
|
|||
NS_ADDREF(mChildList);
|
||||
}
|
||||
|
||||
return mChildList->QueryInterface(kIDOMNodeListIID, (void**)aChildNodes);
|
||||
return mChildList->QueryInterface(NS_GET_IID(nsIDOMNodeList), (void**)aChildNodes);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -333,11 +328,11 @@ nsDOMAttribute::GetFirstChild(nsIDOMNode** aFirstChild)
|
|||
if (NS_OK != result) {
|
||||
return result;
|
||||
}
|
||||
result = content->QueryInterface(kIDOMTextIID, (void**)&mChild);
|
||||
result = content->QueryInterface(NS_GET_IID(nsIDOMText), (void**)&mChild);
|
||||
NS_RELEASE(content);
|
||||
}
|
||||
mChild->SetData(value);
|
||||
result = mChild->QueryInterface(kIDOMNodeIID, (void**)aFirstChild);
|
||||
result = mChild->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aFirstChild);
|
||||
}
|
||||
else {
|
||||
*aFirstChild = nsnull;
|
||||
|
@ -426,7 +421,7 @@ nsDOMAttribute::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return newAttr->QueryInterface(kIDOMNodeIID, (void**)aReturn);
|
||||
return newAttr->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -435,7 +430,7 @@ nsDOMAttribute::GetOwnerDocument(nsIDOMDocument** aOwnerDocument)
|
|||
nsresult result = NS_OK;
|
||||
if (nsnull != mContent) {
|
||||
nsIDOMNode* node;
|
||||
result = mContent->QueryInterface(kIDOMNodeIID, (void**)&node);
|
||||
result = mContent->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&node);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = node->GetOwnerDocument(aOwnerDocument);
|
||||
NS_RELEASE(node);
|
||||
|
|
|
@ -40,6 +40,8 @@ class nsDOMAttribute;
|
|||
|
||||
class nsIDOMAttributePrivate : public nsISupports {
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOMATTRIBUTEPRIVATE_IID)
|
||||
|
||||
NS_IMETHOD DropReference() = 0;
|
||||
NS_IMETHOD SetContent(nsIContent* aContent) = 0;
|
||||
NS_IMETHOD GetContent(nsIContent** aContent) = 0;
|
||||
|
|
|
@ -185,7 +185,7 @@ nsDOMDocumentType::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -34,9 +34,6 @@
|
|||
#include "nsDOMError.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIDOMDocumentFragmentIID, NS_IDOMDOCUMENTFRAGMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMDocumentIID, NS_IDOMDOCUMENT_IID);
|
||||
|
||||
class nsDocumentFragment : public nsIContent,
|
||||
public nsIDOMDocumentFragment,
|
||||
public nsIScriptObjectOwner
|
||||
|
@ -285,7 +282,7 @@ NS_NewDocumentFragment(nsIDOMDocumentFragment** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIDOMDocumentFragmentIID,
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMDocumentFragment),
|
||||
(void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
@ -310,32 +307,32 @@ NS_IMPL_RELEASE(nsDocumentFragment)
|
|||
nsresult
|
||||
nsDocumentFragment::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsISupports))) {
|
||||
nsIDOMDocumentFragment* tmp = this;
|
||||
nsISupports* tmp2 = tmp;
|
||||
*aInstancePtr = (void*) tmp2;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMDocumentFragmentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMDocumentFragment))) {
|
||||
nsIDOMDocumentFragment* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMNodeIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMNode))) {
|
||||
nsIDOMDocumentFragment* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
|
||||
nsIScriptObjectOwner* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIContentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIContent))) {
|
||||
nsIContent* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -376,7 +373,7 @@ NS_IMETHODIMP
|
|||
nsDocumentFragment::GetOwnerDocument(nsIDOMDocument** aOwnerDocument)
|
||||
{
|
||||
if (nsnull != mOwnerDocument) {
|
||||
return mOwnerDocument->QueryInterface(kIDOMDocumentIID, (void **)aOwnerDocument);
|
||||
return mOwnerDocument->QueryInterface(NS_GET_IID(nsIDOMDocument), (void **)aOwnerDocument);
|
||||
}
|
||||
else {
|
||||
*aOwnerDocument = nsnull;
|
||||
|
@ -419,7 +416,7 @@ nsDocumentFragment::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
//XXX mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -45,16 +45,6 @@
|
|||
#include "prprf.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
// XXX share all id's in this dir
|
||||
|
||||
NS_DEFINE_IID(kIDOMCharacterDataIID, NS_IDOMCHARACTERDATA_IID);
|
||||
|
||||
static NS_DEFINE_IID(kIPrivateDOMEventIID, NS_IPRIVATEDOMEVENT_IID);
|
||||
static NS_DEFINE_IID(kIEnumeratorIID, NS_IENUMERATOR_IID);
|
||||
static NS_DEFINE_IID(kIDOMDocumentIID, NS_IDOMDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@ -97,7 +87,7 @@ nsGenericDOMDataNode::GetParentNode(nsIDOMNode** aParentNode)
|
|||
nsresult res = NS_OK;
|
||||
|
||||
if (nsnull != mParent) {
|
||||
res = mParent->QueryInterface(kIDOMNodeIID, (void**)aParentNode);
|
||||
res = mParent->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aParentNode);
|
||||
NS_ASSERTION(NS_OK == res, "Must be a DOM Node");
|
||||
}
|
||||
else if (nsnull == mDocument) {
|
||||
|
@ -107,7 +97,7 @@ nsGenericDOMDataNode::GetParentNode(nsIDOMNode** aParentNode)
|
|||
// If we don't have a parent, but we're in the document, we must
|
||||
// be the root node of the document. The DOM says that the root
|
||||
// is the document.
|
||||
res = mDocument->QueryInterface(kIDOMNodeIID, (void**)aParentNode);
|
||||
res = mDocument->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aParentNode);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
@ -138,7 +128,7 @@ nsGenericDOMDataNode::GetPreviousSibling(nsIContent *aOuterContent,
|
|||
}
|
||||
|
||||
if (nsnull != sibling) {
|
||||
result = sibling->QueryInterface(kIDOMNodeIID,(void**)aPrevSibling);
|
||||
result = sibling->QueryInterface(NS_GET_IID(nsIDOMNode),(void**)aPrevSibling);
|
||||
NS_ASSERTION(NS_OK == result, "Must be a DOM Node");
|
||||
NS_RELEASE(sibling); // balance the AddRef in ChildAt()
|
||||
}
|
||||
|
@ -174,7 +164,7 @@ nsGenericDOMDataNode::GetNextSibling(nsIContent *aOuterContent,
|
|||
}
|
||||
|
||||
if (nsnull != sibling) {
|
||||
result = sibling->QueryInterface(kIDOMNodeIID,(void**)aNextSibling);
|
||||
result = sibling->QueryInterface(NS_GET_IID(nsIDOMNode),(void**)aNextSibling);
|
||||
NS_ASSERTION(NS_OK == result, "Must be a DOM Node");
|
||||
NS_RELEASE(sibling); // balance the AddRef in ChildAt()
|
||||
}
|
||||
|
@ -196,7 +186,7 @@ nsGenericDOMDataNode::GetChildNodes(nsIDOMNodeList** aChildNodes)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return list->QueryInterface(kIDOMNodeListIID, (void**)aChildNodes);
|
||||
return list->QueryInterface(NS_GET_IID(nsIDOMNodeList), (void**)aChildNodes);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -206,7 +196,7 @@ nsGenericDOMDataNode::GetOwnerDocument(nsIDOMDocument** aOwnerDocument)
|
|||
// the node has been created. We should be able to get at it
|
||||
// whether or not we are attached to the document.
|
||||
if (nsnull != mDocument) {
|
||||
return mDocument->QueryInterface(kIDOMDocumentIID, (void **)aOwnerDocument);
|
||||
return mDocument->QueryInterface(NS_GET_IID(nsIDOMDocument), (void **)aOwnerDocument);
|
||||
}
|
||||
else {
|
||||
*aOwnerDocument = nsnull;
|
||||
|
@ -494,7 +484,7 @@ nsGenericDOMDataNode::GetScriptObject(nsIContent *aOuterContent,
|
|||
nsIDOMNode* node;
|
||||
PRUint16 nodeType;
|
||||
|
||||
res = aOuterContent->QueryInterface(kIDOMNodeIID, (void**)&node);
|
||||
res = aOuterContent->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&node);
|
||||
if (NS_OK != res) {
|
||||
return res;
|
||||
}
|
||||
|
@ -805,7 +795,7 @@ nsGenericDOMDataNode::HandleDOMEvent(nsIPresContext* aPresContext,
|
|||
// hasn't been malloc'd. Force a copy of the data here so the
|
||||
// DOM Event is still valid.
|
||||
nsIPrivateDOMEvent *privateEvent;
|
||||
if (NS_OK == (*aDOMEvent)->QueryInterface(kIPrivateDOMEventIID, (void**)&privateEvent)) {
|
||||
if (NS_OK == (*aDOMEvent)->QueryInterface(NS_GET_IID(nsIPrivateDOMEvent), (void**)&privateEvent)) {
|
||||
privateEvent->DuplicatePrivateData();
|
||||
NS_RELEASE(privateEvent);
|
||||
}
|
||||
|
@ -978,7 +968,7 @@ nsGenericDOMDataNode::SplitText(nsIContent *aOuterContent, PRUint32 aOffset,
|
|||
}
|
||||
}
|
||||
|
||||
return newNode->QueryInterface(kIDOMTextIID, (void**)aReturn);
|
||||
return newNode->QueryInterface(NS_GET_IID(nsIDOMText), (void**)aReturn);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -34,13 +34,6 @@
|
|||
#include "nsDOMError.h"
|
||||
#include "nsIEventListenerManager.h"
|
||||
|
||||
extern const nsIID kIDOMCharacterDataIID;
|
||||
extern const nsIID kIDOMNodeIID;
|
||||
extern const nsIID kIDOMEventReceiverIID;
|
||||
extern const nsIID kIDOMEventTargetIID;
|
||||
extern const nsIID kIScriptObjectOwnerIID;
|
||||
extern const nsIID kISupportsIID;
|
||||
extern const nsIID kIContentIID;
|
||||
|
||||
class nsIDOMAttr;
|
||||
class nsIDOMEventListener;
|
||||
|
@ -607,46 +600,46 @@ struct nsGenericDOMDataNode {
|
|||
* generic to all html content objects.
|
||||
*/
|
||||
#define NS_IMPL_DOM_DATA_QUERY_INTERFACE(_id, _iptr, _this) \
|
||||
if (_id.Equals(kISupportsIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsISupports))) { \
|
||||
nsIContent* tmp = _this; \
|
||||
nsISupports* tmp2 = tmp; \
|
||||
*_iptr = (void*) tmp2; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMNodeIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMNode))) { \
|
||||
nsIDOMNode* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMCharacterDataIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMCharacterData))) { \
|
||||
nsIDOMCharacterData* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMEventReceiverIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMEventReceiver))) { \
|
||||
nsCOMPtr<nsIEventListenerManager> man; \
|
||||
if (NS_SUCCEEDED(mInner.GetListenerManager(this, getter_AddRefs(man)))){ \
|
||||
return man->QueryInterface(kIDOMEventReceiverIID, (void**)_iptr); \
|
||||
return man->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), (void**)_iptr); \
|
||||
} \
|
||||
return NS_NOINTERFACE; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMEventTargetIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMEventTarget))) { \
|
||||
nsCOMPtr<nsIEventListenerManager> man; \
|
||||
if (NS_SUCCEEDED(mInner.GetListenerManager(this, getter_AddRefs(man)))){ \
|
||||
return man->QueryInterface(kIDOMEventTargetIID, (void**)_iptr); \
|
||||
return man->QueryInterface(NS_GET_IID(nsIDOMEventTarget), (void**)_iptr); \
|
||||
} \
|
||||
return NS_NOINTERFACE; \
|
||||
} \
|
||||
if (_id.Equals(kIScriptObjectOwnerIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIScriptObjectOwner))) { \
|
||||
nsIScriptObjectOwner* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIContentIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIContent))) { \
|
||||
nsIContent* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
|
|
|
@ -40,18 +40,17 @@ nsGenericDOMNodeList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
if (aIID.Equals(kIDOMNodeListIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMNodeList))) {
|
||||
*aInstancePtr = (void*)(nsIDOMNodeList*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
|
||||
*aInstancePtr = (void*)(nsIScriptObjectOwner*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsISupports))) {
|
||||
*aInstancePtr = (void*)(nsISupports*)(nsIDOMNodeList*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
#include "nsIDOMNamedNodeMap.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIDOMLinkStyle.h"
|
||||
#include "nsIStyleSheetLinkingElement.h"
|
||||
#include "nsICSSStyleSheet.h"
|
||||
#include "nsICSSLoaderObserver.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIJSScriptObject.h"
|
||||
|
@ -35,15 +39,7 @@
|
|||
#include "nsGenericDOMNodeList.h"
|
||||
#include "nsIEventListenerManager.h"
|
||||
#include "nsINodeInfo.h"
|
||||
|
||||
extern const nsIID kIDOMNodeIID;
|
||||
extern const nsIID kIDOMElementIID;
|
||||
extern const nsIID kIDOMEventReceiverIID;
|
||||
extern const nsIID kIDOMEventTargetIID;
|
||||
extern const nsIID kIScriptObjectOwnerIID;
|
||||
extern const nsIID kIJSScriptObjectIID;
|
||||
extern const nsIID kISupportsIID;
|
||||
extern const nsIID kIContentIID;
|
||||
#include "nsIParser.h"
|
||||
|
||||
class nsIDOMAttr;
|
||||
class nsIDOMEventListener;
|
||||
|
@ -1403,53 +1399,53 @@ public:
|
|||
}
|
||||
|
||||
#define NS_IMPL_CONTENT_QUERY_INTERFACE(_id, _iptr, _this, _base) \
|
||||
if (_id.Equals(kISupportsIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsISupports))) { \
|
||||
_base* tmp = _this; \
|
||||
nsISupports* tmp2 = tmp; \
|
||||
*_iptr = (void*) tmp2; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMNodeIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMNode))) { \
|
||||
nsIDOMNode* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMElementIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMElement))) { \
|
||||
nsIDOMElement* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMEventReceiverIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMEventReceiver))) { \
|
||||
nsCOMPtr<nsIEventListenerManager> man; \
|
||||
if (NS_SUCCEEDED(mInner.GetListenerManager(getter_AddRefs(man)))){ \
|
||||
return man->QueryInterface(kIDOMEventReceiverIID, (void**)_iptr); \
|
||||
return man->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), (void**)_iptr); \
|
||||
} \
|
||||
return NS_NOINTERFACE; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMEventTargetIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMEventTarget))) { \
|
||||
nsCOMPtr<nsIEventListenerManager> man; \
|
||||
if (NS_SUCCEEDED(mInner.GetListenerManager(getter_AddRefs(man)))){ \
|
||||
return man->QueryInterface(kIDOMEventTargetIID, (void**)_iptr); \
|
||||
return man->QueryInterface(NS_GET_IID(nsIDOMEventTarget), (void**)_iptr); \
|
||||
} \
|
||||
return NS_NOINTERFACE; \
|
||||
} \
|
||||
if (_id.Equals(kIScriptObjectOwnerIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIScriptObjectOwner))) { \
|
||||
nsIScriptObjectOwner* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIContentIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIContent))) { \
|
||||
_base* tmp = _this; \
|
||||
nsIContent* tmp2 = tmp; \
|
||||
*_iptr = (void*) tmp2; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIJSScriptObjectIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIJSScriptObject))) { \
|
||||
nsIJSScriptObject* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
#include "nsCRT.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);
|
||||
|
||||
class nsTextNode : public nsIDOMText,
|
||||
public nsIScriptObjectOwner,
|
||||
|
@ -84,7 +82,7 @@ NS_NewTextNode(nsIContent** aInstancePtrResult)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIContentIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIContent), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsTextNode::nsTextNode()
|
||||
|
@ -104,13 +102,13 @@ NS_IMETHODIMP
|
|||
nsTextNode::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_DOM_DATA_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMTextIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMText))) {
|
||||
nsIDOMText* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kITextContentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsITextContent))) {
|
||||
nsITextContent* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -160,7 +158,7 @@ nsTextNode::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
// XXX Increment the ref count before calling any
|
||||
// methods. If they do a QI and then a Release()
|
||||
// the instance will be deleted.
|
||||
result = it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
result = it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
if (NS_FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
|
@ -187,7 +185,7 @@ nsTextNode::CloneContent(PRBool aCloneText, nsITextContent** aReturn)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
result = it->QueryInterface(kITextContentIID, (void**) aReturn);
|
||||
result = it->QueryInterface(NS_GET_IID(nsITextContent), (void**) aReturn);
|
||||
if (NS_FAILED(result) || !aCloneText) {
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ GenericElementCollection::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
|
|||
{
|
||||
if (aIndex==theIndex)
|
||||
{
|
||||
child->QueryInterface(kIDOMNodeIID, (void**)aReturn); // out-param addref
|
||||
child->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aReturn); // out-param addref
|
||||
NS_ASSERTION(nsnull!=aReturn, "content element must be an nsIDOMNode");
|
||||
NS_RELEASE(childTag);
|
||||
NS_RELEASE(child);
|
||||
|
|
|
@ -39,20 +39,17 @@ nsGenericDOMHTMLCollection::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLCollectionIID, NS_IDOMHTMLCOLLECTION_IID);
|
||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
||||
if (aIID.Equals(kIDOMHTMLCollectionIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLCollection))) {
|
||||
*aInstancePtr = (void*)(nsIDOMHTMLCollection*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
|
||||
*aInstancePtr = (void*)(nsIScriptObjectOwner*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsISupports))) {
|
||||
*aInstancePtr = (void*)(nsISupports*)(nsIDOMHTMLCollection*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
|
|
|
@ -94,24 +94,9 @@
|
|||
#include "nsXIFDTD.h"
|
||||
#include "nsLayoutCID.h"
|
||||
// XXX todo: add in missing out-of-memory checks
|
||||
NS_DEFINE_IID(kIDOMHTMLElementIID, NS_IDOMHTMLELEMENT_IID);
|
||||
|
||||
#include "nsIPref.h" // Used by the temp pref, should be removed!
|
||||
|
||||
static NS_DEFINE_IID(kIDOMAttrIID, NS_IDOMATTR_IID);
|
||||
static NS_DEFINE_IID(kIDOMNamedNodeMapIID, NS_IDOMNAMEDNODEMAP_IID);
|
||||
static NS_DEFINE_IID(kIPrivateDOMEventIID, NS_IPRIVATEDOMEVENT_IID);
|
||||
static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
|
||||
static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kICSSStyleRuleIID, NS_ICSS_STYLE_RULE_IID);
|
||||
static NS_DEFINE_IID(kICSSDeclarationIID, NS_ICSS_DECLARATION_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
static NS_DEFINE_IID(kIDOMCSSStyleDeclarationIID, NS_IDOMCSSSTYLEDECLARATION_IID);
|
||||
static NS_DEFINE_IID(kIDOMDocumentIID, NS_IDOMNODE_IID);
|
||||
static NS_DEFINE_IID(kIDOMDocumentFragmentIID, NS_IDOMDOCUMENTFRAGMENT_IID);
|
||||
static NS_DEFINE_IID(kIHTMLContentContainerIID, NS_IHTMLCONTENTCONTAINER_IID);
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLFormElementIID, NS_IDOMHTMLFORMELEMENT_IID);
|
||||
|
||||
static NS_DEFINE_CID(kXIFConverterCID, NS_XIFCONVERTER_CID);
|
||||
|
||||
|
@ -217,7 +202,7 @@ nsDOMCSSAttributeDeclaration::GetCSSDeclaration(nsICSSDeclaration **aDecl,
|
|||
mContent->GetHTMLAttribute(nsHTMLAtoms::style, val);
|
||||
if (eHTMLUnit_ISupports == val.GetUnit()) {
|
||||
rule = (nsIStyleRule*) val.GetISupportsValue();
|
||||
result = rule->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule);
|
||||
result = rule->QueryInterface(NS_GET_IID(nsICSSStyleRule), (void**)&cssRule);
|
||||
if (NS_OK == result) {
|
||||
*aDecl = cssRule->GetDeclaration();
|
||||
NS_RELEASE(cssRule);
|
||||
|
@ -259,7 +244,7 @@ nsDOMCSSAttributeDeclaration::SetCSSDeclaration(nsICSSDeclaration *aDecl)
|
|||
mContent->GetHTMLAttribute(nsHTMLAtoms::style, val);
|
||||
if (eHTMLUnit_ISupports == val.GetUnit()) {
|
||||
rule = (nsIStyleRule*) val.GetISupportsValue();
|
||||
result = rule->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule);
|
||||
result = rule->QueryInterface(NS_GET_IID(nsICSSStyleRule), (void**)&cssRule);
|
||||
if (NS_OK == result) {
|
||||
cssRule->SetDeclaration(aDecl);
|
||||
NS_RELEASE(cssRule);
|
||||
|
@ -290,7 +275,7 @@ nsDOMCSSAttributeDeclaration::ParseDeclaration(const nsAReadableString& aDecl,
|
|||
doc->GetBaseURL(baseURI);
|
||||
|
||||
nsIHTMLContentContainer* htmlContainer;
|
||||
result = doc->QueryInterface(kIHTMLContentContainerIID, (void**)&htmlContainer);
|
||||
result = doc->QueryInterface(NS_GET_IID(nsIHTMLContentContainer), (void**)&htmlContainer);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = htmlContainer->GetCSSLoader(cssLoader);
|
||||
NS_RELEASE(htmlContainer);
|
||||
|
@ -364,7 +349,7 @@ nsDOMCSSAttributeDeclaration::GetParent(nsISupports **aParent)
|
|||
*aParent = nsnull;
|
||||
|
||||
if (nsnull != mContent) {
|
||||
return mContent->QueryInterface(kISupportsIID, (void **)aParent);
|
||||
return mContent->QueryInterface(NS_GET_IID(nsISupports), (void **)aParent);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -584,7 +569,7 @@ nsGenericHTMLElement::GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
|
|||
|
||||
if (nsnull == slots->mStyle) {
|
||||
nsIHTMLContent* htmlContent;
|
||||
mContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
mContent->QueryInterface(NS_GET_IID(nsIHTMLContent), (void **)&htmlContent);
|
||||
slots->mStyle = new nsDOMCSSAttributeDeclaration(htmlContent);
|
||||
NS_RELEASE(htmlContent);
|
||||
if (nsnull == slots->mStyle) {
|
||||
|
@ -593,7 +578,7 @@ nsGenericHTMLElement::GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
|
|||
NS_ADDREF(slots->mStyle);
|
||||
}
|
||||
|
||||
res = slots->mStyle->QueryInterface(kIDOMCSSStyleDeclarationIID,
|
||||
res = slots->mStyle->QueryInterface(NS_GET_IID(nsIDOMCSSStyleDeclaration),
|
||||
(void **)aStyle);
|
||||
|
||||
return res;
|
||||
|
@ -905,7 +890,7 @@ static nsIHTMLStyleSheet* GetAttrStyleSheet(nsIDocument* aDocument)
|
|||
nsIHTMLContentContainer* htmlContainer;
|
||||
|
||||
if (nsnull != aDocument) {
|
||||
if (NS_OK == aDocument->QueryInterface(kIHTMLContentContainerIID, (void**)&htmlContainer)) {
|
||||
if (NS_OK == aDocument->QueryInterface(NS_GET_IID(nsIHTMLContentContainer), (void**)&htmlContainer)) {
|
||||
htmlContainer->GetAttributeStyleSheet(&sheet);
|
||||
NS_RELEASE(htmlContainer);
|
||||
}
|
||||
|
@ -953,7 +938,7 @@ nsGenericHTMLElement::SetDocument(nsIDocument* aDocument, PRBool aDeep, PRBool a
|
|||
if (!doNothing) {
|
||||
nsIHTMLContent* htmlContent;
|
||||
|
||||
result = mContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
result = mContent->QueryInterface(NS_GET_IID(nsIHTMLContent), (void **)&htmlContent);
|
||||
if (NS_OK != result) {
|
||||
return result;
|
||||
}
|
||||
|
@ -994,7 +979,7 @@ FindFormParent(nsIContent* aParent,
|
|||
|
||||
// If the current ancestor is a form, set it as our form
|
||||
if ((tag == nsHTMLAtoms::form) && (kNameSpaceID_HTML == nameSpaceID)) {
|
||||
result = parent->QueryInterface(kIDOMHTMLFormElementIID,
|
||||
result = parent->QueryInterface(NS_GET_IID(nsIDOMHTMLFormElement),
|
||||
(void**)&form);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = aControl->SetForm(form);
|
||||
|
@ -1298,7 +1283,7 @@ nsGenericHTMLElement::SetAttribute(PRInt32 aNameSpaceID,
|
|||
nsHTMLValue val;
|
||||
nsIHTMLContent* htmlContent;
|
||||
|
||||
result = mContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
result = mContent->QueryInterface(NS_GET_IID(nsIHTMLContent), (void **)&htmlContent);
|
||||
if (NS_OK != result) {
|
||||
return result;
|
||||
}
|
||||
|
@ -1397,7 +1382,7 @@ static PRInt32 GetStyleImpactFrom(const nsHTMLValue& aValue)
|
|||
nsISupports* supports = aValue.GetISupportsValue();
|
||||
if (nsnull != supports) {
|
||||
nsICSSStyleRule* cssRule;
|
||||
if (NS_SUCCEEDED(supports->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule))) {
|
||||
if (NS_SUCCEEDED(supports->QueryInterface(NS_GET_IID(nsICSSStyleRule), (void**)&cssRule))) {
|
||||
nsICSSDeclaration* declaration = cssRule->GetDeclaration();
|
||||
if (nsnull != declaration) {
|
||||
declaration->GetStyleImpact(&hint);
|
||||
|
@ -1419,7 +1404,7 @@ nsGenericHTMLElement::SetHTMLAttribute(nsIAtom* aAttribute,
|
|||
nsresult result = NS_OK;
|
||||
nsIHTMLContent* htmlContent;
|
||||
|
||||
result = mContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
result = mContent->QueryInterface(NS_GET_IID(nsIHTMLContent), (void **)&htmlContent);
|
||||
if (NS_OK != result) {
|
||||
return result;
|
||||
}
|
||||
|
@ -1486,7 +1471,7 @@ nsGenericHTMLElement::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
|||
|
||||
nsIHTMLContent* htmlContent;
|
||||
|
||||
result = mContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
result = mContent->QueryInterface(NS_GET_IID(nsIHTMLContent), (void **)&htmlContent);
|
||||
if (NS_OK != result) {
|
||||
return result;
|
||||
}
|
||||
|
@ -1561,7 +1546,7 @@ nsGenericHTMLElement::GetAttribute(PRInt32 aNameSpaceID, nsIAtom *aAttribute,
|
|||
nscolor color;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == result) {
|
||||
nsIHTMLContent* htmlContent;
|
||||
result = mContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
result = mContent->QueryInterface(NS_GET_IID(nsIHTMLContent), (void **)&htmlContent);
|
||||
if (NS_OK != result) {
|
||||
return result;
|
||||
}
|
||||
|
@ -1724,7 +1709,7 @@ nsGenericHTMLElement::GetInlineStyleRules(nsISupportsArray* aRules)
|
|||
if (eHTMLUnit_ISupports == value.GetUnit()) {
|
||||
nsISupports* supports = value.GetISupportsValue();
|
||||
if (supports) {
|
||||
result = supports->QueryInterface(kIStyleRuleIID, (void**)&rule);
|
||||
result = supports->QueryInterface(NS_GET_IID(nsIStyleRule), (void**)&rule);
|
||||
}
|
||||
NS_RELEASE(supports);
|
||||
}
|
||||
|
@ -1791,7 +1776,7 @@ nsGenericHTMLElement::GetBaseTarget(nsAWritableString& aBaseTarget) const
|
|||
}
|
||||
if (nsnull != mDocument) {
|
||||
nsIHTMLDocument* htmlDoc;
|
||||
result = mDocument->QueryInterface(kIHTMLDocumentIID, (void**)&htmlDoc);
|
||||
result = mDocument->QueryInterface(NS_GET_IID(nsIHTMLDocument), (void**)&htmlDoc);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = htmlDoc->GetBaseTarget(aBaseTarget);
|
||||
NS_RELEASE(htmlDoc);
|
||||
|
@ -2029,7 +2014,7 @@ nsGenericHTMLElement::AttributeToString(nsIAtom* aAttribute,
|
|||
nsIStyleRule* rule = (nsIStyleRule*) aValue.GetISupportsValue();
|
||||
if (rule) {
|
||||
nsICSSStyleRule* cssRule;
|
||||
if (NS_OK == rule->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule)) {
|
||||
if (NS_OK == rule->QueryInterface(NS_GET_IID(nsICSSStyleRule), (void**)&cssRule)) {
|
||||
nsICSSDeclaration* decl = cssRule->GetDeclaration();
|
||||
if (nsnull != decl) {
|
||||
decl->ToString(aResult);
|
||||
|
@ -2363,7 +2348,7 @@ nsGenericHTMLElement::GetPrimaryFrame(nsIHTMLContent* aContent,
|
|||
nsIFrame *frame = nsnull;
|
||||
presShell->GetPrimaryFrameFor(aContent, &frame);
|
||||
if (nsnull != frame) {
|
||||
res = frame->QueryInterface(kIFormControlFrameIID, (void**)&aFormControlFrame);
|
||||
res = frame->QueryInterface(NS_GET_IID(nsIFormControlFrame), (void**)&aFormControlFrame);
|
||||
}
|
||||
NS_RELEASE(presShell);
|
||||
}
|
||||
|
@ -2767,7 +2752,7 @@ nsGenericHTMLElement::ParseStyleAttribute(const nsAReadableString& aValue, nsHTM
|
|||
nsICSSParser* cssParser = nsnull;
|
||||
nsIHTMLContentContainer* htmlContainer;
|
||||
|
||||
result = mDocument->QueryInterface(kIHTMLContentContainerIID, (void**)&htmlContainer);
|
||||
result = mDocument->QueryInterface(NS_GET_IID(nsIHTMLContentContainer), (void**)&htmlContainer);
|
||||
if (NS_SUCCEEDED(result) && htmlContainer) {
|
||||
result = htmlContainer->GetCSSLoader(cssLoader);
|
||||
NS_RELEASE(htmlContainer);
|
||||
|
@ -3186,7 +3171,7 @@ nsGenericHTMLLeafElement::GetChildNodes(nsIDOMNodeList** aChildNodes)
|
|||
NS_ADDREF(slots->mChildNodes);
|
||||
}
|
||||
|
||||
return slots->mChildNodes->QueryInterface(kIDOMNodeListIID, (void **)aChildNodes);
|
||||
return slots->mChildNodes->QueryInterface(NS_GET_IID(nsIDOMNodeList), (void **)aChildNodes);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -3275,7 +3260,7 @@ nsGenericHTMLContainerElement::CopyInnerTo(nsIContent* aSrcContent,
|
|||
nsIContent* child = (nsIContent*)mChildren.ElementAt(index);
|
||||
if (nsnull != child) {
|
||||
nsIDOMNode* node;
|
||||
result = child->QueryInterface(kIDOMNodeIID, (void**)&node);
|
||||
result = child->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&node);
|
||||
if (NS_OK == result) {
|
||||
nsIDOMNode* newNode;
|
||||
|
||||
|
@ -3283,7 +3268,7 @@ nsGenericHTMLContainerElement::CopyInnerTo(nsIContent* aSrcContent,
|
|||
if (NS_OK == result) {
|
||||
nsIContent* newContent;
|
||||
|
||||
result = newNode->QueryInterface(kIContentIID, (void**)&newContent);
|
||||
result = newNode->QueryInterface(NS_GET_IID(nsIContent), (void**)&newContent);
|
||||
if (NS_OK == result) {
|
||||
result = aDst->AppendChildTo(newContent, PR_FALSE);
|
||||
NS_RELEASE(newContent);
|
||||
|
@ -3313,7 +3298,7 @@ nsGenericHTMLContainerElement::GetChildNodes(nsIDOMNodeList** aChildNodes)
|
|||
NS_ADDREF(slots->mChildNodes);
|
||||
}
|
||||
|
||||
return slots->mChildNodes->QueryInterface(kIDOMNodeListIID, (void **)aChildNodes);
|
||||
return slots->mChildNodes->QueryInterface(NS_GET_IID(nsIDOMNodeList), (void **)aChildNodes);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -3333,7 +3318,7 @@ nsGenericHTMLContainerElement::GetFirstChild(nsIDOMNode** aNode)
|
|||
{
|
||||
nsIContent *child = (nsIContent *)mChildren.ElementAt(0);
|
||||
if (nsnull != child) {
|
||||
nsresult res = child->QueryInterface(kIDOMNodeIID, (void**)aNode);
|
||||
nsresult res = child->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aNode);
|
||||
NS_ASSERTION(NS_OK == res, "Must be a DOM Node"); // must be a DOM Node
|
||||
return res;
|
||||
}
|
||||
|
@ -3346,7 +3331,7 @@ nsGenericHTMLContainerElement::GetLastChild(nsIDOMNode** aNode)
|
|||
{
|
||||
nsIContent *child = (nsIContent *)mChildren.ElementAt(mChildren.Count()-1);
|
||||
if (nsnull != child) {
|
||||
nsresult res = child->QueryInterface(kIDOMNodeIID, (void**)aNode);
|
||||
nsresult res = child->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aNode);
|
||||
NS_ASSERTION(NS_OK == res, "Must be a DOM Node"); // must be a DOM Node
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -33,8 +33,6 @@
|
|||
|
||||
#include "nsIStatefulFrame.h"
|
||||
|
||||
extern const nsIID kIDOMHTMLElementIID;
|
||||
extern const nsIID kIHTMLContentIID;
|
||||
|
||||
class nsIDOMAttr;
|
||||
class nsIDOMEventListener;
|
||||
|
@ -663,19 +661,19 @@ public:
|
|||
*/
|
||||
#define NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(_id, _iptr, _this) \
|
||||
NS_IMPL_CONTENT_QUERY_INTERFACE(_id, _iptr, _this, nsIHTMLContent) \
|
||||
if (_id.Equals(kIDOMHTMLElementIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMHTMLElement))) { \
|
||||
nsIDOMHTMLElement* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIHTMLContentIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIHTMLContent))) { \
|
||||
nsIHTMLContent* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIStyledContentIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIStyledContent))) { \
|
||||
nsIStyledContent* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
|
|
|
@ -53,8 +53,6 @@
|
|||
// XXX either suppress is handled in the event code below OR we need a
|
||||
// custom frame
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLAnchorElementIID, NS_IDOMHTMLANCHORELEMENT_IID);
|
||||
|
||||
class nsHTMLAnchorElement : public nsIDOMHTMLAnchorElement,
|
||||
public nsIDOMNSHTMLAnchorElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -117,7 +115,7 @@ NS_NewHTMLAnchorElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLAnchorElement::nsHTMLAnchorElement(nsINodeInfo *aNodeInfo)
|
||||
|
@ -141,7 +139,7 @@ nsresult
|
|||
nsHTMLAnchorElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLAnchorElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLAnchorElement))) {
|
||||
nsIDOMHTMLAnchorElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -169,7 +167,7 @@ nsHTMLAnchorElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, AccessKey, accesskey)
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#undef GetObject
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLAppletElementIID, NS_IDOMHTMLAPPLETELEMENT_IID);
|
||||
|
||||
class nsHTMLAppletElement : public nsIDOMHTMLAppletElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -130,7 +129,7 @@ NS_NewHTMLAppletElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -153,7 +152,7 @@ nsresult
|
|||
nsHTMLAppletElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLAppletElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLAppletElement))) {
|
||||
nsIDOMHTMLAppletElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -171,7 +170,7 @@ nsHTMLAppletElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Align, align)
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "nsNetUtil.h"
|
||||
#include "nsHTMLUtils.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLAreaElementIID, NS_IDOMHTMLAREAELEMENT_IID);
|
||||
|
||||
class nsHTMLAreaElement : public nsIDOMHTMLAreaElement,
|
||||
public nsIDOMNSHTMLAreaElement,
|
||||
|
@ -99,7 +98,7 @@ NS_NewHTMLAreaElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -124,7 +123,7 @@ nsresult
|
|||
nsHTMLAreaElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLAreaElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLAreaElement))) {
|
||||
nsIDOMHTMLAreaElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -153,7 +152,7 @@ nsHTMLAreaElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, AccessKey, accesskey)
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIHTMLAttributes.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLBRElementIID, NS_IDOMHTMLBRELEMENT_IID);
|
||||
|
||||
class nsHTMLBRElement : public nsIDOMHTMLBRElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -81,7 +80,7 @@ NS_NewHTMLBRElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,7 +102,7 @@ nsresult
|
|||
nsHTMLBRElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLBRElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLBRElement))) {
|
||||
nsIDOMHTMLBRElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -121,7 +120,7 @@ nsHTMLBRElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBRElement, Clear, clear)
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLBaseElementIID, NS_IDOMHTMLBASEELEMENT_IID);
|
||||
|
||||
class nsHTMLBaseElement : public nsIDOMHTMLBaseElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -80,7 +79,7 @@ NS_NewHTMLBaseElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +101,7 @@ nsresult
|
|||
nsHTMLBaseElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLBaseElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLBaseElement))) {
|
||||
nsIDOMHTMLBaseElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -120,7 +119,7 @@ nsHTMLBaseElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseElement, Href, href)
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLBaseFontElementIID, NS_IDOMHTMLBASEFONTELEMENT_IID);
|
||||
|
||||
class nsHTMLBaseFontElement : public nsIDOMHTMLBaseFontElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -80,7 +79,7 @@ NS_NewHTMLBaseFontElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +101,7 @@ nsresult
|
|||
nsHTMLBaseFontElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLBaseFontElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLBaseFontElement))) {
|
||||
nsIDOMHTMLBaseFontElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -120,7 +119,7 @@ nsHTMLBaseFontElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseFontElement, Color, color)
|
||||
|
|
|
@ -51,11 +51,6 @@
|
|||
#include "nsIStyleSet.h"
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
|
||||
static NS_DEFINE_IID(kICSSStyleRuleIID, NS_ICSS_STYLE_RULE_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLBodyElementIID, NS_IDOMHTMLBODYELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIHTMLContentContainerIID, NS_IHTMLCONTENTCONTAINER_IID);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@ -226,7 +221,7 @@ BodyRule::~BodyRule()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(BodyRule, kIStyleRuleIID);
|
||||
NS_IMPL_ISUPPORTS(BodyRule, NS_GET_IID(nsIStyleRule));
|
||||
|
||||
NS_IMETHODIMP
|
||||
BodyRule::Equals(const nsIStyleRule* aRule, PRBool& aResult) const
|
||||
|
@ -442,13 +437,12 @@ nsresult BodyFixupRule::QueryInterface(const nsIID& aIID,
|
|||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
// static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
if (aIID.Equals(kIStyleRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIStyleRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsIStyleRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsISupports))) {
|
||||
*aInstancePtrResult = (void*) ((nsISupports*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -586,7 +580,7 @@ BodyFixupRule::MapStyleInto(nsIMutableStyleContext* aContext, nsIPresContext* aP
|
|||
presShell->GetDocument(getter_AddRefs(doc));
|
||||
if (doc) {
|
||||
nsIHTMLContentContainer* htmlContainer;
|
||||
if (NS_OK == doc->QueryInterface(kIHTMLContentContainerIID,
|
||||
if (NS_OK == doc->QueryInterface(NS_GET_IID(nsIHTMLContentContainer),
|
||||
(void**)&htmlContainer)) {
|
||||
nsIHTMLStyleSheet* styleSheet;
|
||||
if (NS_OK == htmlContainer->GetAttributeStyleSheet(&styleSheet)) {
|
||||
|
@ -695,7 +689,7 @@ NS_NewHTMLBodyElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -717,7 +711,7 @@ nsresult
|
|||
nsHTMLBodyElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLBodyElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLBodyElement))) {
|
||||
nsIDOMHTMLBodyElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -735,7 +729,7 @@ nsHTMLBodyElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBodyElement, ALink, alink)
|
||||
|
@ -854,7 +848,7 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|||
presShell->GetDocument(getter_AddRefs(doc));
|
||||
if (doc) {
|
||||
nsIHTMLContentContainer* htmlContainer;
|
||||
if (NS_OK == doc->QueryInterface(kIHTMLContentContainerIID,
|
||||
if (NS_OK == doc->QueryInterface(NS_GET_IID(nsIHTMLContentContainer),
|
||||
(void**)&htmlContainer)) {
|
||||
nsIHTMLStyleSheet* styleSheet;
|
||||
if (NS_OK == htmlContainer->GetAttributeStyleSheet(&styleSheet)) {
|
||||
|
@ -914,7 +908,7 @@ static nsIHTMLStyleSheet* GetAttrStyleSheet(nsIDocument* aDocument)
|
|||
nsIHTMLContentContainer* htmlContainer;
|
||||
|
||||
if (nsnull != aDocument) {
|
||||
if (NS_OK == aDocument->QueryInterface(kIHTMLContentContainerIID, (void**)&htmlContainer)) {
|
||||
if (NS_OK == aDocument->QueryInterface(NS_GET_IID(nsIHTMLContentContainer), (void**)&htmlContainer)) {
|
||||
htmlContainer->GetAttributeStyleSheet(&sheet);
|
||||
NS_RELEASE(htmlContainer);
|
||||
}
|
||||
|
@ -951,7 +945,7 @@ static nsIHTMLCSSStyleSheet* GetInlineStyleSheet(nsIDocument* aDocument)
|
|||
nsIHTMLContentContainer* htmlContainer;
|
||||
|
||||
if (nsnull != aDocument) {
|
||||
if (NS_OK == aDocument->QueryInterface(kIHTMLContentContainerIID, (void**)&htmlContainer)) {
|
||||
if (NS_OK == aDocument->QueryInterface(NS_GET_IID(nsIHTMLContentContainer), (void**)&htmlContainer)) {
|
||||
htmlContainer->GetInlineStyleSheet(&sheet);
|
||||
NS_RELEASE(htmlContainer);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "nsISizeOfHandler.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLButtonElementIID, NS_IDOMHTMLBUTTONELEMENT_IID);
|
||||
|
||||
class nsHTMLButtonElement : public nsIDOMHTMLButtonElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -147,9 +146,6 @@ protected:
|
|||
PRInt32 mType;
|
||||
};
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLFormElementIID, NS_IDOMHTMLFORMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIFormIID, NS_IFORM_IID);
|
||||
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
|
||||
|
||||
// Construction, destruction
|
||||
|
||||
|
@ -164,7 +160,7 @@ NS_NewHTMLButtonElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -191,12 +187,12 @@ nsresult
|
|||
nsHTMLButtonElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLButtonElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLButtonElement))) {
|
||||
*aInstancePtr = (void*)(nsIDOMHTMLButtonElement*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(kIFormControlIID)) {
|
||||
else if (aIID.Equals(NS_GET_IID(nsIFormControl))) {
|
||||
*aInstancePtr = (void*)(nsIFormControl*) this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -245,7 +241,7 @@ nsHTMLButtonElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
// nsIContent
|
||||
|
@ -269,7 +265,7 @@ nsHTMLButtonElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
|||
*aForm = nsnull;
|
||||
if (nsnull != mForm) {
|
||||
nsIDOMHTMLFormElement* formElem = nsnull;
|
||||
result = mForm->QueryInterface(kIDOMHTMLFormElementIID, (void**)&formElem);
|
||||
result = mForm->QueryInterface(NS_GET_IID(nsIDOMHTMLFormElement), (void**)&formElem);
|
||||
if (NS_OK == result) {
|
||||
*aForm = formElem;
|
||||
}
|
||||
|
@ -615,7 +611,7 @@ NS_IMETHODIMP
|
|||
nsHTMLButtonElement::SetForm(nsIDOMHTMLFormElement* aForm)
|
||||
{
|
||||
nsCOMPtr<nsIFormControl> formControl;
|
||||
nsresult result = QueryInterface(kIFormControlIID, getter_AddRefs(formControl));
|
||||
nsresult result = QueryInterface(NS_GET_IID(nsIFormControl), getter_AddRefs(formControl));
|
||||
if (NS_FAILED(result)) formControl = nsnull;
|
||||
|
||||
nsAutoString nameVal, idVal;
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIHTMLAttributes.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLDListElementIID, NS_IDOMHTMLDLISTELEMENT_IID);
|
||||
|
||||
class nsHTMLDListElement : public nsIDOMHTMLDListElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -82,7 +81,7 @@ NS_NewHTMLDListElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -104,7 +103,7 @@ nsresult
|
|||
nsHTMLDListElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLDListElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLDListElement))) {
|
||||
nsIDOMHTMLDListElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -122,7 +121,7 @@ nsHTMLDListElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLDListElement, Compact, compact)
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLModElementIID, NS_IDOMHTMLMODELEMENT_IID);
|
||||
|
||||
class nsHTMLDelElement : public nsIDOMHTMLModElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -80,7 +79,7 @@ NS_NewHTMLDelElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +101,7 @@ nsresult
|
|||
nsHTMLDelElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLModElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLModElement))) {
|
||||
nsIDOMHTMLModElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -120,7 +119,7 @@ nsHTMLDelElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLDelElement, Cite, cite)
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
|
||||
extern nsGenericHTMLElement::EnumTable kListTypeTable[];
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLDirectoryElementIID, NS_IDOMHTMLDIRECTORYELEMENT_IID);
|
||||
|
||||
class nsHTMLDirectoryElement : public nsIDOMHTMLDirectoryElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -86,7 +85,7 @@ NS_NewHTMLDirectoryElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -108,7 +107,7 @@ nsresult
|
|||
nsHTMLDirectoryElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLDirectoryElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLDirectoryElement))) {
|
||||
nsIDOMHTMLDirectoryElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -126,7 +125,7 @@ nsHTMLDirectoryElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLDirectoryElement, Compact, compact)
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
// XXX support missing nav attributes? gutter, cols, width
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLDivElementIID, NS_IDOMHTMLDIVELEMENT_IID);
|
||||
|
||||
class nsHTMLDivElement : public nsIDOMHTMLDivElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -83,7 +82,7 @@ NS_NewHTMLDivElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -104,7 +103,7 @@ nsresult
|
|||
nsHTMLDivElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLDivElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLDivElement))) {
|
||||
nsIDOMHTMLDivElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -122,7 +121,7 @@ nsHTMLDivElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLDivElement, Align, align)
|
||||
|
|
|
@ -111,7 +111,7 @@ NS_NewHTMLEmbedElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLEmbedElement::nsHTMLEmbedElement(nsINodeInfo *aNodeInfo)
|
||||
|
@ -150,7 +150,7 @@ nsHTMLEmbedElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -35,10 +35,6 @@
|
|||
#include "nsIFormControl.h"
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLFieldSetElementIID, NS_IDOMHTMLFIELDSETELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLFormElementIID, NS_IDOMHTMLFORMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
|
||||
static NS_DEFINE_IID(kIFormIID, NS_IFORM_IID);
|
||||
|
||||
class nsHTMLFieldSetElement : public nsIDOMHTMLFieldSetElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -96,7 +92,7 @@ NS_NewHTMLFieldSetElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -122,12 +118,12 @@ nsresult
|
|||
nsHTMLFieldSetElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLFieldSetElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLFieldSetElement))) {
|
||||
*aInstancePtr = (void*)(nsIDOMHTMLFieldSetElement*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(kIFormControlIID)) {
|
||||
else if (aIID.Equals(NS_GET_IID(nsIFormControl))) {
|
||||
*aInstancePtr = (void*)(nsIFormControl*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -146,7 +142,7 @@ nsHTMLFieldSetElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
// nsIContent
|
||||
|
@ -170,7 +166,7 @@ nsHTMLFieldSetElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
|||
*aForm = nsnull;
|
||||
if (nsnull != mForm) {
|
||||
nsIDOMHTMLFormElement* formElem = nsnull;
|
||||
result = mForm->QueryInterface(kIDOMHTMLFormElementIID, (void**)&formElem);
|
||||
result = mForm->QueryInterface(NS_GET_IID(nsIDOMHTMLFormElement), (void**)&formElem);
|
||||
if (NS_OK == result) {
|
||||
*aForm = formElem;
|
||||
}
|
||||
|
@ -182,7 +178,7 @@ NS_IMETHODIMP
|
|||
nsHTMLFieldSetElement::SetForm(nsIDOMHTMLFormElement* aForm)
|
||||
{
|
||||
nsCOMPtr<nsIFormControl> formControl;
|
||||
nsresult result = QueryInterface(kIFormControlIID, getter_AddRefs(formControl));
|
||||
nsresult result = QueryInterface(NS_GET_IID(nsIFormControl), getter_AddRefs(formControl));
|
||||
if (NS_FAILED(result)) formControl = nsnull;
|
||||
|
||||
nsAutoString nameVal, idVal;
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIHTMLAttributes.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLFontElementIID, NS_IDOMHTMLFONTELEMENT_IID);
|
||||
|
||||
class nsHTMLFontElement : public nsIDOMHTMLFontElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -84,7 +83,7 @@ NS_NewHTMLFontElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -106,7 +105,7 @@ nsresult
|
|||
nsHTMLFontElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLFontElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLFontElement))) {
|
||||
nsIDOMHTMLFontElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -124,7 +123,7 @@ nsHTMLFontElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFontElement, Color, color)
|
||||
|
|
|
@ -49,12 +49,6 @@
|
|||
|
||||
static const int NS_FORM_CONTROL_LIST_HASHTABLE_SIZE = 64;
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLFormElementIID, NS_IDOMHTMLFORMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
|
||||
static NS_DEFINE_IID(kIFormIID, NS_IFORM_IID);
|
||||
static NS_DEFINE_IID(kIFormManagerIID, NS_IFORMMANAGER_IID);
|
||||
static NS_DEFINE_IID(kIDOMNSHTMLFormElementIID, NS_IDOMNSHTMLFORMELEMENT_IID);
|
||||
|
||||
class nsFormControlList;
|
||||
|
||||
// nsHTMLFormElement
|
||||
|
@ -171,7 +165,7 @@ NS_NewHTMLFormElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -208,24 +202,24 @@ nsHTMLFormElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
// Note that this has to stay above the generic element
|
||||
// QI macro, since it overrides the nsIJSScriptObject implementation
|
||||
// from the generic element.
|
||||
if (aIID.Equals(kIJSScriptObjectIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIJSScriptObject))) {
|
||||
nsIJSScriptObject* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIFormIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIForm))) {
|
||||
*aInstancePtr = (void*)(nsIForm*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(kIDOMHTMLFormElementIID)) {
|
||||
else if (aIID.Equals(NS_GET_IID(nsIDOMHTMLFormElement))) {
|
||||
*aInstancePtr = (void*)(nsIDOMHTMLFormElement*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(kIDOMNSHTMLFormElementIID)) {
|
||||
else if (aIID.Equals(NS_GET_IID(nsIDOMNSHTMLFormElement))) {
|
||||
*aInstancePtr = (void*)(nsIDOMNSHTMLFormElement*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
|
@ -246,7 +240,7 @@ nsHTMLFormElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -291,7 +285,7 @@ nsHTMLFormElement::Submit()
|
|||
shell->GetPrimaryFrameFor(this, &frame);
|
||||
if (frame) {
|
||||
nsIFormManager* formMan = nsnull;
|
||||
res = frame->QueryInterface(kIFormManagerIID, (void**)&formMan);
|
||||
res = frame->QueryInterface(NS_GET_IID(nsIFormManager), (void**)&formMan);
|
||||
if (NS_SUCCEEDED(res) && formMan) {
|
||||
nsCOMPtr<nsIPresContext> context;
|
||||
shell->GetPresContext(getter_AddRefs(context));
|
||||
|
@ -458,7 +452,7 @@ nsHTMLFormElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
|||
shell->GetPrimaryFrameFor(this, &frame);
|
||||
if (frame) {
|
||||
nsIFormManager* formMan = nsnull;
|
||||
ret = frame->QueryInterface(kIFormManagerIID, (void**)&formMan);
|
||||
ret = frame->QueryInterface(NS_GET_IID(nsIFormManager), (void**)&formMan);
|
||||
if (NS_SUCCEEDED(ret) && formMan) {
|
||||
ret = formMan->OnReset(aPresContext);
|
||||
}
|
||||
|
@ -708,7 +702,7 @@ nsHTMLFormElement::Item(PRUint32 aIndex, nsIDOMElement** aReturn)
|
|||
nsIDOMNode *node;
|
||||
nsresult result = mControls->Item(aIndex, &node);
|
||||
if ((NS_OK == result) && (nsnull != node)) {
|
||||
result = node->QueryInterface(kIDOMElementIID, (void **)aReturn);
|
||||
result = node->QueryInterface(NS_GET_IID(nsIDOMElement), (void **)aReturn);
|
||||
NS_RELEASE(node);
|
||||
}
|
||||
else {
|
||||
|
@ -795,7 +789,7 @@ nsFormControlList::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
|
|||
{
|
||||
nsIFormControl *control = (nsIFormControl*)mElements.ElementAt(aIndex);
|
||||
if (control) {
|
||||
return control->QueryInterface(kIDOMNodeIID, (void**)aReturn); // keep the ref
|
||||
return control->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aReturn); // keep the ref
|
||||
}
|
||||
*aReturn = nsnull;
|
||||
return NS_OK;
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "nsIChromeEventHandler.h"
|
||||
#include "nsDOMError.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLFrameElementIID, NS_IDOMHTMLFRAMEELEMENT_IID);
|
||||
|
||||
class nsHTMLFrameElement : public nsIDOMHTMLFrameElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -90,7 +89,7 @@ NS_NewHTMLFrameElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -112,7 +111,7 @@ nsresult
|
|||
nsHTMLFrameElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLFrameElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLFrameElement))) {
|
||||
nsIDOMHTMLFrameElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -135,7 +134,7 @@ nsHTMLFrameElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFrameElement, FrameBorder, frameborder)
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLFrameSetElementIID, NS_IDOMHTMLFRAMESETELEMENT_IID);
|
||||
|
||||
class nsHTMLFrameSetElement : public nsIDOMHTMLFrameSetElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -80,7 +79,7 @@ NS_NewHTMLFrameSetElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +101,7 @@ nsresult
|
|||
nsHTMLFrameSetElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLFrameSetElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLFrameSetElement))) {
|
||||
nsIDOMHTMLFrameSetElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -120,7 +119,7 @@ nsHTMLFrameSetElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFrameSetElement, Cols, cols)
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIHTMLAttributes.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLHRElementIID, NS_IDOMHTMLHRELEMENT_IID);
|
||||
|
||||
class nsHTMLHRElement : public nsIDOMHTMLHRElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -81,7 +80,7 @@ NS_NewHTMLHRElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,7 +102,7 @@ nsresult
|
|||
nsHTMLHRElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLHRElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLHRElement))) {
|
||||
nsIDOMHTMLHRElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -121,7 +120,7 @@ nsHTMLHRElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHRElement, Align, align)
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLHeadElementIID, NS_IDOMHTMLHEADELEMENT_IID);
|
||||
|
||||
class nsHTMLHeadElement : public nsIDOMHTMLHeadElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -80,7 +79,7 @@ NS_NewHTMLHeadElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +101,7 @@ nsresult
|
|||
nsHTMLHeadElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLHeadElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLHeadElement))) {
|
||||
nsIDOMHTMLHeadElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -120,7 +119,7 @@ nsHTMLHeadElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHeadElement, Profile, profile)
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIHTMLAttributes.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLHeadingElementIID, NS_IDOMHTMLHEADINGELEMENT_IID);
|
||||
|
||||
class nsHTMLHeadingElement : public nsIDOMHTMLHeadingElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -81,7 +80,7 @@ NS_NewHTMLHeadingElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,7 +102,7 @@ nsresult
|
|||
nsHTMLHeadingElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLHeadingElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLHeadingElement))) {
|
||||
nsIDOMHTMLHeadingElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -121,7 +120,7 @@ nsHTMLHeadingElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHeadingElement, Align, align)
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLHtmlElementIID, NS_IDOMHTMLHTMLELEMENT_IID);
|
||||
|
||||
class nsHTMLHtmlElement : public nsIDOMHTMLHtmlElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -85,7 +84,7 @@ NS_NewHTMLHtmlElement(nsIHTMLContent** aInstancePtrResult,
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
it->mInner.Init(it, aNodeInfo);
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -106,7 +105,7 @@ nsresult
|
|||
nsHTMLHtmlElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLHtmlElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLHtmlElement))) {
|
||||
nsIDOMHTMLHtmlElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -126,7 +125,7 @@ nsHTMLHtmlElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
it->mInner.Init(it, mInner.mNodeInfo);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHtmlElement, Version, version)
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "nsIChromeEventHandler.h"
|
||||
#include "nsDOMError.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLIFrameElementIID, NS_IDOMHTMLIFRAMEELEMENT_IID);
|
||||
|
||||
class nsHTMLIFrameElement : public nsIDOMHTMLIFrameElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -91,7 +90,7 @@ NS_NewHTMLIFrameElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -113,7 +112,7 @@ nsresult
|
|||
nsHTMLIFrameElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLIFrameElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLIFrameElement))) {
|
||||
nsIDOMHTMLIFrameElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -136,7 +135,7 @@ nsHTMLIFrameElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLIFrameElement, Align, align)
|
||||
|
|
|
@ -55,16 +55,9 @@
|
|||
#include "nsNodeInfoManager.h"
|
||||
#include "nsIFrameImageLoader.h"
|
||||
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
|
||||
// XXX nav attrs: suppress
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLImageElementIID, NS_IDOMHTMLIMAGEELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMImageIID, NS_IDOMIMAGE_IID);
|
||||
static NS_DEFINE_IID(kIJSNativeInitializerIID, NS_IJSNATIVEINITIALIZER_IID);
|
||||
static NS_DEFINE_IID(kIDOMWindowIID, NS_IDOMWINDOW_IID);
|
||||
static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);
|
||||
|
||||
class nsHTMLImageElement : public nsIDOMHTMLImageElement,
|
||||
public nsIDOMImage,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -163,7 +156,7 @@ NS_NewHTMLImageElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -192,26 +185,26 @@ nsHTMLImageElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
// Note that this has to stay above the generic element
|
||||
// QI macro, since it overrides the nsIJSScriptObject implementation
|
||||
// from the generic element.
|
||||
if (aIID.Equals(kIJSScriptObjectIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIJSScriptObject))) {
|
||||
nsIJSScriptObject* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLImageElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLImageElement))) {
|
||||
nsIDOMHTMLImageElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMImageIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMImage))) {
|
||||
nsIDOMImage* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIJSNativeInitializerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIJSNativeInitializer))) {
|
||||
nsIJSNativeInitializer* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -229,7 +222,7 @@ nsHTMLImageElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLImageElement, LowSrc, lowsrc)
|
||||
|
@ -767,13 +760,13 @@ nsHTMLImageElement::Initialize(JSContext* aContext,
|
|||
getter_AddRefs(globalObject));;
|
||||
if (globalObject) {
|
||||
nsIDOMWindowInternal* domWindow;
|
||||
result = globalObject->QueryInterface(kIDOMWindowIID, (void**)&domWindow);
|
||||
result = globalObject->QueryInterface(NS_GET_IID(nsIDOMWindow), (void**)&domWindow);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
nsIDOMDocument* domDocument;
|
||||
result = domWindow->GetDocument(&domDocument);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
// Maintain the reference
|
||||
result = domDocument->QueryInterface(kIDocumentIID,
|
||||
result = domDocument->QueryInterface(NS_GET_IID(nsIDocument),
|
||||
(void**)&mOwnerDocument);
|
||||
NS_RELEASE(domDocument);
|
||||
}
|
||||
|
|
|
@ -64,13 +64,8 @@
|
|||
|
||||
// XXX align=left, hspace, vspace, border? other nav4 attrs
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLFormElementIID, NS_IDOMHTMLFORMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIFormIID, NS_IFORM_IID);
|
||||
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID);
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID);
|
||||
|
||||
#ifdef ENDER_LITE
|
||||
typedef nsIGfxTextControlFrame2 textControlPlace;
|
||||
|
@ -226,7 +221,7 @@ NS_NewHTMLInputElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -253,7 +248,7 @@ NS_IMETHODIMP
|
|||
nsHTMLInputElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLInputElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLInputElement))) {
|
||||
*aInstancePtr = (void*)(nsIDOMHTMLInputElement*) this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -263,7 +258,7 @@ nsHTMLInputElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(kIFormControlIID)) {
|
||||
else if (aIID.Equals(NS_GET_IID(nsIFormControl))) {
|
||||
*aInstancePtr = (void*)(nsIFormControl*) this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -285,7 +280,7 @@ nsHTMLInputElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
// nsIContent
|
||||
|
@ -309,7 +304,7 @@ nsHTMLInputElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
|||
*aForm = nsnull;
|
||||
if (nsnull != mForm) {
|
||||
nsIDOMHTMLFormElement* formElem = nsnull;
|
||||
result = mForm->QueryInterface(kIDOMHTMLFormElementIID, (void**)&formElem);
|
||||
result = mForm->QueryInterface(NS_GET_IID(nsIDOMHTMLFormElement), (void**)&formElem);
|
||||
if (NS_OK == result) {
|
||||
*aForm = formElem;
|
||||
}
|
||||
|
@ -1266,7 +1261,7 @@ NS_IMETHODIMP
|
|||
nsHTMLInputElement::SetForm(nsIDOMHTMLFormElement* aForm)
|
||||
{
|
||||
nsCOMPtr<nsIFormControl> formControl;
|
||||
nsresult result = QueryInterface(kIFormControlIID, getter_AddRefs(formControl));
|
||||
nsresult result = QueryInterface(NS_GET_IID(nsIFormControl), getter_AddRefs(formControl));
|
||||
if (NS_FAILED(result)) formControl = nsnull;
|
||||
|
||||
nsAutoString nameVal, idVal;
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLModElementIID, NS_IDOMHTMLMODELEMENT_IID);
|
||||
|
||||
class nsHTMLInsElement : public nsIDOMHTMLModElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -80,7 +79,7 @@ NS_NewHTMLInsElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +101,7 @@ nsresult
|
|||
nsHTMLInsElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLModElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLModElement))) {
|
||||
nsIDOMHTMLModElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -120,7 +119,7 @@ nsHTMLInsElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInsElement, Cite, cite)
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLIsIndexElementIID, NS_IDOMHTMLISINDEXELEMENT_IID);
|
||||
|
||||
class nsHTMLIsIndexElement : public nsIDOMHTMLIsIndexElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -80,7 +79,7 @@ NS_NewHTMLIsIndexElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +101,7 @@ nsresult
|
|||
nsHTMLIsIndexElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLIsIndexElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLIsIndexElement))) {
|
||||
nsIDOMHTMLIsIndexElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -120,7 +119,7 @@ nsHTMLIsIndexElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIHTMLAttributes.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLLIElementIID, NS_IDOMHTMLLIELEMENT_IID);
|
||||
|
||||
class nsHTMLLIElement : public nsIDOMHTMLLIElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -81,7 +80,7 @@ NS_NewHTMLLIElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,7 +102,7 @@ nsresult
|
|||
nsHTMLLIElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLLIElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLLIElement))) {
|
||||
nsIDOMHTMLLIElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -121,7 +120,7 @@ nsHTMLLIElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLIElement, Type, type)
|
||||
|
|
|
@ -41,10 +41,6 @@
|
|||
#include "nsIFormControlFrame.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLLabelElementIID, NS_IDOMHTMLLABELELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLFormElementIID, NS_IDOMHTMLFORMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIFormIID, NS_IFORM_IID);
|
||||
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
|
||||
|
||||
class nsHTMLLabelElement : public nsIDOMHTMLLabelElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -177,7 +173,7 @@ NS_NewHTMLLabelElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -203,12 +199,12 @@ nsresult
|
|||
nsHTMLLabelElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLLabelElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLLabelElement))) {
|
||||
*aInstancePtr = (void*)(nsIDOMHTMLLabelElement*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(kIFormControlIID)) {
|
||||
else if (aIID.Equals(NS_GET_IID(nsIFormControl))) {
|
||||
*aInstancePtr = (void*)(nsIFormControl*) this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -227,7 +223,7 @@ nsHTMLLabelElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
// nsIContent
|
||||
|
@ -251,7 +247,7 @@ nsHTMLLabelElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
|||
*aForm = nsnull;
|
||||
if (nsnull != mForm) {
|
||||
nsIDOMHTMLFormElement* formElem = nsnull;
|
||||
result = mForm->QueryInterface(kIDOMHTMLFormElementIID, (void**)&formElem);
|
||||
result = mForm->QueryInterface(NS_GET_IID(nsIDOMHTMLFormElement), (void**)&formElem);
|
||||
if (NS_OK == result) {
|
||||
*aForm = formElem;
|
||||
}
|
||||
|
@ -263,7 +259,7 @@ NS_IMETHODIMP
|
|||
nsHTMLLabelElement::SetForm(nsIDOMHTMLFormElement* aForm)
|
||||
{
|
||||
nsCOMPtr<nsIFormControl> formControl;
|
||||
nsresult result = QueryInterface(kIFormControlIID, getter_AddRefs(formControl));
|
||||
nsresult result = QueryInterface(NS_GET_IID(nsIFormControl), getter_AddRefs(formControl));
|
||||
if (NS_FAILED(result)) formControl = nsnull;
|
||||
|
||||
nsAutoString nameVal, idVal;
|
||||
|
|
|
@ -35,9 +35,6 @@
|
|||
#include "nsIFormControl.h"
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLLegendElementIID, NS_IDOMHTMLLEGENDELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLFormElementIID, NS_IDOMHTMLFORMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIFormIID, NS_IFORM_IID);
|
||||
|
||||
class nsHTMLLegendElement : public nsIDOMHTMLLegendElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -94,7 +91,7 @@ NS_NewHTMLLegendElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -142,7 +139,7 @@ nsHTMLLegendElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
// nsIContent
|
||||
|
@ -166,7 +163,7 @@ nsHTMLLegendElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
|||
*aForm = nsnull;
|
||||
if (nsnull != mForm) {
|
||||
nsIDOMHTMLFormElement* formElem = nsnull;
|
||||
result = mForm->QueryInterface(kIDOMHTMLFormElementIID, (void**)&formElem);
|
||||
result = mForm->QueryInterface(NS_GET_IID(nsIDOMHTMLFormElement), (void**)&formElem);
|
||||
if (NS_OK == result) {
|
||||
*aForm = formElem;
|
||||
}
|
||||
|
|
|
@ -38,9 +38,6 @@
|
|||
#include "nsHTMLUtils.h"
|
||||
#include "nsIURL.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLLinkElementIID, NS_IDOMHTMLLINKELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIStyleSheetLinkingElementIID, NS_ISTYLESHEETLINKINGELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMStyleSheetIID, NS_IDOMSTYLESHEET_IID);
|
||||
|
||||
class nsHTMLLinkElement : public nsIDOMHTMLLinkElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -108,7 +105,7 @@ NS_NewHTMLLinkElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -135,13 +132,13 @@ nsresult
|
|||
nsHTMLLinkElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLLinkElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLLinkElement))) {
|
||||
nsIDOMHTMLLinkElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIStyleSheetLinkingElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIStyleSheetLinkingElement))) {
|
||||
nsIStyleSheetLinkingElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -169,7 +166,7 @@ nsHTMLLinkElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -180,7 +177,7 @@ nsHTMLLinkElement::GetDisabled(PRBool* aDisabled)
|
|||
if (nsnull != mStyleSheet) {
|
||||
nsIDOMStyleSheet* ss;
|
||||
|
||||
result = mStyleSheet->QueryInterface(kIDOMStyleSheetIID, (void**)&ss);
|
||||
result = mStyleSheet->QueryInterface(NS_GET_IID(nsIDOMStyleSheet), (void**)&ss);
|
||||
if (NS_OK == result) {
|
||||
result = ss->GetDisabled(aDisabled);
|
||||
NS_RELEASE(ss);
|
||||
|
@ -201,7 +198,7 @@ nsHTMLLinkElement::SetDisabled(PRBool aDisabled)
|
|||
if (nsnull != mStyleSheet) {
|
||||
nsIDOMStyleSheet* ss;
|
||||
|
||||
result = mStyleSheet->QueryInterface(kIDOMStyleSheetIID, (void**)&ss);
|
||||
result = mStyleSheet->QueryInterface(NS_GET_IID(nsIDOMStyleSheet), (void**)&ss);
|
||||
if (NS_OK == result) {
|
||||
result = ss->SetDisabled(aDisabled);
|
||||
NS_RELEASE(ss);
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
#include "nsIHTMLDocument.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLMapElementIID, NS_IDOMHTMLMAPELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID);
|
||||
|
||||
class nsHTMLMapElement : public nsIDOMHTMLMapElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -221,7 +219,7 @@ NS_NewHTMLMapElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -248,7 +246,7 @@ nsresult
|
|||
nsHTMLMapElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLMapElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLMapElement))) {
|
||||
nsIDOMHTMLMapElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -265,7 +263,7 @@ nsHTMLMapElement::SetDocument(nsIDocument* aDocument, PRBool aDeep, PRBool aComp
|
|||
if (nsnull != mInner.mDocument) {
|
||||
nsCOMPtr<nsIHTMLDocument> htmlDoc;
|
||||
|
||||
rv = mInner.mDocument->QueryInterface(kIHTMLDocumentIID,
|
||||
rv = mInner.mDocument->QueryInterface(NS_GET_IID(nsIHTMLDocument),
|
||||
getter_AddRefs(htmlDoc));
|
||||
if (NS_OK == rv) {
|
||||
htmlDoc->RemoveImageMap(this);
|
||||
|
@ -277,7 +275,7 @@ nsHTMLMapElement::SetDocument(nsIDocument* aDocument, PRBool aDeep, PRBool aComp
|
|||
if (NS_SUCCEEDED(rv) && (nsnull != aDocument)) {
|
||||
nsCOMPtr<nsIHTMLDocument> htmlDoc;
|
||||
|
||||
rv = aDocument->QueryInterface(kIHTMLDocumentIID,
|
||||
rv = aDocument->QueryInterface(NS_GET_IID(nsIHTMLDocument),
|
||||
getter_AddRefs(htmlDoc));
|
||||
if (NS_OK == rv) {
|
||||
htmlDoc->AddImageMap(this);
|
||||
|
@ -296,7 +294,7 @@ nsHTMLMapElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
|
||||
extern nsGenericHTMLElement::EnumTable kListTypeTable[];
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLMenuElementIID, NS_IDOMHTMLMENUELEMENT_IID);
|
||||
|
||||
class nsHTMLMenuElement : public nsIDOMHTMLMenuElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -86,7 +85,7 @@ NS_NewHTMLMenuElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -108,7 +107,7 @@ nsresult
|
|||
nsHTMLMenuElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLMenuElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLMenuElement))) {
|
||||
nsIDOMHTMLMenuElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -126,7 +125,7 @@ nsHTMLMenuElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLMenuElement, Compact, compact)
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLMetaElementIID, NS_IDOMHTMLMETAELEMENT_IID);
|
||||
|
||||
class nsHTMLMetaElement : public nsIDOMHTMLMetaElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -80,7 +79,7 @@ NS_NewHTMLMetaElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,7 +102,7 @@ nsresult
|
|||
nsHTMLMetaElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLMetaElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLMetaElement))) {
|
||||
nsIDOMHTMLMetaElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -121,7 +120,7 @@ nsHTMLMetaElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMetaElement, Content, content)
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLModElementIID, NS_IDOMHTMLMODELEMENT_IID);
|
||||
|
||||
class nsHTMLModElement : public nsIDOMHTMLModElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -80,7 +79,7 @@ NS_NewHTMLModElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +101,7 @@ nsresult
|
|||
nsHTMLModElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLModElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLModElement))) {
|
||||
nsIDOMHTMLModElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -120,7 +119,7 @@ nsHTMLModElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLModElement, Cite, cite)
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIHTMLAttributes.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLOListElementIID, NS_IDOMHTMLOLISTELEMENT_IID);
|
||||
|
||||
class nsHTMLOListElement : public nsIDOMHTMLOListElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -81,7 +80,7 @@ NS_NewHTMLOListElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,7 +102,7 @@ nsresult
|
|||
nsHTMLOListElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLOListElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLOListElement))) {
|
||||
nsIDOMHTMLOListElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -121,7 +120,7 @@ nsHTMLOListElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOListElement, Compact, compact)
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsDOMError.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLObjectElementIID, NS_IDOMHTMLOBJECTELEMENT_IID);
|
||||
|
||||
class nsHTMLObjectElement : public nsIDOMHTMLObjectElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -81,7 +80,7 @@ NS_NewHTMLObjectElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,7 +102,7 @@ nsresult
|
|||
nsHTMLObjectElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLObjectElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLObjectElement))) {
|
||||
nsIDOMHTMLObjectElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -121,7 +120,7 @@ nsHTMLObjectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "nsIFrame.h"
|
||||
#include "nsIFormControlFrame.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLOptGroupElementIID, NS_IDOMHTMLOPTGROUPELEMENT_IID);
|
||||
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
class nsHTMLOptGroupElement : public nsIDOMHTMLOptGroupElement,
|
||||
|
@ -83,7 +83,7 @@ NS_NewHTMLOptGroupElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -105,7 +105,7 @@ nsresult
|
|||
nsHTMLOptGroupElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLOptGroupElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLOptGroupElement))) {
|
||||
nsIDOMHTMLOptGroupElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -123,7 +123,7 @@ nsHTMLOptGroupElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOptGroupElement, Disabled, disabled)
|
||||
|
|
|
@ -56,17 +56,6 @@
|
|||
#include "nsCOMPtr.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLSelectElementIID, NS_IDOMHTMLSELECTELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLOptionElementIID, NS_IDOMHTMLOPTIONELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLOptGroupElementIID, NS_IDOMHTMLOPTIONELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLFormElementIID, NS_IDOMHTMLFORMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
|
||||
static NS_DEFINE_IID(kISelectElementIID, NS_ISELECTELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIFormIID, NS_IFORM_IID);
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kIJSNativeInitializerIID, NS_IJSNATIVEINITIALIZER_IID);
|
||||
|
||||
class nsHTMLOptionElement : public nsIDOMHTMLOptionElement,
|
||||
public nsIJSScriptObject,
|
||||
public nsIHTMLContent,
|
||||
|
@ -143,7 +132,7 @@ NS_NewHTMLOptionElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -166,12 +155,12 @@ nsresult
|
|||
nsHTMLOptionElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLOptionElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLOptionElement))) {
|
||||
*aInstancePtr = (void*)(nsIDOMHTMLOptionElement*) this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIJSNativeInitializerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIJSNativeInitializer))) {
|
||||
nsIJSNativeInitializer* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -198,7 +187,7 @@ nsHTMLOptionElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -208,7 +197,7 @@ nsHTMLOptionElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
|||
nsresult res = GetSelect(selectElement);
|
||||
if (NS_OK == res) {
|
||||
nsIFormControl* selectControl = nsnull;
|
||||
res = selectElement->QueryInterface(kIFormControlIID, (void**)&selectControl);
|
||||
res = selectElement->QueryInterface(NS_GET_IID(nsIFormControl), (void**)&selectControl);
|
||||
NS_RELEASE(selectElement);
|
||||
|
||||
if (NS_OK == res) {
|
||||
|
@ -393,7 +382,7 @@ nsHTMLOptionElement::GetIndex(PRInt32* aIndex)
|
|||
|
||||
// Get our nsIDOMNode interface to compare apples to apples.
|
||||
nsIDOMNode* thisNode = nsnull;
|
||||
if (NS_OK == this->QueryInterface(kIDOMNodeIID, (void**)&thisNode)) {
|
||||
if (NS_OK == this->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&thisNode)) {
|
||||
|
||||
// Get our containing select content object.
|
||||
nsIDOMHTMLSelectElement* selectElement = nsnull;
|
||||
|
@ -509,7 +498,7 @@ nsHTMLOptionElement::GetText(nsAWritableString& aText)
|
|||
rv = ChildAt(i, node);
|
||||
if (NS_SUCCEEDED(rv) && node) {
|
||||
nsCOMPtr<nsIDOMText> domText;
|
||||
rv = node->QueryInterface(kIDOMTextIID, (void**)getter_AddRefs(domText));
|
||||
rv = node->QueryInterface(NS_GET_IID(nsIDOMText), (void**)getter_AddRefs(domText));
|
||||
if (NS_SUCCEEDED(rv) && domText) {
|
||||
rv = domText->GetData(aText);
|
||||
// the option could be all spaces, so compress the white space
|
||||
|
@ -546,7 +535,7 @@ nsHTMLOptionElement::SetText(const nsAReadableString& aText)
|
|||
result = ChildAt(i, node);
|
||||
if (NS_SUCCEEDED(result) && node) {
|
||||
nsCOMPtr<nsIDOMText> domText;
|
||||
result = node->QueryInterface(kIDOMTextIID, (void**)getter_AddRefs(domText));
|
||||
result = node->QueryInterface(NS_GET_IID(nsIDOMText), (void**)getter_AddRefs(domText));
|
||||
if (NS_SUCCEEDED(result) && domText) {
|
||||
result = domText->SetData(aText);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
|
@ -564,7 +553,7 @@ nsHTMLOptionElement::SetText(const nsAReadableString& aText)
|
|||
result = NS_NewTextNode(getter_AddRefs(text));
|
||||
if (NS_OK == result) {
|
||||
nsIDOMText* domtext;
|
||||
result = text->QueryInterface(kIDOMTextIID, (void**)&domtext);
|
||||
result = text->QueryInterface(NS_GET_IID(nsIDOMText), (void**)&domtext);
|
||||
if (NS_SUCCEEDED(result) && domtext) {
|
||||
result = domtext->SetData(aText);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
|
@ -605,7 +594,7 @@ nsresult nsHTMLOptionElement::GetPrimaryFrame(nsIFormControlFrame *&aIFormContro
|
|||
nsresult res = GetSelect(selectElement);
|
||||
if (NS_OK == res) {
|
||||
nsIHTMLContent* selectContent = nsnull;
|
||||
nsresult gotContent = selectElement->QueryInterface(kIContentIID, (void**)&selectContent);
|
||||
nsresult gotContent = selectElement->QueryInterface(NS_GET_IID(nsIContent), (void**)&selectContent);
|
||||
NS_RELEASE(selectElement);
|
||||
|
||||
if (NS_OK == gotContent) {
|
||||
|
@ -626,13 +615,13 @@ nsresult nsHTMLOptionElement::GetSelect(nsIDOMHTMLSelectElement *&aSelectElement
|
|||
aSelectElement = nsnull;
|
||||
if (nsnull != parentNode) {
|
||||
|
||||
res = parentNode->QueryInterface(kIDOMHTMLSelectElementIID, (void**)&aSelectElement);
|
||||
res = parentNode->QueryInterface(NS_GET_IID(nsIDOMHTMLSelectElement), (void**)&aSelectElement);
|
||||
|
||||
// If we are in an OptGroup we need to GetParentNode again (at least once)
|
||||
if (NS_OK != res) {
|
||||
nsIDOMHTMLOptGroupElement* optgroupElement = nsnull;
|
||||
while (1) { // Be ready for nested OptGroups
|
||||
if ((nsnull != parentNode) && (NS_OK == parentNode->QueryInterface(kIDOMHTMLOptGroupElementIID, (void**)&optgroupElement))) {
|
||||
if ((nsnull != parentNode) && (NS_OK == parentNode->QueryInterface(NS_GET_IID(nsIDOMHTMLOptGroupElement), (void**)&optgroupElement))) {
|
||||
NS_RELEASE(optgroupElement); // Don't need the optgroup, just seeing if it IS one.
|
||||
nsIDOMNode* grandParentNode = nsnull;
|
||||
if (NS_OK == parentNode->GetParentNode(&grandParentNode)) {
|
||||
|
@ -645,7 +634,7 @@ nsresult nsHTMLOptionElement::GetSelect(nsIDOMHTMLSelectElement *&aSelectElement
|
|||
break; // Break out if not a OptGroup (hopefully we have a select)
|
||||
}
|
||||
}
|
||||
res = parentNode->QueryInterface(kIDOMHTMLSelectElementIID, (void**)&aSelectElement);
|
||||
res = parentNode->QueryInterface(NS_GET_IID(nsIDOMHTMLSelectElement), (void**)&aSelectElement);
|
||||
}
|
||||
|
||||
// We have a select if we're gonna get one, so let go of the generic node
|
||||
|
@ -677,7 +666,7 @@ nsHTMLOptionElement::Initialize(JSContext* aContext,
|
|||
return result;
|
||||
}
|
||||
|
||||
result = textNode->QueryInterface(kITextContentIID, (void**)&content);
|
||||
result = textNode->QueryInterface(NS_GET_IID(nsITextContent), (void**)&content);
|
||||
if (NS_FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
// XXX missing nav attributes
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLParagraphElementIID, NS_IDOMHTMLPARAGRAPHELEMENT_IID);
|
||||
|
||||
class nsHTMLParagraphElement : public nsIDOMHTMLParagraphElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -87,7 +86,7 @@ NS_NewHTMLParagraphElement(nsIHTMLContent** aInstancePtrResult,
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
it->mInner.Init(it, aNodeInfo);
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -108,7 +107,7 @@ nsresult
|
|||
nsHTMLParagraphElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLParagraphElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLParagraphElement))) {
|
||||
nsIDOMHTMLParagraphElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -128,7 +127,7 @@ nsHTMLParagraphElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
it->mInner.Init(it, mInner.mNodeInfo);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParagraphElement, Align, align)
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLParamElementIID, NS_IDOMHTMLPARAMELEMENT_IID);
|
||||
|
||||
class nsHTMLParamElement : public nsIDOMHTMLParamElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -80,7 +79,7 @@ NS_NewHTMLParamElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +101,7 @@ nsresult
|
|||
nsHTMLParamElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLParamElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLParamElement))) {
|
||||
nsIDOMHTMLParamElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -120,7 +119,7 @@ nsHTMLParamElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParamElement, Name, name)
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
// XXX wrap, variable, cols, tabstop
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLPreElementIID, NS_IDOMHTMLPREELEMENT_IID);
|
||||
|
||||
class nsHTMLPreElement : public nsIDOMHTMLPreElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -84,7 +83,7 @@ NS_NewHTMLPreElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -106,7 +105,7 @@ nsresult
|
|||
nsHTMLPreElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLPreElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLPreElement))) {
|
||||
nsIDOMHTMLPreElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -124,7 +123,7 @@ nsHTMLPreElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_INT_ATTR(nsHTMLPreElement, Width, width)
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLQuoteElementIID, NS_IDOMHTMLQUOTEELEMENT_IID);
|
||||
|
||||
class nsHTMLQuoteElement : public nsIDOMHTMLQuoteElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -80,7 +79,7 @@ NS_NewHTMLQuoteElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +101,7 @@ nsresult
|
|||
nsHTMLQuoteElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLQuoteElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLQuoteElement))) {
|
||||
nsIDOMHTMLQuoteElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -120,7 +119,7 @@ nsHTMLQuoteElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLQuoteElement, Cite, cite)
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsITextContent.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLScriptElementIID, NS_IDOMHTMLSCRIPTELEMENT_IID);
|
||||
|
||||
class nsHTMLScriptElement : public nsIDOMHTMLScriptElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -81,7 +80,7 @@ NS_NewHTMLScriptElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,7 +102,7 @@ nsresult
|
|||
nsHTMLScriptElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLScriptElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLScriptElement))) {
|
||||
nsIDOMHTMLScriptElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -121,7 +120,7 @@ nsHTMLScriptElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -60,17 +60,9 @@
|
|||
#include "nsIFormControlFrame.h"
|
||||
#include "nsIFrame.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLSelectElementIID, NS_IDOMHTMLSELECTELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMNSHTMLSelectElementIID, NS_IDOMNSHTMLSELECTELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMNSHTMLOptionCollectionIID, NS_IDOMNSHTMLOPTIONCOLLECTION_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLOptionElementIID, NS_IDOMHTMLOPTIONELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLFormElementIID, NS_IDOMHTMLFORMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
|
||||
static NS_DEFINE_IID(kIFormIID, NS_IFORM_IID);
|
||||
static NS_DEFINE_IID(kISelectElementIID, NS_ISELECTELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
|
||||
class nsHTMLSelectElement;
|
||||
|
||||
// nsHTMLOptionCollection
|
||||
|
@ -334,7 +326,7 @@ NS_NewHTMLSelectElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -371,28 +363,28 @@ nsHTMLSelectElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
}
|
||||
// NS_IMPL_HTML_CONTENT_QUERY_INTERFACE returns mInner as the script object
|
||||
// We need to be our own so we can implement setprop to set select[i]
|
||||
if (aIID.Equals(kIJSScriptObjectIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIJSScriptObject))) {
|
||||
*aInstancePtr = (void*)(nsIJSScriptObject*) this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLSelectElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLSelectElement))) {
|
||||
*aInstancePtr = (void*)(nsIDOMHTMLSelectElement*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(kIDOMNSHTMLSelectElementIID)) {
|
||||
else if (aIID.Equals(NS_GET_IID(nsIDOMNSHTMLSelectElement))) {
|
||||
*aInstancePtr = (void*)(nsIDOMNSHTMLSelectElement*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(kIFormControlIID)) {
|
||||
else if (aIID.Equals(NS_GET_IID(nsIFormControl))) {
|
||||
*aInstancePtr = (void*)(nsIFormControl*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(kISelectElementIID)) {
|
||||
else if (aIID.Equals(NS_GET_IID(nsISelectElement))) {
|
||||
*aInstancePtr = (void*)(nsISelectElement*) this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -411,7 +403,7 @@ nsHTMLSelectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
nsresult rv = it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
nsresult rv = it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -537,7 +529,7 @@ nsHTMLSelectElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
|||
*aForm = nsnull;
|
||||
if (nsnull != mForm) {
|
||||
nsIDOMHTMLFormElement* formElem = nsnull;
|
||||
result = mForm->QueryInterface(kIDOMHTMLFormElementIID, (void**)&formElem);
|
||||
result = mForm->QueryInterface(NS_GET_IID(nsIDOMHTMLFormElement), (void**)&formElem);
|
||||
if (NS_OK == result) {
|
||||
*aForm = formElem;
|
||||
}
|
||||
|
@ -1470,7 +1462,7 @@ NS_IMETHODIMP
|
|||
nsHTMLSelectElement::SetForm(nsIDOMHTMLFormElement* aForm)
|
||||
{
|
||||
nsCOMPtr<nsIFormControl> formControl;
|
||||
nsresult result = QueryInterface(kIFormControlIID, getter_AddRefs(formControl));
|
||||
nsresult result = QueryInterface(NS_GET_IID(nsIFormControl), getter_AddRefs(formControl));
|
||||
if (NS_FAILED(result)) formControl = nsnull;
|
||||
|
||||
nsAutoString nameVal, idVal;
|
||||
|
@ -1561,7 +1553,7 @@ nsHTMLSelectElement::SetProperty(JSContext *aContext,
|
|||
// Set options in the options list by indexing into select
|
||||
if (JSVAL_IS_INT(aID) && mOptions) {
|
||||
nsIJSScriptObject* optList = nsnull;
|
||||
res = mOptions->QueryInterface(kIJSScriptObjectIID, (void **)&optList);
|
||||
res = mOptions->QueryInterface(NS_GET_IID(nsIJSScriptObject), (void **)&optList);
|
||||
if (NS_SUCCEEDED(res) && optList) {
|
||||
res = optList->SetProperty(aContext, aObj, aID, aVp);
|
||||
NS_RELEASE(optList);
|
||||
|
@ -1610,7 +1602,7 @@ void GetOptionsRecurse(nsIContent* aContent, nsVoidArray& aOptions)
|
|||
for (int i = 0; i < numChildren; i++) {
|
||||
aContent->ChildAt(i, child);
|
||||
if (child) {
|
||||
nsresult result = child->QueryInterface(kIDOMHTMLOptionElementIID, (void**)&option);
|
||||
nsresult result = child->QueryInterface(NS_GET_IID(nsIDOMHTMLOptionElement), (void**)&option);
|
||||
if ((NS_OK == result) && option) {
|
||||
aOptions.AppendElement(option); // keep the ref count
|
||||
} else {
|
||||
|
@ -1660,12 +1652,12 @@ nsresult
|
|||
nsHTMLOptionCollection::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
if (!aInstancePtr) return NS_ERROR_NULL_POINTER;
|
||||
if (aIID.Equals(kIJSScriptObjectIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIJSScriptObject))) {
|
||||
*aInstancePtr = (void*)(nsIJSScriptObject*) this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMNSHTMLOptionCollectionIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMNSHTMLOptionCollection))) {
|
||||
*aInstancePtr = (void*)(nsIDOMNSHTMLOptionCollection*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -1758,7 +1750,7 @@ nsHTMLOptionCollection::NamedItem(const nsAReadableString& aName, nsIDOMNode** a
|
|||
if (nsnull != option) {
|
||||
nsIContent *content;
|
||||
|
||||
result = option->QueryInterface(kIContentIID, (void **)&content);
|
||||
result = option->QueryInterface(NS_GET_IID(nsIContent), (void **)&content);
|
||||
if (NS_OK == result) {
|
||||
nsAutoString name;
|
||||
// XXX Should it be an EqualsIgnoreCase?
|
||||
|
@ -1766,7 +1758,7 @@ nsHTMLOptionCollection::NamedItem(const nsAReadableString& aName, nsIDOMNode** a
|
|||
(aName.Equals(name))) ||
|
||||
((content->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::id, name) == NS_CONTENT_ATTR_HAS_VALUE) &&
|
||||
(aName.Equals(name)))) {
|
||||
result = option->QueryInterface(kIDOMNodeIID, (void **)aReturn);
|
||||
result = option->QueryInterface(NS_GET_IID(nsIDOMNode), (void **)aReturn);
|
||||
}
|
||||
NS_RELEASE(content);
|
||||
}
|
||||
|
@ -1791,7 +1783,7 @@ nsHTMLOptionCollection::RemoveOption(nsIContent* aOption)
|
|||
nsIDOMHTMLOptionElement* option;
|
||||
|
||||
if ((nsnull != aOption) &&
|
||||
NS_SUCCEEDED(aOption->QueryInterface(kIDOMHTMLOptionElementIID, (void**)&option))) {
|
||||
NS_SUCCEEDED(aOption->QueryInterface(NS_GET_IID(nsIDOMHTMLOptionElement), (void**)&option))) {
|
||||
if (mElements.RemoveElement(option)) {
|
||||
nsresult result;
|
||||
NS_RELEASE2(option, result);
|
||||
|
@ -1809,7 +1801,7 @@ nsHTMLOptionCollection::IndexOf(nsIContent* aOption)
|
|||
GetOptions();
|
||||
}
|
||||
if ((nsnull != aOption) &&
|
||||
NS_SUCCEEDED(aOption->QueryInterface(kIDOMHTMLOptionElementIID, getter_AddRefs(option)))) {
|
||||
NS_SUCCEEDED(aOption->QueryInterface(NS_GET_IID(nsIDOMHTMLOptionElement), getter_AddRefs(option)))) {
|
||||
return mElements.IndexOf(option);
|
||||
}
|
||||
return -1;
|
||||
|
@ -1900,7 +1892,7 @@ nsHTMLOptionCollection::SetProperty(JSContext *aContext,
|
|||
nsIDOMNode* refChild;
|
||||
nsIDOMNode* ret;
|
||||
|
||||
if (NS_OK == supports->QueryInterface(kIDOMNodeIID, (void **)&option)) {
|
||||
if (NS_OK == supports->QueryInterface(NS_GET_IID(nsIDOMNode), (void **)&option)) {
|
||||
if (indx == length) {
|
||||
result = mSelect->AppendChild(option, &ret);
|
||||
NS_IF_RELEASE(ret);
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsDOMError.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLObjectElementIID, NS_IDOMHTMLOBJECTELEMENT_IID);
|
||||
|
||||
class nsHTMLObjectElement : public nsIDOMHTMLObjectElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -81,7 +80,7 @@ NS_NewHTMLObjectElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,7 +102,7 @@ nsresult
|
|||
nsHTMLObjectElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLObjectElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLObjectElement))) {
|
||||
nsIDOMHTMLObjectElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -121,7 +120,7 @@ nsHTMLObjectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -50,13 +50,9 @@
|
|||
#include "nsImageFrame.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
|
||||
// XXX nav attrs: suppress
|
||||
|
||||
static NS_DEFINE_IID(kIDOMWindowIID, NS_IDOMWINDOW_IID);
|
||||
static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);
|
||||
|
||||
class nsHTMLSpacerElement : public nsIDOMHTMLElement,
|
||||
public nsIJSScriptObject,
|
||||
public nsIHTMLContent
|
||||
|
@ -113,7 +109,7 @@ NS_NewHTMLSpacerElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -137,7 +133,7 @@ nsHTMLSpacerElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
// Note that this has to stay above the generic element
|
||||
// QI macro, since it overrides the nsIJSScriptObject implementation
|
||||
// from the generic element.
|
||||
if (aIID.Equals(kIJSScriptObjectIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIJSScriptObject))) {
|
||||
nsIJSScriptObject* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
|
@ -156,7 +152,7 @@ nsHTMLSpacerElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -75,7 +75,7 @@ NS_NewHTMLSpanElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -109,7 +109,7 @@ nsHTMLSpanElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -37,9 +37,6 @@
|
|||
|
||||
// XXX no SRC attribute
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLStyleElementIID, NS_IDOMHTMLSTYLEELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIStyleSheetLinkingElementIID, NS_ISTYLESHEETLINKINGELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMStyleSheetIID, NS_IDOMSTYLESHEET_IID);
|
||||
|
||||
class nsHTMLStyleElement : public nsIDOMHTMLStyleElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -98,7 +95,7 @@ NS_NewHTMLStyleElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -122,13 +119,13 @@ nsresult
|
|||
nsHTMLStyleElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLStyleElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLStyleElement))) {
|
||||
nsIDOMHTMLStyleElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIStyleSheetLinkingElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIStyleSheetLinkingElement))) {
|
||||
nsIStyleSheetLinkingElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -151,7 +148,7 @@ nsHTMLStyleElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -162,7 +159,7 @@ nsHTMLStyleElement::GetDisabled(PRBool* aDisabled)
|
|||
if (nsnull != mStyleSheet) {
|
||||
nsIDOMStyleSheet* ss;
|
||||
|
||||
result = mStyleSheet->QueryInterface(kIDOMStyleSheetIID, (void**)&ss);
|
||||
result = mStyleSheet->QueryInterface(NS_GET_IID(nsIDOMStyleSheet), (void**)&ss);
|
||||
if (NS_OK == result) {
|
||||
result = ss->GetDisabled(aDisabled);
|
||||
NS_RELEASE(ss);
|
||||
|
@ -183,7 +180,7 @@ nsHTMLStyleElement::SetDisabled(PRBool aDisabled)
|
|||
if (nsnull != mStyleSheet) {
|
||||
nsIDOMStyleSheet* ss;
|
||||
|
||||
result = mStyleSheet->QueryInterface(kIDOMStyleSheetIID, (void**)&ss);
|
||||
result = mStyleSheet->QueryInterface(NS_GET_IID(nsIDOMStyleSheet), (void**)&ss);
|
||||
if (NS_OK == result) {
|
||||
result = ss->SetDisabled(aDisabled);
|
||||
NS_RELEASE(ss);
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIHTMLAttributes.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableCaptionElementIID, NS_IDOMHTMLTABLECAPTIONELEMENT_IID);
|
||||
|
||||
class nsHTMLTableCaptionElement : public nsIDOMHTMLTableCaptionElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -81,7 +80,7 @@ NS_NewHTMLTableCaptionElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,7 +102,7 @@ nsresult
|
|||
nsHTMLTableCaptionElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableCaptionElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLTableCaptionElement))) {
|
||||
nsIDOMHTMLTableCaptionElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -121,7 +120,7 @@ nsHTMLTableCaptionElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCaptionElement, Align, align)
|
||||
|
|
|
@ -35,9 +35,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableCellElementIID, NS_IDOMHTMLTABLECELLELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIHTMLTableCellElementIID, NS_IHTMLTABLECELLELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableRowElementIID, NS_IDOMHTMLTABLEROWELEMENT_IID);
|
||||
|
||||
class nsHTMLTableCellElement : public nsIHTMLTableCellElement,
|
||||
public nsIDOMHTMLTableCellElement,
|
||||
|
@ -99,7 +96,7 @@ NS_NewHTMLTableCellElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -122,13 +119,13 @@ nsresult
|
|||
nsHTMLTableCellElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableCellElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLTableCellElement))) {
|
||||
nsIDOMHTMLTableCellElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(kIHTMLTableCellElementIID)) {
|
||||
else if (aIID.Equals(NS_GET_IID(nsIHTMLTableCellElement))) {
|
||||
nsIHTMLTableCellElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -146,7 +143,7 @@ nsHTMLTableCellElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
/** @return the starting column for this cell in aColIndex. Always >= 1 */
|
||||
|
@ -169,7 +166,7 @@ nsHTMLTableCellElement::GetRow(nsIDOMHTMLTableRowElement** aRow)
|
|||
{
|
||||
nsIDOMNode *rowNode;
|
||||
GetParentNode(&rowNode);
|
||||
nsresult result = rowNode->QueryInterface(kIDOMHTMLTableRowElementIID, (void**)aRow);
|
||||
nsresult result = rowNode->QueryInterface(NS_GET_IID(nsIDOMHTMLTableRowElement), (void**)aRow);
|
||||
NS_RELEASE(rowNode);
|
||||
return result;
|
||||
}
|
||||
|
@ -256,7 +253,7 @@ nsHTMLTableCellElement::GetContentStyleRules(nsISupportsArray* aRules)
|
|||
nsIContent* table = nsnull;
|
||||
if (NS_SUCCEEDED(section->GetParent(table)) && table) {
|
||||
nsIStyledContent* styledTable = nsnull;
|
||||
if (NS_SUCCEEDED(table->QueryInterface(kIStyledContentIID, (void**)&styledTable))) {
|
||||
if (NS_SUCCEEDED(table->QueryInterface(NS_GET_IID(nsIStyledContent), (void**)&styledTable))) {
|
||||
styledTable->GetContentStyleRules(aRules);
|
||||
NS_RELEASE(styledTable);
|
||||
}
|
||||
|
|
|
@ -33,8 +33,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableColElementIID, NS_IDOMHTMLTABLECOLELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIHTMLTableColElementIID, NS_IHTMLTABLECOLELEMENT_IID);
|
||||
|
||||
class nsHTMLTableColElement : public nsIDOMHTMLTableColElement,
|
||||
public nsIHTMLTableColElement,
|
||||
|
@ -87,7 +85,7 @@ NS_NewHTMLTableColElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -109,13 +107,13 @@ nsresult
|
|||
nsHTMLTableColElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableColElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLTableColElement))) {
|
||||
nsIDOMHTMLTableColElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIHTMLTableColElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIHTMLTableColElement))) {
|
||||
nsIHTMLTableColElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -133,7 +131,7 @@ nsHTMLTableColElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Align, align)
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableColElementIID, NS_IDOMHTMLTABLECOLELEMENT_IID);
|
||||
|
||||
class nsHTMLTableColGroupElement : public nsIDOMHTMLTableColElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -81,7 +80,7 @@ NS_NewHTMLTableColGroupElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -104,7 +103,7 @@ nsHTMLTableColGroupElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
// DOM treats COLGROUP like COL
|
||||
if (aIID.Equals(kIDOMHTMLTableColElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLTableColElement))) {
|
||||
nsIDOMHTMLTableColElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -122,7 +121,7 @@ nsHTMLTableColGroupElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableColGroupElement, Align, align)
|
||||
|
|
|
@ -43,11 +43,6 @@
|
|||
#include "nsGenericHTMLElement.h"
|
||||
/* end for collections */
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableElementIID, NS_IDOMHTMLTABLEELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableCaptionElementIID, NS_IDOMHTMLTABLECAPTIONELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableSectionElementIID, NS_IDOMHTMLTABLESECTIONELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLCollectionIID, NS_IDOMHTMLCOLLECTION_IID);
|
||||
|
||||
class GenericElementCollection;
|
||||
class TableRowsCollection;
|
||||
|
||||
|
@ -148,7 +143,7 @@ TableRowsCollection::GetLength(PRUint32* aLength)
|
|||
if (nsnull!=rowGroup)
|
||||
{
|
||||
nsIContent *content=nsnull;
|
||||
rowGroup->QueryInterface(kIContentIID, (void **)&content);
|
||||
rowGroup->QueryInterface(NS_GET_IID(nsIContent), (void **)&content);
|
||||
GenericElementCollection head(content, nsHTMLAtoms::tr);
|
||||
PRUint32 rows;
|
||||
head.GetLength(&rows);
|
||||
|
@ -160,7 +155,7 @@ TableRowsCollection::GetLength(PRUint32* aLength)
|
|||
if (nsnull!=rowGroup)
|
||||
{
|
||||
nsIContent *content=nsnull;
|
||||
rowGroup->QueryInterface(kIContentIID, (void **)&content);
|
||||
rowGroup->QueryInterface(NS_GET_IID(nsIContent), (void **)&content);
|
||||
GenericElementCollection foot(content, nsHTMLAtoms::tr);
|
||||
PRUint32 rows;
|
||||
foot.GetLength(&rows);
|
||||
|
@ -179,7 +174,7 @@ TableRowsCollection::GetLength(PRUint32* aLength)
|
|||
while (nsnull!=node)
|
||||
{
|
||||
nsIContent *content=nsnull;
|
||||
node->QueryInterface(kIContentIID, (void **)&content);
|
||||
node->QueryInterface(NS_GET_IID(nsIContent), (void **)&content);
|
||||
GenericElementCollection body(content, nsHTMLAtoms::tr);
|
||||
PRUint32 rows;
|
||||
body.GetLength(&rows);
|
||||
|
@ -210,7 +205,7 @@ TableRowsCollection::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
|
|||
mParent->GetTHead(&rowGroup);
|
||||
if (nsnull != rowGroup) {
|
||||
nsIContent *content = nsnull;
|
||||
rowGroup->QueryInterface(kIContentIID, (void **)&content);
|
||||
rowGroup->QueryInterface(NS_GET_IID(nsIContent), (void **)&content);
|
||||
GenericElementCollection head(content, nsHTMLAtoms::tr);
|
||||
PRUint32 rowsInHead;
|
||||
head.GetLength(&rowsInHead);
|
||||
|
@ -233,7 +228,7 @@ TableRowsCollection::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
|
|||
tbodies->Item(theIndex, &node);
|
||||
while (nsnull != node) {
|
||||
nsIContent *content = nsnull;
|
||||
node->QueryInterface(kIContentIID, (void **)&content);
|
||||
node->QueryInterface(NS_GET_IID(nsIContent), (void **)&content);
|
||||
GenericElementCollection body(content, nsHTMLAtoms::tr);
|
||||
NS_RELEASE(content);
|
||||
NS_RELEASE(node);
|
||||
|
@ -255,7 +250,7 @@ TableRowsCollection::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
|
|||
mParent->GetTFoot(&rowGroup);
|
||||
if (nsnull != rowGroup) {
|
||||
nsIContent *content = nsnull;
|
||||
rowGroup->QueryInterface(kIContentIID, (void **)&content);
|
||||
rowGroup->QueryInterface(NS_GET_IID(nsIContent), (void **)&content);
|
||||
GenericElementCollection foot(content, nsHTMLAtoms::tr);
|
||||
foot.Item(aIndex-count, aReturn);
|
||||
NS_RELEASE(content);
|
||||
|
@ -299,7 +294,7 @@ NS_NewHTMLTableElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -333,7 +328,7 @@ nsresult
|
|||
nsHTMLTableElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLTableElement))) {
|
||||
nsIDOMHTMLTableElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -351,7 +346,7 @@ nsHTMLTableElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
// the DOM spec says border, cellpadding, cellSpacing are all "wstring"
|
||||
|
@ -503,7 +498,7 @@ nsHTMLTableElement::GetRows(nsIDOMHTMLCollection** aValue)
|
|||
mRows = new TableRowsCollection(this);
|
||||
NS_ADDREF(mRows); // this table's reference, released in the destructor
|
||||
}
|
||||
mRows->QueryInterface(kIDOMHTMLCollectionIID, (void **)aValue); // caller's addref
|
||||
mRows->QueryInterface(NS_GET_IID(nsIDOMHTMLCollection), (void **)aValue); // caller's addref
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -515,7 +510,7 @@ nsHTMLTableElement::GetTBodies(nsIDOMHTMLCollection** aValue)
|
|||
mTBodies = new GenericElementCollection((nsIContent*)this, nsHTMLAtoms::tbody);
|
||||
NS_ADDREF(mTBodies); // this table's reference, released in the destructor
|
||||
}
|
||||
mTBodies->QueryInterface(kIDOMHTMLCollectionIID, (void **)aValue); // caller's addref
|
||||
mTBodies->QueryInterface(NS_GET_IID(nsIDOMHTMLCollection), (void **)aValue); // caller's addref
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -528,7 +523,7 @@ nsHTMLTableElement::CreateTHead(nsIDOMHTMLElement** aValue)
|
|||
GetTHead(getter_AddRefs(head));
|
||||
if (head)
|
||||
{ // return the existing thead
|
||||
head->QueryInterface(kIDOMHTMLElementIID, (void **)aValue); // caller's addref
|
||||
head->QueryInterface(NS_GET_IID(nsIDOMHTMLElement), (void **)aValue); // caller's addref
|
||||
NS_ASSERTION(nsnull!=*aValue, "head must be a DOMHTMLElement");
|
||||
}
|
||||
else
|
||||
|
@ -548,7 +543,7 @@ nsHTMLTableElement::CreateTHead(nsIDOMHTMLElement** aValue)
|
|||
return rv;
|
||||
}
|
||||
|
||||
newHead->QueryInterface(kIDOMHTMLElementIID, (void **)aValue); // caller's addref
|
||||
newHead->QueryInterface(NS_GET_IID(nsIDOMHTMLElement), (void **)aValue); // caller's addref
|
||||
|
||||
nsCOMPtr<nsIDOMNode> resultChild;
|
||||
rv = mInner.InsertBefore(*aValue, child, getter_AddRefs(resultChild));
|
||||
|
@ -579,7 +574,7 @@ nsHTMLTableElement::CreateTFoot(nsIDOMHTMLElement** aValue)
|
|||
GetTFoot(getter_AddRefs(foot));
|
||||
if (nsnull!=foot)
|
||||
{ // return the existing tfoot
|
||||
foot->QueryInterface(kIDOMHTMLElementIID, (void **)aValue); // caller's addref
|
||||
foot->QueryInterface(NS_GET_IID(nsIDOMHTMLElement), (void **)aValue); // caller's addref
|
||||
NS_ASSERTION(nsnull!=*aValue, "foot must be a DOMHTMLElement");
|
||||
}
|
||||
else
|
||||
|
@ -594,7 +589,7 @@ nsHTMLTableElement::CreateTFoot(nsIDOMHTMLElement** aValue)
|
|||
if (NS_SUCCEEDED(rv) && newFoot)
|
||||
{
|
||||
rv = mInner.AppendChildTo(newFoot, PR_TRUE);
|
||||
newFoot->QueryInterface(kIDOMHTMLElementIID, (void **)aValue); // caller's addref
|
||||
newFoot->QueryInterface(NS_GET_IID(nsIDOMHTMLElement), (void **)aValue); // caller's addref
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -622,7 +617,7 @@ nsHTMLTableElement::CreateCaption(nsIDOMHTMLElement** aValue)
|
|||
GetCaption(getter_AddRefs(caption));
|
||||
if (caption)
|
||||
{ // return the existing thead
|
||||
caption->QueryInterface(kIDOMHTMLElementIID, (void **)aValue); // caller's addref
|
||||
caption->QueryInterface(NS_GET_IID(nsIDOMHTMLElement), (void **)aValue); // caller's addref
|
||||
NS_ASSERTION(nsnull!=*aValue, "caption must be a DOMHTMLElement");
|
||||
}
|
||||
else
|
||||
|
@ -637,7 +632,7 @@ nsHTMLTableElement::CreateCaption(nsIDOMHTMLElement** aValue)
|
|||
if (NS_SUCCEEDED(rv) && newCaption)
|
||||
{
|
||||
rv = mInner.AppendChildTo(newCaption, PR_TRUE);
|
||||
newCaption->QueryInterface(kIDOMHTMLElementIID, (void **)aValue); // caller's addref
|
||||
newCaption->QueryInterface(NS_GET_IID(nsIDOMHTMLElement), (void **)aValue); // caller's addref
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -695,7 +690,7 @@ nsHTMLTableElement::InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
|||
if (NS_SUCCEEDED(rv) && (nsnull!=newRow))
|
||||
{
|
||||
nsIDOMNode *newRowNode=nsnull;
|
||||
newRow->QueryInterface(kIDOMNodeIID, (void **)&newRowNode); // caller's addref
|
||||
newRow->QueryInterface(NS_GET_IID(nsIDOMNode), (void **)&newRowNode); // caller's addref
|
||||
if ((0<=aIndex) && (PRInt32(rowCount)<=aIndex)) // the index is greater than the number of rows, so just append
|
||||
rv = parent->AppendChild(newRowNode, (nsIDOMNode **)aValue);
|
||||
else // insert the new row before the reference row we found above
|
||||
|
@ -749,7 +744,7 @@ nsHTMLTableElement::InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
|||
if (NS_SUCCEEDED(rv) && (nsnull!=newRowGroup))
|
||||
{
|
||||
rv = mInner.AppendChildTo(newRowGroup, PR_TRUE);
|
||||
newRowGroup->QueryInterface(kIDOMNodeIID, (void **)&rowGroup);
|
||||
newRowGroup->QueryInterface(NS_GET_IID(nsIDOMNode), (void **)&rowGroup);
|
||||
NS_RELEASE(newRowGroup);
|
||||
}
|
||||
}
|
||||
|
@ -763,14 +758,14 @@ nsHTMLTableElement::InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
|||
|
||||
rv = NS_NewHTMLTableRowElement(&newRow, nodeInfo);
|
||||
nsIContent *rowGroupContent=nsnull;
|
||||
rowGroup->QueryInterface(kIContentIID, (void **)&rowGroupContent);
|
||||
rowGroup->QueryInterface(NS_GET_IID(nsIContent), (void **)&rowGroupContent);
|
||||
GenericElementCollection rowGroupRows(rowGroupContent, nsHTMLAtoms::tr);
|
||||
nsIDOMNode *firstRow=nsnull;
|
||||
rowGroupRows.Item(0, &firstRow); // it's ok if this returns nsnull
|
||||
if (NS_SUCCEEDED(rv) && (nsnull!=newRow))
|
||||
{
|
||||
nsIDOMNode *newRowNode;
|
||||
newRow->QueryInterface(kIDOMNodeIID, (void **)&newRowNode);
|
||||
newRow->QueryInterface(NS_GET_IID(nsIDOMNode), (void **)&newRowNode);
|
||||
rowGroup->InsertBefore(newRowNode, firstRow, (nsIDOMNode **)aValue);
|
||||
NS_RELEASE(newRowNode);
|
||||
NS_RELEASE(newRow);
|
||||
|
|
|
@ -42,12 +42,6 @@
|
|||
#include "nsIPresShell.h"
|
||||
#include "nsIFrame.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableRowElementIID, NS_IDOMHTMLTABLEROWELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableElementIID, NS_IDOMHTMLTABLEELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableSectionElementIID, NS_IDOMHTMLTABLESECTIONELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableCellElementIID, NS_IDOMHTMLTABLECELLELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLCollectionIID, NS_IDOMHTMLCOLLECTION_IID);
|
||||
|
||||
// nsTableCellCollection is needed because GenericElementCollection
|
||||
// only supports element of a single tag. This collection supports
|
||||
// elements <td> or <th> elements.
|
||||
|
@ -118,7 +112,7 @@ nsTableCellCollection::Item(PRUint32 aIndex,
|
|||
child->GetTag(childTag);
|
||||
if ((nsHTMLAtoms::td ==childTag) || (nsHTMLAtoms::th ==childTag)) {
|
||||
if (aIndex == theIndex) {
|
||||
child->QueryInterface(kIDOMNodeIID, (void**)aReturn); // out-param addref
|
||||
child->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aReturn); // out-param addref
|
||||
NS_ASSERTION(aReturn, "content element must be an nsIDOMNode");
|
||||
NS_RELEASE(childTag);
|
||||
NS_RELEASE(child);
|
||||
|
@ -180,7 +174,7 @@ protected:
|
|||
static
|
||||
void DebugList(nsIDOMHTMLTableElement* aTable) {
|
||||
nsIHTMLContent* content = nsnull;
|
||||
nsresult result = aTable->QueryInterface(kIHTMLContentIID, (void**)&content);
|
||||
nsresult result = aTable->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**)&content);
|
||||
if (NS_SUCCEEDED(result) && (nsnull != content)) {
|
||||
nsIDocument* doc = nsnull;
|
||||
result = content->GetDocument(doc);
|
||||
|
@ -216,7 +210,7 @@ NS_NewHTMLTableRowElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -243,7 +237,7 @@ nsresult
|
|||
nsHTMLTableRowElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableRowElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLTableRowElement))) {
|
||||
nsIDOMHTMLTableRowElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -261,7 +255,7 @@ nsHTMLTableRowElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
// protected method
|
||||
|
@ -275,7 +269,7 @@ nsHTMLTableRowElement::GetSection(nsIDOMHTMLTableSectionElement** aSection)
|
|||
nsIDOMNode *sectionNode = nsnull;
|
||||
nsresult result = GetParentNode(§ionNode);
|
||||
if (NS_SUCCEEDED(result) && (nsnull != sectionNode)) {
|
||||
result = sectionNode->QueryInterface(kIDOMHTMLTableSectionElementIID, (void**)aSection);
|
||||
result = sectionNode->QueryInterface(NS_GET_IID(nsIDOMHTMLTableSectionElement), (void**)aSection);
|
||||
NS_RELEASE(sectionNode);
|
||||
}
|
||||
return result;
|
||||
|
@ -295,7 +289,7 @@ nsHTMLTableRowElement::GetTable(nsIDOMHTMLTableElement** aTable)
|
|||
nsIDOMNode *tableNode = nsnull;
|
||||
result = sectionNode->GetParentNode(&tableNode);
|
||||
if (NS_SUCCEEDED(result) && (nsnull != tableNode)) {
|
||||
result = tableNode->QueryInterface(kIDOMHTMLTableElementIID, (void**)aTable);
|
||||
result = tableNode->QueryInterface(NS_GET_IID(nsIDOMHTMLTableElement), (void**)aTable);
|
||||
NS_RELEASE(tableNode);
|
||||
}
|
||||
NS_RELEASE(sectionNode);
|
||||
|
@ -473,7 +467,7 @@ nsHTMLTableRowElement::GetCells(nsIDOMHTMLCollection** aValue)
|
|||
mCells = new nsTableCellCollection(this, nsHTMLAtoms::td);
|
||||
NS_ADDREF(mCells); // this table's reference, released in the destructor
|
||||
}
|
||||
mCells->QueryInterface(kIDOMHTMLCollectionIID, (void **)aValue); // caller's addref
|
||||
mCells->QueryInterface(NS_GET_IID(nsIDOMHTMLCollection), (void **)aValue); // caller's addref
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -522,7 +516,7 @@ nsHTMLTableRowElement::InsertCell(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
|||
nsresult rv = NS_NewHTMLTableCellElement(&cellContent, nodeInfo);
|
||||
if (NS_SUCCEEDED(rv) && (nsnull != cellContent)) {
|
||||
nsIDOMNode* cellNode = nsnull;
|
||||
rv = cellContent->QueryInterface(kIDOMNodeIID, (void **)&cellNode);
|
||||
rv = cellContent->QueryInterface(NS_GET_IID(nsIDOMNode), (void **)&cellNode);
|
||||
if (NS_SUCCEEDED(rv) && (nsnull != cellNode)) {
|
||||
if (doInsert) {
|
||||
PRInt32 refIndex = PR_MAX(aIndex, 0);
|
||||
|
|
|
@ -34,9 +34,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "GenericElementCollection.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableSectionElementIID, NS_IDOMHTMLTABLESECTIONELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLCollectionIID, NS_IDOMHTMLCOLLECTION_IID);
|
||||
|
||||
// you will see the phrases "rowgroup" and "section" used interchangably
|
||||
|
||||
class nsHTMLTableSectionElement : public nsIDOMHTMLTableSectionElement,
|
||||
|
@ -87,7 +84,7 @@ NS_NewHTMLTableSectionElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -114,7 +111,7 @@ nsresult
|
|||
nsHTMLTableSectionElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableSectionElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLTableSectionElement))) {
|
||||
nsIDOMHTMLTableSectionElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -132,7 +129,7 @@ nsHTMLTableSectionElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableSectionElement, Align, align)
|
||||
|
@ -149,7 +146,7 @@ nsHTMLTableSectionElement::GetRows(nsIDOMHTMLCollection** aValue)
|
|||
mRows = new GenericElementCollection(this, nsHTMLAtoms::tr);
|
||||
NS_ADDREF(mRows); // this table's reference, released in the destructor
|
||||
}
|
||||
mRows->QueryInterface(kIDOMHTMLCollectionIID, (void **)aValue); // caller's addref
|
||||
mRows->QueryInterface(NS_GET_IID(nsIDOMHTMLCollection), (void **)aValue); // caller's addref
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -173,7 +170,7 @@ nsHTMLTableSectionElement::InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
|||
nsresult rv = NS_NewHTMLTableRowElement(&rowContent, nodeInfo);
|
||||
if (NS_SUCCEEDED(rv) && (nsnull != rowContent)) {
|
||||
nsIDOMNode* rowNode = nsnull;
|
||||
rv = rowContent->QueryInterface(kIDOMNodeIID, (void **)&rowNode);
|
||||
rv = rowContent->QueryInterface(NS_GET_IID(nsIDOMNode), (void **)&rowNode);
|
||||
if (NS_SUCCEEDED(rv) && (nsnull != rowNode)) {
|
||||
if (doInsert) {
|
||||
PRInt32 refIndex = PR_MAX(aIndex, 0);
|
||||
|
|
|
@ -51,13 +51,10 @@
|
|||
#include "nsIFormControlFrame.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTextAreaElementIID, NS_IDOMHTMLTEXTAREAELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLFormElementIID, NS_IDOMHTMLFORMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
|
||||
static NS_DEFINE_IID(kIFormIID, NS_IFORM_IID);
|
||||
static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID);
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
|
||||
class nsHTMLTextAreaElement : public nsIDOMHTMLTextAreaElement,
|
||||
public nsIDOMNSHTMLTextAreaElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -119,7 +116,7 @@ NS_NewHTMLTextAreaElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -143,7 +140,7 @@ nsresult
|
|||
nsHTMLTextAreaElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTextAreaElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLTextAreaElement))) {
|
||||
*aInstancePtr = (void*)(nsIDOMHTMLTextAreaElement*) this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -153,7 +150,7 @@ nsHTMLTextAreaElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(kIFormControlIID)) {
|
||||
else if (aIID.Equals(NS_GET_IID(nsIFormControl))) {
|
||||
*aInstancePtr = (void*)(nsIFormControl*) this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -172,7 +169,7 @@ nsHTMLTextAreaElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
// nsIContent
|
||||
|
@ -196,7 +193,7 @@ nsHTMLTextAreaElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
|||
*aForm = nsnull;
|
||||
if (nsnull != mForm) {
|
||||
nsIDOMHTMLFormElement* formElem = nsnull;
|
||||
result = mForm->QueryInterface(kIDOMHTMLFormElementIID, (void**)&formElem);
|
||||
result = mForm->QueryInterface(NS_GET_IID(nsIDOMHTMLFormElement), (void**)&formElem);
|
||||
if (NS_OK == result) {
|
||||
*aForm = formElem;
|
||||
}
|
||||
|
@ -607,7 +604,7 @@ NS_IMETHODIMP
|
|||
nsHTMLTextAreaElement::SetForm(nsIDOMHTMLFormElement* aForm)
|
||||
{
|
||||
nsCOMPtr<nsIFormControl> formControl;
|
||||
nsresult result = QueryInterface(kIFormControlIID, getter_AddRefs(formControl));
|
||||
nsresult result = QueryInterface(NS_GET_IID(nsIFormControl), getter_AddRefs(formControl));
|
||||
if (NS_FAILED(result)) formControl = nsnull;
|
||||
|
||||
nsAutoString nameVal, idVal;
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "nsIDOMHTMLDocument.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTitleElementIID, NS_IDOMHTMLTITLEELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
|
||||
class nsHTMLTitleElement : public nsIDOMHTMLTitleElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -85,7 +83,7 @@ NS_NewHTMLTitleElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -107,7 +105,7 @@ nsresult
|
|||
nsHTMLTitleElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTitleElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLTitleElement))) {
|
||||
nsIDOMHTMLTitleElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -125,7 +123,7 @@ nsHTMLTitleElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -183,7 +181,7 @@ nsHTMLTitleElement::GetText(nsAWritableString& aTitle)
|
|||
if ((NS_OK == result) && (nsnull != child)) {
|
||||
nsIDOMText* text;
|
||||
|
||||
result = child->QueryInterface(kIDOMTextIID, (void**)&text);
|
||||
result = child->QueryInterface(NS_GET_IID(nsIDOMText), (void**)&text);
|
||||
if (NS_OK == result) {
|
||||
text->GetData(aTitle);
|
||||
NS_RELEASE(text);
|
||||
|
@ -214,7 +212,7 @@ nsHTMLTitleElement::SetText(const nsAReadableString& aTitle)
|
|||
if ((NS_OK == result) && (nsnull != child)) {
|
||||
nsIDOMText* text;
|
||||
|
||||
result = child->QueryInterface(kIDOMTextIID, (void**)&text);
|
||||
result = child->QueryInterface(NS_GET_IID(nsIDOMText), (void**)&text);
|
||||
if (NS_OK == result) {
|
||||
text->SetData(aTitle);
|
||||
NS_RELEASE(text);
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
extern nsGenericHTMLElement::EnumTable kListTypeTable[];
|
||||
extern nsGenericHTMLElement::EnumTable kOldListTypeTable[];
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLUListElementIID, NS_IDOMHTMLULISTELEMENT_IID);
|
||||
|
||||
class nsHTMLUListElement : public nsIDOMHTMLUListElement,
|
||||
public nsIJSScriptObject,
|
||||
public nsIHTMLContent
|
||||
|
@ -84,7 +82,7 @@ NS_NewHTMLUListElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -106,7 +104,7 @@ nsresult
|
|||
nsHTMLUListElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLUListElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLUListElement))) {
|
||||
nsIDOMHTMLUListElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -124,7 +122,7 @@ nsHTMLUListElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLUListElement, Compact, compact)
|
||||
|
|
|
@ -211,7 +211,7 @@ NS_NewHTMLUnknownElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -246,7 +246,7 @@ nsHTMLUnknownElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
// XXX add nsIDOMHTMLWBR?
|
||||
|
||||
//static NS_DEFINE_IID(kIDOMHTMLWBRElementIID, NS_IDOMHTMLWBRELEMENT_IID);
|
||||
|
||||
class nsHTMLWBRElement : public nsIDOMHTMLElement,
|
||||
public nsIJSScriptObject,
|
||||
|
@ -79,7 +78,7 @@ NS_NewHTMLWBRElement(nsIHTMLContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +101,7 @@ nsHTMLWBRElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
#if 0
|
||||
if (aIID.Equals(kIDOMHTMLWBRElementIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLWBRElement))) {
|
||||
nsIDOMHTMLWBRElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -121,7 +120,7 @@ nsHTMLWBRElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
}
|
||||
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
|
||||
mInner.CopyInnerTo(this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
class nsIHTMLTableColElement : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IHTMLTABLECOLELEMENT_IID)
|
||||
|
||||
/** @return the number of columns this column object represents. Always >= 1 */
|
||||
NS_IMETHOD GetSpanValue (PRInt32* aSpan) = 0;
|
||||
|
|
|
@ -139,23 +139,12 @@ const PRInt32 kBackward = 1;
|
|||
// XXX Used to control whether we implement document.layers
|
||||
//#define NS_IMPLEMENT_DOCUMENT_LAYERS
|
||||
|
||||
static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
|
||||
static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLDocumentIID, NS_IDOMHTMLDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMNSHTMLDocumentIID, NS_IDOMNSHTMLDOCUMENT_IID);
|
||||
|
||||
static NS_DEFINE_IID(kIIOServiceIID, NS_IIOSERVICE_IID);
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
static NS_DEFINE_IID(kCookieServiceCID, NS_COOKIESERVICE_CID);
|
||||
static NS_DEFINE_CID(kCookieServiceCID, NS_COOKIESERVICE_CID);
|
||||
|
||||
static NS_DEFINE_CID(kParserServiceCID, NS_PARSERSERVICE_CID);
|
||||
|
||||
static NS_DEFINE_IID(kIHTMLContentContainerIID, NS_IHTMLCONTENTCONTAINER_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLBodyElementIID, NS_IDOMHTMLBODYELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIParserFilterIID, NS_IPARSERFILTER_IID);
|
||||
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
|
||||
|
||||
nsIRDFService* nsHTMLDocument::gRDF;
|
||||
|
@ -244,7 +233,7 @@ NS_NewHTMLDocument(nsIDocument** aInstancePtrResult)
|
|||
{
|
||||
nsHTMLDocument* doc = new nsHTMLDocument();
|
||||
if(doc)
|
||||
return doc->QueryInterface(kIDocumentIID, (void**) aInstancePtrResult);
|
||||
return doc->QueryInterface(NS_GET_IID(nsIDocument), (void**) aInstancePtrResult);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
@ -361,22 +350,22 @@ NS_IMETHODIMP nsHTMLDocument::QueryInterface(REFNSIID aIID,
|
|||
if (nsnull == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kIHTMLDocumentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIHTMLDocument))) {
|
||||
NS_ADDREF_THIS();
|
||||
*aInstancePtr = (void**) (nsIHTMLDocument *)this;
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMHTMLDocumentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLDocument))) {
|
||||
NS_ADDREF_THIS();
|
||||
*aInstancePtr = (void**) (nsIDOMHTMLDocument *)this;
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMNSHTMLDocumentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMNSHTMLDocument))) {
|
||||
NS_ADDREF_THIS();
|
||||
*aInstancePtr = (void**) (nsIDOMNSHTMLDocument *)this;
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIHTMLContentContainerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIHTMLContentContainer))) {
|
||||
NS_ADDREF_THIS();
|
||||
*aInstancePtr = (void**) (nsIHTMLContentContainer *)this;
|
||||
return NS_OK;
|
||||
|
@ -921,8 +910,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
|
|||
// Set the parser as the stream listener for the document loader...
|
||||
if (mParser)
|
||||
{
|
||||
static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID);
|
||||
rv = mParser->QueryInterface(kIStreamListenerIID, (void**)aDocListener);
|
||||
rv = mParser->QueryInterface(NS_GET_IID(nsIStreamListener), (void**)aDocListener);
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
|
||||
|
||||
|
@ -1420,7 +1408,7 @@ nsHTMLDocument::CreateElementNS(const nsAReadableString& aNamespaceURI,
|
|||
|
||||
content->SetContentID(mNextContentID++);
|
||||
|
||||
return content->QueryInterface(kIDOMElementIID, (void**)aReturn);
|
||||
return content->QueryInterface(NS_GET_IID(nsIDOMElement), (void**)aReturn);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1445,7 +1433,7 @@ nsHTMLDocument::CreateElement(const nsAReadableString& aTagName,
|
|||
nsresult rv = NS_CreateHTMLElement(getter_AddRefs(content), nodeInfo);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
content->SetContentID(mNextContentID++);
|
||||
rv = content->QueryInterface(kIDOMElementIID, (void**)aReturn);
|
||||
rv = content->QueryInterface(NS_GET_IID(nsIDOMElement), (void**)aReturn);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
@ -1820,7 +1808,7 @@ nsHTMLDocument::GetBody(nsIDOMHTMLElement** aBody)
|
|||
if (mBodyContent == nsnull && PR_FALSE == GetBodyContent()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
return mBodyContent->QueryInterface(kIDOMHTMLElementIID, (void **)aBody);
|
||||
return mBodyContent->QueryInterface(NS_GET_IID(nsIDOMHTMLElement), (void **)aBody);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -1839,7 +1827,7 @@ nsHTMLDocument::SetBody(nsIDOMHTMLElement* aBody)
|
|||
|
||||
while (child != nsnull) {
|
||||
nsIDOMElement* domElement;
|
||||
result = child->QueryInterface(kIDOMElementIID,(void **)&domElement);
|
||||
result = child->QueryInterface(NS_GET_IID(nsIDOMElement),(void **)&domElement);
|
||||
if (NS_OK == result) {
|
||||
nsString tagName;
|
||||
domElement->GetTagName(tagName);
|
||||
|
@ -2422,7 +2410,7 @@ nsHTMLDocument::GetElementsByName(const nsAReadableString& aElementName,
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return elements->QueryInterface(kIDOMNodeListIID, (void**)aReturn);
|
||||
return elements->QueryInterface(NS_GET_IID(nsIDOMNodeList), (void**)aReturn);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -3365,12 +3353,12 @@ PRBool nsHTMLDocument::SearchBlock(BlockText & aBlockText,
|
|||
nsSelectionPoint * endPnt = range->GetEndPoint();
|
||||
|
||||
nsIContent* content;
|
||||
nsresult rv = startNode->QueryInterface(kIContentIID,(void **)&content);
|
||||
nsresult rv = startNode->QueryInterface(NS_GET_IID(nsIContent),(void **)&content);
|
||||
if (NS_OK == rv) {
|
||||
startPnt->SetPoint(content, startOffset, PR_TRUE);
|
||||
NS_RELEASE(content);
|
||||
}
|
||||
rv = endNode->QueryInterface(kIContentIID,(void **)&content);
|
||||
rv = endNode->QueryInterface(NS_GET_IID(nsIContent),(void **)&content);
|
||||
if (NS_OK == rv) {
|
||||
endPnt->SetPoint(content, endOffset, PR_FALSE);
|
||||
NS_RELEASE(content);
|
||||
|
@ -3571,7 +3559,7 @@ PRBool nsHTMLDocument::BuildBlockTraversing(nsIDOMNode * aParent,
|
|||
nsIDOMNode * aCurrentBlock)
|
||||
{
|
||||
nsIDOMText* textContent;
|
||||
nsresult rv = aParent->QueryInterface(kIDOMTextIID,(void **)&textContent);
|
||||
nsresult rv = aParent->QueryInterface(NS_GET_IID(nsIDOMText),(void **)&textContent);
|
||||
if (NS_OK == rv) {
|
||||
nsString stringBuf;
|
||||
textContent->GetData(stringBuf);
|
||||
|
@ -3687,7 +3675,7 @@ void printDOMRefs(nsIDOMNode * aNode, PRInt32 aLevel)
|
|||
}
|
||||
|
||||
nsIDOMElement* domElement;
|
||||
nsresult rv = aNode->QueryInterface(kIDOMElementIID,(void **)&domElement);
|
||||
nsresult rv = aNode->QueryInterface(NS_GET_IID(nsIDOMElement),(void **)&domElement);
|
||||
if (NS_OK == rv) {
|
||||
nsString tagName;
|
||||
domElement->GetTagName(tagName);
|
||||
|
@ -3695,9 +3683,8 @@ void printDOMRefs(nsIDOMNode * aNode, PRInt32 aLevel)
|
|||
NS_RELEASE(domElement);
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
nsIDOMText* textContent;
|
||||
rv = aNode->QueryInterface(kIDOMTextIID,(void **)&textContent);
|
||||
rv = aNode->QueryInterface(NS_GET_IID(nsIDOMText),(void **)&textContent);
|
||||
if (NS_OK == rv) {
|
||||
nsString stringBuf;
|
||||
textContent->GetData(stringBuf);
|
||||
|
@ -3736,7 +3723,7 @@ void printDOMRefs(nsIDOMNode * aNode, PRInt32 aLevel)
|
|||
static nsIDOMNode * FindDOMNode(nsIDOMNode * aNode, nsIContent * aContent)
|
||||
{
|
||||
nsIContent* content;
|
||||
nsresult rv = aNode->QueryInterface(kIContentIID,(void **)&content);
|
||||
nsresult rv = aNode->QueryInterface(NS_GET_IID(nsIContent),(void **)&content);
|
||||
if (NS_OK == rv) {
|
||||
if (content == aContent) {
|
||||
return aNode;
|
||||
|
@ -3867,7 +3854,7 @@ NS_IMETHODIMP nsHTMLDocument::FindNext(const nsAReadableString &aSearchStr,
|
|||
// to their DOM Node counter part
|
||||
if (mSearchDirection == kForward) {
|
||||
nsIDOMNode * endNode;
|
||||
nsresult rv = endContent->QueryInterface(kIDOMNodeIID,(void **)&endNode);
|
||||
nsresult rv = endContent->QueryInterface(NS_GET_IID(nsIDOMNode),(void **)&endNode);
|
||||
if (NS_OK == rv) {
|
||||
searchNode = endNode;
|
||||
}
|
||||
|
@ -3879,7 +3866,7 @@ NS_IMETHODIMP nsHTMLDocument::FindNext(const nsAReadableString &aSearchStr,
|
|||
mAdjustToEnd = PR_TRUE;
|
||||
} else {
|
||||
nsIDOMNode * startNode;
|
||||
nsresult rv = startContent->QueryInterface(kIDOMNodeIID,(void **)&startNode);
|
||||
nsresult rv = startContent->QueryInterface(NS_GET_IID(nsIDOMNode),(void **)&startNode);
|
||||
if (NS_OK == rv) {
|
||||
searchNode = startNode;
|
||||
}
|
||||
|
@ -3937,9 +3924,8 @@ NS_IMETHODIMP nsHTMLDocument::FindNext(const nsAReadableString &aSearchStr,
|
|||
nsIDOMNode * node = FindDOMNode(root, startContent);
|
||||
|
||||
nsString contentStr;
|
||||
//static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
nsIDOMText* textContent;
|
||||
nsresult rv = node->QueryInterface(kIDOMTextIID,(void **)&textContent);
|
||||
nsresult rv = node->QueryInterface(NS_GET_IID(nsIDOMText),(void **)&textContent);
|
||||
if (NS_OK == rv) {
|
||||
textContent->GetData(contentStr);
|
||||
NS_RELEASE(textContent);
|
||||
|
@ -4022,9 +4008,8 @@ NS_IMETHODIMP nsHTMLDocument::FindNext(const nsAReadableString &aSearchStr,
|
|||
NS_IF_RELEASE(prevNode);
|
||||
|
||||
if (contentNode != nsnull) {
|
||||
static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID);
|
||||
nsIContent* content;
|
||||
rv = contentNode->QueryInterface(kIContentIID,(void **)&content);
|
||||
rv = contentNode->QueryInterface(NS_GET_IID(nsIContent),(void **)&content);
|
||||
if (NS_OK == rv) {
|
||||
//range = mSelection->GetRange();
|
||||
//startPnt = range->GetStartPoint();
|
||||
|
@ -4066,7 +4051,7 @@ nsHTMLDocument::GetBodyContent()
|
|||
|
||||
while (child != nsnull) {
|
||||
nsIDOMElement* domElement;
|
||||
nsresult rv = child->QueryInterface(kIDOMElementIID,(void **)&domElement);
|
||||
nsresult rv = child->QueryInterface(NS_GET_IID(nsIDOMElement),(void **)&domElement);
|
||||
if (NS_OK == rv) {
|
||||
nsString tagName;
|
||||
domElement->GetTagName(tagName);
|
||||
|
@ -4093,7 +4078,7 @@ nsHTMLDocument::GetBodyElement(nsIDOMHTMLBodyElement** aBody)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
return mBodyContent->QueryInterface(kIDOMHTMLBodyElementIID,
|
||||
return mBodyContent->QueryInterface(NS_GET_IID(nsIDOMHTMLBodyElement),
|
||||
(void**)aBody);
|
||||
}
|
||||
|
||||
|
@ -4110,7 +4095,7 @@ nsHTMLDocument::AddForm(nsIDOMHTMLFormElement *aForm)
|
|||
}
|
||||
|
||||
nsIContent* iContent = nsnull;
|
||||
nsresult result = aForm->QueryInterface(kIContentIID, (void**)&iContent);
|
||||
nsresult result = aForm->QueryInterface(NS_GET_IID(nsIContent), (void**)&iContent);
|
||||
if ((NS_OK == result) && iContent) {
|
||||
nsIDOMHTMLCollection* forms = nsnull;
|
||||
|
||||
|
|
|
@ -32,9 +32,6 @@
|
|||
#include "nsLayoutAtoms.h"
|
||||
#include "nsIXMLContent.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMCDATASectionIID, NS_IDOMCDATASECTION_IID);
|
||||
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);
|
||||
|
||||
class nsXMLCDATASection : public nsIDOMCDATASection,
|
||||
public nsIScriptObjectOwner,
|
||||
|
@ -85,7 +82,7 @@ NS_NewXMLCDATASection(nsIContent** aInstancePtrResult)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIContentIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIContent), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsXMLCDATASection::nsXMLCDATASection()
|
||||
|
@ -105,19 +102,19 @@ NS_IMETHODIMP
|
|||
nsXMLCDATASection::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_DOM_DATA_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMCDATASectionIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMCDATASection))) {
|
||||
nsIDOMCDATASection* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMTextIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMText))) {
|
||||
nsIDOMText* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kITextContentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsITextContent))) {
|
||||
nsITextContent* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -167,7 +164,7 @@ nsXMLCDATASection::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
// XXX Increment the ref count before calling any
|
||||
// methods. If they do a QI and then a Release()
|
||||
// the instance will be deleted.
|
||||
result = it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
result = it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
if (NS_FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
|
@ -194,7 +191,7 @@ nsXMLCDATASection::CloneContent(PRBool aCloneText, nsITextContent** aReturn)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
result = it->QueryInterface(kITextContentIID, (void**) aReturn);
|
||||
result = it->QueryInterface(NS_GET_IID(nsITextContent), (void**) aReturn);
|
||||
if (NS_FAILED(result) || !aCloneText) {
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -41,9 +41,6 @@
|
|||
#include "nsIRefreshURI.h"
|
||||
|
||||
|
||||
//static NS_DEFINE_IID(kIDOMElementIID, NS_IDOMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIXMLContentIID, NS_IXMLCONTENT_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewXMLElement(nsIXMLContent** aInstancePtrResult, nsINodeInfo *aNodeInfo)
|
||||
{
|
||||
|
@ -55,7 +52,7 @@ NS_NewXMLElement(nsIXMLContent** aInstancePtrResult, nsINodeInfo *aNodeInfo)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIXMLContentIID, (void**) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIXMLContent), (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
static nsIAtom* kSimpleAtom; // XXX these should get moved to nsXMLAtoms
|
||||
|
@ -107,7 +104,7 @@ nsXMLElement::QueryInterface(REFNSIID aIID,
|
|||
void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this, nsIXMLContent)
|
||||
if (aIID.Equals(kIXMLContentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIXMLContent))) {
|
||||
nsIXMLContent* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -496,7 +493,7 @@ nsXMLElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo((nsIContent *)(nsIXMLContent *)this, &it->mInner, aDeep);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
// nsIStyledContent implementation
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsString.h"
|
||||
#include "nsIXMLContent.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMEntityIID, NS_IDOMENTITY_IID);
|
||||
|
||||
class nsXMLEntity : public nsIDOMEntity,
|
||||
public nsIScriptObjectOwner,
|
||||
|
@ -94,7 +93,7 @@ NS_NewXMLEntity(nsIContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIContentIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIContent), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsXMLEntity::nsXMLEntity(const nsAReadableString& aName,
|
||||
|
@ -121,39 +120,39 @@ nsXMLEntity::QueryInterface(REFNSIID aIID, void** aInstancePtrResult)
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsISupports))) {
|
||||
nsIDOMEntity* tmp = this;
|
||||
nsISupports* tmp2 = tmp;
|
||||
*aInstancePtrResult = (void*) tmp2;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMNodeIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMNode))) {
|
||||
nsIDOMNode* tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMEventReceiverIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMEventReceiver))) {
|
||||
nsCOMPtr<nsIEventListenerManager> man;
|
||||
if (NS_SUCCEEDED(mInner.GetListenerManager(this, getter_AddRefs(man)))){
|
||||
return man->QueryInterface(kIDOMEventReceiverIID, (void**)aInstancePtrResult);
|
||||
return man->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), (void**)aInstancePtrResult);
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
|
||||
nsIScriptObjectOwner* tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIContentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIContent))) {
|
||||
nsIContent* tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMEntityIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMEntity))) {
|
||||
nsIDOMEntity* tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -260,7 +259,7 @@ nsXMLEntity::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsISupportsArray.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMNamedNodeMapIID, NS_IDOMNAMEDNODEMAP_IID);
|
||||
|
||||
class nsXMLNamedNodeMap : public nsIDOMNamedNodeMap,
|
||||
public nsIScriptObjectOwner
|
||||
|
@ -83,7 +82,7 @@ NS_NewXMLNamedNodeMap(nsIDOMNamedNodeMap** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIDOMNamedNodeMapIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNamedNodeMap), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsXMLNamedNodeMap::nsXMLNamedNodeMap(nsISupportsArray *aArray)
|
||||
|
@ -111,20 +110,20 @@ nsXMLNamedNodeMap::QueryInterface(REFNSIID aIID, void** aInstancePtrResult)
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsISupports))) {
|
||||
nsIDOMNamedNodeMap* tmp = this;
|
||||
nsISupports* tmp2 = tmp;
|
||||
*aInstancePtrResult = (void*) tmp2;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
|
||||
nsIScriptObjectOwner* tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMNamedNodeMapIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMNamedNodeMap))) {
|
||||
nsIDOMNamedNodeMap* tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsString.h"
|
||||
#include "nsIXMLContent.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMNotationIID, NS_IDOMNOTATION_IID);
|
||||
|
||||
class nsXMLNotation : public nsIDOMNotation,
|
||||
public nsIScriptObjectOwner,
|
||||
|
@ -90,7 +89,7 @@ NS_NewXMLNotation(nsIContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIContentIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIContent), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsXMLNotation::nsXMLNotation(const nsAReadableString& aName,
|
||||
|
@ -116,39 +115,39 @@ nsXMLNotation::QueryInterface(REFNSIID aIID, void** aInstancePtrResult)
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsISupports))) {
|
||||
nsIDOMNotation* tmp = this;
|
||||
nsISupports* tmp2 = tmp;
|
||||
*aInstancePtrResult = (void*) tmp2;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMNodeIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMNode))) {
|
||||
nsIDOMNode* tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMEventReceiverIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMEventReceiver))) {
|
||||
nsCOMPtr<nsIEventListenerManager> man;
|
||||
if (NS_SUCCEEDED(mInner.GetListenerManager(this, getter_AddRefs(man)))){
|
||||
return man->QueryInterface(kIDOMEventReceiverIID, (void**)aInstancePtrResult);
|
||||
return man->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), (void**)aInstancePtrResult);
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
|
||||
nsIScriptObjectOwner* tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIContentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIContent))) {
|
||||
nsIContent* tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMNotationIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMNotation))) {
|
||||
nsIDOMNotation* tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -246,7 +245,7 @@ nsXMLNotation::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -96,7 +96,7 @@ NS_NewXMLProcessingInstruction(nsIContent** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIContentIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIContent), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsXMLProcessingInstruction::nsXMLProcessingInstruction(const nsAReadableString& aTarget,
|
||||
|
@ -138,7 +138,7 @@ nsXMLProcessingInstruction::QueryInterface(REFNSIID aIID, void** aInstancePtrRes
|
|||
if (aIID.Equals(NS_GET_IID(nsIDOMEventReceiver))) {
|
||||
nsCOMPtr<nsIEventListenerManager> man;
|
||||
if (NS_SUCCEEDED(mInner.GetListenerManager(this, getter_AddRefs(man)))){
|
||||
return man->QueryInterface(kIDOMEventReceiverIID, (void**)aInstancePtrResult);
|
||||
return man->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), (void**)aInstancePtrResult);
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
#ifndef nsIStyleSheetLinkingElement_h__
|
||||
#define nsIStyleSheetLinkingElement_h__
|
||||
|
||||
|
||||
#include "nsISupports.h"
|
||||
|
||||
#define NS_ISTYLESHEETLINKINGELEMENT_IID \
|
||||
{0xa6cf90e9, 0x15b3, 0x11d2, \
|
||||
{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
class nsIStyleSheet;
|
||||
|
||||
class nsIStyleSheetLinkingElement : public nsISupports {
|
||||
public:
|
||||
/**
|
||||
* Used to make the association between a style sheet and
|
||||
* the element that linked it to the document.
|
||||
*
|
||||
* @param aStyleSheet the style sheet associated with this
|
||||
* element.
|
||||
*/
|
||||
NS_IMETHOD SetStyleSheet(nsIStyleSheet* aStyleSheet) = 0;
|
||||
|
||||
/**
|
||||
* Used to obtain the style sheet linked in by this element.
|
||||
*
|
||||
* @param aStyleSheet out parameter that returns the style
|
||||
* sheet associated with this element.
|
||||
*/
|
||||
NS_IMETHOD GetStyleSheet(nsIStyleSheet*& aStyleSheet) = 0;
|
||||
};
|
||||
|
||||
#endif // nsILinkingElement_h__
|
|
@ -33,10 +33,6 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsIDOMRange.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMCommentIID, NS_IDOMCOMMENT_IID);
|
||||
static NS_DEFINE_IID(kIEnumeratorIID, NS_IENUMERATOR_IID);
|
||||
static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);
|
||||
|
||||
class nsCommentNode : public nsIDOMComment,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsITextContent
|
||||
|
@ -242,7 +238,7 @@ NS_NewCommentNode(nsIContent** aInstancePtrResult)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIContentIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIContent), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsCommentNode::nsCommentNode()
|
||||
|
@ -263,13 +259,13 @@ NS_IMETHODIMP
|
|||
nsCommentNode::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_DOM_DATA_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMCommentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMComment))) {
|
||||
nsIDOMComment* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kITextContentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsITextContent))) {
|
||||
nsITextContent* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -311,7 +307,7 @@ nsCommentNode::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
// XXX Increment the ref count before calling any
|
||||
// methods. If they do a QI and then a Release()
|
||||
// the instance will be deleted.
|
||||
result = it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
result = it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
if (NS_FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
|
@ -338,7 +334,7 @@ nsCommentNode::CloneContent(PRBool aCloneText, nsITextContent** aReturn)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
result = it->QueryInterface(kITextContentIID, (void**) aReturn);
|
||||
result = it->QueryInterface(NS_GET_IID(nsITextContent), (void**) aReturn);
|
||||
if (NS_FAILED(result) || !aCloneText) {
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -112,30 +112,27 @@ nsContentList::~nsContentList()
|
|||
}
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLCollectionIID, NS_IDOMHTMLCOLLECTION_IID);
|
||||
|
||||
nsresult nsContentList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
if (nsnull == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kIDOMNodeListIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMNodeList))) {
|
||||
*aInstancePtr = (void*)(nsIDOMNodeList*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMHTMLCollectionIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMHTMLCollection))) {
|
||||
*aInstancePtr = (void*)(nsIDOMHTMLCollection*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
|
||||
*aInstancePtr = (void*)(nsIScriptObjectOwner*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsISupports))) {
|
||||
*aInstancePtr = (void*)(nsISupports*)(nsIDOMNodeList*)this;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -169,7 +166,7 @@ nsContentList::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
|
|||
nsISupports *element = (nsISupports *)mContent.ElementAt(aIndex);
|
||||
|
||||
if (nsnull != element) {
|
||||
result = element->QueryInterface(kIDOMNodeIID, (void **)aReturn);
|
||||
result = element->QueryInterface(NS_GET_IID(nsIDOMNode), (void **)aReturn);
|
||||
}
|
||||
else {
|
||||
*aReturn = nsnull;
|
||||
|
@ -200,7 +197,7 @@ nsContentList::NamedItem(const nsAReadableString& aName, nsIDOMNode** aReturn)
|
|||
(aName.Equals(name))) ||
|
||||
((content->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::id, name) == NS_CONTENT_ATTR_HAS_VALUE) &&
|
||||
(aName.Equals(name)))) {
|
||||
return content->QueryInterface(kIDOMNodeIID, (void **)aReturn);
|
||||
return content->QueryInterface(NS_GET_IID(nsIDOMNode), (void **)aReturn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,11 +28,6 @@
|
|||
#include "nsINameSpaceManager.h"
|
||||
#include "nsDOMError.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMAttrIID, NS_IDOMATTR_IID);
|
||||
static NS_DEFINE_IID(kIDOMAttributePrivateIID, NS_IDOMATTRIBUTEPRIVATE_IID);
|
||||
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsDOMAttribute::nsDOMAttribute(nsIContent* aContent,
|
||||
|
@ -63,31 +58,31 @@ nsDOMAttribute::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kIDOMAttrIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMAttr))) {
|
||||
nsIDOMAttr* tmp = this;
|
||||
*aInstancePtr = (void*)tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
|
||||
nsIScriptObjectOwner* tmp = this;
|
||||
*aInstancePtr = (void*)tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMAttributePrivateIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMAttributePrivate))) {
|
||||
nsIDOMAttributePrivate* tmp = this;
|
||||
*aInstancePtr = (void*)tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMNodeIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMNode))) {
|
||||
nsIDOMNode* tmp = this;
|
||||
*aInstancePtr = (void*)tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsISupports))) {
|
||||
nsIDOMAttr* tmp1 = this;
|
||||
nsISupports* tmp2 = tmp1;
|
||||
*aInstancePtr = (void*)tmp2;
|
||||
|
@ -293,7 +288,7 @@ nsDOMAttribute::GetChildNodes(nsIDOMNodeList** aChildNodes)
|
|||
NS_ADDREF(mChildList);
|
||||
}
|
||||
|
||||
return mChildList->QueryInterface(kIDOMNodeListIID, (void**)aChildNodes);
|
||||
return mChildList->QueryInterface(NS_GET_IID(nsIDOMNodeList), (void**)aChildNodes);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -333,11 +328,11 @@ nsDOMAttribute::GetFirstChild(nsIDOMNode** aFirstChild)
|
|||
if (NS_OK != result) {
|
||||
return result;
|
||||
}
|
||||
result = content->QueryInterface(kIDOMTextIID, (void**)&mChild);
|
||||
result = content->QueryInterface(NS_GET_IID(nsIDOMText), (void**)&mChild);
|
||||
NS_RELEASE(content);
|
||||
}
|
||||
mChild->SetData(value);
|
||||
result = mChild->QueryInterface(kIDOMNodeIID, (void**)aFirstChild);
|
||||
result = mChild->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aFirstChild);
|
||||
}
|
||||
else {
|
||||
*aFirstChild = nsnull;
|
||||
|
@ -426,7 +421,7 @@ nsDOMAttribute::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return newAttr->QueryInterface(kIDOMNodeIID, (void**)aReturn);
|
||||
return newAttr->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -435,7 +430,7 @@ nsDOMAttribute::GetOwnerDocument(nsIDOMDocument** aOwnerDocument)
|
|||
nsresult result = NS_OK;
|
||||
if (nsnull != mContent) {
|
||||
nsIDOMNode* node;
|
||||
result = mContent->QueryInterface(kIDOMNodeIID, (void**)&node);
|
||||
result = mContent->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&node);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = node->GetOwnerDocument(aOwnerDocument);
|
||||
NS_RELEASE(node);
|
||||
|
|
|
@ -1,105 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
#ifndef nsDOMAttribute_h___
|
||||
#define nsDOMAttribute_h___
|
||||
|
||||
#include "nsIDOMAttr.h"
|
||||
#include "nsIDOMText.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsGenericDOMNodeList.h"
|
||||
#include "nsString.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsINodeInfo.h"
|
||||
|
||||
class nsIContent;
|
||||
class nsDOMAttribute;
|
||||
|
||||
#define NS_IDOMATTRIBUTEPRIVATE_IID \
|
||||
{0xa6cf90dd, 0x15b3, 0x11d2, \
|
||||
{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
class nsIDOMAttributePrivate : public nsISupports {
|
||||
public:
|
||||
NS_IMETHOD DropReference() = 0;
|
||||
NS_IMETHOD SetContent(nsIContent* aContent) = 0;
|
||||
NS_IMETHOD GetContent(nsIContent** aContent) = 0;
|
||||
};
|
||||
|
||||
// bogus child list for an attribute
|
||||
class nsAttributeChildList : public nsGenericDOMNodeList
|
||||
{
|
||||
public:
|
||||
nsAttributeChildList(nsDOMAttribute* aAttribute);
|
||||
virtual ~nsAttributeChildList();
|
||||
|
||||
// interface nsIDOMNodeList
|
||||
NS_IMETHOD GetLength(PRUint32* aLength);
|
||||
NS_IMETHOD Item(PRUint32 aIndex, nsIDOMNode** aReturn);
|
||||
|
||||
void DropReference();
|
||||
|
||||
protected:
|
||||
nsDOMAttribute* mAttribute;
|
||||
};
|
||||
|
||||
// Attribute helper class used to wrap up an attribute with a dom
|
||||
// object that implements nsIDOMAttr and nsIDOMNode and
|
||||
// nsIScriptObjectOwner
|
||||
class nsDOMAttribute : public nsIDOMAttr,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMAttributePrivate
|
||||
{
|
||||
public:
|
||||
nsDOMAttribute(nsIContent* aContent, nsINodeInfo *aNodeInfo,
|
||||
const nsAReadableString& aValue);
|
||||
virtual ~nsDOMAttribute();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD GetScriptObject(nsIScriptContext* aContext, void** aScriptObject);
|
||||
NS_IMETHOD SetScriptObject(void *aScriptObject);
|
||||
|
||||
// nsIDOMAttr interface
|
||||
NS_DECL_IDOMATTR
|
||||
|
||||
// nsIDOMNode interface
|
||||
NS_DECL_IDOMNODE
|
||||
|
||||
// nsIDOMAttributePrivate interface
|
||||
NS_IMETHOD DropReference();
|
||||
NS_IMETHOD SetContent(nsIContent* aContent);
|
||||
NS_IMETHOD GetContent(nsIContent** aContent);
|
||||
|
||||
private:
|
||||
nsIContent* mContent;
|
||||
nsCOMPtr<nsINodeInfo> mNodeInfo;
|
||||
nsString mValue;
|
||||
// XXX For now, there's only a single child - a text
|
||||
// element representing the value
|
||||
nsIDOMText* mChild;
|
||||
nsAttributeChildList* mChildList;
|
||||
void* mScriptObject;
|
||||
};
|
||||
|
||||
|
||||
#endif /* nsDOMAttribute_h___ */
|
|
@ -1,268 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#include "nsDOMDocumentType.h"
|
||||
#include "nsDOMAttributeMap.h"
|
||||
#include "nsIDOMNamedNodeMap.h"
|
||||
#include "nsIDOMScriptObjectFactory.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
nsresult
|
||||
NS_NewDOMDocumentType(nsIDOMDocumentType** aDocType,
|
||||
const nsAReadableString& aName,
|
||||
nsIDOMNamedNodeMap *aEntities,
|
||||
nsIDOMNamedNodeMap *aNotations,
|
||||
const nsAReadableString& aPublicId,
|
||||
const nsAReadableString& aSystemId,
|
||||
const nsAReadableString& aInternalSubset)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocType);
|
||||
|
||||
*aDocType = new nsDOMDocumentType(aName, aEntities, aNotations,
|
||||
aPublicId, aSystemId, aInternalSubset);
|
||||
if (!*aDocType) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
NS_ADDREF(*aDocType);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsDOMDocumentType::nsDOMDocumentType(const nsAReadableString& aName,
|
||||
nsIDOMNamedNodeMap *aEntities,
|
||||
nsIDOMNamedNodeMap *aNotations,
|
||||
const nsAReadableString& aPublicId,
|
||||
const nsAReadableString& aSystemId,
|
||||
const nsAReadableString& aInternalSubset) :
|
||||
mName(aName),
|
||||
mPublicId(aPublicId),
|
||||
mSystemId(aSystemId),
|
||||
mInternalSubset(aInternalSubset)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
mEntities = aEntities;
|
||||
mNotations = aNotations;
|
||||
|
||||
NS_IF_ADDREF(mEntities);
|
||||
NS_IF_ADDREF(mNotations);
|
||||
}
|
||||
|
||||
nsDOMDocumentType::~nsDOMDocumentType()
|
||||
{
|
||||
NS_IF_RELEASE(mEntities);
|
||||
NS_IF_RELEASE(mNotations);
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsDOMDocumentType)
|
||||
NS_IMPL_RELEASE(nsDOMDocumentType)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsDOMDocumentType)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMDocumentType)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentType)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNode)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIContent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIScriptObjectOwner)
|
||||
NS_INTERFACE_MAP_END_THREADSAFE
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::GetName(nsAWritableString& aName)
|
||||
{
|
||||
aName=mName;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::GetEntities(nsIDOMNamedNodeMap** aEntities)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aEntities);
|
||||
|
||||
*aEntities = mEntities;
|
||||
|
||||
NS_IF_ADDREF(*aEntities);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::GetNotations(nsIDOMNamedNodeMap** aNotations)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aNotations);
|
||||
|
||||
*aNotations = mNotations;
|
||||
|
||||
NS_IF_ADDREF(*aNotations);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::GetPublicId(nsAWritableString& aPublicId)
|
||||
{
|
||||
aPublicId = mPublicId;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::GetSystemId(nsAWritableString& aSystemId)
|
||||
{
|
||||
aSystemId = mSystemId;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::GetInternalSubset(nsAWritableString& aInternalSubset)
|
||||
{
|
||||
aInternalSubset = mInternalSubset;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::GetTag(nsIAtom*& aResult) const
|
||||
{
|
||||
aResult = NS_NewAtom(mName.GetUnicode());
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::GetNodeInfo(nsINodeInfo*& aResult) const
|
||||
{
|
||||
aResult = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::GetNodeName(nsAWritableString& aNodeName)
|
||||
{
|
||||
aNodeName=mName;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::GetNodeType(PRUint16* aNodeType)
|
||||
{
|
||||
*aNodeType = nsIDOMNode::DOCUMENT_TYPE_NODE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
{
|
||||
nsDOMDocumentType* it = new nsDOMDocumentType(mName,
|
||||
mEntities,
|
||||
mNotations,
|
||||
mPublicId,
|
||||
mSystemId,
|
||||
mInternalSubset);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::List(FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
NS_PRECONDITION(nsnull != mInner.mDocument, "bad content");
|
||||
|
||||
PRInt32 index;
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
|
||||
fprintf(out, "Document type refcount: %d\n", mRefCnt);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::DumpContent(FILE* out = stdout, PRInt32 aIndent = 0,PRBool aDumpAll=PR_TRUE) const {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::HandleDOMEvent(nsIPresContext* aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus* aEventStatus)
|
||||
{
|
||||
// We should never be getting events
|
||||
NS_ASSERTION(0, "event handler called for document type");
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::GetContentID(PRUint32* aID)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aID);
|
||||
|
||||
*aID = 0;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::SetContentID(PRUint32 aID)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDocumentType::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
|
||||
#ifdef DEBUG
|
||||
PRUint32 sum;
|
||||
mInner.SizeOf(aSizer, &sum, sizeof(*this));
|
||||
PRUint32 ssize;
|
||||
mName.SizeOf(aSizer, &ssize);
|
||||
sum = sum - sizeof(mName) + ssize;
|
||||
if (mEntities) {
|
||||
PRBool recorded;
|
||||
aSizer->RecordObject((void*) mEntities, &recorded);
|
||||
if (!recorded) {
|
||||
PRUint32 size;
|
||||
nsDOMAttributeMap::SizeOfNamedNodeMap(mEntities, aSizer, &size);
|
||||
aSizer->AddSize(nsLayoutAtoms::xml_document_entities, size);
|
||||
}
|
||||
}
|
||||
if (mNotations) {
|
||||
PRBool recorded;
|
||||
aSizer->RecordObject((void*) mNotations, &recorded);
|
||||
if (!recorded) {
|
||||
PRUint32 size;
|
||||
nsDOMAttributeMap::SizeOfNamedNodeMap(mNotations, aSizer, &size);
|
||||
aSizer->AddSize(nsLayoutAtoms::xml_document_notations, size);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
|
@ -34,9 +34,6 @@
|
|||
#include "nsDOMError.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIDOMDocumentFragmentIID, NS_IDOMDOCUMENTFRAGMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMDocumentIID, NS_IDOMDOCUMENT_IID);
|
||||
|
||||
class nsDocumentFragment : public nsIContent,
|
||||
public nsIDOMDocumentFragment,
|
||||
public nsIScriptObjectOwner
|
||||
|
@ -285,7 +282,7 @@ NS_NewDocumentFragment(nsIDOMDocumentFragment** aInstancePtrResult,
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIDOMDocumentFragmentIID,
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMDocumentFragment),
|
||||
(void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
@ -310,32 +307,32 @@ NS_IMPL_RELEASE(nsDocumentFragment)
|
|||
nsresult
|
||||
nsDocumentFragment::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsISupports))) {
|
||||
nsIDOMDocumentFragment* tmp = this;
|
||||
nsISupports* tmp2 = tmp;
|
||||
*aInstancePtr = (void*) tmp2;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMDocumentFragmentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMDocumentFragment))) {
|
||||
nsIDOMDocumentFragment* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMNodeIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMNode))) {
|
||||
nsIDOMDocumentFragment* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
|
||||
nsIScriptObjectOwner* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIContentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIContent))) {
|
||||
nsIContent* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -376,7 +373,7 @@ NS_IMETHODIMP
|
|||
nsDocumentFragment::GetOwnerDocument(nsIDOMDocument** aOwnerDocument)
|
||||
{
|
||||
if (nsnull != mOwnerDocument) {
|
||||
return mOwnerDocument->QueryInterface(kIDOMDocumentIID, (void **)aOwnerDocument);
|
||||
return mOwnerDocument->QueryInterface(NS_GET_IID(nsIDOMDocument), (void **)aOwnerDocument);
|
||||
}
|
||||
else {
|
||||
*aOwnerDocument = nsnull;
|
||||
|
@ -419,7 +416,7 @@ nsDocumentFragment::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
//XXX mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -45,16 +45,6 @@
|
|||
#include "prprf.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
// XXX share all id's in this dir
|
||||
|
||||
NS_DEFINE_IID(kIDOMCharacterDataIID, NS_IDOMCHARACTERDATA_IID);
|
||||
|
||||
static NS_DEFINE_IID(kIPrivateDOMEventIID, NS_IPRIVATEDOMEVENT_IID);
|
||||
static NS_DEFINE_IID(kIEnumeratorIID, NS_IENUMERATOR_IID);
|
||||
static NS_DEFINE_IID(kIDOMDocumentIID, NS_IDOMDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@ -97,7 +87,7 @@ nsGenericDOMDataNode::GetParentNode(nsIDOMNode** aParentNode)
|
|||
nsresult res = NS_OK;
|
||||
|
||||
if (nsnull != mParent) {
|
||||
res = mParent->QueryInterface(kIDOMNodeIID, (void**)aParentNode);
|
||||
res = mParent->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aParentNode);
|
||||
NS_ASSERTION(NS_OK == res, "Must be a DOM Node");
|
||||
}
|
||||
else if (nsnull == mDocument) {
|
||||
|
@ -107,7 +97,7 @@ nsGenericDOMDataNode::GetParentNode(nsIDOMNode** aParentNode)
|
|||
// If we don't have a parent, but we're in the document, we must
|
||||
// be the root node of the document. The DOM says that the root
|
||||
// is the document.
|
||||
res = mDocument->QueryInterface(kIDOMNodeIID, (void**)aParentNode);
|
||||
res = mDocument->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aParentNode);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
@ -138,7 +128,7 @@ nsGenericDOMDataNode::GetPreviousSibling(nsIContent *aOuterContent,
|
|||
}
|
||||
|
||||
if (nsnull != sibling) {
|
||||
result = sibling->QueryInterface(kIDOMNodeIID,(void**)aPrevSibling);
|
||||
result = sibling->QueryInterface(NS_GET_IID(nsIDOMNode),(void**)aPrevSibling);
|
||||
NS_ASSERTION(NS_OK == result, "Must be a DOM Node");
|
||||
NS_RELEASE(sibling); // balance the AddRef in ChildAt()
|
||||
}
|
||||
|
@ -174,7 +164,7 @@ nsGenericDOMDataNode::GetNextSibling(nsIContent *aOuterContent,
|
|||
}
|
||||
|
||||
if (nsnull != sibling) {
|
||||
result = sibling->QueryInterface(kIDOMNodeIID,(void**)aNextSibling);
|
||||
result = sibling->QueryInterface(NS_GET_IID(nsIDOMNode),(void**)aNextSibling);
|
||||
NS_ASSERTION(NS_OK == result, "Must be a DOM Node");
|
||||
NS_RELEASE(sibling); // balance the AddRef in ChildAt()
|
||||
}
|
||||
|
@ -196,7 +186,7 @@ nsGenericDOMDataNode::GetChildNodes(nsIDOMNodeList** aChildNodes)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return list->QueryInterface(kIDOMNodeListIID, (void**)aChildNodes);
|
||||
return list->QueryInterface(NS_GET_IID(nsIDOMNodeList), (void**)aChildNodes);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -206,7 +196,7 @@ nsGenericDOMDataNode::GetOwnerDocument(nsIDOMDocument** aOwnerDocument)
|
|||
// the node has been created. We should be able to get at it
|
||||
// whether or not we are attached to the document.
|
||||
if (nsnull != mDocument) {
|
||||
return mDocument->QueryInterface(kIDOMDocumentIID, (void **)aOwnerDocument);
|
||||
return mDocument->QueryInterface(NS_GET_IID(nsIDOMDocument), (void **)aOwnerDocument);
|
||||
}
|
||||
else {
|
||||
*aOwnerDocument = nsnull;
|
||||
|
@ -494,7 +484,7 @@ nsGenericDOMDataNode::GetScriptObject(nsIContent *aOuterContent,
|
|||
nsIDOMNode* node;
|
||||
PRUint16 nodeType;
|
||||
|
||||
res = aOuterContent->QueryInterface(kIDOMNodeIID, (void**)&node);
|
||||
res = aOuterContent->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&node);
|
||||
if (NS_OK != res) {
|
||||
return res;
|
||||
}
|
||||
|
@ -805,7 +795,7 @@ nsGenericDOMDataNode::HandleDOMEvent(nsIPresContext* aPresContext,
|
|||
// hasn't been malloc'd. Force a copy of the data here so the
|
||||
// DOM Event is still valid.
|
||||
nsIPrivateDOMEvent *privateEvent;
|
||||
if (NS_OK == (*aDOMEvent)->QueryInterface(kIPrivateDOMEventIID, (void**)&privateEvent)) {
|
||||
if (NS_OK == (*aDOMEvent)->QueryInterface(NS_GET_IID(nsIPrivateDOMEvent), (void**)&privateEvent)) {
|
||||
privateEvent->DuplicatePrivateData();
|
||||
NS_RELEASE(privateEvent);
|
||||
}
|
||||
|
@ -978,7 +968,7 @@ nsGenericDOMDataNode::SplitText(nsIContent *aOuterContent, PRUint32 aOffset,
|
|||
}
|
||||
}
|
||||
|
||||
return newNode->QueryInterface(kIDOMTextIID, (void**)aReturn);
|
||||
return newNode->QueryInterface(NS_GET_IID(nsIDOMText), (void**)aReturn);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -34,13 +34,6 @@
|
|||
#include "nsDOMError.h"
|
||||
#include "nsIEventListenerManager.h"
|
||||
|
||||
extern const nsIID kIDOMCharacterDataIID;
|
||||
extern const nsIID kIDOMNodeIID;
|
||||
extern const nsIID kIDOMEventReceiverIID;
|
||||
extern const nsIID kIDOMEventTargetIID;
|
||||
extern const nsIID kIScriptObjectOwnerIID;
|
||||
extern const nsIID kISupportsIID;
|
||||
extern const nsIID kIContentIID;
|
||||
|
||||
class nsIDOMAttr;
|
||||
class nsIDOMEventListener;
|
||||
|
@ -607,46 +600,46 @@ struct nsGenericDOMDataNode {
|
|||
* generic to all html content objects.
|
||||
*/
|
||||
#define NS_IMPL_DOM_DATA_QUERY_INTERFACE(_id, _iptr, _this) \
|
||||
if (_id.Equals(kISupportsIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsISupports))) { \
|
||||
nsIContent* tmp = _this; \
|
||||
nsISupports* tmp2 = tmp; \
|
||||
*_iptr = (void*) tmp2; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMNodeIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMNode))) { \
|
||||
nsIDOMNode* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMCharacterDataIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMCharacterData))) { \
|
||||
nsIDOMCharacterData* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMEventReceiverIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMEventReceiver))) { \
|
||||
nsCOMPtr<nsIEventListenerManager> man; \
|
||||
if (NS_SUCCEEDED(mInner.GetListenerManager(this, getter_AddRefs(man)))){ \
|
||||
return man->QueryInterface(kIDOMEventReceiverIID, (void**)_iptr); \
|
||||
return man->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), (void**)_iptr); \
|
||||
} \
|
||||
return NS_NOINTERFACE; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMEventTargetIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMEventTarget))) { \
|
||||
nsCOMPtr<nsIEventListenerManager> man; \
|
||||
if (NS_SUCCEEDED(mInner.GetListenerManager(this, getter_AddRefs(man)))){ \
|
||||
return man->QueryInterface(kIDOMEventTargetIID, (void**)_iptr); \
|
||||
return man->QueryInterface(NS_GET_IID(nsIDOMEventTarget), (void**)_iptr); \
|
||||
} \
|
||||
return NS_NOINTERFACE; \
|
||||
} \
|
||||
if (_id.Equals(kIScriptObjectOwnerIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIScriptObjectOwner))) { \
|
||||
nsIScriptObjectOwner* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIContentIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIContent))) { \
|
||||
nsIContent* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
|
|
|
@ -1,89 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#include "nsGenericDOMNodeList.h"
|
||||
#include "nsIDOMScriptObjectFactory.h"
|
||||
#include "nsGenericElement.h"
|
||||
|
||||
nsGenericDOMNodeList::nsGenericDOMNodeList()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mScriptObject = nsnull;
|
||||
}
|
||||
|
||||
nsGenericDOMNodeList::~nsGenericDOMNodeList()
|
||||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericDOMNodeList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
if (aIID.Equals(kIDOMNodeListIID)) {
|
||||
*aInstancePtr = (void*)(nsIDOMNodeList*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
*aInstancePtr = (void*)(nsIScriptObjectOwner*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
*aInstancePtr = (void*)(nsISupports*)(nsIDOMNodeList*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsGenericDOMNodeList)
|
||||
NS_IMPL_RELEASE(nsGenericDOMNodeList)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGenericDOMNodeList::GetScriptObject(nsIScriptContext *aContext, void** aScriptObject)
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
if (nsnull == mScriptObject) {
|
||||
nsIDOMScriptObjectFactory *factory;
|
||||
|
||||
res = nsGenericElement::GetScriptObjectFactory(&factory);
|
||||
if (NS_OK != res) {
|
||||
return res;
|
||||
}
|
||||
|
||||
res = factory->NewScriptNodeList(aContext, (nsISupports *)(nsIDOMNodeList *)this, nsnull, (void**)&mScriptObject);
|
||||
NS_RELEASE(factory);
|
||||
}
|
||||
*aScriptObject = mScriptObject;
|
||||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGenericDOMNodeList::SetScriptObject(void *aScriptObject)
|
||||
{
|
||||
mScriptObject = aScriptObject;
|
||||
return NS_OK;
|
||||
}
|
|
@ -28,6 +28,10 @@
|
|||
#include "nsIDOMNamedNodeMap.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIDOMLinkStyle.h"
|
||||
#include "nsIStyleSheetLinkingElement.h"
|
||||
#include "nsICSSStyleSheet.h"
|
||||
#include "nsICSSLoaderObserver.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIJSScriptObject.h"
|
||||
|
@ -35,15 +39,7 @@
|
|||
#include "nsGenericDOMNodeList.h"
|
||||
#include "nsIEventListenerManager.h"
|
||||
#include "nsINodeInfo.h"
|
||||
|
||||
extern const nsIID kIDOMNodeIID;
|
||||
extern const nsIID kIDOMElementIID;
|
||||
extern const nsIID kIDOMEventReceiverIID;
|
||||
extern const nsIID kIDOMEventTargetIID;
|
||||
extern const nsIID kIScriptObjectOwnerIID;
|
||||
extern const nsIID kIJSScriptObjectIID;
|
||||
extern const nsIID kISupportsIID;
|
||||
extern const nsIID kIContentIID;
|
||||
#include "nsIParser.h"
|
||||
|
||||
class nsIDOMAttr;
|
||||
class nsIDOMEventListener;
|
||||
|
@ -1403,53 +1399,53 @@ public:
|
|||
}
|
||||
|
||||
#define NS_IMPL_CONTENT_QUERY_INTERFACE(_id, _iptr, _this, _base) \
|
||||
if (_id.Equals(kISupportsIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsISupports))) { \
|
||||
_base* tmp = _this; \
|
||||
nsISupports* tmp2 = tmp; \
|
||||
*_iptr = (void*) tmp2; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMNodeIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMNode))) { \
|
||||
nsIDOMNode* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMElementIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMElement))) { \
|
||||
nsIDOMElement* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMEventReceiverIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMEventReceiver))) { \
|
||||
nsCOMPtr<nsIEventListenerManager> man; \
|
||||
if (NS_SUCCEEDED(mInner.GetListenerManager(getter_AddRefs(man)))){ \
|
||||
return man->QueryInterface(kIDOMEventReceiverIID, (void**)_iptr); \
|
||||
return man->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), (void**)_iptr); \
|
||||
} \
|
||||
return NS_NOINTERFACE; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMEventTargetIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIDOMEventTarget))) { \
|
||||
nsCOMPtr<nsIEventListenerManager> man; \
|
||||
if (NS_SUCCEEDED(mInner.GetListenerManager(getter_AddRefs(man)))){ \
|
||||
return man->QueryInterface(kIDOMEventTargetIID, (void**)_iptr); \
|
||||
return man->QueryInterface(NS_GET_IID(nsIDOMEventTarget), (void**)_iptr); \
|
||||
} \
|
||||
return NS_NOINTERFACE; \
|
||||
} \
|
||||
if (_id.Equals(kIScriptObjectOwnerIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIScriptObjectOwner))) { \
|
||||
nsIScriptObjectOwner* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIContentIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIContent))) { \
|
||||
_base* tmp = _this; \
|
||||
nsIContent* tmp2 = tmp; \
|
||||
*_iptr = (void*) tmp2; \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIJSScriptObjectIID)) { \
|
||||
if (_id.Equals(NS_GET_IID(nsIJSScriptObject))) { \
|
||||
nsIJSScriptObject* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
NS_ADDREF_THIS(); \
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
#include "nsCRT.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);
|
||||
|
||||
class nsTextNode : public nsIDOMText,
|
||||
public nsIScriptObjectOwner,
|
||||
|
@ -84,7 +82,7 @@ NS_NewTextNode(nsIContent** aInstancePtrResult)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIContentIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIContent), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsTextNode::nsTextNode()
|
||||
|
@ -104,13 +102,13 @@ NS_IMETHODIMP
|
|||
nsTextNode::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_DOM_DATA_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMTextIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMText))) {
|
||||
nsIDOMText* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kITextContentIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsITextContent))) {
|
||||
nsITextContent* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -160,7 +158,7 @@ nsTextNode::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
// XXX Increment the ref count before calling any
|
||||
// methods. If they do a QI and then a Release()
|
||||
// the instance will be deleted.
|
||||
result = it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
result = it->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aReturn);
|
||||
if (NS_FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
|
@ -187,7 +185,7 @@ nsTextNode::CloneContent(PRBool aCloneText, nsITextContent** aReturn)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
result = it->QueryInterface(kITextContentIID, (void**) aReturn);
|
||||
result = it->QueryInterface(NS_GET_IID(nsITextContent), (void**) aReturn);
|
||||
if (NS_FAILED(result) || !aCloneText) {
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -66,13 +66,9 @@
|
|||
|
||||
class nsHTMLFrame;
|
||||
|
||||
static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
|
||||
static NS_DEFINE_IID(kWebShellCID, NS_WEB_SHELL_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
static NS_DEFINE_IID(kCViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kCChildCID, NS_CHILD_CID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLFrameElementIID, NS_IDOMHTMLFRAMEELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLIFrameElementIID, NS_IDOMHTMLIFRAMEELEMENT_IID);
|
||||
static NS_DEFINE_CID(kWebShellCID, NS_WEB_SHELL_CID);
|
||||
static NS_DEFINE_CID(kCViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_CID(kCChildCID, NS_CHILD_CID);
|
||||
|
||||
/*******************************************************************************
|
||||
* FrameLoadingInfo
|
||||
|
@ -800,7 +796,7 @@ nsHTMLFrameInnerFrame::CreateDocShell(nsIPresContext* aPresContext,
|
|||
|
||||
// create, init, set the parent of the view
|
||||
nsIView* view;
|
||||
rv = nsComponentManager::CreateInstance(kCViewCID, nsnull, kIViewIID,
|
||||
rv = nsComponentManager::CreateInstance(kCViewCID, nsnull, NS_GET_IID(nsIView),
|
||||
(void **)&view);
|
||||
if (NS_OK != rv) {
|
||||
NS_ASSERTION(0, "Could not create view for nsHTMLFrame");
|
||||
|
@ -1036,5 +1032,5 @@ FrameLoadingInfo::FrameLoadingInfo(const nsSize& aSize)
|
|||
/*
|
||||
* Implementation of ISupports methods...
|
||||
*/
|
||||
NS_IMPL_ISUPPORTS(FrameLoadingInfo,kISupportsIID);
|
||||
NS_IMPL_ISUPPORTS(FrameLoadingInfo, NS_GET_IID(nsISupports));
|
||||
|
||||
|
|
|
@ -1,143 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#include "GenericElementCollection.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
||||
GenericElementCollection::GenericElementCollection(nsIContent *aParent,
|
||||
nsIAtom *aTag)
|
||||
: nsGenericDOMHTMLCollection()
|
||||
{
|
||||
mParent = aParent;
|
||||
mTag = aTag;
|
||||
NS_IF_ADDREF(aTag);
|
||||
}
|
||||
|
||||
GenericElementCollection::~GenericElementCollection()
|
||||
{
|
||||
// we do NOT have a ref-counted reference to mParent, so do NOT
|
||||
// release it! this is to avoid circular references. The
|
||||
// instantiator who provided mParent is responsible for managing our
|
||||
// reference for us.
|
||||
|
||||
// Release reference on the tag
|
||||
NS_IF_RELEASE(mTag);
|
||||
}
|
||||
|
||||
// we re-count every call. A better implementation would be to set ourselves up as
|
||||
// an observer of contentAppended, contentInserted, and contentDeleted
|
||||
NS_IMETHODIMP
|
||||
GenericElementCollection::GetLength(PRUint32* aLength)
|
||||
{
|
||||
if (nsnull==aLength)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
*aLength=0;
|
||||
nsresult result = NS_OK;
|
||||
if (nsnull!=mParent)
|
||||
{
|
||||
nsIContent *child=nsnull;
|
||||
PRUint32 childIndex=0;
|
||||
mParent->ChildAt(childIndex, child);
|
||||
while (nsnull!=child)
|
||||
{
|
||||
nsIAtom *childTag;
|
||||
child->GetTag(childTag);
|
||||
if (mTag==childTag)
|
||||
{
|
||||
(*aLength)++;
|
||||
}
|
||||
NS_RELEASE(childTag);
|
||||
NS_RELEASE(child);
|
||||
childIndex++;
|
||||
mParent->ChildAt(childIndex, child);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
GenericElementCollection::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
|
||||
{
|
||||
*aReturn=nsnull;
|
||||
PRUint32 theIndex = 0;
|
||||
nsresult rv = NS_OK;
|
||||
if (nsnull!=mParent)
|
||||
{
|
||||
nsIContent *child=nsnull;
|
||||
PRUint32 childIndex=0;
|
||||
mParent->ChildAt(childIndex, child);
|
||||
while (nsnull!=child)
|
||||
{
|
||||
nsIAtom *childTag;
|
||||
child->GetTag(childTag);
|
||||
if (mTag==childTag)
|
||||
{
|
||||
if (aIndex==theIndex)
|
||||
{
|
||||
child->QueryInterface(kIDOMNodeIID, (void**)aReturn); // out-param addref
|
||||
NS_ASSERTION(nsnull!=aReturn, "content element must be an nsIDOMNode");
|
||||
NS_RELEASE(childTag);
|
||||
NS_RELEASE(child);
|
||||
break;
|
||||
}
|
||||
theIndex++;
|
||||
}
|
||||
NS_RELEASE(childTag);
|
||||
NS_RELEASE(child);
|
||||
childIndex++;
|
||||
mParent->ChildAt(childIndex, child);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
GenericElementCollection::NamedItem(const nsAReadableString& aName, nsIDOMNode** aReturn)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aReturn);
|
||||
*aReturn = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
if (nsnull!=mParent)
|
||||
{
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
GenericElementCollection::ParentDestroyed()
|
||||
{
|
||||
// see comment in destructor, do NOT release mParent!
|
||||
mParent = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
nsresult
|
||||
GenericElementCollection::SizeOf(nsISizeOfHandler* aSizer,
|
||||
PRUint32* aResult) const
|
||||
{
|
||||
if (!aResult) return NS_ERROR_NULL_POINTER;
|
||||
*aResult = sizeof(*this);
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
|
@ -1,82 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
#include "nslayout.h"
|
||||
#include "nsGenericDOMHTMLCollection.h"
|
||||
|
||||
|
||||
nsGenericDOMHTMLCollection::nsGenericDOMHTMLCollection()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mScriptObject = nsnull;
|
||||
}
|
||||
|
||||
nsGenericDOMHTMLCollection::~nsGenericDOMHTMLCollection()
|
||||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericDOMHTMLCollection::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLCollectionIID, NS_IDOMHTMLCOLLECTION_IID);
|
||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
||||
if (aIID.Equals(kIDOMHTMLCollectionIID)) {
|
||||
*aInstancePtr = (void*)(nsIDOMHTMLCollection*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
*aInstancePtr = (void*)(nsIScriptObjectOwner*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
*aInstancePtr = (void*)(nsISupports*)(nsIDOMHTMLCollection*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsGenericDOMHTMLCollection)
|
||||
NS_IMPL_RELEASE(nsGenericDOMHTMLCollection)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGenericDOMHTMLCollection::GetScriptObject(nsIScriptContext *aContext, void** aScriptObject)
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
if (nsnull == mScriptObject) {
|
||||
res = NS_NewScriptHTMLCollection(aContext, (nsISupports *)(nsIDOMHTMLCollection *)this, nsnull, (void**)&mScriptObject);
|
||||
}
|
||||
*aScriptObject = mScriptObject;
|
||||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGenericDOMHTMLCollection::SetScriptObject(void *aScriptObject)
|
||||
{
|
||||
mScriptObject = aScriptObject;
|
||||
return NS_OK;
|
||||
}
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче