зеркало из https://github.com/mozilla/pjs.git
removing most all NS_DEFINE_IID and replacing them with NS_GET_IID macros
Bug 61274, r=buster sr=waterson
This commit is contained in:
Родитель
f58c367f86
Коммит
c81b2c3b26
|
@ -114,7 +114,6 @@
|
|||
static NS_DEFINE_CID(kCRangeCID, NS_RANGE_CID);
|
||||
static NS_DEFINE_CID(kDOMScriptObjectFactoryCID, NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
|
||||
|
||||
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
|
||||
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
|
||||
|
||||
#include "nsILineBreakerFactory.h"
|
||||
|
|
|
@ -1527,7 +1527,6 @@ DocumentViewerImpl::GetSaveable(PRBool *aSaveable)
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kIDeviceContextSpecFactoryIID, NS_IDEVICE_CONTEXT_SPEC_FACTORY_IID);
|
||||
static NS_DEFINE_IID(kDeviceContextSpecFactoryCID, NS_DEVICE_CONTEXT_SPEC_FACTORY_CID);
|
||||
|
||||
|
||||
|
@ -1544,7 +1543,7 @@ PRInt32 width,height;
|
|||
|
||||
nsComponentManager::CreateInstance(kDeviceContextSpecFactoryCID,
|
||||
nsnull,
|
||||
kIDeviceContextSpecFactoryIID,
|
||||
NS_GET_IID(nsIDeviceContextSpecFactory),
|
||||
(void **)getter_AddRefs(factory));
|
||||
|
||||
if (factory) {
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
#include "nsString.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
static NS_DEFINE_IID(kINameSpaceManagerIID, NS_INAMESPACEMANAGER_IID);
|
||||
static NS_DEFINE_IID(kINameSpaceIID, NS_INAMESPACE_IID);
|
||||
|
||||
|
||||
static const char kXMLNSNameSpaceURI[] = "http://www.w3.org/2000/xmlns";
|
||||
|
@ -196,7 +194,7 @@ NameSpaceImpl::~NameSpaceImpl()
|
|||
NS_IF_RELEASE(mPrefix);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(NameSpaceImpl, kINameSpaceIID)
|
||||
NS_IMPL_ISUPPORTS(NameSpaceImpl, NS_GET_IID(nsINameSpace))
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceImpl::GetNameSpaceManager(nsINameSpaceManager*& aManager) const
|
||||
|
@ -299,7 +297,7 @@ NameSpaceImpl::CreateChildNameSpace(nsIAtom* aPrefix, const nsAReadableString& a
|
|||
NameSpaceImpl* child = new NameSpaceImpl(mManager, this, aPrefix, aURI);
|
||||
|
||||
if (child) {
|
||||
return child->QueryInterface(kINameSpaceIID, (void**)&aChildNameSpace);
|
||||
return child->QueryInterface(NS_GET_IID(nsINameSpace), (void**)&aChildNameSpace);
|
||||
}
|
||||
aChildNameSpace = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -313,7 +311,7 @@ NameSpaceImpl::CreateChildNameSpace(nsIAtom* aPrefix, PRInt32 aNameSpaceID,
|
|||
NameSpaceImpl* child = new NameSpaceImpl(mManager, this, aPrefix, aNameSpaceID);
|
||||
|
||||
if (child) {
|
||||
return child->QueryInterface(kINameSpaceIID, (void**)&aChildNameSpace);
|
||||
return child->QueryInterface(NS_GET_IID(nsINameSpace), (void**)&aChildNameSpace);
|
||||
}
|
||||
aChildNameSpace = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -360,7 +358,7 @@ NameSpaceManagerImpl::~NameSpaceManagerImpl()
|
|||
ReleaseTable();
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(NameSpaceManagerImpl, kINameSpaceManagerIID)
|
||||
NS_IMPL_ISUPPORTS(NameSpaceManagerImpl, NS_GET_IID(nsINameSpaceManager))
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceManagerImpl::CreateRootNameSpace(nsINameSpace*& aRootNameSpace)
|
||||
|
@ -372,7 +370,7 @@ NameSpaceManagerImpl::CreateRootNameSpace(nsINameSpace*& aRootNameSpace)
|
|||
if (nsnull != xmlns) {
|
||||
NameSpaceImpl* xml = new NameSpaceImpl(this, xmlns, nsLayoutAtoms::xmlNameSpace, kNameSpaceID_XML);
|
||||
if (nsnull != xml) {
|
||||
rv = xml->QueryInterface(kINameSpaceIID, (void**)&aRootNameSpace);
|
||||
rv = xml->QueryInterface(NS_GET_IID(nsINameSpace), (void**)&aRootNameSpace);
|
||||
}
|
||||
else {
|
||||
delete xmlns;
|
||||
|
@ -430,5 +428,5 @@ NS_NewNameSpaceManager(nsINameSpaceManager** aInstancePtrResult)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kINameSpaceManagerIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsINameSpaceManager), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -47,8 +47,6 @@
|
|||
#include "nsHTMLParts.h"
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
||||
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
|
||||
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
|
||||
|
||||
PRMonitor* nsRange::mMonitor = nsnull;
|
||||
|
@ -347,7 +345,7 @@ nsresult nsRange::QueryInterface(const nsIID& aIID,
|
|||
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();
|
||||
|
@ -1895,7 +1893,7 @@ nsRange::CreateContextualFragment(const nsAReadableString& aFragment,
|
|||
// Create a new parser for this entire operation
|
||||
result = nsComponentManager::CreateInstance(kCParserCID,
|
||||
nsnull,
|
||||
kCParserIID,
|
||||
NS_GET_IID(nsIParser),
|
||||
(void **)getter_AddRefs(parser));
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = parser->CreateTagStack(&tagStack);
|
||||
|
@ -2000,7 +1998,7 @@ nsRange::IsValidFragment(const nsAReadableString& aFragment, PRBool* aReturn)
|
|||
// Create a new parser for this entire operation
|
||||
result = nsComponentManager::CreateInstance(kCParserCID,
|
||||
nsnull,
|
||||
kCParserIID,
|
||||
NS_GET_IID(nsIParser),
|
||||
(void **)getter_AddRefs(parser));
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = parser->CreateTagStack(&tagStack);
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
#include "nsLayoutAtoms.h"
|
||||
#include "prenv.h"
|
||||
|
||||
static NS_DEFINE_IID(kIStyleContextIID, NS_ISTYLECONTEXT_IID);
|
||||
|
||||
#define DELETE_ARRAY_IF(array) if (array) { delete[] array; array = nsnull; }
|
||||
|
||||
|
@ -3587,7 +3586,7 @@ NS_NewStyleContext(nsIStyleContext** aInstancePtrResult,
|
|||
if (nsnull == context) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
nsresult result = context->QueryInterface(kIStyleContextIID, (void **) aInstancePtrResult);
|
||||
nsresult result = context->QueryInterface(NS_GET_IID(nsIStyleContext), (void **) aInstancePtrResult);
|
||||
context->RemapStyle(aPresContext); // remap after initial ref-count is set
|
||||
|
||||
#ifdef SHARE_STYLECONTEXTS
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
static NS_DEFINE_IID(kIStyleSetIID, NS_ISTYLE_SET_IID);
|
||||
static NS_DEFINE_IID(kIStyleFrameConstructionIID, NS_ISTYLE_FRAME_CONSTRUCTION_IID);
|
||||
|
||||
// - fast cache uses a CRC32 on the style context to quickly find sharing candidates.
|
||||
|
@ -394,7 +393,7 @@ StyleSetImpl::~StyleSetImpl()
|
|||
}
|
||||
|
||||
#ifndef MOZ_PERF_METRICS
|
||||
NS_IMPL_ISUPPORTS(StyleSetImpl, kIStyleSetIID)
|
||||
NS_IMPL_ISUPPORTS(StyleSetImpl, NS_GET_IID(nsIStyleSet))
|
||||
#else
|
||||
NS_IMPL_ISUPPORTS2(StyleSetImpl, nsIStyleSet, nsITimeRecorder)
|
||||
#endif
|
||||
|
@ -729,7 +728,7 @@ NS_IMETHODIMP StyleSetImpl::EnableQuirkStyleSheet(PRBool aEnable)
|
|||
sheet = getter_AddRefs(GetBackstopStyleSheetAt(i));
|
||||
if (sheet) {
|
||||
nsCOMPtr<nsICSSStyleSheet> cssSheet;
|
||||
sheet->QueryInterface(nsICSSStyleSheet::GetIID(), getter_AddRefs(cssSheet));
|
||||
sheet->QueryInterface(NS_GET_IID(nsICSSStyleSheet), getter_AddRefs(cssSheet));
|
||||
if (cssSheet) {
|
||||
nsCOMPtr<nsIStyleSheet> quirkSheet;
|
||||
PRBool bHasSheet = PR_FALSE;
|
||||
|
@ -1388,7 +1387,7 @@ NS_NewStyleSet(nsIStyleSet** aInstancePtrResult)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kIStyleSetIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIStyleSet), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
// nsITimeRecorder implementation
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "nsLayoutAtoms.h"
|
||||
#include "nsMutationEvent.h"
|
||||
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
static char* mEventNames[] = {
|
||||
"mousedown", "mouseup", "click", "dblclick", "mouseover",
|
||||
|
|
|
@ -60,10 +60,6 @@
|
|||
#include "nsIPresShell.h"
|
||||
#include "nsMutationEvent.h"
|
||||
|
||||
static NS_DEFINE_IID(kIEventListenerManagerIID, NS_IEVENTLISTENERMANAGER_IID);
|
||||
static NS_DEFINE_IID(kIDOMEventListenerIID, NS_IDOMEVENTLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDOMEventIID, NS_IDOMEVENT_IID);
|
||||
static NS_DEFINE_IID(kIScriptEventListenerIID, NS_ISCRIPTEVENTLISTENER_IID);
|
||||
|
||||
nsEventListenerManager::nsEventListenerManager()
|
||||
{
|
||||
|
@ -2236,7 +2232,7 @@ NS_HTML nsresult NS_NewEventListenerManager(nsIEventListenerManager** aInstanceP
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if (NS_OK == l->QueryInterface(kIEventListenerManagerIID, (void**) aInstancePtrResult)) {
|
||||
if (NS_OK == l->QueryInterface(NS_GET_IID(nsIEventListenerManager), (void**) aInstancePtrResult)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,13 +64,7 @@ class nsIDOMText;
|
|||
|
||||
// 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);
|
||||
|
||||
|
||||
class nsAttributeContent : public nsITextContent, public nsIAttributeContent {
|
||||
|
@ -544,7 +538,7 @@ nsAttributeContent::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)) {
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -64,7 +64,6 @@
|
|||
|
||||
// XXX align=left, hspace, vspace, border? other nav4 attrs
|
||||
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID);
|
||||
|
||||
#ifdef ENDER_LITE
|
||||
|
@ -896,7 +895,7 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
|||
nsIFrame* formFrame = nsnull;
|
||||
|
||||
if (formControlFrame &&
|
||||
NS_SUCCEEDED(formControlFrame->QueryInterface(kIFrameIID,
|
||||
NS_SUCCEEDED(formControlFrame->QueryInterface(NS_GET_IID(nsIFrame),
|
||||
(void **)&formFrame)) &&
|
||||
formFrame) {
|
||||
const nsStyleUserInterface* uiStyle;
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "nsIFormControlFrame.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
class nsHTMLOptGroupElement : public nsGenericHTMLContainerElement,
|
||||
public nsIDOMHTMLOptGroupElement
|
||||
|
@ -159,7 +158,7 @@ nsHTMLOptGroupElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
|||
nsIFrame* formFrame = nsnull;
|
||||
|
||||
if (formControlFrame &&
|
||||
NS_SUCCEEDED(formControlFrame->QueryInterface(kIFrameIID,
|
||||
NS_SUCCEEDED(formControlFrame->QueryInterface(NS_GET_IID(nsIFrame),
|
||||
(void **)&formFrame)) &&
|
||||
formFrame)
|
||||
{
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
#include "nsIFormControlFrame.h"
|
||||
#include "nsIFrame.h"
|
||||
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
|
||||
class nsHTMLSelectElement;
|
||||
|
@ -1432,7 +1431,7 @@ nsHTMLSelectElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
|||
nsIFrame* formFrame = nsnull;
|
||||
|
||||
if (formControlFrame &&
|
||||
NS_SUCCEEDED(formControlFrame->QueryInterface(kIFrameIID,
|
||||
NS_SUCCEEDED(formControlFrame->QueryInterface(NS_GET_IID(nsIFrame),
|
||||
(void **)&formFrame)) &&
|
||||
formFrame)
|
||||
{
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
#include "nsIPrivateDOMEvent.h"
|
||||
|
||||
static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID);
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
|
||||
class nsHTMLTextAreaElement : public nsGenericHTMLContainerFormElement,
|
||||
|
@ -552,7 +551,7 @@ nsHTMLTextAreaElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
|||
nsIFrame* formFrame = nsnull;
|
||||
|
||||
if (formControlFrame &&
|
||||
NS_SUCCEEDED(formControlFrame->QueryInterface(kIFrameIID,
|
||||
NS_SUCCEEDED(formControlFrame->QueryInterface(NS_GET_IID(nsIFrame),
|
||||
(void **)&formFrame)) &&
|
||||
formFrame) {
|
||||
const nsStyleUserInterface* uiStyle;
|
||||
|
|
|
@ -119,23 +119,7 @@ const PRBool kBlockByDefault=PR_FALSE;
|
|||
const PRBool kBlockByDefault=PR_TRUE;
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTitleElementIID, NS_IDOMHTMLTITLEELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID);
|
||||
|
||||
static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
static NS_DEFINE_IID(kIDOMCommentIID, NS_IDOMCOMMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLFormElementIID, NS_IDOMHTMLFORMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLMapElementIID, NS_IDOMHTMLMAPELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLTextAreaElementIID, NS_IDOMHTMLTEXTAREAELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLOptionElementIID, NS_IDOMHTMLOPTIONELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
|
||||
static NS_DEFINE_IID(kIHTMLContentSinkIID, NS_IHTML_CONTENT_SINK_IID);
|
||||
static NS_DEFINE_IID(kIScrollableViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIHTMLContentContainerIID, NS_IHTMLCONTENTCONTAINER_IID);
|
||||
static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIStyleSheetLinkingElementIID, NS_ISTYLESHEETLINKINGELEMENT_IID);
|
||||
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
|
||||
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
|
||||
|
||||
|
@ -725,7 +709,7 @@ static
|
|||
void SetForm(nsIHTMLContent* aContent, nsIDOMHTMLFormElement* aForm)
|
||||
{
|
||||
nsIFormControl* formControl = nsnull;
|
||||
nsresult result = aContent->QueryInterface(kIFormControlIID, (void**)&formControl);
|
||||
nsresult result = aContent->QueryInterface(NS_GET_IID(nsIFormControl), (void**)&formControl);
|
||||
if ((NS_OK == result) && formControl) {
|
||||
formControl->SetForm(aForm);
|
||||
NS_RELEASE(formControl);
|
||||
|
@ -1168,7 +1152,7 @@ MakeContentObject(nsHTMLTag aNodeType,
|
|||
// If the text area has some content, set it
|
||||
if (aContent && (aContent->Length() > 0)) {
|
||||
nsIDOMHTMLTextAreaElement* taElem;
|
||||
rv = (*aResult)->QueryInterface(kIDOMHTMLTextAreaElementIID, (void **)&taElem);
|
||||
rv = (*aResult)->QueryInterface(NS_GET_IID(nsIDOMHTMLTextAreaElement), (void **)&taElem);
|
||||
if ((NS_OK == rv) && taElem) {
|
||||
taElem->SetDefaultValue(*aContent);
|
||||
NS_RELEASE(taElem);
|
||||
|
@ -1675,7 +1659,7 @@ SinkContext::DemoteContainer(const nsIParserNode& aNode)
|
|||
// After the form control is removed from it's container, restore
|
||||
// it's form.
|
||||
nsIFormControl* childFormControl = nsnull;
|
||||
result = child->QueryInterface(kIFormControlIID, (void**)&childFormControl);
|
||||
result = child->QueryInterface(NS_GET_IID(nsIFormControl), (void**)&childFormControl);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
// It is a form control, so get it's form and cache it.
|
||||
nsIDOMHTMLFormElement* formElem = nsnull;
|
||||
|
@ -1848,7 +1832,7 @@ SinkContext::AddComment(const nsIParserNode& aNode)
|
|||
|
||||
result = NS_NewCommentNode(&comment);
|
||||
if (NS_OK == result) {
|
||||
result = comment->QueryInterface(kIDOMCommentIID,
|
||||
result = comment->QueryInterface(NS_GET_IID(nsIDOMComment),
|
||||
(void **)&domComment);
|
||||
if (NS_OK == result) {
|
||||
domComment->AppendData(aNode.GetText());
|
||||
|
@ -2187,7 +2171,7 @@ NS_NewHTMLContentSink(nsIHTMLContentSink** aResult,
|
|||
delete it;
|
||||
return rv;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentSinkIID, (void **)aResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLContentSink), (void **)aResult);
|
||||
}
|
||||
|
||||
// Note: operator new zeros our memory
|
||||
|
@ -2296,7 +2280,7 @@ HTMLContentSink::Init(nsIDocument* aDoc,
|
|||
mDocument = aDoc;
|
||||
NS_ADDREF(aDoc);
|
||||
aDoc->AddObserver(this);
|
||||
aDoc->QueryInterface(kIHTMLDocumentIID, (void**)&mHTMLDocument);
|
||||
aDoc->QueryInterface(NS_GET_IID(nsIHTMLDocument), (void**)&mHTMLDocument);
|
||||
rv = mDocument->GetNodeInfoManager(mNodeInfoManager);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
mDocumentURI = aURL;
|
||||
|
@ -2327,7 +2311,7 @@ HTMLContentSink::Init(nsIDocument* aDoc,
|
|||
prefs->GetIntPref("content.maxtextrun", &mMaxTextRun);
|
||||
|
||||
nsIHTMLContentContainer* htmlContainer = nsnull;
|
||||
if (NS_SUCCEEDED(aDoc->QueryInterface(kIHTMLContentContainerIID, (void**)&htmlContainer))) {
|
||||
if (NS_SUCCEEDED(aDoc->QueryInterface(NS_GET_IID(nsIHTMLContentContainer), (void**)&htmlContainer))) {
|
||||
htmlContainer->GetCSSLoader(mCSSLoader);
|
||||
NS_RELEASE(htmlContainer);
|
||||
}
|
||||
|
@ -2699,7 +2683,7 @@ HTMLContentSink::SetTitle(const nsString& aValue)
|
|||
rv = NS_NewTextNode(&text);
|
||||
if (NS_OK == rv) {
|
||||
nsIDOMText* tc;
|
||||
rv = text->QueryInterface(kIDOMTextIID, (void**)&tc);
|
||||
rv = text->QueryInterface(NS_GET_IID(nsIDOMText), (void**)&tc);
|
||||
if (NS_OK == rv) {
|
||||
tc->SetData(*mTitle);
|
||||
NS_RELEASE(tc);
|
||||
|
@ -2908,7 +2892,7 @@ HTMLContentSink::OpenForm(const nsIParserNode& aNode)
|
|||
|
||||
result = NS_NewHTMLFormElement(&content, nodeInfo);
|
||||
if (NS_SUCCEEDED(result) && content) {
|
||||
content->QueryInterface(kIDOMHTMLFormElementIID, (void**)&mCurrentForm);
|
||||
content->QueryInterface(NS_GET_IID(nsIDOMHTMLFormElement), (void**)&mCurrentForm);
|
||||
NS_RELEASE(content);
|
||||
}
|
||||
|
||||
|
@ -2921,7 +2905,7 @@ HTMLContentSink::OpenForm(const nsIParserNode& aNode)
|
|||
|
||||
content = mCurrentContext->GetCurrentContainer();
|
||||
if (nsnull != content) {
|
||||
result = content->QueryInterface(kIDOMHTMLFormElementIID,
|
||||
result = content->QueryInterface(NS_GET_IID(nsIDOMHTMLFormElement),
|
||||
(void**)&mCurrentForm);
|
||||
NS_RELEASE(content);
|
||||
}
|
||||
|
@ -3576,7 +3560,7 @@ HTMLContentSink::StartLayout()
|
|||
vm->GetRootView(rootView);
|
||||
if (nsnull != rootView) {
|
||||
nsIScrollableView* sview = nsnull;
|
||||
rootView->QueryInterface(kIScrollableViewIID, (void**) &sview);
|
||||
rootView->QueryInterface(NS_GET_IID(nsIScrollableView), (void**) &sview);
|
||||
if (nsnull != sview) {
|
||||
if (mFrameset)
|
||||
mOriginalScrollPreference = nsScrollPreference_kNeverScroll;
|
||||
|
@ -4221,7 +4205,7 @@ HTMLContentSink::ProcessMAPTag(const nsIParserNode& aNode,
|
|||
NS_IF_RELEASE(mCurrentMap);
|
||||
|
||||
nsIDOMHTMLMapElement* domMap;
|
||||
rv = aContent->QueryInterface(kIDOMHTMLMapElementIID, (void**)&domMap);
|
||||
rv = aContent->QueryInterface(NS_GET_IID(nsIDOMHTMLMapElement), (void**)&domMap);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -4945,7 +4929,7 @@ HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode)
|
|||
rv = NS_NewTextNode(&text);
|
||||
if (NS_OK == rv) {
|
||||
nsIDOMText* tc;
|
||||
rv = text->QueryInterface(kIDOMTextIID, (void**)&tc);
|
||||
rv = text->QueryInterface(NS_GET_IID(nsIDOMText), (void**)&tc);
|
||||
if (NS_OK == rv) {
|
||||
tc->SetData(script);
|
||||
NS_RELEASE(tc);
|
||||
|
@ -5153,7 +5137,7 @@ HTMLContentSink::ProcessSTYLETag(const nsIParserNode& aNode)
|
|||
rv = NS_NewTextNode(&text);
|
||||
if (NS_OK == rv) {
|
||||
nsIDOMText* tc;
|
||||
rv = text->QueryInterface(kIDOMTextIID, (void**)&tc);
|
||||
rv = text->QueryInterface(NS_GET_IID(nsIDOMText), (void**)&tc);
|
||||
if (NS_OK == rv) {
|
||||
tc->SetData(content);
|
||||
NS_RELEASE(tc);
|
||||
|
|
|
@ -614,13 +614,12 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
|
|||
}
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
|
||||
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
|
||||
|
||||
if (needsParser) {
|
||||
rv = nsComponentManager::CreateInstance(kCParserCID,
|
||||
nsnull,
|
||||
kCParserIID,
|
||||
NS_GET_IID(nsIParser),
|
||||
(void **)&mParser);
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
}
|
||||
|
@ -2098,12 +2097,11 @@ nsHTMLDocument::OpenCommon(nsIURI* aSourceURL)
|
|||
result = Reset(channel, group);
|
||||
if (NS_FAILED(result)) return result;
|
||||
if (NS_OK == result) {
|
||||
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
|
||||
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
|
||||
|
||||
result = nsComponentManager::CreateInstance(kCParserCID,
|
||||
nsnull,
|
||||
kCParserIID,
|
||||
NS_GET_IID(nsIParser),
|
||||
(void **)&mParser);
|
||||
mIsWriting = 1;
|
||||
|
||||
|
|
|
@ -51,11 +51,6 @@
|
|||
// at some pointe really soon!
|
||||
//
|
||||
|
||||
static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID);
|
||||
static NS_DEFINE_IID(kIHTMLContentSinkIID, NS_IHTML_CONTENT_SINK_IID);
|
||||
static NS_DEFINE_IID(kIHTMLFragmentContentSinkIID, NS_IHTML_FRAGMENT_CONTENT_SINK_IID);
|
||||
static NS_DEFINE_IID(kIDOMCommentIID, NS_IDOMCOMMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMDocumentFragmentIID, NS_IDOMDOCUMENTFRAGMENT_IID);
|
||||
static NS_DEFINE_CID(kParserServiceCID, NS_PARSERSERVICE_CID);
|
||||
|
||||
class nsHTMLFragmentContentSink : public nsIHTMLFragmentContentSink {
|
||||
|
@ -163,7 +158,7 @@ NS_NewHTMLFragmentContentSink(nsIHTMLFragmentContentSink** aResult)
|
|||
return rv;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kIHTMLFragmentContentSinkIID, (void **)aResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIHTMLFragmentContentSink), (void **)aResult);
|
||||
}
|
||||
|
||||
nsHTMLFragmentContentSink::nsHTMLFragmentContentSink()
|
||||
|
@ -217,13 +212,13 @@ nsHTMLFragmentContentSink::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
*aInstancePtr = NULL;
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
if (aIID.Equals(kIHTMLFragmentContentSinkIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIHTMLFragmentContentSink))) {
|
||||
nsIHTMLFragmentContentSink* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIHTMLContentSinkIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIHTMLContentSink))) {
|
||||
nsIHTMLContentSink* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -261,7 +256,7 @@ nsHTMLFragmentContentSink::WillBuildModel(void)
|
|||
|
||||
result = NS_NewDocumentFragment(&frag, nsnull);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = frag->QueryInterface(kIContentIID, (void**)&mRoot);
|
||||
result = frag->QueryInterface(NS_GET_IID(nsIContent), (void**)&mRoot);
|
||||
NS_RELEASE(frag);
|
||||
}
|
||||
}
|
||||
|
@ -651,7 +646,7 @@ nsHTMLFragmentContentSink::AddComment(const nsIParserNode& aNode)
|
|||
|
||||
result = NS_NewCommentNode(&comment);
|
||||
if (NS_OK == result) {
|
||||
result = comment->QueryInterface(kIDOMCommentIID,
|
||||
result = comment->QueryInterface(NS_GET_IID(nsIDOMComment),
|
||||
(void **)&domComment);
|
||||
if (NS_OK == result) {
|
||||
domComment->AppendData(aNode.GetText());
|
||||
|
@ -698,7 +693,7 @@ NS_IMETHODIMP
|
|||
nsHTMLFragmentContentSink::GetFragment(nsIDOMDocumentFragment** aFragment)
|
||||
{
|
||||
if (nsnull != mRoot) {
|
||||
return mRoot->QueryInterface(kIDOMDocumentFragmentIID, (void**)aFragment);
|
||||
return mRoot->QueryInterface(NS_GET_IID(nsIDOMDocumentFragment), (void**)aFragment);
|
||||
}
|
||||
else {
|
||||
*aFragment = nsnull;
|
||||
|
@ -812,9 +807,8 @@ nsHTMLFragmentContentSink::FlushText()
|
|||
if (NS_OK == rv) {
|
||||
|
||||
// Set the text in the text node
|
||||
static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);
|
||||
nsITextContent* text = nsnull;
|
||||
content->QueryInterface(kITextContentIID, (void**) &text);
|
||||
content->QueryInterface(NS_GET_IID(nsITextContent), (void**) &text);
|
||||
text->SetText(mText, mTextLength, PR_FALSE);
|
||||
NS_RELEASE(text);
|
||||
|
||||
|
|
|
@ -52,8 +52,6 @@
|
|||
// 3. override the save-as methods so that we don't write out our synthetic
|
||||
// html
|
||||
|
||||
static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);
|
||||
|
||||
class nsImageDocument : public nsHTMLDocument {
|
||||
public:
|
||||
|
@ -112,7 +110,7 @@ ImageListener::~ImageListener()
|
|||
NS_IF_RELEASE(mNextStream);
|
||||
}
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS(ImageListener, kIStreamListenerIID)
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS(ImageListener, NS_GET_IID(nsIStreamListener))
|
||||
|
||||
NS_IMETHODIMP
|
||||
ImageListener::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
|
@ -161,7 +159,7 @@ NS_NewImageDocument(nsIDocument** aInstancePtrResult)
|
|||
{
|
||||
nsImageDocument* doc = new nsImageDocument();
|
||||
if(doc)
|
||||
return doc->QueryInterface(kIDocumentIID, (void**) aInstancePtrResult);
|
||||
return doc->QueryInterface(NS_GET_IID(nsIDocument), (void**) aInstancePtrResult);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
@ -382,7 +380,7 @@ nsresult nsImageDocument::UpdateTitle( void )
|
|||
// - get the URL interface, get the extension, convert to upper-case
|
||||
// Unless the Imagerequest or Image can tell us the type this is the best we can do.
|
||||
nsIURL *pURL=nsnull;
|
||||
if(NS_SUCCEEDED(mDocumentURL->QueryInterface(nsIURL::GetIID(),(void **)&pURL))){
|
||||
if(NS_SUCCEEDED(mDocumentURL->QueryInterface(NS_GET_IID(nsIURL),(void **)&pURL))){
|
||||
char *pExtension=nsnull;
|
||||
pURL->GetFileExtension(&pExtension);
|
||||
if(pExtension){
|
||||
|
|
|
@ -48,7 +48,6 @@ static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
|
|||
static NS_DEFINE_IID(kCSSContentSID, NS_CSS_CONTENT_SID);
|
||||
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
||||
static NS_DEFINE_IID(kCSSAuralSID, NS_CSS_AURAL_SID);
|
||||
static NS_DEFINE_IID(kICSSDeclarationIID, NS_ICSS_DECLARATION_IID);
|
||||
|
||||
|
||||
#define CSS_IF_DELETE(ptr) if (nsnull != ptr) { delete ptr; ptr = nsnull; }
|
||||
|
@ -1138,7 +1137,7 @@ CSSDeclarationImpl::~CSSDeclarationImpl(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(CSSDeclarationImpl, kICSSDeclarationIID);
|
||||
NS_IMPL_ISUPPORTS(CSSDeclarationImpl, NS_GET_IID(nsICSSDeclaration));
|
||||
|
||||
#define CSS_IF_GET_ELSE(sid,ptr,result) \
|
||||
if (sid.Equals(kCSS##ptr##SID)) { *result = m##ptr; } else
|
||||
|
@ -4678,7 +4677,7 @@ CSSDeclarationImpl::Clone(nsICSSDeclaration*& aClone) const
|
|||
{
|
||||
CSSDeclarationImpl* clone = new CSSDeclarationImpl(*this);
|
||||
if (clone) {
|
||||
return clone->QueryInterface(kICSSDeclarationIID, (void**)&aClone);
|
||||
return clone->QueryInterface(NS_GET_IID(nsICSSDeclaration), (void**)&aClone);
|
||||
}
|
||||
aClone = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -4699,7 +4698,7 @@ NS_HTML nsresult
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kICSSDeclarationIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsICSSDeclaration), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -59,12 +59,6 @@
|
|||
|
||||
#include <iostream.h>
|
||||
|
||||
static NS_DEFINE_IID(kICSSLoaderIID, NS_ICSS_LOADER_IID);
|
||||
//static NS_DEFINE_IID(kICSSParserIID, NS_ICSS_PARSER_IID);
|
||||
//static NS_DEFINE_IID(kICSSStyleSheetIID, NS_ICSS_STYLE_SHEET_IID);
|
||||
//static NS_DEFINE_IID(kIStyleSheetIID, NS_ISTYLE_SHEET_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID);
|
||||
static NS_DEFINE_IID(kIStyleSheetLinkingElementIID, NS_ISTYLESHEETLINKINGELEMENT_IID);
|
||||
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
|
||||
|
||||
class CSSLoaderImpl;
|
||||
|
@ -486,7 +480,7 @@ CSSLoaderImpl::~CSSLoaderImpl(void)
|
|||
mSheetMapTable.Enumerate(DeleteSheetMap);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(CSSLoaderImpl, kICSSLoaderIID)
|
||||
NS_IMPL_ISUPPORTS(CSSLoaderImpl, NS_GET_IID(nsICSSLoader))
|
||||
|
||||
NS_IMETHODIMP
|
||||
CSSLoaderImpl::Init(nsIDocument* aDocument)
|
||||
|
@ -1073,13 +1067,13 @@ CSSLoaderImpl::InsertSheetInDoc(nsICSSStyleSheet* aSheet, PRInt32 aDocIndex,
|
|||
|
||||
if (nsnull != aElement) {
|
||||
nsIDOMNode* domNode = nsnull;
|
||||
if (NS_SUCCEEDED(aElement->QueryInterface(kIDOMNodeIID, (void**)&domNode))) {
|
||||
if (NS_SUCCEEDED(aElement->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&domNode))) {
|
||||
aSheet->SetOwningNode(domNode);
|
||||
NS_RELEASE(domNode);
|
||||
}
|
||||
|
||||
nsIStyleSheetLinkingElement* element;
|
||||
if (NS_SUCCEEDED(aElement->QueryInterface(kIStyleSheetLinkingElementIID,
|
||||
if (NS_SUCCEEDED(aElement->QueryInterface(NS_GET_IID(nsIStyleSheetLinkingElement),
|
||||
(void**)&element))) {
|
||||
element->SetStyleSheet(aSheet);
|
||||
NS_RELEASE(element);
|
||||
|
@ -1557,7 +1551,7 @@ nsresult NS_NewCSSLoader(nsIDocument* aDocument, nsICSSLoader** aLoader)
|
|||
}
|
||||
|
||||
it->Init(aDocument);
|
||||
return it->QueryInterface(kICSSLoaderIID, (void **)aLoader);
|
||||
return it->QueryInterface(NS_GET_IID(nsICSSLoader), (void **)aLoader);
|
||||
}
|
||||
|
||||
nsresult NS_NewCSSLoader(nsICSSLoader** aLoader)
|
||||
|
@ -1568,7 +1562,7 @@ nsresult NS_NewCSSLoader(nsICSSLoader** aLoader)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kICSSLoaderIID, (void **)aLoader);
|
||||
return it->QueryInterface(NS_GET_IID(nsICSSLoader), (void **)aLoader);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -52,9 +52,6 @@
|
|||
// - rework aErrorCode stuff: switch over to nsresult
|
||||
// verify ! is followed by important and nothing else
|
||||
|
||||
static NS_DEFINE_IID(kICSSParserIID, NS_ICSS_PARSER_IID);
|
||||
static NS_DEFINE_IID(kICSSStyleSheetIID, NS_ICSS_STYLE_SHEET_IID);
|
||||
static NS_DEFINE_IID(kIStyleSheetIID, NS_ISTYLE_SHEET_IID);
|
||||
|
||||
#define ENABLE_OUTLINE // un-comment this to enable the outline properties (bug 9816)
|
||||
// XXX un-commenting for temporary fix for nsbeta3+ Bug 48973
|
||||
|
@ -315,7 +312,7 @@ NS_NewCSSParser(nsICSSParser** aInstancePtrResult)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kICSSParserIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsICSSParser), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
#ifdef CSS_REPORT_PARSE_ERRORS
|
||||
|
@ -386,7 +383,7 @@ CSSParserImpl::Init(nsICSSStyleSheet* aSheet)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(CSSParserImpl,kICSSParserIID)
|
||||
NS_IMPL_ISUPPORTS(CSSParserImpl,NS_GET_IID(nsICSSParser))
|
||||
|
||||
CSSParserImpl::~CSSParserImpl()
|
||||
{
|
||||
|
|
|
@ -38,12 +38,6 @@
|
|||
#include "nsISizeOfHandler.h"
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
|
||||
static NS_DEFINE_IID(kICSSRuleIID, NS_ICSS_RULE_IID);
|
||||
static NS_DEFINE_IID(kICSSCharsetRuleIID, NS_ICSS_CHARSET_RULE_IID);
|
||||
static NS_DEFINE_IID(kICSSImportRuleIID, NS_ICSS_IMPORT_RULE_IID);
|
||||
static NS_DEFINE_IID(kICSSMediaRuleIID, NS_ICSS_MEDIA_RULE_IID);
|
||||
static NS_DEFINE_IID(kICSSNameSpaceRuleIID, NS_ICSS_NAMESPACE_RULE_IID);
|
||||
|
||||
#define DECL_STYLE_RULE_INHERIT \
|
||||
NS_IMETHOD GetStyleSheet(nsIStyleSheet*& aSheet) const; \
|
||||
|
@ -125,17 +119,17 @@ CSSCharsetRuleImpl::QueryInterface(const nsIID& aIID,
|
|||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kICSSCharsetRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsICSSCharsetRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsICSSCharsetRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kICSSRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsICSSRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsICSSRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIStyleRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIStyleRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsIStyleRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -221,7 +215,7 @@ CSSCharsetRuleImpl::Clone(nsICSSRule*& aClone) const
|
|||
{
|
||||
CSSCharsetRuleImpl* clone = new CSSCharsetRuleImpl(*this);
|
||||
if (clone) {
|
||||
return clone->QueryInterface(kICSSRuleIID, (void **)&aClone);
|
||||
return clone->QueryInterface(NS_GET_IID(nsICSSRule), (void **)&aClone);
|
||||
}
|
||||
aClone = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -249,7 +243,7 @@ NS_NewCSSCharsetRule(nsICSSCharsetRule** aInstancePtrResult, const nsString& aEn
|
|||
}
|
||||
|
||||
it->Init(aEncoding);
|
||||
return it->QueryInterface(kICSSCharsetRuleIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsICSSCharsetRule), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -318,17 +312,17 @@ CSSImportRuleImpl::QueryInterface(const nsIID& aIID,
|
|||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kICSSImportRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsICSSImportRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsICSSImportRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kICSSRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsICSSRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsICSSRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIStyleRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIStyleRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsIStyleRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -416,7 +410,7 @@ CSSImportRuleImpl::Clone(nsICSSRule*& aClone) const
|
|||
{
|
||||
CSSImportRuleImpl* clone = new CSSImportRuleImpl(*this);
|
||||
if (clone) {
|
||||
return clone->QueryInterface(kICSSRuleIID, (void **)&aClone);
|
||||
return clone->QueryInterface(NS_GET_IID(nsICSSRule), (void **)&aClone);
|
||||
}
|
||||
aClone = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -467,7 +461,7 @@ NS_NewCSSImportRule(nsICSSImportRule** aInstancePtrResult,
|
|||
|
||||
it->SetURLSpec(aURLSpec);
|
||||
it->SetMedia(aMedia);
|
||||
return it->QueryInterface(kICSSImportRuleIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsICSSImportRule), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
// -------------------------------------------
|
||||
|
@ -568,17 +562,17 @@ CSSMediaRuleImpl::QueryInterface(const nsIID& aIID,
|
|||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kICSSMediaRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsICSSMediaRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsICSSMediaRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kICSSRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsICSSRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsICSSRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIStyleRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIStyleRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsIStyleRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -725,7 +719,7 @@ CSSMediaRuleImpl::Clone(nsICSSRule*& aClone) const
|
|||
{
|
||||
CSSMediaRuleImpl* clone = new CSSMediaRuleImpl(*this);
|
||||
if (clone) {
|
||||
return clone->QueryInterface(kICSSRuleIID, (void **)&aClone);
|
||||
return clone->QueryInterface(NS_GET_IID(nsICSSRule), (void **)&aClone);
|
||||
}
|
||||
aClone = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -821,7 +815,7 @@ NS_NewCSSMediaRule(nsICSSMediaRule** aInstancePtrResult)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kICSSMediaRuleIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsICSSMediaRule), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -892,17 +886,17 @@ CSSNameSpaceRuleImpl::QueryInterface(const nsIID& aIID,
|
|||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kICSSNameSpaceRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsICSSNameSpaceRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsICSSNameSpaceRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kICSSRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsICSSRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsICSSRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIStyleRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIStyleRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsIStyleRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -996,7 +990,7 @@ CSSNameSpaceRuleImpl::Clone(nsICSSRule*& aClone) const
|
|||
{
|
||||
CSSNameSpaceRuleImpl* clone = new CSSNameSpaceRuleImpl(*this);
|
||||
if (clone) {
|
||||
return clone->QueryInterface(kICSSRuleIID, (void **)&aClone);
|
||||
return clone->QueryInterface(NS_GET_IID(nsICSSRule), (void **)&aClone);
|
||||
}
|
||||
aClone = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -1049,6 +1043,6 @@ NS_NewCSSNameSpaceRule(nsICSSNameSpaceRule** aInstancePtrResult,
|
|||
|
||||
it->SetPrefix(aPrefix);
|
||||
it->SetURLSpec(aURLSpec);
|
||||
return it->QueryInterface(kICSSNameSpaceRuleIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsICSSNameSpaceRule), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,6 @@ static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
|
|||
static NS_DEFINE_IID(kCSSContentSID, NS_CSS_CONTENT_SID);
|
||||
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
||||
static NS_DEFINE_IID(kCSSAuralSID, NS_CSS_AURAL_SID);
|
||||
static NS_DEFINE_IID(kICSSDeclarationIID, NS_ICSS_DECLARATION_IID);
|
||||
|
||||
|
||||
#define CSS_IF_DELETE(ptr) if (nsnull != ptr) { delete ptr; ptr = nsnull; }
|
||||
|
@ -1138,7 +1137,7 @@ CSSDeclarationImpl::~CSSDeclarationImpl(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(CSSDeclarationImpl, kICSSDeclarationIID);
|
||||
NS_IMPL_ISUPPORTS(CSSDeclarationImpl, NS_GET_IID(nsICSSDeclaration));
|
||||
|
||||
#define CSS_IF_GET_ELSE(sid,ptr,result) \
|
||||
if (sid.Equals(kCSS##ptr##SID)) { *result = m##ptr; } else
|
||||
|
@ -4678,7 +4677,7 @@ CSSDeclarationImpl::Clone(nsICSSDeclaration*& aClone) const
|
|||
{
|
||||
CSSDeclarationImpl* clone = new CSSDeclarationImpl(*this);
|
||||
if (clone) {
|
||||
return clone->QueryInterface(kICSSDeclarationIID, (void**)&aClone);
|
||||
return clone->QueryInterface(NS_GET_IID(nsICSSDeclaration), (void**)&aClone);
|
||||
}
|
||||
aClone = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -4699,7 +4698,7 @@ NS_HTML nsresult
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kICSSDeclarationIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsICSSDeclaration), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -63,17 +63,6 @@
|
|||
// #define DEBUG_REFS
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
|
||||
static NS_DEFINE_IID(kICSSDeclarationIID, NS_ICSS_DECLARATION_IID);
|
||||
static NS_DEFINE_IID(kICSSRuleIID, NS_ICSS_RULE_IID);
|
||||
static NS_DEFINE_IID(kICSSStyleRuleIID, NS_ICSS_STYLE_RULE_IID);
|
||||
static NS_DEFINE_IID(kICSSStyleSheetIID, NS_ICSS_STYLE_SHEET_IID);
|
||||
static NS_DEFINE_IID(kIHTMLContentContainerIID, NS_IHTMLCONTENTCONTAINER_IID);
|
||||
static NS_DEFINE_IID(kIDOMCSSStyleSheetIID, NS_IDOMCSSSTYLESHEET_IID);
|
||||
static NS_DEFINE_IID(kIDOMCSSRuleIID, NS_IDOMCSSRULE_IID);
|
||||
static NS_DEFINE_IID(kIDOMCSSStyleRuleIID, NS_IDOMCSSSTYLERULE_IID);
|
||||
static NS_DEFINE_IID(kIDOMCSSStyleDeclarationIID, NS_IDOMCSSSTYLEDECLARATION_IID);
|
||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
||||
|
||||
static NS_DEFINE_IID(kCSSFontSID, NS_CSS_FONT_SID);
|
||||
static NS_DEFINE_IID(kCSSColorSID, NS_CSS_COLOR_SID);
|
||||
|
@ -681,7 +670,7 @@ CSSImportantRule::~CSSImportantRule(void)
|
|||
NS_IF_RELEASE(mDeclaration);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(CSSImportantRule, kIStyleRuleIID);
|
||||
NS_IMPL_ISUPPORTS(CSSImportantRule, NS_GET_IID(nsIStyleRule));
|
||||
|
||||
#if 0
|
||||
NS_IMETHODIMP
|
||||
|
@ -909,10 +898,10 @@ DOMCSSDeclarationImpl::ParseDeclaration(const nsAReadableString& aDecl,
|
|||
if (sheet) {
|
||||
sheet->GetURL(baseURI);
|
||||
sheet->GetOwningDocument(owningDoc);
|
||||
sheet->QueryInterface(kICSSStyleSheetIID, (void**)&cssSheet);
|
||||
sheet->QueryInterface(NS_GET_IID(nsICSSStyleSheet), (void**)&cssSheet);
|
||||
if (owningDoc) {
|
||||
nsIHTMLContentContainer* htmlContainer;
|
||||
result = owningDoc->QueryInterface(kIHTMLContentContainerIID, (void**)&htmlContainer);
|
||||
result = owningDoc->QueryInterface(NS_GET_IID(nsIHTMLContentContainer), (void**)&htmlContainer);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = htmlContainer->GetCSSLoader(cssLoader);
|
||||
NS_RELEASE(htmlContainer);
|
||||
|
@ -1148,34 +1137,34 @@ nsresult CSSStyleRuleImpl::QueryInterface(const nsIID& aIID,
|
|||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kICSSStyleRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsICSSStyleRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsICSSStyleRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kICSSRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsICSSRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsICSSRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIStyleRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIStyleRule))) {
|
||||
*aInstancePtrResult = (void*) ((nsIStyleRule*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMCSSRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMCSSRule))) {
|
||||
nsIDOMCSSRule *tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMCSSStyleRuleIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMCSSStyleRule))) {
|
||||
nsIDOMCSSStyleRule *tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
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();
|
||||
|
@ -1202,7 +1191,7 @@ NS_IMETHODIMP CSSStyleRuleImpl::Equals(const nsIStyleRule* aRule, PRBool& aResul
|
|||
else {
|
||||
aResult = PR_FALSE;
|
||||
if ((nsnull != aRule) &&
|
||||
(NS_OK == ((nsIStyleRule*)aRule)->QueryInterface(kICSSStyleRuleIID, (void**) &iCSSRule))) {
|
||||
(NS_OK == ((nsIStyleRule*)aRule)->QueryInterface(NS_GET_IID(nsICSSStyleRule), (void**) &iCSSRule))) {
|
||||
|
||||
CSSStyleRuleImpl* rule = (CSSStyleRuleImpl*)iCSSRule;
|
||||
const nsCSSSelector* local = &mSelector;
|
||||
|
@ -1539,7 +1528,7 @@ CSSStyleRuleImpl::Clone(nsICSSRule*& aClone) const
|
|||
{
|
||||
CSSStyleRuleImpl* clone = new CSSStyleRuleImpl(*this);
|
||||
if (clone) {
|
||||
return clone->QueryInterface(kICSSRuleIID, (void **)&aClone);
|
||||
return clone->QueryInterface(NS_GET_IID(nsICSSRule), (void **)&aClone);
|
||||
}
|
||||
aClone = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -3373,7 +3362,7 @@ NS_IMETHODIMP
|
|||
CSSStyleRuleImpl::GetParentStyleSheet(nsIDOMCSSStyleSheet** aSheet)
|
||||
{
|
||||
if (nsnull != mSheet) {
|
||||
return mSheet->QueryInterface(kIDOMCSSStyleSheetIID, (void**)aSheet);
|
||||
return mSheet->QueryInterface(NS_GET_IID(nsIDOMCSSStyleSheet), (void**)aSheet);
|
||||
}
|
||||
*aSheet = nsnull;
|
||||
return NS_OK;
|
||||
|
@ -3458,5 +3447,5 @@ NS_HTML nsresult
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kICSSStyleRuleIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsICSSStyleRule), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -70,13 +70,6 @@
|
|||
//#define DEBUG_RULES
|
||||
//#define EVENT_DEBUG
|
||||
|
||||
static NS_DEFINE_IID(kICSSStyleSheetIID, NS_ICSS_STYLE_SHEET_IID);
|
||||
static NS_DEFINE_IID(kIStyleSheetIID, NS_ISTYLE_SHEET_IID);
|
||||
static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
|
||||
static NS_DEFINE_IID(kIDOMStyleSheetIID, NS_IDOMSTYLESHEET_IID);
|
||||
static NS_DEFINE_IID(kIDOMCSSStyleSheetIID, NS_IDOMCSSSTYLESHEET_IID);
|
||||
static NS_DEFINE_IID(kIDOMCSSStyleRuleIID, NS_IDOMCSSSTYLERULE_IID);
|
||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
||||
|
||||
// ----------------------
|
||||
// Rule hash key
|
||||
|
@ -986,7 +979,7 @@ CSSImportsCollectionImpl::QueryInterface(REFNSIID aIID, void** aInstancePtrResul
|
|||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
|
||||
nsIScriptObjectOwner *tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
AddRef();
|
||||
|
@ -1028,7 +1021,7 @@ CSSImportsCollectionImpl::Item(PRUint32 aIndex, nsIDOMStyleSheet** aReturn)
|
|||
|
||||
result = mStyleSheet->GetStyleSheetAt(aIndex, sheet);
|
||||
if (NS_OK == result) {
|
||||
result = sheet->QueryInterface(kIDOMStyleSheetIID, (void **)aReturn);
|
||||
result = sheet->QueryInterface(NS_GET_IID(nsIDOMStyleSheet), (void **)aReturn);
|
||||
}
|
||||
NS_RELEASE(sheet);
|
||||
}
|
||||
|
@ -1476,29 +1469,29 @@ nsresult CSSStyleSheetImpl::QueryInterface(const nsIID& aIID,
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
if (aIID.Equals(kICSSStyleSheetIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsICSSStyleSheet))) {
|
||||
*aInstancePtrResult = (void*) ((nsICSSStyleSheet*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIStyleSheetIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIStyleSheet))) {
|
||||
*aInstancePtrResult = (void*) ((nsIStyleSheet*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMStyleSheetIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMStyleSheet))) {
|
||||
nsIDOMStyleSheet *tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMCSSStyleSheetIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMCSSStyleSheet))) {
|
||||
nsIDOMCSSStyleSheet *tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
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();
|
||||
|
@ -1764,7 +1757,7 @@ CSSStyleSheetImpl::ContainsStyleSheet(nsIURI* aURL, PRBool& aContains, nsIStyleS
|
|||
if (aContains) {
|
||||
// if we found it and the out-param is there, set it and addref
|
||||
if (aTheChild) {
|
||||
rv = QueryInterface( nsIStyleSheet::GetIID(), (void **)aTheChild);
|
||||
rv = QueryInterface( NS_GET_IID(nsIStyleSheet), (void **)aTheChild);
|
||||
}
|
||||
} else {
|
||||
CSSStyleSheetImpl* child = mFirstChild;
|
||||
|
@ -3163,7 +3156,7 @@ static void ContentEnumFunc(nsICSSStyleRule* aRule, void* aData)
|
|||
selector = selector->mNext;
|
||||
if (SelectorMatchesTree(data->mPresContext, data->mContent, selector)) {
|
||||
nsIStyleRule* iRule;
|
||||
if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) {
|
||||
if (NS_OK == aRule->QueryInterface(NS_GET_IID(nsIStyleRule), (void**)&iRule)) {
|
||||
data->mResults->AppendElement(iRule);
|
||||
NS_RELEASE(iRule);
|
||||
iRule = aRule->GetImportantRule();
|
||||
|
@ -3281,7 +3274,7 @@ static void PseudoEnumFunc(nsICSSStyleRule* aRule, void* aData)
|
|||
}
|
||||
|
||||
nsIStyleRule* iRule;
|
||||
if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) {
|
||||
if (NS_OK == aRule->QueryInterface(NS_GET_IID(nsIStyleRule), (void**)&iRule)) {
|
||||
data->mResults->AppendElement(iRule);
|
||||
NS_RELEASE(iRule);
|
||||
iRule = aRule->GetImportantRule();
|
||||
|
|
|
@ -42,9 +42,6 @@ nsDOMCSSDeclaration::~nsDOMCSSDeclaration()
|
|||
NS_IMPL_ADDREF(nsDOMCSSDeclaration);
|
||||
NS_IMPL_RELEASE(nsDOMCSSDeclaration);
|
||||
|
||||
static NS_DEFINE_IID(kIDOMCSS2PropertiesIID, NS_IDOMCSS2PROPERTIES_IID);
|
||||
static NS_DEFINE_IID(kIDOMCSSStyleDeclarationIID, NS_IDOMCSSSTYLEDECLARATION_IID);
|
||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -55,19 +52,19 @@ nsDOMCSSDeclaration::QueryInterface(REFNSIID aIID,
|
|||
if (nsnull == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kIDOMCSS2PropertiesIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMCSS2Properties))) {
|
||||
nsIDOMCSS2Properties *tmp = this;
|
||||
AddRef();
|
||||
*aInstancePtr = (void*) tmp;
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMCSSStyleDeclarationIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMCSSStyleDeclaration))) {
|
||||
nsIDOMCSSStyleDeclaration *tmp = this;
|
||||
AddRef();
|
||||
*aInstancePtr = (void*) tmp;
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIScriptObjectOwnerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
|
||||
nsIScriptObjectOwner *tmp = this;
|
||||
AddRef();
|
||||
*aInstancePtr = (void*) tmp;
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
|
||||
#include "nsIStyleSet.h"
|
||||
|
||||
static NS_DEFINE_IID(kIHTMLAttributesIID, NS_IHTML_ATTRIBUTES_IID);
|
||||
|
||||
MOZ_DECL_CTOR_COUNTER(HTMLAttribute);
|
||||
|
||||
|
@ -983,7 +982,7 @@ HTMLAttributesImpl::~HTMLAttributesImpl(void)
|
|||
NS_IMPL_ADDREF(HTMLAttributesImpl)
|
||||
NS_IMPL_RELEASE(HTMLAttributesImpl)
|
||||
|
||||
NS_IMPL_QUERY_INTERFACE(HTMLAttributesImpl, kIHTMLAttributesIID);
|
||||
NS_IMPL_QUERY_INTERFACE(HTMLAttributesImpl, NS_GET_IID(nsIHTMLAttributes));
|
||||
|
||||
const PRUnichar kNullCh = PRUnichar('\0');
|
||||
|
||||
|
|
|
@ -43,10 +43,6 @@
|
|||
#include "nsIStyleSet.h"
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
static NS_DEFINE_IID(kIHTMLCSSStyleSheetIID, NS_IHTML_CSS_STYLE_SHEET_IID);
|
||||
static NS_DEFINE_IID(kIStyleSheetIID, NS_ISTYLE_SHEET_IID);
|
||||
static NS_DEFINE_IID(kICSSStyleRuleIID, NS_ICSS_STYLE_RULE_IID);
|
||||
static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
|
||||
|
||||
class CSSFirstLineRule : public nsIStyleRule {
|
||||
public:
|
||||
|
@ -80,7 +76,7 @@ CSSFirstLineRule::~CSSFirstLineRule()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(CSSFirstLineRule, kIStyleRuleIID);
|
||||
NS_IMPL_ISUPPORTS(CSSFirstLineRule, NS_GET_IID(nsIStyleRule));
|
||||
|
||||
NS_IMETHODIMP
|
||||
CSSFirstLineRule::Equals(const nsIStyleRule* aRule, PRBool& aResult) const
|
||||
|
@ -460,12 +456,12 @@ nsresult HTMLCSSStyleSheetImpl::QueryInterface(const nsIID& aIID,
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
if (aIID.Equals(kIHTMLCSSStyleSheetIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIHTMLCSSStyleSheet))) {
|
||||
*aInstancePtrResult = (void*) ((nsIHTMLCSSStyleSheet*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIStyleSheetIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIStyleSheet))) {
|
||||
*aInstancePtrResult = (void*) ((nsIStyleSheet*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -515,7 +511,7 @@ HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
|
|||
while (index < postCount) {
|
||||
nsIStyleRule* rule = (nsIStyleRule*)aResults->ElementAt(index++);
|
||||
nsICSSStyleRule* cssRule;
|
||||
if (NS_SUCCEEDED(rule->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule))) {
|
||||
if (NS_SUCCEEDED(rule->QueryInterface(NS_GET_IID(nsICSSStyleRule), (void**)&cssRule))) {
|
||||
nsIStyleRule* important = cssRule->GetImportantRule();
|
||||
if (nsnull != important) {
|
||||
aResults->AppendElement(important);
|
||||
|
|
|
@ -61,9 +61,6 @@
|
|||
#include "nsIStyleSet.h"
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
static NS_DEFINE_IID(kIHTMLStyleSheetIID, NS_IHTML_STYLE_SHEET_IID);
|
||||
static NS_DEFINE_IID(kIStyleSheetIID, NS_ISTYLE_SHEET_IID);
|
||||
static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
|
||||
static NS_DEFINE_IID(kIStyleFrameConstructionIID, NS_ISTYLE_FRAME_CONSTRUCTION_IID);
|
||||
|
||||
class HTMLColorRule : public nsIStyleRule {
|
||||
|
@ -114,7 +111,7 @@ HTMLColorRule::~HTMLColorRule()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(HTMLColorRule, kIStyleRuleIID);
|
||||
NS_IMPL_ISUPPORTS(HTMLColorRule, NS_GET_IID(nsIStyleRule));
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLColorRule::Equals(const nsIStyleRule* aRule, PRBool& aResult) const
|
||||
|
@ -309,7 +306,7 @@ GenericTableRule::~GenericTableRule()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(GenericTableRule, kIStyleRuleIID);
|
||||
NS_IMPL_ISUPPORTS(GenericTableRule, NS_GET_IID(nsIStyleRule));
|
||||
|
||||
NS_IMETHODIMP
|
||||
GenericTableRule::Equals(const nsIStyleRule* aRule, PRBool& aResult) const
|
||||
|
@ -782,12 +779,12 @@ nsresult HTMLStyleSheetImpl::QueryInterface(const nsIID& aIID,
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
if (aIID.Equals(kIHTMLStyleSheetIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIHTMLStyleSheet))) {
|
||||
*aInstancePtrResult = (void*) ((nsIHTMLStyleSheet*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIStyleSheetIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIStyleSheet))) {
|
||||
*aInstancePtrResult = (void*) ((nsIStyleSheet*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
|
|
@ -433,12 +433,11 @@ nsXMLDocument::StartDocumentLoad(const char* aCommand,
|
|||
}
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
|
||||
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
|
||||
|
||||
rv = nsComponentManager::CreateInstance(kCParserCID,
|
||||
nsnull,
|
||||
kCParserIID,
|
||||
NS_GET_IID(nsIParser),
|
||||
(void **)&mParser);
|
||||
if (NS_OK == rv) {
|
||||
nsIXMLContentSink* sink;
|
||||
|
|
|
@ -273,22 +273,8 @@ NS_NewResizerFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
|||
|
||||
#endif
|
||||
|
||||
//static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
|
||||
static NS_DEFINE_IID(kIStyleFrameConstructionIID, NS_ISTYLE_FRAME_CONSTRUCTION_IID);
|
||||
static NS_DEFINE_IID(kIHTMLTableCellElementIID, NS_IHTMLTABLECELLELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIXMLDocumentIID, NS_IXMLDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLSelectElementIID, NS_IDOMHTMLSELECTELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIComboboxControlFrameIID, NS_ICOMBOBOXCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kIRadioControlFrameIID, NS_IRADIOCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kIListControlFrameIID, NS_ILISTCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLImageElementIID, NS_IDOMHTMLIMAGEELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMCharacterDataIID, NS_IDOMCHARACTERDATA_IID);
|
||||
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
static NS_DEFINE_IID(kIScrollableFrameIID, NS_ISCROLLABLE_FRAME_IID);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
|
@ -1358,7 +1344,7 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIPresContext* aPresContex
|
|||
NS_NewTextNode(&textContent);
|
||||
if (textContent) {
|
||||
// Set the text
|
||||
textContent->QueryInterface(kIDOMCharacterDataIID, (void**)&domData);
|
||||
textContent->QueryInterface(NS_GET_IID(nsIDOMCharacterData), (void**)&domData);
|
||||
domData->SetData(contentString);
|
||||
NS_RELEASE(domData);
|
||||
|
||||
|
@ -1719,7 +1705,7 @@ GetNonScrollFrame(nsIFrame& aFrameIn,
|
|||
if (nsLayoutAtoms::scrollFrame == frameType) {
|
||||
// get the scrolled frame if there is a scroll frame
|
||||
nsIScrollableFrame* scrollable = nsnull;
|
||||
nsresult rv = aFrameIn.QueryInterface(kIScrollableFrameIID, (void **)&scrollable);
|
||||
nsresult rv = aFrameIn.QueryInterface(NS_GET_IID(nsIScrollableFrame), (void **)&scrollable);
|
||||
if (NS_SUCCEEDED(rv) && (scrollable)) {
|
||||
scrollable->GetScrolledFrame(nsnull, aNonScrollFrame);
|
||||
}
|
||||
|
@ -3765,7 +3751,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
|
|||
nsIView* view = nsnull;
|
||||
newScrollableFrame->GetView(aPresContext, &view);
|
||||
nsIScrollableView* scrollableView;
|
||||
view->QueryInterface(kScrollViewIID, (void**)&scrollableView);
|
||||
view->QueryInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollableView);
|
||||
viewManager->SetRootScrollableView(scrollableView);
|
||||
parentFrame = newScrollableFrame;
|
||||
|
||||
|
@ -3942,7 +3928,7 @@ nsCSSFrameConstructor::ConstructRadioControlFrame(nsIPresShell* aPresShel
|
|||
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::radioPseudo,
|
||||
aStyleContext, PR_FALSE, getter_AddRefs(radioStyle));
|
||||
nsIRadioControlFrame* radio = nsnull;
|
||||
if (aNewFrame != nsnull && NS_SUCCEEDED(aNewFrame->QueryInterface(kIRadioControlFrameIID, (void**)&radio))) {
|
||||
if (aNewFrame != nsnull && NS_SUCCEEDED(aNewFrame->QueryInterface(NS_GET_IID(nsIRadioControlFrame), (void**)&radio))) {
|
||||
radio->SetRadioButtonFaceStyleContext(radioStyle);
|
||||
NS_RELEASE(radio);
|
||||
}
|
||||
|
@ -4113,7 +4099,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell,
|
|||
///////////////////////////////////////////////////////////////////
|
||||
// Construct a frame-based list box
|
||||
nsIComboboxControlFrame* comboBox = nsnull;
|
||||
if (NS_SUCCEEDED(comboboxFrame->QueryInterface(kIComboboxControlFrameIID, (void**)&comboBox))) {
|
||||
if (NS_SUCCEEDED(comboboxFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboBox))) {
|
||||
comboBox->SetFrameConstructor(this);
|
||||
|
||||
nsIFrame * listFrame;
|
||||
|
@ -4121,7 +4107,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell,
|
|||
|
||||
// Notify the listbox that it is being used as a dropdown list.
|
||||
nsIListControlFrame * listControlFrame;
|
||||
if (NS_SUCCEEDED(listFrame->QueryInterface(kIListControlFrameIID, (void**)&listControlFrame))) {
|
||||
if (NS_SUCCEEDED(listFrame->QueryInterface(NS_GET_IID(nsIListControlFrame), (void**)&listControlFrame))) {
|
||||
listControlFrame->SetComboboxFrame(comboboxFrame);
|
||||
}
|
||||
// Notify combobox that it should use the listbox as it's popup
|
||||
|
@ -4287,7 +4273,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell,
|
|||
// Combobox - Old Native Implementation
|
||||
///////////////////////////////////////////////////////////////////
|
||||
nsIComboboxControlFrame* comboBox = nsnull;
|
||||
if (NS_SUCCEEDED(comboboxFrame->QueryInterface(kIComboboxControlFrameIID, (void**)&comboBox))) {
|
||||
if (NS_SUCCEEDED(comboboxFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboBox))) {
|
||||
comboBox->SetFrameConstructor(this);
|
||||
|
||||
// Create a listbox
|
||||
|
@ -4296,7 +4282,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell,
|
|||
|
||||
// Notify the listbox that it is being used as a dropdown list.
|
||||
nsIListControlFrame * listControlFrame;
|
||||
if (NS_SUCCEEDED(listFrame->QueryInterface(kIListControlFrameIID, (void**)&listControlFrame))) {
|
||||
if (NS_SUCCEEDED(listFrame->QueryInterface(NS_GET_IID(nsIListControlFrame), (void**)&listControlFrame))) {
|
||||
listControlFrame->SetComboboxFrame(comboboxFrame);
|
||||
}
|
||||
// Notify combobox that it should use the listbox as it's popup
|
||||
|
@ -4342,7 +4328,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell,
|
|||
//listView->SetViewFlags(NS_VIEW_PUBLIC_FLAG_DONT_CHECK_CHILDREN);
|
||||
|
||||
nsIFrame* frame = nsnull;
|
||||
if (NS_SUCCEEDED(comboboxFrame->QueryInterface(kIFrameIID, (void**)&frame))) {
|
||||
if (NS_SUCCEEDED(comboboxFrame->QueryInterface(NS_GET_IID(nsIFrame), (void**)&frame))) {
|
||||
nsFrameItems childItems;
|
||||
|
||||
// Create display and button frames from the combobox'es anonymous content
|
||||
|
@ -7769,7 +7755,7 @@ nsCSSFrameConstructor::GetFrameFor(nsIPresShell* aPresShell,
|
|||
// If the primary frame supports IScrollableFrame, then get the scrolled frame.
|
||||
// That's the frame that gets the reflow command
|
||||
nsIScrollableFrame *pScrollableFrame = nsnull;
|
||||
if (NS_SUCCEEDED( frame->QueryInterface(nsIScrollableFrame::GetIID(),
|
||||
if (NS_SUCCEEDED( frame->QueryInterface(NS_GET_IID(nsIScrollableFrame),
|
||||
(void **)&pScrollableFrame) ))
|
||||
{
|
||||
pScrollableFrame->GetScrolledFrame( aPresContext, frame );
|
||||
|
@ -10434,7 +10420,7 @@ nsCSSFrameConstructor::ConstructAlternateFrame(nsIPresShell* aPresShell,
|
|||
|
||||
// Set the content's text
|
||||
nsIDOMCharacterData* domData;
|
||||
altTextContent->QueryInterface(kIDOMCharacterDataIID, (void**)&domData);
|
||||
altTextContent->QueryInterface(NS_GET_IID(nsIDOMCharacterData), (void**)&domData);
|
||||
domData->SetData(altText);
|
||||
NS_RELEASE(domData);
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
|
||||
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
|
||||
#define BORDER_FULL 0 //entire side
|
||||
#define BORDER_INSIDE 1 //inside half
|
||||
|
|
|
@ -1527,7 +1527,6 @@ DocumentViewerImpl::GetSaveable(PRBool *aSaveable)
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kIDeviceContextSpecFactoryIID, NS_IDEVICE_CONTEXT_SPEC_FACTORY_IID);
|
||||
static NS_DEFINE_IID(kDeviceContextSpecFactoryCID, NS_DEVICE_CONTEXT_SPEC_FACTORY_CID);
|
||||
|
||||
|
||||
|
@ -1544,7 +1543,7 @@ PRInt32 width,height;
|
|||
|
||||
nsComponentManager::CreateInstance(kDeviceContextSpecFactoryCID,
|
||||
nsnull,
|
||||
kIDeviceContextSpecFactoryIID,
|
||||
NS_GET_IID(nsIDeviceContextSpecFactory),
|
||||
(void **)getter_AddRefs(factory));
|
||||
|
||||
if (factory) {
|
||||
|
|
|
@ -83,7 +83,6 @@
|
|||
static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
||||
|
||||
// IID's
|
||||
static NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@ -816,7 +815,7 @@ FrameManager::RevokePostedEvents()
|
|||
nsresult rv;
|
||||
|
||||
rv = nsServiceManager::GetService(kEventQueueServiceCID,
|
||||
kIEventQueueServiceIID,
|
||||
NS_GET_IID(nsIEventQueueService),
|
||||
(nsISupports **)&eventService);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIEventQueue> eventQueue;
|
||||
|
@ -865,7 +864,7 @@ FrameManager::DequeuePostedEventFor(nsIFrame* aFrame)
|
|||
nsresult rv;
|
||||
|
||||
rv = nsServiceManager::GetService(kEventQueueServiceCID,
|
||||
kIEventQueueServiceIID,
|
||||
NS_GET_IID(nsIEventQueueService),
|
||||
(nsISupports **)&eventService);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIEventQueue> eventQueue;
|
||||
|
@ -949,7 +948,7 @@ FrameManager::CantRenderReplacedElement(nsIPresContext* aPresContext,
|
|||
// We need to notify the style stystem, but post the notification so it
|
||||
// doesn't happen now
|
||||
rv = nsServiceManager::GetService(kEventQueueServiceCID,
|
||||
kIEventQueueServiceIID,
|
||||
NS_GET_IID(nsIEventQueueService),
|
||||
(nsISupports **)&eventService);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIEventQueue> eventQueue;
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "nsFrameList.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIEnumeratorIID, NS_IENUMERATOR_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@ class nsIPresShell;
|
|||
*/
|
||||
class nsILayoutDebugger : public nsISupports {
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ILAYOUT_DEBUGGER_IID)
|
||||
|
||||
NS_IMETHOD SetShowFrameBorders(PRBool aEnable) = 0;
|
||||
|
||||
NS_IMETHOD GetShowFrameBorders(PRBool* aResult) = 0;
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "nsIFrame.h"
|
||||
#include "nsIFrameDebug.h"
|
||||
|
||||
static NS_DEFINE_IID(kILayoutDebuggerIID, NS_ILAYOUT_DEBUGGER_IID);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
class nsLayoutDebugger : public nsILayoutDebugger {
|
||||
|
@ -63,7 +62,7 @@ NS_NewLayoutDebugger(nsILayoutDebugger** aResult)
|
|||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kILayoutDebuggerIID, (void**)aResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsILayoutDebugger), (void**)aResult);
|
||||
}
|
||||
|
||||
nsLayoutDebugger::nsLayoutDebugger()
|
||||
|
@ -75,7 +74,7 @@ nsLayoutDebugger::~nsLayoutDebugger()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsLayoutDebugger, kILayoutDebuggerIID);
|
||||
NS_IMPL_ISUPPORTS(nsLayoutDebugger, NS_GET_IID(nsILayoutDebugger));
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLayoutDebugger::SetShowFrameBorders(PRBool aEnable)
|
||||
|
|
|
@ -76,9 +76,7 @@ PrefChangedCallback(const char* aPrefName, void* instance_data)
|
|||
return 0; // PREF_OK
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID);
|
||||
static NS_DEFINE_CID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
|
||||
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
|
||||
|
||||
nsPresContext::nsPresContext()
|
||||
: mDefaultFont("serif", NS_FONT_STYLE_NORMAL,
|
||||
|
|
|
@ -455,6 +455,7 @@ typedef PRBool nsDidReflowStatus;
|
|||
class nsIFrame : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFRAME_IID)
|
||||
/**
|
||||
* Called to initialize the frame. This is called immediately after creating
|
||||
* the frame.
|
||||
|
|
|
@ -34,6 +34,7 @@ class nsIURI;
|
|||
*/
|
||||
class nsIFrameUtil : public nsISupports {
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFRAME_UTIL_IID)
|
||||
/**
|
||||
* Compare two regression data dumps. The return status will be NS_OK
|
||||
* if the trees compare favoribly, otherwise the return will indicate
|
||||
|
|
|
@ -37,6 +37,8 @@ class nsIPresShell;
|
|||
*/
|
||||
class nsILayoutDebugger : public nsISupports {
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ILAYOUT_DEBUGGER_IID)
|
||||
|
||||
NS_IMETHOD SetShowFrameBorders(PRBool aEnable) = 0;
|
||||
|
||||
NS_IMETHOD GetShowFrameBorders(PRBool* aResult) = 0;
|
||||
|
|
|
@ -114,7 +114,6 @@
|
|||
static NS_DEFINE_CID(kCRangeCID, NS_RANGE_CID);
|
||||
static NS_DEFINE_CID(kDOMScriptObjectFactoryCID, NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
|
||||
|
||||
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
|
||||
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
|
||||
|
||||
#include "nsILineBreakerFactory.h"
|
||||
|
|
|
@ -1527,7 +1527,6 @@ DocumentViewerImpl::GetSaveable(PRBool *aSaveable)
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kIDeviceContextSpecFactoryIID, NS_IDEVICE_CONTEXT_SPEC_FACTORY_IID);
|
||||
static NS_DEFINE_IID(kDeviceContextSpecFactoryCID, NS_DEVICE_CONTEXT_SPEC_FACTORY_CID);
|
||||
|
||||
|
||||
|
@ -1544,7 +1543,7 @@ PRInt32 width,height;
|
|||
|
||||
nsComponentManager::CreateInstance(kDeviceContextSpecFactoryCID,
|
||||
nsnull,
|
||||
kIDeviceContextSpecFactoryIID,
|
||||
NS_GET_IID(nsIDeviceContextSpecFactory),
|
||||
(void **)getter_AddRefs(factory));
|
||||
|
||||
if (factory) {
|
||||
|
|
|
@ -38,8 +38,6 @@
|
|||
#undef NOISY_IMAGE_LOADING
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_IID(kIFrameImageLoaderIID, NS_IFRAME_IMAGE_LOADER_IID);
|
||||
static NS_DEFINE_IID(kIImageRequestObserverIID, NS_IIMAGEREQUESTOBSERVER_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
NS_LAYOUT nsresult
|
||||
|
@ -53,7 +51,7 @@ NS_NewFrameImageLoader(nsIFrameImageLoader** aResult)
|
|||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIFrameImageLoaderIID, (void**) aResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIFrameImageLoader), (void**) aResult);
|
||||
}
|
||||
|
||||
nsFrameImageLoader::nsFrameImageLoader()
|
||||
|
@ -93,13 +91,13 @@ nsFrameImageLoader::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
if (!aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kIFrameImageLoaderIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIFrameImageLoader))) {
|
||||
nsIFrameImageLoader* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIImageRequestObserverIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIImageRequestObserver))) {
|
||||
nsIImageRequestObserver* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "nsFrameList.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIEnumeratorIID, NS_IENUMERATOR_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include <stdlib.h>
|
||||
#include "plstr.h"
|
||||
|
||||
static NS_DEFINE_IID(kIFrameUtilIID, NS_IFRAME_UTIL_IID);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
class nsFrameUtil : public nsIFrameUtil {
|
||||
|
@ -492,7 +491,7 @@ NS_NewFrameUtil(nsIFrameUtil** aResult)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIFrameUtilIID, (void**) aResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIFrameUtil), (void**) aResult);
|
||||
}
|
||||
|
||||
nsFrameUtil::nsFrameUtil()
|
||||
|
@ -504,7 +503,7 @@ nsFrameUtil::~nsFrameUtil()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsFrameUtil, kIFrameUtilIID);
|
||||
NS_IMPL_ISUPPORTS(nsFrameUtil, NS_GET_IID(nsIFrameUtil));
|
||||
|
||||
void
|
||||
nsFrameUtil::DumpNode(Node* aNode, FILE* aOutputFile, PRInt32 aIndent)
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "nsGfxCIID.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
|
||||
static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID);
|
||||
|
||||
class GalleyContext : public nsPresContext {
|
||||
public:
|
||||
|
@ -102,5 +101,5 @@ NS_NewGalleyContext(nsIPresContext** aInstancePtrResult)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kIPresContextIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIPresContext), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "nsIFrame.h"
|
||||
#include "nsIFrameDebug.h"
|
||||
|
||||
static NS_DEFINE_IID(kILayoutDebuggerIID, NS_ILAYOUT_DEBUGGER_IID);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
class nsLayoutDebugger : public nsILayoutDebugger {
|
||||
|
@ -63,7 +62,7 @@ NS_NewLayoutDebugger(nsILayoutDebugger** aResult)
|
|||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kILayoutDebuggerIID, (void**)aResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsILayoutDebugger), (void**)aResult);
|
||||
}
|
||||
|
||||
nsLayoutDebugger::nsLayoutDebugger()
|
||||
|
@ -75,7 +74,7 @@ nsLayoutDebugger::~nsLayoutDebugger()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsLayoutDebugger, kILayoutDebuggerIID);
|
||||
NS_IMPL_ISUPPORTS(nsLayoutDebugger, NS_GET_IID(nsILayoutDebugger));
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLayoutDebugger::SetShowFrameBorders(PRBool aEnable)
|
||||
|
|
|
@ -1,434 +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):
|
||||
*/
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsINameSpace.h"
|
||||
#include "nsHashtable.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsString.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
static NS_DEFINE_IID(kINameSpaceManagerIID, NS_INAMESPACEMANAGER_IID);
|
||||
static NS_DEFINE_IID(kINameSpaceIID, NS_INAMESPACE_IID);
|
||||
|
||||
|
||||
static const char kXMLNSNameSpaceURI[] = "http://www.w3.org/2000/xmlns";
|
||||
static const char kXMLNameSpaceURI[] = "http://www.w3.org/XML/1998/namespace";
|
||||
static const char kHTMLNameSpaceURI[] = "http://www.w3.org/TR/REC-html40"; // XXX?? "urn:w3-org-ns:HTML"??
|
||||
// XXX To be removed: Bug 7834 ---
|
||||
static const char kXHTMLNameSpaceURI[] = "http://www.w3.org/1999/xhtml";
|
||||
static const char kXLinkNameSpaceURI[] = "http://www.w3.org/1999/xlink";
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Name Space ID table support
|
||||
|
||||
static PRInt32 gNameSpaceTableRefs;
|
||||
static nsHashtable* gURIToIDTable;
|
||||
static nsVoidArray* gURIArray;
|
||||
|
||||
static void AddRefTable()
|
||||
{
|
||||
if (0 == gNameSpaceTableRefs++) {
|
||||
NS_ASSERTION(nsnull == gURIToIDTable, "already have URI table");
|
||||
NS_ASSERTION(nsnull == gURIArray, "already have URI array");
|
||||
|
||||
gURIToIDTable = new nsHashtable();
|
||||
gURIArray = new nsVoidArray();
|
||||
|
||||
nsString* xmlns = new nsString( NS_ConvertToString(kXMLNSNameSpaceURI) );
|
||||
nsString* xml = new nsString( NS_ConvertToString(kXMLNameSpaceURI) );
|
||||
nsString* xhtml = new nsString( NS_ConvertToString(kXHTMLNameSpaceURI) );
|
||||
nsString* xlink = new nsString( NS_ConvertToString(kXLinkNameSpaceURI) );
|
||||
nsString* html = new nsString( NS_ConvertToString(kHTMLNameSpaceURI) );
|
||||
gURIArray->AppendElement(xmlns); // ordering here needs to match IDs
|
||||
gURIArray->AppendElement(xml);
|
||||
gURIArray->AppendElement(xhtml);
|
||||
gURIArray->AppendElement(xlink);
|
||||
gURIArray->AppendElement(html);
|
||||
nsStringKey xmlnsKey(*xmlns);
|
||||
nsStringKey xmlKey(*xml);
|
||||
nsStringKey xhtmlKey(*xhtml);
|
||||
nsStringKey xlinkKey(*xlink);
|
||||
nsStringKey htmlKey(*html);
|
||||
gURIToIDTable->Put(&xmlnsKey, (void*)kNameSpaceID_XMLNS);
|
||||
gURIToIDTable->Put(&xmlKey, (void*)kNameSpaceID_XML);
|
||||
gURIToIDTable->Put(&xhtmlKey, (void*)kNameSpaceID_HTML);
|
||||
gURIToIDTable->Put(&xlinkKey, (void*)kNameSpaceID_XLink);
|
||||
gURIToIDTable->Put(&htmlKey, (void*)kNameSpaceID_HTML);
|
||||
}
|
||||
NS_ASSERTION(nsnull != gURIToIDTable, "no URI table");
|
||||
NS_ASSERTION(nsnull != gURIArray, "no URI array");
|
||||
}
|
||||
|
||||
static void ReleaseTable()
|
||||
{
|
||||
if (0 == --gNameSpaceTableRefs) {
|
||||
delete gURIToIDTable;
|
||||
PRInt32 index = gURIArray->Count();
|
||||
while (0 < index--) {
|
||||
nsString* str = (nsString*)gURIArray->ElementAt(index);
|
||||
delete str;
|
||||
}
|
||||
delete gURIArray;
|
||||
gURIToIDTable = nsnull;
|
||||
gURIArray = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
static PRInt32 FindNameSpaceID(const nsAReadableString& aURI)
|
||||
{
|
||||
NS_ASSERTION(nsnull != gURIToIDTable, "no URI table");
|
||||
nsStringKey key(aURI);
|
||||
void* value = gURIToIDTable->Get(&key);
|
||||
if (nsnull != value) {
|
||||
return PRInt32(value);
|
||||
}
|
||||
return kNameSpaceID_Unknown;
|
||||
}
|
||||
|
||||
static const nsString* FindNameSpaceURI(PRInt32 aID)
|
||||
{
|
||||
NS_ASSERTION(nsnull != gURIArray, "no URI array");
|
||||
return (const nsString*)gURIArray->ElementAt(aID - 1);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Name Space
|
||||
|
||||
class NameSpaceImpl : public nsINameSpace {
|
||||
public:
|
||||
NameSpaceImpl(nsINameSpaceManager* aManager,
|
||||
NameSpaceImpl* aParent,
|
||||
nsIAtom* aPrefix,
|
||||
const nsAReadableString& aURI);
|
||||
NameSpaceImpl(nsINameSpaceManager* aManager,
|
||||
NameSpaceImpl* aParent,
|
||||
nsIAtom* aPrefix,
|
||||
PRInt32 aNameSpaceID);
|
||||
virtual ~NameSpaceImpl();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD GetNameSpaceManager(nsINameSpaceManager*& aManager) const;
|
||||
|
||||
NS_IMETHOD GetNameSpaceID(PRInt32& aID) const;
|
||||
NS_IMETHOD GetNameSpaceURI(nsAWritableString& aURI) const;
|
||||
NS_IMETHOD GetNameSpacePrefix(nsIAtom*& aPrefix) const;
|
||||
|
||||
NS_IMETHOD GetParentNameSpace(nsINameSpace*& aParent) const;
|
||||
|
||||
NS_IMETHOD FindNameSpace(nsIAtom* aPrefix, nsINameSpace*& aNameSpace) const;
|
||||
NS_IMETHOD FindNameSpaceID(nsIAtom* aPrefix, PRInt32& aNameSpaceID) const;
|
||||
NS_IMETHOD FindNameSpacePrefix(PRInt32 aNameSpaceID, nsIAtom*& aPrefix) const;
|
||||
|
||||
NS_IMETHOD CreateChildNameSpace(nsIAtom* aPrefix, const nsAReadableString& aURI,
|
||||
nsINameSpace*& aChildNameSpace);
|
||||
NS_IMETHOD CreateChildNameSpace(nsIAtom* aPrefix, PRInt32 aNameSpaceID,
|
||||
nsINameSpace*& aChildNameSpace);
|
||||
|
||||
private:
|
||||
// These are not supported and are not implemented!
|
||||
NameSpaceImpl(const NameSpaceImpl& aCopy);
|
||||
NameSpaceImpl& operator=(const NameSpaceImpl& aCopy);
|
||||
|
||||
public:
|
||||
nsINameSpaceManager* mManager;
|
||||
NameSpaceImpl* mParent;
|
||||
nsIAtom* mPrefix;
|
||||
PRInt32 mID;
|
||||
};
|
||||
|
||||
NameSpaceImpl::NameSpaceImpl(nsINameSpaceManager* aManager,
|
||||
NameSpaceImpl* aParent,
|
||||
nsIAtom* aPrefix,
|
||||
const nsAReadableString& aURI)
|
||||
: mManager(aManager),
|
||||
mParent(aParent),
|
||||
mPrefix(aPrefix)
|
||||
{
|
||||
NS_ASSERTION(nsnull != aManager, "null namespace manager");
|
||||
NS_INIT_REFCNT();
|
||||
NS_ADDREF(mManager);
|
||||
NS_IF_ADDREF(mParent);
|
||||
NS_IF_ADDREF(mPrefix);
|
||||
mManager->RegisterNameSpace(aURI, mID);
|
||||
}
|
||||
|
||||
NameSpaceImpl::NameSpaceImpl(nsINameSpaceManager* aManager,
|
||||
NameSpaceImpl* aParent,
|
||||
nsIAtom* aPrefix,
|
||||
PRInt32 aNameSpaceID)
|
||||
: mManager(aManager),
|
||||
mParent(aParent),
|
||||
mPrefix(aPrefix),
|
||||
mID(aNameSpaceID)
|
||||
{
|
||||
NS_ASSERTION(nsnull != aManager, "null namespace manager");
|
||||
NS_INIT_REFCNT();
|
||||
NS_ADDREF(mManager);
|
||||
NS_IF_ADDREF(mParent);
|
||||
NS_IF_ADDREF(mPrefix);
|
||||
}
|
||||
|
||||
NameSpaceImpl::~NameSpaceImpl()
|
||||
{
|
||||
NS_RELEASE(mManager);
|
||||
NS_IF_RELEASE(mParent);
|
||||
NS_IF_RELEASE(mPrefix);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(NameSpaceImpl, kINameSpaceIID)
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceImpl::GetNameSpaceManager(nsINameSpaceManager*& aManager) const
|
||||
{
|
||||
NS_ASSERTION(nsnull != aManager, "null namespace manager");
|
||||
aManager = mManager;
|
||||
NS_ADDREF(aManager);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceImpl::GetNameSpaceID(PRInt32& aID) const
|
||||
{
|
||||
aID = mID;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceImpl::GetNameSpaceURI(nsAWritableString& aURI) const
|
||||
{
|
||||
NS_ASSERTION(nsnull != mManager, "null namespace manager");
|
||||
return mManager->GetNameSpaceURI(mID, aURI);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceImpl::GetNameSpacePrefix(nsIAtom*& aPrefix) const
|
||||
{
|
||||
aPrefix = mPrefix;
|
||||
NS_IF_ADDREF(aPrefix);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceImpl::GetParentNameSpace(nsINameSpace*& aParent) const
|
||||
{
|
||||
aParent = mParent;
|
||||
NS_IF_ADDREF(aParent);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceImpl::FindNameSpace(nsIAtom* aPrefix, nsINameSpace*& aNameSpace) const
|
||||
{
|
||||
const NameSpaceImpl* nameSpace = this;
|
||||
do {
|
||||
if (aPrefix == nameSpace->mPrefix) {
|
||||
aNameSpace = (nsINameSpace*)nameSpace;
|
||||
NS_ADDREF(aNameSpace);
|
||||
return NS_OK;
|
||||
}
|
||||
nameSpace = nameSpace->mParent;
|
||||
}
|
||||
while (nsnull != nameSpace);
|
||||
aNameSpace = nsnull;
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceImpl::FindNameSpaceID(nsIAtom* aPrefix, PRInt32& aNameSpaceID) const
|
||||
{
|
||||
const NameSpaceImpl* nameSpace = this;
|
||||
do {
|
||||
if (aPrefix == nameSpace->mPrefix) {
|
||||
aNameSpaceID = nameSpace->mID;
|
||||
return NS_OK;
|
||||
}
|
||||
nameSpace = nameSpace->mParent;
|
||||
} while (nsnull != nameSpace);
|
||||
|
||||
if (nsnull == aPrefix) {
|
||||
aNameSpaceID = kNameSpaceID_None;
|
||||
}
|
||||
else {
|
||||
aNameSpaceID = kNameSpaceID_Unknown;
|
||||
}
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceImpl::FindNameSpacePrefix(PRInt32 aNameSpaceID, nsIAtom*& aPrefix) const
|
||||
{
|
||||
const NameSpaceImpl* nameSpace = this;
|
||||
do {
|
||||
if (aNameSpaceID == nameSpace->mID) {
|
||||
aPrefix = nameSpace->mPrefix;
|
||||
NS_IF_ADDREF(aPrefix);
|
||||
return NS_OK;
|
||||
}
|
||||
nameSpace = nameSpace->mParent;
|
||||
}
|
||||
while (nsnull != nameSpace);
|
||||
aPrefix = nsnull;
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceImpl::CreateChildNameSpace(nsIAtom* aPrefix, const nsAReadableString& aURI,
|
||||
nsINameSpace*& aChildNameSpace)
|
||||
{
|
||||
NameSpaceImpl* child = new NameSpaceImpl(mManager, this, aPrefix, aURI);
|
||||
|
||||
if (child) {
|
||||
return child->QueryInterface(kINameSpaceIID, (void**)&aChildNameSpace);
|
||||
}
|
||||
aChildNameSpace = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceImpl::CreateChildNameSpace(nsIAtom* aPrefix, PRInt32 aNameSpaceID,
|
||||
nsINameSpace*& aChildNameSpace)
|
||||
{
|
||||
if (FindNameSpaceURI(aNameSpaceID)) {
|
||||
NameSpaceImpl* child = new NameSpaceImpl(mManager, this, aPrefix, aNameSpaceID);
|
||||
|
||||
if (child) {
|
||||
return child->QueryInterface(kINameSpaceIID, (void**)&aChildNameSpace);
|
||||
}
|
||||
aChildNameSpace = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
aChildNameSpace = nsnull;
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Name Space Manager
|
||||
|
||||
class NameSpaceManagerImpl : public nsINameSpaceManager {
|
||||
public:
|
||||
NameSpaceManagerImpl();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD CreateRootNameSpace(nsINameSpace*& aRootNameSpace);
|
||||
|
||||
NS_IMETHOD RegisterNameSpace(const nsAReadableString& aURI,
|
||||
PRInt32& aNameSpaceID);
|
||||
|
||||
NS_IMETHOD GetNameSpaceURI(PRInt32 aNameSpaceID, nsAWritableString& aURI);
|
||||
NS_IMETHOD GetNameSpaceID(const nsAReadableString& aURI, PRInt32& aNameSpaceID);
|
||||
|
||||
private:
|
||||
// These are not supported and are not implemented!
|
||||
NameSpaceManagerImpl(const NameSpaceManagerImpl& aCopy);
|
||||
NameSpaceManagerImpl& operator=(const NameSpaceManagerImpl& aCopy);
|
||||
|
||||
protected:
|
||||
virtual ~NameSpaceManagerImpl();
|
||||
|
||||
};
|
||||
|
||||
NameSpaceManagerImpl::NameSpaceManagerImpl()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
AddRefTable();
|
||||
}
|
||||
|
||||
NameSpaceManagerImpl::~NameSpaceManagerImpl()
|
||||
{
|
||||
ReleaseTable();
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(NameSpaceManagerImpl, kINameSpaceManagerIID)
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceManagerImpl::CreateRootNameSpace(nsINameSpace*& aRootNameSpace)
|
||||
{
|
||||
nsresult rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
aRootNameSpace = nsnull;
|
||||
|
||||
NameSpaceImpl* xmlns = new NameSpaceImpl(this, nsnull, nsLayoutAtoms::xmlnsNameSpace, kNameSpaceID_XMLNS);
|
||||
if (nsnull != xmlns) {
|
||||
NameSpaceImpl* xml = new NameSpaceImpl(this, xmlns, nsLayoutAtoms::xmlNameSpace, kNameSpaceID_XML);
|
||||
if (nsnull != xml) {
|
||||
rv = xml->QueryInterface(kINameSpaceIID, (void**)&aRootNameSpace);
|
||||
}
|
||||
else {
|
||||
delete xmlns;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceManagerImpl::RegisterNameSpace(const nsAReadableString& aURI,
|
||||
PRInt32& aNameSpaceID)
|
||||
{
|
||||
PRInt32 id = FindNameSpaceID(aURI);
|
||||
|
||||
if (kNameSpaceID_Unknown == id) {
|
||||
nsString* uri = new nsString(aURI);
|
||||
gURIArray->AppendElement(uri);
|
||||
id = gURIArray->Count(); // id is index + 1
|
||||
nsStringKey key(*uri);
|
||||
gURIToIDTable->Put(&key, (void*)id);
|
||||
}
|
||||
aNameSpaceID = id;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceManagerImpl::GetNameSpaceURI(PRInt32 aNameSpaceID, nsAWritableString& aURI)
|
||||
{
|
||||
const nsString* result = FindNameSpaceURI(aNameSpaceID);
|
||||
if (nsnull != result) {
|
||||
aURI = *result;
|
||||
return NS_OK;
|
||||
}
|
||||
aURI.Truncate();
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NameSpaceManagerImpl::GetNameSpaceID(const nsAReadableString& aURI, PRInt32& aNameSpaceID)
|
||||
{
|
||||
aNameSpaceID = FindNameSpaceID(aURI);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_LAYOUT nsresult
|
||||
NS_NewNameSpaceManager(nsINameSpaceManager** aInstancePtrResult)
|
||||
{
|
||||
if (aInstancePtrResult == nsnull) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
NameSpaceManagerImpl *it = new NameSpaceManagerImpl();
|
||||
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kINameSpaceManagerIID, (void **) aInstancePtrResult);
|
||||
}
|
|
@ -76,9 +76,7 @@ PrefChangedCallback(const char* aPrefName, void* instance_data)
|
|||
return 0; // PREF_OK
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID);
|
||||
static NS_DEFINE_CID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
|
||||
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
|
||||
|
||||
nsPresContext::nsPresContext()
|
||||
: mDefaultFont("serif", NS_FONT_STYLE_NORMAL,
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "nsGfxCIID.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
|
||||
static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID);
|
||||
|
||||
class PrintContext : public nsPresContext {
|
||||
public:
|
||||
|
@ -118,5 +117,5 @@ NS_NewPrintContext(nsIPresContext** aInstancePtrResult)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kIPresContextIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIPresContext), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "nsLayoutAtoms.h"
|
||||
#include "prlog.h"
|
||||
|
||||
static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID);
|
||||
|
||||
class PrintPreviewContext : public nsPresContext {
|
||||
public:
|
||||
|
@ -151,5 +150,5 @@ NS_NewPrintPreviewContext(nsIPresContext** aInstancePtrResult)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kIPresContextIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIPresContext), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -47,8 +47,6 @@
|
|||
#include "nsHTMLParts.h"
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
||||
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
|
||||
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
|
||||
|
||||
PRMonitor* nsRange::mMonitor = nsnull;
|
||||
|
@ -347,7 +345,7 @@ nsresult nsRange::QueryInterface(const nsIID& aIID,
|
|||
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();
|
||||
|
@ -1895,7 +1893,7 @@ nsRange::CreateContextualFragment(const nsAReadableString& aFragment,
|
|||
// Create a new parser for this entire operation
|
||||
result = nsComponentManager::CreateInstance(kCParserCID,
|
||||
nsnull,
|
||||
kCParserIID,
|
||||
NS_GET_IID(nsIParser),
|
||||
(void **)getter_AddRefs(parser));
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = parser->CreateTagStack(&tagStack);
|
||||
|
@ -2000,7 +1998,7 @@ nsRange::IsValidFragment(const nsAReadableString& aFragment, PRBool* aReturn)
|
|||
// Create a new parser for this entire operation
|
||||
result = nsComponentManager::CreateInstance(kCParserCID,
|
||||
nsnull,
|
||||
kCParserIID,
|
||||
NS_GET_IID(nsIParser),
|
||||
(void **)getter_AddRefs(parser));
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = parser->CreateTagStack(&tagStack);
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#ifdef DEBUG
|
||||
#include "nsIFrameDebug.h"
|
||||
#endif
|
||||
static NS_DEFINE_IID(kISpaceManagerIID, NS_ISPACEMANAGER_IID);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// BandList
|
||||
|
@ -89,7 +88,7 @@ nsSpaceManager::~nsSpaceManager()
|
|||
ClearFrameInfo();
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsSpaceManager, kISpaceManagerIID);
|
||||
NS_IMPL_ISUPPORTS(nsSpaceManager, NS_GET_IID(nsISpaceManager));
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSpaceManager::GetFrame(nsIFrame*& aFrame) const
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
#include "nsLayoutAtoms.h"
|
||||
#include "prenv.h"
|
||||
|
||||
static NS_DEFINE_IID(kIStyleContextIID, NS_ISTYLECONTEXT_IID);
|
||||
|
||||
#define DELETE_ARRAY_IF(array) if (array) { delete[] array; array = nsnull; }
|
||||
|
||||
|
@ -3587,7 +3586,7 @@ NS_NewStyleContext(nsIStyleContext** aInstancePtrResult,
|
|||
if (nsnull == context) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
nsresult result = context->QueryInterface(kIStyleContextIID, (void **) aInstancePtrResult);
|
||||
nsresult result = context->QueryInterface(NS_GET_IID(nsIStyleContext), (void **) aInstancePtrResult);
|
||||
context->RemapStyle(aPresContext); // remap after initial ref-count is set
|
||||
|
||||
#ifdef SHARE_STYLECONTEXTS
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
static NS_DEFINE_IID(kIStyleSetIID, NS_ISTYLE_SET_IID);
|
||||
static NS_DEFINE_IID(kIStyleFrameConstructionIID, NS_ISTYLE_FRAME_CONSTRUCTION_IID);
|
||||
|
||||
// - fast cache uses a CRC32 on the style context to quickly find sharing candidates.
|
||||
|
@ -394,7 +393,7 @@ StyleSetImpl::~StyleSetImpl()
|
|||
}
|
||||
|
||||
#ifndef MOZ_PERF_METRICS
|
||||
NS_IMPL_ISUPPORTS(StyleSetImpl, kIStyleSetIID)
|
||||
NS_IMPL_ISUPPORTS(StyleSetImpl, NS_GET_IID(nsIStyleSet))
|
||||
#else
|
||||
NS_IMPL_ISUPPORTS2(StyleSetImpl, nsIStyleSet, nsITimeRecorder)
|
||||
#endif
|
||||
|
@ -729,7 +728,7 @@ NS_IMETHODIMP StyleSetImpl::EnableQuirkStyleSheet(PRBool aEnable)
|
|||
sheet = getter_AddRefs(GetBackstopStyleSheetAt(i));
|
||||
if (sheet) {
|
||||
nsCOMPtr<nsICSSStyleSheet> cssSheet;
|
||||
sheet->QueryInterface(nsICSSStyleSheet::GetIID(), getter_AddRefs(cssSheet));
|
||||
sheet->QueryInterface(NS_GET_IID(nsICSSStyleSheet), getter_AddRefs(cssSheet));
|
||||
if (cssSheet) {
|
||||
nsCOMPtr<nsIStyleSheet> quirkSheet;
|
||||
PRBool bHasSheet = PR_FALSE;
|
||||
|
@ -1388,7 +1387,7 @@ NS_NewStyleSet(nsIStyleSet** aInstancePtrResult)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kIStyleSetIID, (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIStyleSet), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
// nsITimeRecorder implementation
|
||||
|
|
|
@ -49,9 +49,6 @@
|
|||
|
||||
#undef NOISY_REGISTRY
|
||||
|
||||
static NS_DEFINE_IID(kIDocumentLoaderFactoryIID, NS_IDOCUMENTLOADERFACTORY_IID);
|
||||
static NS_DEFINE_IID(kIDocStreamLoaderFactoryIID, NS_IDOCSTREAMLOADERFACTORY_IID);
|
||||
static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kHTMLDocumentCID, NS_HTMLDOCUMENT_CID);
|
||||
static NS_DEFINE_IID(kXMLDocumentCID, NS_XMLDOCUMENT_CID);
|
||||
static NS_DEFINE_IID(kImageDocumentCID, NS_IMAGEDOCUMENT_CID);
|
||||
|
@ -169,7 +166,7 @@ NS_NewLayoutDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult)
|
|||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIDocumentLoaderFactoryIID, (void**)aResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIDocumentLoaderFactory), (void**)aResult);
|
||||
}
|
||||
|
||||
nsLayoutDLF::nsLayoutDLF()
|
||||
|
@ -192,13 +189,13 @@ nsLayoutDLF::QueryInterface(REFNSIID aIID, void** aInstancePtrResult)
|
|||
}
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
if (aIID.Equals(kIDocumentLoaderFactoryIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDocumentLoaderFactory))) {
|
||||
nsIDocumentLoaderFactory *tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDocStreamLoaderFactoryIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDocStreamLoaderFactory))) {
|
||||
nsIDocStreamLoaderFactory *tmp = this;
|
||||
*aInstancePtrResult = (void*) tmp;
|
||||
AddRef();
|
||||
|
@ -364,7 +361,7 @@ nsLayoutDLF::CreateDocument(const char* aCommand,
|
|||
do {
|
||||
// Create the document
|
||||
rv = nsComponentManager::CreateInstance(aDocumentCID, nsnull,
|
||||
kIDocumentIID,
|
||||
NS_GET_IID(nsIDocument),
|
||||
getter_AddRefs(doc));
|
||||
if (NS_FAILED(rv))
|
||||
break;
|
||||
|
@ -427,7 +424,7 @@ nsLayoutDLF::CreateRDFDocument(nsISupports* aExtraInfo,
|
|||
|
||||
// Create the XUL document
|
||||
rv = nsComponentManager::CreateInstance(kXULDocumentCID, nsnull,
|
||||
kIDocumentIID,
|
||||
NS_GET_IID(nsIDocument),
|
||||
getter_AddRefs(*doc));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
|
|
|
@ -112,10 +112,7 @@ extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
|
|||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIScriptNameSetRegistryIID, NS_ISCRIPTNAMESETREGISTRY_IID);
|
||||
static NS_DEFINE_IID(kCScriptNameSetRegistryCID, NS_SCRIPT_NAMESET_REGISTRY_CID);
|
||||
static NS_DEFINE_IID(kIScriptNameSpaceManagerIID, NS_ISCRIPTNAMESPACEMANAGER_IID);
|
||||
static NS_DEFINE_IID(kIScriptExternalNameSetIID, NS_ISCRIPTEXTERNALNAMESET_IID);
|
||||
|
||||
class LayoutScriptNameSet : public nsIScriptExternalNameSet {
|
||||
public:
|
||||
|
@ -137,7 +134,7 @@ LayoutScriptNameSet::~LayoutScriptNameSet()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(LayoutScriptNameSet, kIScriptExternalNameSetIID);
|
||||
NS_IMPL_ISUPPORTS(LayoutScriptNameSet, NS_GET_IID(nsIScriptExternalNameSet));
|
||||
|
||||
NS_IMETHODIMP
|
||||
LayoutScriptNameSet::InitializeClasses(nsIScriptContext* aScriptContext)
|
||||
|
@ -152,12 +149,11 @@ LayoutScriptNameSet::AddNameSet(nsIScriptContext* aScriptContext)
|
|||
nsIScriptNameSpaceManager* manager;
|
||||
static NS_DEFINE_IID(kHTMLImageElementCID, NS_HTMLIMAGEELEMENT_CID);
|
||||
static NS_DEFINE_IID(kHTMLOptionElementCID, NS_HTMLOPTIONELEMENT_CID);
|
||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
||||
|
||||
result = aScriptContext->GetNameSpaceManager(&manager);
|
||||
if (NS_OK == result) {
|
||||
result = manager->RegisterGlobalName(NS_ConvertToString("HTMLImageElement"),
|
||||
kIScriptObjectOwnerIID,
|
||||
NS_GET_IID(nsIScriptObjectOwner),
|
||||
kHTMLImageElementCID,
|
||||
PR_TRUE);
|
||||
if (NS_FAILED(result)) {
|
||||
|
@ -166,7 +162,7 @@ LayoutScriptNameSet::AddNameSet(nsIScriptContext* aScriptContext)
|
|||
}
|
||||
|
||||
result = manager->RegisterGlobalName(NS_ConvertToString("HTMLOptionElement"),
|
||||
kIScriptObjectOwnerIID,
|
||||
NS_GET_IID(nsIScriptObjectOwner),
|
||||
kHTMLOptionElementCID,
|
||||
PR_TRUE);
|
||||
if (NS_FAILED(result)) {
|
||||
|
@ -182,7 +178,6 @@ LayoutScriptNameSet::AddNameSet(nsIScriptContext* aScriptContext)
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static NS_DEFINE_IID(kIModuleIID, NS_IMODULE_IID);
|
||||
|
||||
nsIScriptNameSetRegistry* nsLayoutModule::gRegistry;
|
||||
nsICSSStyleSheet* nsLayoutModule::gUAStyleSheet = nsnull;
|
||||
|
@ -198,7 +193,7 @@ nsLayoutModule::~nsLayoutModule()
|
|||
Shutdown();
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsLayoutModule, kIModuleIID)
|
||||
NS_IMPL_ISUPPORTS(nsLayoutModule, NS_GET_IID(nsIModule))
|
||||
|
||||
// Perform our one-time intialization for this module
|
||||
nsresult
|
||||
|
@ -236,7 +231,7 @@ nsLayoutModule::Initialize()
|
|||
// XXX Initialize the script name set thingy-ma-jigger
|
||||
if (!gRegistry) {
|
||||
rv = nsServiceManager::GetService(kCScriptNameSetRegistryCID,
|
||||
kIScriptNameSetRegistryIID,
|
||||
NS_GET_IID(nsIScriptNameSetRegistry),
|
||||
(nsISupports**) &gRegistry);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
LayoutScriptNameSet* nameSet = new LayoutScriptNameSet();
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "nsLayoutAtoms.h"
|
||||
#include "nsMutationEvent.h"
|
||||
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
static char* mEventNames[] = {
|
||||
"mousedown", "mouseup", "click", "dblclick", "mouseover",
|
||||
|
|
|
@ -60,10 +60,6 @@
|
|||
#include "nsIPresShell.h"
|
||||
#include "nsMutationEvent.h"
|
||||
|
||||
static NS_DEFINE_IID(kIEventListenerManagerIID, NS_IEVENTLISTENERMANAGER_IID);
|
||||
static NS_DEFINE_IID(kIDOMEventListenerIID, NS_IDOMEVENTLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDOMEventIID, NS_IDOMEVENT_IID);
|
||||
static NS_DEFINE_IID(kIScriptEventListenerIID, NS_ISCRIPTEVENTLISTENER_IID);
|
||||
|
||||
nsEventListenerManager::nsEventListenerManager()
|
||||
{
|
||||
|
@ -2236,7 +2232,7 @@ NS_HTML nsresult NS_NewEventListenerManager(nsIEventListenerManager** aInstanceP
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if (NS_OK == l->QueryInterface(kIEventListenerManagerIID, (void**) aInstancePtrResult)) {
|
||||
if (NS_OK == l->QueryInterface(NS_GET_IID(nsIEventListenerManager), (void**) aInstancePtrResult)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
#include "nsIScrollableFrame.h"
|
||||
#include "nsIScrollableView.h"
|
||||
|
||||
static NS_DEFINE_IID(kScrollableViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
|
||||
#include "nsIXULDocument.h" // Temporary fix for Bug 36558
|
||||
|
||||
|
@ -69,14 +68,6 @@ static NS_DEFINE_IID(kScrollableViewIID, NS_ISCROLLABLEVIEW_IID);
|
|||
#include "nsIFontMetrics.h"
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kIComboboxControlFrameIID, NS_ICOMBOBOXCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kIListControlFrameIID, NS_ILISTCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kIDOMMouseListenerIID, NS_IDOMMOUSELISTENER_IID);
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
static NS_DEFINE_IID(kIAnonymousContentCreatorIID, NS_IANONYMOUS_CONTENT_CREATOR_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID);
|
||||
static NS_DEFINE_IID(kIPrivateDOMEventIID, NS_IPRIVATEDOMEVENT_IID);
|
||||
|
||||
#define FIX_FOR_BUG_53259
|
||||
|
||||
|
@ -283,13 +274,13 @@ nsComboboxControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (aIID.Equals(kIComboboxControlFrameIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIComboboxControlFrame))) {
|
||||
*aInstancePtr = (void*) ((nsIComboboxControlFrame*) this);
|
||||
return NS_OK;
|
||||
} else if (aIID.Equals(kIFormControlFrameIID)) {
|
||||
} else if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
|
||||
*aInstancePtr = (void*) ((nsIFormControlFrame*) this);
|
||||
return NS_OK;
|
||||
} else if (aIID.Equals(kIAnonymousContentCreatorIID)) {
|
||||
} else if (aIID.Equals(NS_GET_IID(nsIAnonymousContentCreator))) {
|
||||
*aInstancePtr = (void*)(nsIAnonymousContentCreator*) this;
|
||||
return NS_OK;
|
||||
} else if (aIID.Equals(NS_GET_IID(nsISelectControlFrame))) {
|
||||
|
@ -357,7 +348,7 @@ nsComboboxControlFrame::MakeSureSomethingIsSelected(nsIPresContext* aPresContext
|
|||
REFLOW_DEBUG_MSG("CBX::MakeSureSomethingIsSelected\n");
|
||||
|
||||
nsIFormControlFrame* fcFrame = nsnull;
|
||||
nsresult rv = mDropdownFrame->QueryInterface(kIFormControlFrameIID, (void**)&fcFrame);
|
||||
nsresult rv = mDropdownFrame->QueryInterface(NS_GET_IID(nsIFormControlFrame), (void**)&fcFrame);
|
||||
if (NS_SUCCEEDED(rv) && fcFrame) {
|
||||
// If nothing selected, and there are options, default selection to item 0
|
||||
rv = mListControlFrame->GetSelectedIndex(&mSelectedIndex);
|
||||
|
@ -413,7 +404,7 @@ nsComboboxControlFrame::Reset(nsIPresContext* aPresContext)
|
|||
|
||||
// Reset the dropdown list to its original state
|
||||
nsIFormControlFrame* fcFrame = nsnull;
|
||||
nsresult result = mDropdownFrame->QueryInterface(kIFormControlFrameIID, (void**)&fcFrame);
|
||||
nsresult result = mDropdownFrame->QueryInterface(NS_GET_IID(nsIFormControlFrame), (void**)&fcFrame);
|
||||
if ((NS_OK == result) && (nsnull != fcFrame)) {
|
||||
fcFrame->Reset(aPresContext);
|
||||
}
|
||||
|
@ -538,7 +529,7 @@ nsComboboxControlFrame::ShowPopup(PRBool aShowPopup)
|
|||
mDropdownFrame->GetRect(rect);
|
||||
viewManager->ResizeView(view, rect.width, rect.height);
|
||||
nsIScrollableView* scrollingView;
|
||||
if (NS_SUCCEEDED(view->QueryInterface(kScrollableViewIID, (void**)&scrollingView))) {
|
||||
if (NS_SUCCEEDED(view->QueryInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollingView))) {
|
||||
scrollingView->ComputeScrollOffsets(PR_TRUE);
|
||||
}
|
||||
viewManager->SetViewVisibility(view, nsViewVisibility_kShow);
|
||||
|
@ -557,7 +548,7 @@ nsComboboxControlFrame::ShowList(nsIPresContext* aPresContext, PRBool aShowList)
|
|||
|
||||
// Get parent view
|
||||
nsIFrame * listFrame;
|
||||
if (NS_OK == mListControlFrame->QueryInterface(kIFrameIID, (void **)&listFrame)) {
|
||||
if (NS_OK == mListControlFrame->QueryInterface(NS_GET_IID(nsIFrame), (void **)&listFrame)) {
|
||||
nsIView * view = nsnull;
|
||||
listFrame->GetView(aPresContext, &view);
|
||||
NS_ASSERTION(view != nsnull, "nsComboboxControlFrame view is null");
|
||||
|
@ -645,7 +636,7 @@ void
|
|||
nsComboboxControlFrame::SetChildFrameSize(nsIFrame* aFrame, nscoord aWidth, nscoord aHeight)
|
||||
{
|
||||
nsIFormControlFrame* fcFrame = nsnull;
|
||||
nsresult result = aFrame->QueryInterface(kIFormControlFrameIID, (void**)&fcFrame);
|
||||
nsresult result = aFrame->QueryInterface(NS_GET_IID(nsIFormControlFrame), (void**)&fcFrame);
|
||||
if (NS_SUCCEEDED(result) && (nsnull != fcFrame)) {
|
||||
fcFrame->SetSuggestedSize(aWidth, aHeight);
|
||||
}
|
||||
|
@ -1341,7 +1332,7 @@ nsComboboxControlFrame::Reflow(nsIPresContext* aPresContext,
|
|||
return rv;
|
||||
} else {
|
||||
nsIFrame * plainLstFrame;
|
||||
if (NS_SUCCEEDED(mListControlFrame->QueryInterface(kIFrameIID, (void**)&plainLstFrame))) {
|
||||
if (NS_SUCCEEDED(mListControlFrame->QueryInterface(NS_GET_IID(nsIFrame), (void**)&plainLstFrame))) {
|
||||
nsIFrame * frame;
|
||||
plainLstFrame->FirstChild(aPresContext, nsnull, &frame);
|
||||
nsIScrollableFrame * scrollFrame;
|
||||
|
@ -1703,7 +1694,7 @@ nsComboboxControlFrame::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValue
|
|||
nsString* aValues, nsString* aNames)
|
||||
{
|
||||
nsIFormControlFrame* fcFrame = nsnull;
|
||||
nsresult result = mDropdownFrame->QueryInterface(kIFormControlFrameIID, (void**)&fcFrame);
|
||||
nsresult result = mDropdownFrame->QueryInterface(NS_GET_IID(nsIFormControlFrame), (void**)&fcFrame);
|
||||
if ((NS_SUCCEEDED(result)) && (nsnull != fcFrame)) {
|
||||
return fcFrame->GetNamesValues(aMaxNumValues, aNumValues, aValues, aNames);
|
||||
}
|
||||
|
@ -1795,7 +1786,7 @@ nsComboboxControlFrame::SetDropDown(nsIFrame* aDropDownFrame)
|
|||
{
|
||||
mDropdownFrame = aDropDownFrame;
|
||||
|
||||
if (NS_OK != mDropdownFrame->QueryInterface(kIListControlFrameIID, (void**)&mListControlFrame)) {
|
||||
if (NS_OK != mDropdownFrame->QueryInterface(NS_GET_IID(nsIListControlFrame), (void**)&mListControlFrame)) {
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -2089,7 +2080,7 @@ NS_IMETHODIMP
|
|||
nsComboboxControlFrame::SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsAReadableString& aValue)
|
||||
{
|
||||
nsIFormControlFrame* fcFrame = nsnull;
|
||||
nsresult result = mDropdownFrame->QueryInterface(kIFormControlFrameIID, (void**)&fcFrame);
|
||||
nsresult result = mDropdownFrame->QueryInterface(NS_GET_IID(nsIFormControlFrame), (void**)&fcFrame);
|
||||
if ((NS_SUCCEEDED(result)) && (nsnull != fcFrame)) {
|
||||
return fcFrame->SetProperty(aPresContext, aName, aValue);
|
||||
}
|
||||
|
@ -2100,7 +2091,7 @@ NS_IMETHODIMP
|
|||
nsComboboxControlFrame::GetProperty(nsIAtom* aName, nsAWritableString& aValue)
|
||||
{
|
||||
nsIFormControlFrame* fcFrame = nsnull;
|
||||
nsresult result = mDropdownFrame->QueryInterface(kIFormControlFrameIID, (void**)&fcFrame);
|
||||
nsresult result = mDropdownFrame->QueryInterface(NS_GET_IID(nsIFormControlFrame), (void**)&fcFrame);
|
||||
if ((NS_SUCCEEDED(result)) && (nsnull != fcFrame)) {
|
||||
return fcFrame->GetProperty(aName, aValue);
|
||||
}
|
||||
|
@ -2320,7 +2311,7 @@ nsComboboxControlFrame::Destroy(nsIPresContext* aPresContext)
|
|||
nsCOMPtr<nsIWidget> widget;
|
||||
// Get parent view
|
||||
nsIFrame * listFrame;
|
||||
if (NS_OK == mListControlFrame->QueryInterface(kIFrameIID, (void **)&listFrame)) {
|
||||
if (NS_OK == mListControlFrame->QueryInterface(NS_GET_IID(nsIFrame), (void **)&listFrame)) {
|
||||
nsIView * view = nsnull;
|
||||
listFrame->GetView(aPresContext, &view);
|
||||
NS_ASSERTION(view != nsnull, "nsComboboxControlFrame view is null");
|
||||
|
@ -2375,7 +2366,7 @@ nsComboboxControlFrame::SetInitialChildList(nsIPresContext* aPresContext,
|
|||
nsIFrame * child = aChildList;
|
||||
while (child != nsnull) {
|
||||
nsIFormControlFrame* fcFrame = nsnull;
|
||||
rv = child->QueryInterface(kIFormControlFrameIID, (void**)&fcFrame);
|
||||
rv = child->QueryInterface(NS_GET_IID(nsIFormControlFrame), (void**)&fcFrame);
|
||||
if (NS_FAILED(rv) && fcFrame == nsnull) {
|
||||
mDisplayFrame = child;
|
||||
} else if (fcFrame != nsnull) {
|
||||
|
|
|
@ -46,8 +46,6 @@
|
|||
#include "nsCOMPtr.h"
|
||||
|
||||
static NS_DEFINE_IID(kLegendFrameCID, NS_LEGEND_FRAME_CID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLFieldSetElementIID, NS_IDOMHTMLFIELDSETELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLLegendElementIID, NS_IDOMHTMLLEGENDELEMENT_IID);
|
||||
|
||||
class nsLegendFrame;
|
||||
|
||||
|
|
|
@ -59,10 +59,6 @@
|
|||
#include "nsIScriptGlobalObject.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMMouseListenerIID, NS_IDOMMOUSELISTENER_IID);
|
||||
static NS_DEFINE_IID(kIAnonymousContentCreatorIID, NS_IANONYMOUS_CONTENT_CREATOR_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewFileControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
|
@ -96,7 +92,7 @@ nsFileControlFrame::~nsFileControlFrame()
|
|||
// remove ourself as a listener of the button (bug 40533)
|
||||
if (mBrowse) {
|
||||
nsCOMPtr<nsIDOMEventReceiver> reciever(do_QueryInterface(mBrowse));
|
||||
reciever->RemoveEventListenerByIID(this, kIDOMMouseListenerIID);
|
||||
reciever->RemoveEventListenerByIID(this, NS_GET_IID(nsIDOMMouseListener));
|
||||
}
|
||||
|
||||
if (mCachedState) {
|
||||
|
@ -146,7 +142,7 @@ nsFileControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
|||
|
||||
// register as an event listener of the button to open file dialog on mouse click
|
||||
nsCOMPtr<nsIDOMEventReceiver> reciever(do_QueryInterface(mBrowse));
|
||||
reciever->AddEventListenerByIID(this, kIDOMMouseListenerIID);
|
||||
reciever->AddEventListenerByIID(this, NS_GET_IID(nsIDOMMouseListener));
|
||||
}
|
||||
|
||||
nsString value;
|
||||
|
@ -164,13 +160,13 @@ nsFileControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
NS_PRECONDITION(0 != aInstancePtr, "null ptr");
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
} else if (aIID.Equals(kIAnonymousContentCreatorIID)) {
|
||||
} else if (aIID.Equals(NS_GET_IID(nsIAnonymousContentCreator))) {
|
||||
*aInstancePtr = (void*)(nsIAnonymousContentCreator*) this;
|
||||
return NS_OK;
|
||||
} else if (aIID.Equals(kIFormControlFrameIID)) {
|
||||
} else if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
|
||||
*aInstancePtr = (void*) ((nsIFormControlFrame*) this);
|
||||
return NS_OK;
|
||||
} else if (aIID.Equals(kIDOMMouseListenerIID)) {
|
||||
} else if (aIID.Equals(NS_GET_IID(nsIDOMMouseListener))) {
|
||||
*aInstancePtr = (void*)(nsIDOMMouseListener*) this;
|
||||
return NS_OK;
|
||||
} else if (aIID.Equals(NS_GET_IID(nsIStatefulFrame))) {
|
||||
|
|
|
@ -93,13 +93,8 @@
|
|||
|
||||
const PRInt32 kSizeNotSet = -1;
|
||||
|
||||
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
|
||||
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
|
||||
|
||||
nsFormControlFrame::nsFormControlFrame()
|
||||
: nsLeafFrame()
|
||||
|
@ -142,7 +137,7 @@ nsFormControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kIFormControlFrameIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
|
||||
*aInstancePtr = (void*) ((nsIFormControlFrame*) this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -623,8 +618,7 @@ nsFormControlFrame::ScrollIntoView(nsIPresContext* aPresContext)
|
|||
const nsIID&
|
||||
nsFormControlFrame::GetIID()
|
||||
{
|
||||
static NS_DEFINE_IID(kButtonIID, NS_IBUTTON_IID);
|
||||
return kButtonIID;
|
||||
return NS_GET_IID(nsIButton);
|
||||
}
|
||||
|
||||
const nsIID&
|
||||
|
@ -676,7 +670,7 @@ nsFormControlFrame::GetType(PRInt32* aType) const
|
|||
nsresult result = NS_FORM_NOTOK;
|
||||
if (mContent) {
|
||||
nsIFormControl* formControl = nsnull;
|
||||
result = mContent->QueryInterface(kIFormControlIID, (void**)&formControl);
|
||||
result = mContent->QueryInterface(NS_GET_IID(nsIFormControl), (void**)&formControl);
|
||||
if ((NS_OK == result) && formControl) {
|
||||
result = formControl->GetType(aType);
|
||||
NS_RELEASE(formControl);
|
||||
|
@ -830,7 +824,7 @@ nsresult
|
|||
nsFormControlFrame::GetDefaultCheckState(PRBool *aState)
|
||||
{ nsresult res = NS_OK;
|
||||
nsIDOMHTMLInputElement* inputElement;
|
||||
if (NS_OK == mContent->QueryInterface(kIDOMHTMLInputElementIID, (void**)&inputElement)) {
|
||||
if (NS_OK == mContent->QueryInterface(NS_GET_IID(nsIDOMHTMLInputElement), (void**)&inputElement)) {
|
||||
res = inputElement->GetDefaultChecked(aState);
|
||||
NS_RELEASE(inputElement);
|
||||
}
|
||||
|
@ -842,7 +836,7 @@ nsFormControlFrame::SetDefaultCheckState(PRBool aState)
|
|||
{
|
||||
nsresult res = NS_OK;
|
||||
nsIDOMHTMLInputElement* inputElement;
|
||||
if (NS_OK == mContent->QueryInterface(kIDOMHTMLInputElementIID, (void**)&inputElement)) {
|
||||
if (NS_OK == mContent->QueryInterface(NS_GET_IID(nsIDOMHTMLInputElement), (void**)&inputElement)) {
|
||||
res = inputElement->SetDefaultChecked(aState);
|
||||
NS_RELEASE(inputElement);
|
||||
}
|
||||
|
@ -854,7 +848,7 @@ nsFormControlFrame::GetCurrentCheckState(PRBool *aState)
|
|||
{
|
||||
nsresult res = NS_OK;
|
||||
nsIDOMHTMLInputElement* inputElement;
|
||||
if (NS_OK == mContent->QueryInterface(kIDOMHTMLInputElementIID, (void**)&inputElement)) {
|
||||
if (NS_OK == mContent->QueryInterface(NS_GET_IID(nsIDOMHTMLInputElement), (void**)&inputElement)) {
|
||||
res = inputElement->GetChecked(aState);
|
||||
NS_RELEASE(inputElement);
|
||||
}
|
||||
|
@ -866,7 +860,7 @@ nsFormControlFrame::SetCurrentCheckState(PRBool aState)
|
|||
{
|
||||
nsresult res = NS_OK;
|
||||
nsIDOMHTMLInputElement* inputElement;
|
||||
if (NS_OK == mContent->QueryInterface(kIDOMHTMLInputElementIID, (void**)&inputElement)) {
|
||||
if (NS_OK == mContent->QueryInterface(NS_GET_IID(nsIDOMHTMLInputElement), (void**)&inputElement)) {
|
||||
inputElement->SetChecked(aState);
|
||||
NS_RELEASE(inputElement);
|
||||
}
|
||||
|
|
|
@ -68,14 +68,8 @@ static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
|||
// done I10N
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
|
||||
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
|
||||
|
||||
// For figuring out the "WRAP" property
|
||||
#define kTextControl_Wrap_Soft "SOFT"
|
||||
|
@ -454,7 +448,7 @@ nsFormControlHelper::CalculateSize (nsIPresContext* aPresContext,
|
|||
|
||||
const nsStylePosition* pos;
|
||||
nsIFrame* iFrame = nsnull;
|
||||
nsresult rv = aFrame->QueryInterface(kIFrameIID, (void**)&iFrame);
|
||||
nsresult rv = aFrame->QueryInterface(NS_GET_IID(nsIFrame), (void**)&iFrame);
|
||||
if ((NS_OK == rv) && (nsnull != iFrame)) {
|
||||
iFrame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)pos);
|
||||
if (eStyleUnit_Percent == pos->mWidth.GetUnit()) {
|
||||
|
@ -863,7 +857,7 @@ nsFormControlHelper::GetInputElementValue(nsIContent* aContent, nsString* aText,
|
|||
{
|
||||
nsresult result = NS_OK;
|
||||
nsIDOMHTMLInputElement* inputElem = nsnull;
|
||||
result = aContent->QueryInterface(kIDOMHTMLInputElementIID, (void**)&inputElem);
|
||||
result = aContent->QueryInterface(NS_GET_IID(nsIDOMHTMLInputElement), (void**)&inputElem);
|
||||
if ((NS_OK == result) && inputElem) {
|
||||
if (PR_TRUE == aInitialValue) {
|
||||
result = inputElem->GetDefaultValue(*aText);
|
||||
|
|
|
@ -178,8 +178,7 @@ nsGfxButtonControlFrame::IsBrowse(PRInt32 type)
|
|||
const nsIID&
|
||||
nsGfxButtonControlFrame::GetIID()
|
||||
{
|
||||
static NS_DEFINE_IID(kButtonIID, NS_IBUTTON_IID);
|
||||
return kButtonIID;
|
||||
return NS_GET_IID(nsIButton);
|
||||
}
|
||||
|
||||
const nsIID&
|
||||
|
|
|
@ -55,10 +55,7 @@
|
|||
#include "nsIFrameManager.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
|
||||
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
|
@ -161,7 +158,7 @@ nsHTMLButtonControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kIFormControlFrameIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
|
||||
*aInstancePtr = (void*) ((nsIFormControlFrame*) this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -226,7 +223,7 @@ nsHTMLButtonControlFrame::GetType(PRInt32* aType) const
|
|||
nsresult result = NS_FORM_NOTOK;
|
||||
if (mContent) {
|
||||
nsIFormControl* formControl = nsnull;
|
||||
result = mContent->QueryInterface(kIFormControlIID, (void**)&formControl);
|
||||
result = mContent->QueryInterface(NS_GET_IID(nsIFormControl), (void**)&formControl);
|
||||
if ((NS_OK == result) && formControl) {
|
||||
result = formControl->GetType(aType);
|
||||
NS_RELEASE(formControl);
|
||||
|
@ -595,7 +592,7 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext* aPresContext,
|
|||
nsIView* view;
|
||||
GetView(&view);
|
||||
if (!view) {
|
||||
nsresult result = nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID, (void **)&view);
|
||||
nsresult result = nsComponentManager::CreateInstance(kViewCID, nsnull, NS_GET_IID(nsIView), (void **)&view);
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
aPresContext->GetShell(getter_AddRefs(presShell));
|
||||
nsCOMPtr<nsIViewManager> viewMan;
|
||||
|
|
|
@ -54,9 +54,7 @@
|
|||
eMouseUp
|
||||
};
|
||||
*/
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
|
||||
#define nsImageControlFrameSuper nsImageFrame
|
||||
class nsImageControlFrame : public nsImageControlFrameSuper,
|
||||
|
@ -197,7 +195,7 @@ nsImageControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kIFormControlFrameIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
|
||||
*aInstancePtr = (void*) ((nsIFormControlFrame*) this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -231,7 +229,7 @@ nsImageControlFrame::Init(nsIPresContext* aPresContext,
|
|||
nsIView* view;
|
||||
GetView(aPresContext, &view);
|
||||
if (!view) {
|
||||
nsresult result = nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID, (void **)&view);
|
||||
nsresult result = nsComponentManager::CreateInstance(kViewCID, nsnull, NS_GET_IID(nsIView), (void **)&view);
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
aPresContext->GetShell(getter_AddRefs(presShell));
|
||||
nsCOMPtr<nsIViewManager> viewMan;
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "nsFormControlFrame.h"
|
||||
|
||||
static NS_DEFINE_IID(kLegendFrameCID, NS_LEGEND_FRAME_CID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLLegendElementIID, NS_IDOMHTMLLEGENDELEMENT_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewLegendFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
|
|
|
@ -62,12 +62,6 @@
|
|||
#include "nsISelectElement.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMMouseListenerIID, NS_IDOMMOUSELISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDOMMouseMotionListenerIID, NS_IDOMMOUSEMOTIONLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDOMKeyListenerIID, NS_IDOMKEYLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID);
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
static NS_DEFINE_IID(kIPrivateDOMEventIID, NS_IPRIVATEDOMEVENT_IID);
|
||||
//static NS_DEFINE_IID(kBlockFrameCID, NS_BLOCK_FRAME_CID);
|
||||
|
||||
// Constants
|
||||
|
@ -317,15 +311,15 @@ nsListControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
*aInstancePtr = (void *)((nsISelectControlFrame*)this);
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMMouseListenerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMMouseListener))) {
|
||||
*aInstancePtr = (void*)(nsIDOMMouseListener*) this;
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMMouseMotionListenerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMMouseMotionListener))) {
|
||||
*aInstancePtr = (void*)(nsIDOMMouseMotionListener*) this;
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMKeyListenerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMKeyListener))) {
|
||||
*aInstancePtr = (void*)(nsIDOMKeyListener*) this;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -182,8 +182,6 @@ nsIFrameDebug::GetLogModuleInfo()
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
static NS_DEFINE_IID(kIFrameSelection, NS_IFRAMESELECTION_IID);
|
||||
nsresult
|
||||
NS_NewEmptyFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
{
|
||||
|
@ -258,7 +256,7 @@ nsresult nsFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kClassIID, kIFrameIID);
|
||||
static NS_DEFINE_IID(kClassIID, NS_GET_IID(nsIFrame));
|
||||
|
||||
#ifdef DEBUG
|
||||
if (aIID.Equals(NS_GET_IID(nsIFrameDebug))) {
|
||||
|
@ -833,7 +831,7 @@ nsFrame::GetDataForTableSelection(nsIFrameSelection *aFrameSelection, nsMouseEve
|
|||
{
|
||||
// Check for a table cell by querying to a known CellFrame interface
|
||||
nsITableCellLayout *cellElement;
|
||||
result = (frame)->QueryInterface(nsITableCellLayout::GetIID(), (void **)&cellElement);
|
||||
result = (frame)->QueryInterface(NS_GET_IID(nsITableCellLayout), (void **)&cellElement);
|
||||
if (NS_SUCCEEDED(result) && cellElement)
|
||||
{
|
||||
foundCell = PR_TRUE;
|
||||
|
@ -847,7 +845,7 @@ nsFrame::GetDataForTableSelection(nsIFrameSelection *aFrameSelection, nsMouseEve
|
|||
// This will happen when starting frame is the table or child of a table,
|
||||
// such as a row (we were inbetween cells or in table border)
|
||||
nsITableLayout *tableElement;
|
||||
result = (frame)->QueryInterface(nsITableLayout::GetIID(), (void **)&tableElement);
|
||||
result = (frame)->QueryInterface(NS_GET_IID(nsITableLayout), (void **)&tableElement);
|
||||
if (NS_SUCCEEDED(result) && tableElement)
|
||||
{
|
||||
foundTable = PR_TRUE;
|
||||
|
@ -2325,7 +2323,7 @@ nsFrame::GetSelectionController(nsIPresContext *aPresContext, nsISelectionContro
|
|||
while (tmp)
|
||||
{
|
||||
nsIGfxTextControlFrame2 *tcf;
|
||||
if (NS_SUCCEEDED(tmp->QueryInterface(nsIGfxTextControlFrame2::GetIID(),(void**)&tcf)))
|
||||
if (NS_SUCCEEDED(tmp->QueryInterface(NS_GET_IID(nsIGfxTextControlFrame2),(void**)&tcf)))
|
||||
{
|
||||
return tcf->GetSelectionContr(aSelCon);
|
||||
}
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
|
||||
static NS_DEFINE_IID(kIFramesetFrameIID, NS_IFRAMESETFRAME_IID);
|
||||
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
|
||||
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
|
||||
|
||||
/*******************************************************************************
|
||||
* nsFramesetDrag
|
||||
|
@ -233,7 +232,6 @@ nsresult nsHTMLFramesetFrame::QueryInterface(const nsIID& aIID,
|
|||
}
|
||||
|
||||
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
|
||||
|
@ -262,7 +260,7 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
|
|||
|
||||
// create the view. a view is needed since it needs to be a mouse grabber
|
||||
nsIView* view;
|
||||
nsresult result = nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID,
|
||||
nsresult result = nsComponentManager::CreateInstance(kViewCID, nsnull, NS_GET_IID(nsIView),
|
||||
(void **)&view);
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
aPresContext->GetShell(getter_AddRefs(presShell));
|
||||
|
@ -1619,7 +1617,7 @@ nsHTMLFramesetBorderFrame::Paint(nsIPresContext* aPresContext,
|
|||
nscolor sdwColor = NS_RGB(128,128,128);
|
||||
|
||||
nsILookAndFeel * lookAndFeel;
|
||||
if (NS_OK == nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
|
||||
if (NS_OK == nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, NS_GET_IID(nsILookAndFeel), (void**)&lookAndFeel)) {
|
||||
lookAndFeel->GetColor(nsILookAndFeel::eColor_WidgetBackground, bgColor);
|
||||
lookAndFeel->GetColor(nsILookAndFeel::eColor_WidgetForeground, fgColor);
|
||||
lookAndFeel->GetColor(nsILookAndFeel::eColor_Widget3DShadow, sdwColor);
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include <stdlib.h>
|
||||
#include "plstr.h"
|
||||
|
||||
static NS_DEFINE_IID(kIFrameUtilIID, NS_IFRAME_UTIL_IID);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
class nsFrameUtil : public nsIFrameUtil {
|
||||
|
@ -492,7 +491,7 @@ NS_NewFrameUtil(nsIFrameUtil** aResult)
|
|||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIFrameUtilIID, (void**) aResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIFrameUtil), (void**) aResult);
|
||||
}
|
||||
|
||||
nsFrameUtil::nsFrameUtil()
|
||||
|
@ -504,7 +503,7 @@ nsFrameUtil::~nsFrameUtil()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsFrameUtil, kIFrameUtilIID);
|
||||
NS_IMPL_ISUPPORTS(nsFrameUtil, NS_GET_IID(nsIFrameUtil));
|
||||
|
||||
void
|
||||
nsFrameUtil::DumpNode(Node* aNode, FILE* aOutputFile, PRInt32 aIndent)
|
||||
|
|
|
@ -60,11 +60,7 @@ static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
|
|||
static NS_DEFINE_IID(kScrollingViewCID, NS_SCROLLING_VIEW_CID);
|
||||
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
|
||||
static NS_DEFINE_IID(kIAnonymousContentCreatorIID, NS_IANONYMOUS_CONTENT_CREATOR_IID);
|
||||
static NS_DEFINE_IID(kIScrollableFrameIID, NS_ISCROLLABLE_FRAME_IID);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@ -923,7 +919,7 @@ nsGfxScrollFrameInner::GetScrollableView(nsIPresContext* aPresContext)
|
|||
nsIFrame* frame = nsnull;
|
||||
mScrollAreaBox->GetFrame(&frame);
|
||||
frame->GetView(aPresContext, &view);
|
||||
nsresult result = view->QueryInterface(kScrollViewIID, (void**)&scrollingView);
|
||||
nsresult result = view->QueryInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollingView);
|
||||
NS_ASSERTION(NS_SUCCEEDED(result), "assertion gfx scrollframe does not contain a scrollframe");
|
||||
return scrollingView;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#include "nsIStyleSet.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
static NS_DEFINE_IID(kCChildCID, NS_CHILD_CID);
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -519,11 +518,10 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext,
|
|||
|
||||
// Create a view
|
||||
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
|
||||
nsresult result = nsComponentManager::CreateInstance(kViewCID,
|
||||
nsnull,
|
||||
kIViewIID,
|
||||
NS_GET_IID(nsIView),
|
||||
(void **)&view);
|
||||
if (NS_OK == result) {
|
||||
nsIViewManager* viewManager;
|
||||
|
@ -546,7 +544,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext,
|
|||
// Insert the view into the view hierarchy. If the parent view is a
|
||||
// scrolling view we need to do this differently
|
||||
nsIScrollableView* scrollingView;
|
||||
if (NS_SUCCEEDED(parentView->QueryInterface(kScrollViewIID, (void**)&scrollingView))) {
|
||||
if (NS_SUCCEEDED(parentView->QueryInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollingView))) {
|
||||
scrollingView->SetScrolledView(view);
|
||||
} else {
|
||||
PRInt32 zIndex = 0;
|
||||
|
|
|
@ -45,8 +45,6 @@
|
|||
#include "nsIPresShell.h"
|
||||
|
||||
// Interface IDs
|
||||
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
/**
|
||||
* Root frame class.
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsFrame.h"
|
||||
#include "nsContainerFrame.h"
|
||||
|
||||
static NS_DEFINE_IID(kIReflowCommandIID, NS_IREFLOWCOMMAND_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLReflowCommand(nsIReflowCommand** aInstancePtrResult,
|
||||
|
@ -50,7 +49,7 @@ NS_NewHTMLReflowCommand(nsIReflowCommand** aInstancePtrResult,
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return cmd->QueryInterface(kIReflowCommandIID, (void**)aInstancePtrResult);
|
||||
return cmd->QueryInterface(NS_GET_IID(nsIReflowCommand), (void**)aInstancePtrResult);
|
||||
}
|
||||
|
||||
// Construct a reflow command given a target frame, reflow command type,
|
||||
|
@ -77,7 +76,7 @@ nsHTMLReflowCommand::~nsHTMLReflowCommand()
|
|||
NS_IF_RELEASE(mListName);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsHTMLReflowCommand, kIReflowCommandIID);
|
||||
NS_IMPL_ISUPPORTS(nsHTMLReflowCommand, NS_GET_IID(nsIReflowCommand));
|
||||
|
||||
nsIFrame* nsHTMLReflowCommand::GetContainingBlock(nsIFrame* aFloater) const
|
||||
{
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
|
||||
// hack for bug 50695
|
||||
#include "nsIFormManager.h"
|
||||
static NS_DEFINE_IID(kIFormManagerIID, NS_IFORMMANAGER_IID);
|
||||
|
||||
// Initialize a <b>root</b> reflow state with a rendering context to
|
||||
// use for measuring things.
|
||||
|
@ -1315,7 +1314,7 @@ CalcQuirkContainingBlockHeight(const nsHTMLReflowState& aReflowState)
|
|||
if (nsLayoutAtoms::blockFrame == frameType.get()) {
|
||||
// special hack for bug 50695, skip form frames
|
||||
nsIFrame* formFrame;
|
||||
if (NS_OK == rs->frame->QueryInterface(kIFormManagerIID, (void **)&formFrame)) {
|
||||
if (NS_OK == rs->frame->QueryInterface(NS_GET_IID(nsIFormManager), (void **)&formFrame)) {
|
||||
continue;
|
||||
}
|
||||
if (!firstBlockRS) {
|
||||
|
|
|
@ -455,6 +455,7 @@ typedef PRBool nsDidReflowStatus;
|
|||
class nsIFrame : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFRAME_IID)
|
||||
/**
|
||||
* Called to initialize the frame. This is called immediately after creating
|
||||
* the frame.
|
||||
|
|
|
@ -34,6 +34,7 @@ class nsIURI;
|
|||
*/
|
||||
class nsIFrameUtil : public nsISupports {
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFRAME_UTIL_IID)
|
||||
/**
|
||||
* Compare two regression data dumps. The return status will be NS_OK
|
||||
* if the trees compare favoribly, otherwise the return will indicate
|
||||
|
|
|
@ -70,7 +70,6 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
|||
#undef NOISY_IMAGE_LOADING
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID);
|
||||
|
||||
// Value's for mSuppress
|
||||
#define SUPPRESS_UNSET 0
|
||||
|
@ -713,7 +712,7 @@ nsImageFrame::GetImageMap(nsIPresContext* aPresContext)
|
|||
usemap.Cut(0, 1);
|
||||
}
|
||||
nsIHTMLDocument* hdoc;
|
||||
nsresult rv = doc->QueryInterface(kIHTMLDocumentIID, (void**)&hdoc);
|
||||
nsresult rv = doc->QueryInterface(NS_GET_IID(nsIHTMLDocument), (void**)&hdoc);
|
||||
NS_RELEASE(doc);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMHTMLMapElement* map;
|
||||
|
|
|
@ -710,11 +710,6 @@ void CircleArea::GetShapeName(nsString& aResult) const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLElementIID, NS_IDOMHTMLELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLAreaElementIID, NS_IDOMHTMLAREAELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLAnchorElementIID, NS_IDOMHTMLANCHORELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDocumentObserverIID, NS_IDOCUMENT_OBSERVER_IID);
|
||||
|
||||
nsImageMap::nsImageMap()
|
||||
{
|
||||
|
@ -800,7 +795,7 @@ nsImageMap::Init(nsIPresShell* aPresShell, nsIFrame* aImageFrame, nsIDOMHTMLMapE
|
|||
mImageFrame = aImageFrame;
|
||||
mDomMap = aMap;
|
||||
|
||||
nsresult rv = aMap->QueryInterface(kIContentIID, (void**) &mMap);
|
||||
nsresult rv = aMap->QueryInterface(NS_GET_IID(nsIContent), (void**) &mMap);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = mMap->GetDocument(mDocument);
|
||||
if (NS_SUCCEEDED(rv) && (nsnull != mDocument)) {
|
||||
|
@ -828,7 +823,7 @@ nsImageMap::UpdateAreasForBlock(nsIContent* aParent)
|
|||
rv = aParent->ChildAt(i, child);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMHTMLAnchorElement* area;
|
||||
rv = child->QueryInterface(kIDOMHTMLAnchorElementIID, (void**) &area);
|
||||
rv = child->QueryInterface(NS_GET_IID(nsIDOMHTMLAnchorElement), (void**) &area);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = AddArea(child);
|
||||
NS_RELEASE(area);
|
||||
|
@ -860,7 +855,7 @@ nsImageMap::UpdateAreas()
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
// Only look at elements and not text, comments, etc.
|
||||
nsIDOMHTMLElement* element;
|
||||
rv = child->QueryInterface(kIDOMHTMLElementIID, (void**)&element);
|
||||
rv = child->QueryInterface(NS_GET_IID(nsIDOMHTMLElement), (void**)&element);
|
||||
if (NS_FAILED(rv)) {
|
||||
rv = NS_OK;
|
||||
continue;
|
||||
|
@ -871,7 +866,7 @@ nsImageMap::UpdateAreas()
|
|||
// If so, we only look for AREA elements
|
||||
if (!containsBlock) {
|
||||
nsIDOMHTMLAreaElement* area;
|
||||
rv = child->QueryInterface(kIDOMHTMLAreaElementIID, (void**) &area);
|
||||
rv = child->QueryInterface(NS_GET_IID(nsIDOMHTMLAreaElement), (void**) &area);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
containsArea = PR_TRUE;
|
||||
rv = AddArea(child);
|
||||
|
|
|
@ -496,7 +496,6 @@ nsLineBox::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static NS_DEFINE_IID(kILineIteratorIID, NS_ILINE_ITERATOR_IID);
|
||||
|
||||
static nsLineBox* gDummyLines[1];
|
||||
|
||||
|
|
|
@ -69,7 +69,6 @@
|
|||
|
||||
#include "nsObjectFrame.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMMouseListenerIID, NS_IDOMMOUSELISTENER_IID);
|
||||
|
||||
class nsPluginInstanceOwner : public nsIPluginInstanceOwner,
|
||||
public nsIPluginTagInfo2,
|
||||
|
@ -230,12 +229,8 @@ nsObjectFrame::~nsObjectFrame()
|
|||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
|
||||
static NS_DEFINE_IID(kIHTMLContentIID, NS_IHTMLCONTENT_IID);
|
||||
static NS_DEFINE_IID(kILinkHandlerIID, NS_ILINKHANDLER_IID);
|
||||
static NS_DEFINE_IID(kCAppShellCID, NS_APPSHELL_CID);
|
||||
static NS_DEFINE_IID(kIPluginHostIID, NS_IPLUGINHOST_IID);
|
||||
static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
|
||||
|
||||
PRIntn
|
||||
|
@ -432,7 +427,7 @@ nsObjectFrame::CreateWidget(nsIPresContext* aPresContext,
|
|||
// Create our view and widget
|
||||
|
||||
nsresult result =
|
||||
nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID,
|
||||
nsComponentManager::CreateInstance(kViewCID, nsnull, NS_GET_IID(nsIView),
|
||||
(void **)&view);
|
||||
if (NS_OK != result) {
|
||||
return result;
|
||||
|
@ -900,8 +895,7 @@ nsObjectFrame::InstantiateWidget(nsIPresContext* aPresContext,
|
|||
PRInt32 height = NSTwipsToIntPixels(aMetrics.height, t2p);
|
||||
nsRect r = nsRect(x, y, width, height);
|
||||
|
||||
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
|
||||
if((rv = nsComponentManager::CreateInstance(aWidgetCID, nsnull, kIWidgetIID, (void**)&mWidget)) != NS_OK)
|
||||
if((rv = nsComponentManager::CreateInstance(aWidgetCID, nsnull, NS_GET_IID(nsIWidget), (void**)&mWidget)) != NS_OK)
|
||||
return rv;
|
||||
|
||||
nsIWidget *parent;
|
||||
|
@ -1052,7 +1046,7 @@ nsObjectFrame::HandleImage(nsIPresContext* aPresContext,
|
|||
|
||||
// adjust kidReflowState
|
||||
nsIHTMLContent* hc = nsnull;
|
||||
mContent->QueryInterface(kIHTMLContentIID, (void**) &hc);
|
||||
mContent->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) &hc);
|
||||
|
||||
if(hc != nsnull)
|
||||
{
|
||||
|
@ -1095,7 +1089,7 @@ nsresult
|
|||
nsObjectFrame::GetBaseURL(nsIURI* &aURL)
|
||||
{
|
||||
nsIHTMLContent* htmlContent;
|
||||
if (NS_SUCCEEDED(mContent->QueryInterface(kIHTMLContentIID, (void**)&htmlContent)))
|
||||
if (NS_SUCCEEDED(mContent->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**)&htmlContent)))
|
||||
{
|
||||
htmlContent->GetBaseURL(aURL);
|
||||
NS_RELEASE(htmlContent);
|
||||
|
@ -1574,7 +1568,7 @@ nsresult nsPluginInstanceOwner::QueryInterface(const nsIID& aIID,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aIID.Equals(kIDOMMouseListenerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMMouseListener))) {
|
||||
*aInstancePtrResult = (void*)(nsIDOMMouseListener*) this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
|
@ -1777,7 +1771,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
|
|||
|
||||
if (NS_OK == rv)
|
||||
{
|
||||
rv = container->QueryInterface(kILinkHandlerIID, (void **)&lh);
|
||||
rv = container->QueryInterface(NS_GET_IID(nsILinkHandler), (void **)&lh);
|
||||
|
||||
if (NS_OK == rv)
|
||||
{
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#ifdef DEBUG
|
||||
#include "nsIFrameDebug.h"
|
||||
#endif
|
||||
static NS_DEFINE_IID(kISpaceManagerIID, NS_ISPACEMANAGER_IID);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// BandList
|
||||
|
@ -89,7 +88,7 @@ nsSpaceManager::~nsSpaceManager()
|
|||
ClearFrameInfo();
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsSpaceManager, kISpaceManagerIID);
|
||||
NS_IMPL_ISUPPORTS(nsSpaceManager, NS_GET_IID(nsISpaceManager));
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSpaceManager::GetFrame(nsIFrame*& aFrame) const
|
||||
|
|
|
@ -70,7 +70,6 @@
|
|||
#define PR_ABS(x) ((x) < 0 ? -(x) : (x))
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
|
||||
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
|
@ -229,8 +228,7 @@ void nsBlinkTimer::Stop()
|
|||
}
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kITimerCallbackIID, NS_ITIMERCALLBACK_IID);
|
||||
NS_IMPL_ISUPPORTS(nsBlinkTimer, kITimerCallbackIID);
|
||||
NS_IMPL_ISUPPORTS(nsBlinkTimer, NS_GET_IID(nsITimerCallback));
|
||||
|
||||
void nsBlinkTimer::AddFrame(nsIPresContext* aPresContext, nsIFrame* aFrame) {
|
||||
FrameData* frameData = new FrameData(aPresContext, aFrame);
|
||||
|
|
|
@ -80,7 +80,6 @@ nsAutoTextBuffer::GrowTo(PRInt32 aNewSize, PRBool aCopyToHead)
|
|||
//----------------------------------------------------------------------
|
||||
|
||||
static NS_DEFINE_IID(kUnicharUtilCID, NS_UNICHARUTIL_CID);
|
||||
static NS_DEFINE_IID(kICaseConversionIID, NS_ICASECONVERSION_IID);
|
||||
|
||||
static nsICaseConversion* gCaseConv = nsnull;
|
||||
|
||||
|
@ -89,7 +88,7 @@ nsTextTransformer::Initialize()
|
|||
{
|
||||
nsresult res = NS_OK;
|
||||
if (!gCaseConv) {
|
||||
res = nsServiceManager::GetService(kUnicharUtilCID, kICaseConversionIID,
|
||||
res = nsServiceManager::GetService(kUnicharUtilCID, NS_GET_IID(nsICaseConversion),
|
||||
(nsISupports**)&gCaseConv);
|
||||
NS_ASSERTION( NS_SUCCEEDED(res), "cannot get UnicharUtil");
|
||||
NS_ASSERTION( gCaseConv != NULL, "cannot get UnicharUtil");
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
#include "nsIReflowCommand.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
|
||||
/**
|
||||
* Viewport frame class.
|
||||
|
@ -318,7 +316,7 @@ ViewportFrame::CalculateFixedContainingBlockSize(nsIPresContext* aPresC
|
|||
if (nsnull != kidView) {
|
||||
nsIScrollableView* scrollingView;
|
||||
|
||||
if (NS_SUCCEEDED(kidView->QueryInterface(kScrollViewIID, (void**)&scrollingView))) {
|
||||
if (NS_SUCCEEDED(kidView->QueryInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollingView))) {
|
||||
// Get the scrollbar dimensions
|
||||
float sbWidth, sbHeight;
|
||||
nsCOMPtr<nsIDeviceContext> dc;
|
||||
|
|
|
@ -1,431 +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):
|
||||
*/
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsContainerFrame.h"
|
||||
#include "nsCSSRendering.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIReflowCommand.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsViewsCID.h"
|
||||
#include "nsIView.h"
|
||||
#include "nsIViewManager.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsPageFrame.h"
|
||||
#include "nsIRenderingContext.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIViewManager.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
// Interface IDs
|
||||
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
/**
|
||||
* Root frame class.
|
||||
*
|
||||
* The root frame is the parent frame for the document element's frame.
|
||||
* It only supports having a single child frame which must be an area
|
||||
* frame
|
||||
*/
|
||||
class CanvasFrame : public nsHTMLContainerFrame {
|
||||
public:
|
||||
NS_IMETHOD AppendFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aFrameList);
|
||||
NS_IMETHOD InsertFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aPrevFrame,
|
||||
nsIFrame* aFrameList);
|
||||
NS_IMETHOD RemoveFrame(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD HandleEvent(nsIPresContext* aPresContext,
|
||||
nsGUIEvent* aEvent,
|
||||
nsEventStatus* aEventStatus);
|
||||
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
const nsPoint& aPoint,
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
nsIFrame** aFrame);
|
||||
NS_IMETHOD IsPercentageBase(PRBool& aBase) const {
|
||||
aBase = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
* @see nsLayoutAtoms::canvasFrame
|
||||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual PRIntn GetSkipSides() const;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewCanvasFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
CanvasFrame* it = new (aPresShell)CanvasFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CanvasFrame::AppendFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aFrameList)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
NS_ASSERTION(!aListName, "unexpected child list name");
|
||||
NS_PRECONDITION(mFrames.IsEmpty(), "already have a child frame");
|
||||
if (aListName) {
|
||||
// We only support unnamed principal child list
|
||||
rv = NS_ERROR_INVALID_ARG;
|
||||
|
||||
} else if (!mFrames.IsEmpty()) {
|
||||
// We only allow a single child frame
|
||||
rv = NS_ERROR_FAILURE;
|
||||
|
||||
} else {
|
||||
// Insert the new frames
|
||||
#ifdef NS_DEBUG
|
||||
nsFrame::VerifyDirtyBitSet(aFrameList);
|
||||
#endif
|
||||
mFrames.AppendFrame(nsnull, aFrameList);
|
||||
|
||||
// Generate a reflow command to reflow the newly inserted frame
|
||||
nsIReflowCommand* reflowCmd;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this, nsIReflowCommand::ReflowDirty);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CanvasFrame::InsertFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aPrevFrame,
|
||||
nsIFrame* aFrameList)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// Because we only support a single child frame inserting is the same
|
||||
// as appending
|
||||
NS_PRECONDITION(!aPrevFrame, "unexpected previous sibling frame");
|
||||
if (aPrevFrame) {
|
||||
rv = NS_ERROR_UNEXPECTED;
|
||||
} else {
|
||||
rv = AppendFrames(aPresContext, aPresShell, aListName, aFrameList);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CanvasFrame::RemoveFrame(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
NS_ASSERTION(!aListName, "unexpected child list name");
|
||||
if (aListName) {
|
||||
// We only support the unnamed principal child list
|
||||
rv = NS_ERROR_INVALID_ARG;
|
||||
|
||||
} else if (aOldFrame == mFrames.FirstChild()) {
|
||||
// It's our one and only child frame
|
||||
// Damage the area occupied by the deleted frame
|
||||
nsRect damageRect;
|
||||
aOldFrame->GetRect(damageRect);
|
||||
Invalidate(aPresContext, damageRect, PR_FALSE);
|
||||
|
||||
// Remove the frame and destroy it
|
||||
mFrames.DestroyFrame(aPresContext, aOldFrame);
|
||||
|
||||
// Generate a reflow command so we get reflowed
|
||||
nsIReflowCommand* reflowCmd;
|
||||
rv = NS_NewHTMLReflowCommand(&reflowCmd, this, nsIReflowCommand::ReflowDirty);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
aPresShell.AppendReflowCommand(reflowCmd);
|
||||
NS_RELEASE(reflowCmd);
|
||||
}
|
||||
|
||||
} else {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CanvasFrame::Reflow(nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_FRAME_TRACE_REFLOW_IN("CanvasFrame::Reflow");
|
||||
NS_PRECONDITION(nsnull == aDesiredSize.maxElementSize, "unexpected request");
|
||||
|
||||
// Initialize OUT parameter
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
|
||||
PRBool isStyleChange = PR_FALSE;
|
||||
PRBool isDirtyChildReflow = PR_FALSE;
|
||||
|
||||
// Check for an incremental reflow
|
||||
if (eReflowReason_Incremental == aReflowState.reason) {
|
||||
// See if we're the target frame
|
||||
nsIFrame* targetFrame;
|
||||
aReflowState.reflowCommand->GetTarget(targetFrame);
|
||||
if (this == targetFrame) {
|
||||
// Get the reflow type
|
||||
nsIReflowCommand::ReflowType reflowType;
|
||||
aReflowState.reflowCommand->GetType(reflowType);
|
||||
|
||||
switch (reflowType) {
|
||||
case nsIReflowCommand::ReflowDirty:
|
||||
isDirtyChildReflow = PR_TRUE;
|
||||
break;
|
||||
|
||||
case nsIReflowCommand::StyleChanged:
|
||||
// Remember it's a style change so we can set the reflow reason below
|
||||
isStyleChange = PR_TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
NS_ASSERTION(PR_FALSE, "unexpected reflow command type");
|
||||
}
|
||||
|
||||
} else {
|
||||
nsIFrame* nextFrame;
|
||||
// Get the next frame in the reflow chain
|
||||
aReflowState.reflowCommand->GetNext(nextFrame);
|
||||
NS_ASSERTION(nextFrame == mFrames.FirstChild(), "unexpected next reflow command frame");
|
||||
}
|
||||
}
|
||||
|
||||
// Reflow our one and only child frame
|
||||
nsHTMLReflowMetrics kidDesiredSize(nsnull);
|
||||
if (mFrames.IsEmpty()) {
|
||||
// We have no child frame, so return an empty size
|
||||
aDesiredSize.width = aDesiredSize.height = 0;
|
||||
aDesiredSize.ascent = aDesiredSize.descent = 0;
|
||||
|
||||
} else {
|
||||
nsIFrame* kidFrame = mFrames.FirstChild();
|
||||
|
||||
// We must specify an unconstrained available height, because constrained
|
||||
// is only for when we're paginated...
|
||||
nsHTMLReflowState kidReflowState(aPresContext, aReflowState, kidFrame,
|
||||
nsSize(aReflowState.availableWidth,
|
||||
NS_UNCONSTRAINEDSIZE));
|
||||
if (isDirtyChildReflow) {
|
||||
// Note: the only reason the frame would be dirty would be if it had
|
||||
// just been inserted or appended
|
||||
kidReflowState.reason = eReflowReason_Initial;
|
||||
kidReflowState.reflowCommand = nsnull;
|
||||
} else if (isStyleChange) {
|
||||
kidReflowState.reason = eReflowReason_StyleChange;
|
||||
kidReflowState.reflowCommand = nsnull;
|
||||
}
|
||||
|
||||
// Reflow the frame
|
||||
ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowState,
|
||||
kidReflowState.mComputedMargin.left, kidReflowState.mComputedMargin.top,
|
||||
0, aStatus);
|
||||
|
||||
// The document element's background should cover the entire canvas, so
|
||||
// take into account the combined area and any space taken up by
|
||||
// absolutely positioned elements
|
||||
nsMargin border;
|
||||
nsFrameState kidState;
|
||||
|
||||
if (!kidReflowState.mStyleSpacing->GetBorder(border)) {
|
||||
NS_NOTYETIMPLEMENTED("percentage border");
|
||||
}
|
||||
kidFrame->GetFrameState(&kidState);
|
||||
|
||||
// First check the combined area
|
||||
if (NS_FRAME_OUTSIDE_CHILDREN & kidState) {
|
||||
// The background covers the content area and padding area, so check
|
||||
// for children sticking outside the child frame's padding edge
|
||||
nscoord paddingEdgeX = kidDesiredSize.width - border.right;
|
||||
nscoord paddingEdgeY = kidDesiredSize.height - border.bottom;
|
||||
|
||||
if (kidDesiredSize.mOverflowArea.XMost() > paddingEdgeX) {
|
||||
kidDesiredSize.width = kidDesiredSize.mOverflowArea.XMost() +
|
||||
border.right;
|
||||
}
|
||||
if (kidDesiredSize.mOverflowArea.YMost() > paddingEdgeY) {
|
||||
kidDesiredSize.height = kidDesiredSize.mOverflowArea.YMost() +
|
||||
border.bottom;
|
||||
}
|
||||
}
|
||||
|
||||
// If our height is fixed, then make sure the child frame plus its top and
|
||||
// bottom margin is at least that high as well...
|
||||
if (NS_AUTOHEIGHT != aReflowState.mComputedHeight) {
|
||||
nscoord totalHeight = kidDesiredSize.height + kidReflowState.mComputedMargin.top +
|
||||
kidReflowState.mComputedMargin.bottom;
|
||||
|
||||
if (totalHeight < aReflowState.mComputedHeight) {
|
||||
kidDesiredSize.height += aReflowState.mComputedHeight - totalHeight;
|
||||
}
|
||||
}
|
||||
|
||||
// Complete the reflow and position and size the child frame
|
||||
nsRect rect(kidReflowState.mComputedMargin.left, kidReflowState.mComputedMargin.top,
|
||||
kidDesiredSize.width, kidDesiredSize.height);
|
||||
FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, rect.x, rect.y, 0);
|
||||
|
||||
// If the child frame was just inserted, then we're responsible for making sure
|
||||
// it repaints
|
||||
if (isDirtyChildReflow) {
|
||||
// Damage the area occupied by the deleted frame
|
||||
Invalidate(aPresContext, rect, PR_FALSE);
|
||||
}
|
||||
|
||||
// Return our desired size
|
||||
aDesiredSize.width = kidDesiredSize.width + kidReflowState.mComputedMargin.left +
|
||||
kidReflowState.mComputedMargin.right;
|
||||
aDesiredSize.height = kidDesiredSize.height + kidReflowState.mComputedMargin.top +
|
||||
kidReflowState.mComputedMargin.bottom;
|
||||
aDesiredSize.ascent = aDesiredSize.height;
|
||||
aDesiredSize.descent = 0;
|
||||
// XXX Don't completely ignore NS_FRAME_OUTSIDE_CHILDREN for child frames
|
||||
// that stick out on the left or top edges...
|
||||
}
|
||||
|
||||
NS_FRAME_TRACE_REFLOW_OUT("CanvasFrame::Reflow", aStatus);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRIntn
|
||||
CanvasFrame::GetSkipSides() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CanvasFrame::HandleEvent(nsIPresContext* aPresContext,
|
||||
nsGUIEvent* aEvent,
|
||||
nsEventStatus* aEventStatus)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aEventStatus);
|
||||
if (nsEventStatus_eConsumeNoDefault == *aEventStatus) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aEvent->message == NS_MOUSE_LEFT_BUTTON_UP ||
|
||||
aEvent->message == NS_MOUSE_MIDDLE_BUTTON_UP ||
|
||||
aEvent->message == NS_MOUSE_RIGHT_BUTTON_UP ||
|
||||
aEvent->message == NS_MOUSE_MOVE ) {
|
||||
nsIFrame *firstChild;
|
||||
nsresult rv = FirstChild(aPresContext,nsnull,&firstChild);
|
||||
//canvas frame needs to pass mouse events to its area frame so that mouse movement
|
||||
//and selection code will work properly. this will still have the necessary effects
|
||||
//that would have happened if nsFrame::HandleEvent was called.
|
||||
if (NS_SUCCEEDED(rv) && firstChild)
|
||||
firstChild->HandleEvent(aPresContext, aEvent, aEventStatus);
|
||||
else
|
||||
nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CanvasFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
const nsPoint& aPoint,
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
nsIFrame** aFrame)
|
||||
{
|
||||
// this should act like a block, so we need to override
|
||||
return GetFrameForPointUsing(aPresContext, aPoint, nsnull, aWhichLayer, (aWhichLayer == NS_FRAME_PAINT_LAYER_BACKGROUND), aFrame);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CanvasFrame::GetFrameType(nsIAtom** aType) const
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
|
||||
*aType = nsLayoutAtoms::canvasFrame;
|
||||
NS_ADDREF(*aType);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
CanvasFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Canvas", aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CanvasFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
if (!aResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
*aResult = sizeof(*this);
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
|
@ -182,8 +182,6 @@ nsIFrameDebug::GetLogModuleInfo()
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
static NS_DEFINE_IID(kIFrameSelection, NS_IFRAMESELECTION_IID);
|
||||
nsresult
|
||||
NS_NewEmptyFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
{
|
||||
|
@ -258,7 +256,7 @@ nsresult nsFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kClassIID, kIFrameIID);
|
||||
static NS_DEFINE_IID(kClassIID, NS_GET_IID(nsIFrame));
|
||||
|
||||
#ifdef DEBUG
|
||||
if (aIID.Equals(NS_GET_IID(nsIFrameDebug))) {
|
||||
|
@ -833,7 +831,7 @@ nsFrame::GetDataForTableSelection(nsIFrameSelection *aFrameSelection, nsMouseEve
|
|||
{
|
||||
// Check for a table cell by querying to a known CellFrame interface
|
||||
nsITableCellLayout *cellElement;
|
||||
result = (frame)->QueryInterface(nsITableCellLayout::GetIID(), (void **)&cellElement);
|
||||
result = (frame)->QueryInterface(NS_GET_IID(nsITableCellLayout), (void **)&cellElement);
|
||||
if (NS_SUCCEEDED(result) && cellElement)
|
||||
{
|
||||
foundCell = PR_TRUE;
|
||||
|
@ -847,7 +845,7 @@ nsFrame::GetDataForTableSelection(nsIFrameSelection *aFrameSelection, nsMouseEve
|
|||
// This will happen when starting frame is the table or child of a table,
|
||||
// such as a row (we were inbetween cells or in table border)
|
||||
nsITableLayout *tableElement;
|
||||
result = (frame)->QueryInterface(nsITableLayout::GetIID(), (void **)&tableElement);
|
||||
result = (frame)->QueryInterface(NS_GET_IID(nsITableLayout), (void **)&tableElement);
|
||||
if (NS_SUCCEEDED(result) && tableElement)
|
||||
{
|
||||
foundTable = PR_TRUE;
|
||||
|
@ -2325,7 +2323,7 @@ nsFrame::GetSelectionController(nsIPresContext *aPresContext, nsISelectionContro
|
|||
while (tmp)
|
||||
{
|
||||
nsIGfxTextControlFrame2 *tcf;
|
||||
if (NS_SUCCEEDED(tmp->QueryInterface(nsIGfxTextControlFrame2::GetIID(),(void**)&tcf)))
|
||||
if (NS_SUCCEEDED(tmp->QueryInterface(NS_GET_IID(nsIGfxTextControlFrame2),(void**)&tcf)))
|
||||
{
|
||||
return tcf->GetSelectionContr(aSelCon);
|
||||
}
|
||||
|
|
|
@ -83,7 +83,6 @@
|
|||
static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
||||
|
||||
// IID's
|
||||
static NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@ -816,7 +815,7 @@ FrameManager::RevokePostedEvents()
|
|||
nsresult rv;
|
||||
|
||||
rv = nsServiceManager::GetService(kEventQueueServiceCID,
|
||||
kIEventQueueServiceIID,
|
||||
NS_GET_IID(nsIEventQueueService),
|
||||
(nsISupports **)&eventService);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIEventQueue> eventQueue;
|
||||
|
@ -865,7 +864,7 @@ FrameManager::DequeuePostedEventFor(nsIFrame* aFrame)
|
|||
nsresult rv;
|
||||
|
||||
rv = nsServiceManager::GetService(kEventQueueServiceCID,
|
||||
kIEventQueueServiceIID,
|
||||
NS_GET_IID(nsIEventQueueService),
|
||||
(nsISupports **)&eventService);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIEventQueue> eventQueue;
|
||||
|
@ -949,7 +948,7 @@ FrameManager::CantRenderReplacedElement(nsIPresContext* aPresContext,
|
|||
// We need to notify the style stystem, but post the notification so it
|
||||
// doesn't happen now
|
||||
rv = nsServiceManager::GetService(kEventQueueServiceCID,
|
||||
kIEventQueueServiceIID,
|
||||
NS_GET_IID(nsIEventQueueService),
|
||||
(nsISupports **)&eventService);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIEventQueue> eventQueue;
|
||||
|
|
|
@ -60,11 +60,7 @@ static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
|
|||
static NS_DEFINE_IID(kScrollingViewCID, NS_SCROLLING_VIEW_CID);
|
||||
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
|
||||
static NS_DEFINE_IID(kIAnonymousContentCreatorIID, NS_IANONYMOUS_CONTENT_CREATOR_IID);
|
||||
static NS_DEFINE_IID(kIScrollableFrameIID, NS_ISCROLLABLE_FRAME_IID);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@ -923,7 +919,7 @@ nsGfxScrollFrameInner::GetScrollableView(nsIPresContext* aPresContext)
|
|||
nsIFrame* frame = nsnull;
|
||||
mScrollAreaBox->GetFrame(&frame);
|
||||
frame->GetView(aPresContext, &view);
|
||||
nsresult result = view->QueryInterface(kScrollViewIID, (void**)&scrollingView);
|
||||
nsresult result = view->QueryInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollingView);
|
||||
NS_ASSERTION(NS_SUCCEEDED(result), "assertion gfx scrollframe does not contain a scrollframe");
|
||||
return scrollingView;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "nsStyleUtil.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLHRElementIID, NS_IDOMHTMLHRELEMENT_IID);
|
||||
|
||||
// default hr thickness in pixels
|
||||
#define DEFAULT_THICKNESS 3
|
||||
|
@ -282,7 +281,7 @@ HRuleFrame::GetNoShade()
|
|||
{
|
||||
PRBool result = PR_FALSE;
|
||||
nsIDOMHTMLHRElement* hr = nsnull;
|
||||
mContent->QueryInterface(kIDOMHTMLHRElementIID, (void**) &hr);
|
||||
mContent->QueryInterface(NS_GET_IID(nsIDOMHTMLHRElement), (void**) &hr);
|
||||
if (nsnull != hr) {
|
||||
hr->GetNoShade(&result);
|
||||
NS_RELEASE(hr);
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#include "nsIStyleSet.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
static NS_DEFINE_IID(kCChildCID, NS_CHILD_CID);
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -519,11 +518,10 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext,
|
|||
|
||||
// Create a view
|
||||
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
|
||||
nsresult result = nsComponentManager::CreateInstance(kViewCID,
|
||||
nsnull,
|
||||
kIViewIID,
|
||||
NS_GET_IID(nsIView),
|
||||
(void **)&view);
|
||||
if (NS_OK == result) {
|
||||
nsIViewManager* viewManager;
|
||||
|
@ -546,7 +544,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext,
|
|||
// Insert the view into the view hierarchy. If the parent view is a
|
||||
// scrolling view we need to do this differently
|
||||
nsIScrollableView* scrollingView;
|
||||
if (NS_SUCCEEDED(parentView->QueryInterface(kScrollViewIID, (void**)&scrollingView))) {
|
||||
if (NS_SUCCEEDED(parentView->QueryInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollingView))) {
|
||||
scrollingView->SetScrolledView(view);
|
||||
} else {
|
||||
PRInt32 zIndex = 0;
|
||||
|
|
|
@ -45,8 +45,6 @@
|
|||
#include "nsIPresShell.h"
|
||||
|
||||
// Interface IDs
|
||||
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
/**
|
||||
* Root frame class.
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsFrame.h"
|
||||
#include "nsContainerFrame.h"
|
||||
|
||||
static NS_DEFINE_IID(kIReflowCommandIID, NS_IREFLOWCOMMAND_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLReflowCommand(nsIReflowCommand** aInstancePtrResult,
|
||||
|
@ -50,7 +49,7 @@ NS_NewHTMLReflowCommand(nsIReflowCommand** aInstancePtrResult,
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return cmd->QueryInterface(kIReflowCommandIID, (void**)aInstancePtrResult);
|
||||
return cmd->QueryInterface(NS_GET_IID(nsIReflowCommand), (void**)aInstancePtrResult);
|
||||
}
|
||||
|
||||
// Construct a reflow command given a target frame, reflow command type,
|
||||
|
@ -77,7 +76,7 @@ nsHTMLReflowCommand::~nsHTMLReflowCommand()
|
|||
NS_IF_RELEASE(mListName);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsHTMLReflowCommand, kIReflowCommandIID);
|
||||
NS_IMPL_ISUPPORTS(nsHTMLReflowCommand, NS_GET_IID(nsIReflowCommand));
|
||||
|
||||
nsIFrame* nsHTMLReflowCommand::GetContainingBlock(nsIFrame* aFloater) const
|
||||
{
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
|
||||
// hack for bug 50695
|
||||
#include "nsIFormManager.h"
|
||||
static NS_DEFINE_IID(kIFormManagerIID, NS_IFORMMANAGER_IID);
|
||||
|
||||
// Initialize a <b>root</b> reflow state with a rendering context to
|
||||
// use for measuring things.
|
||||
|
@ -1315,7 +1314,7 @@ CalcQuirkContainingBlockHeight(const nsHTMLReflowState& aReflowState)
|
|||
if (nsLayoutAtoms::blockFrame == frameType.get()) {
|
||||
// special hack for bug 50695, skip form frames
|
||||
nsIFrame* formFrame;
|
||||
if (NS_OK == rs->frame->QueryInterface(kIFormManagerIID, (void **)&formFrame)) {
|
||||
if (NS_OK == rs->frame->QueryInterface(NS_GET_IID(nsIFormManager), (void **)&formFrame)) {
|
||||
continue;
|
||||
}
|
||||
if (!firstBlockRS) {
|
||||
|
|
|
@ -70,7 +70,6 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
|||
#undef NOISY_IMAGE_LOADING
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID);
|
||||
|
||||
// Value's for mSuppress
|
||||
#define SUPPRESS_UNSET 0
|
||||
|
@ -713,7 +712,7 @@ nsImageFrame::GetImageMap(nsIPresContext* aPresContext)
|
|||
usemap.Cut(0, 1);
|
||||
}
|
||||
nsIHTMLDocument* hdoc;
|
||||
nsresult rv = doc->QueryInterface(kIHTMLDocumentIID, (void**)&hdoc);
|
||||
nsresult rv = doc->QueryInterface(NS_GET_IID(nsIHTMLDocument), (void**)&hdoc);
|
||||
NS_RELEASE(doc);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMHTMLMapElement* map;
|
||||
|
|
|
@ -710,11 +710,6 @@ void CircleArea::GetShapeName(nsString& aResult) const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLElementIID, NS_IDOMHTMLELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLAreaElementIID, NS_IDOMHTMLAREAELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLAnchorElementIID, NS_IDOMHTMLANCHORELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDocumentObserverIID, NS_IDOCUMENT_OBSERVER_IID);
|
||||
|
||||
nsImageMap::nsImageMap()
|
||||
{
|
||||
|
@ -800,7 +795,7 @@ nsImageMap::Init(nsIPresShell* aPresShell, nsIFrame* aImageFrame, nsIDOMHTMLMapE
|
|||
mImageFrame = aImageFrame;
|
||||
mDomMap = aMap;
|
||||
|
||||
nsresult rv = aMap->QueryInterface(kIContentIID, (void**) &mMap);
|
||||
nsresult rv = aMap->QueryInterface(NS_GET_IID(nsIContent), (void**) &mMap);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = mMap->GetDocument(mDocument);
|
||||
if (NS_SUCCEEDED(rv) && (nsnull != mDocument)) {
|
||||
|
@ -828,7 +823,7 @@ nsImageMap::UpdateAreasForBlock(nsIContent* aParent)
|
|||
rv = aParent->ChildAt(i, child);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMHTMLAnchorElement* area;
|
||||
rv = child->QueryInterface(kIDOMHTMLAnchorElementIID, (void**) &area);
|
||||
rv = child->QueryInterface(NS_GET_IID(nsIDOMHTMLAnchorElement), (void**) &area);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = AddArea(child);
|
||||
NS_RELEASE(area);
|
||||
|
@ -860,7 +855,7 @@ nsImageMap::UpdateAreas()
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
// Only look at elements and not text, comments, etc.
|
||||
nsIDOMHTMLElement* element;
|
||||
rv = child->QueryInterface(kIDOMHTMLElementIID, (void**)&element);
|
||||
rv = child->QueryInterface(NS_GET_IID(nsIDOMHTMLElement), (void**)&element);
|
||||
if (NS_FAILED(rv)) {
|
||||
rv = NS_OK;
|
||||
continue;
|
||||
|
@ -871,7 +866,7 @@ nsImageMap::UpdateAreas()
|
|||
// If so, we only look for AREA elements
|
||||
if (!containsBlock) {
|
||||
nsIDOMHTMLAreaElement* area;
|
||||
rv = child->QueryInterface(kIDOMHTMLAreaElementIID, (void**) &area);
|
||||
rv = child->QueryInterface(NS_GET_IID(nsIDOMHTMLAreaElement), (void**) &area);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
containsArea = PR_TRUE;
|
||||
rv = AddArea(child);
|
||||
|
|
|
@ -496,7 +496,6 @@ nsLineBox::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static NS_DEFINE_IID(kILineIteratorIID, NS_ILINE_ITERATOR_IID);
|
||||
|
||||
static nsLineBox* gDummyLines[1];
|
||||
|
||||
|
|
|
@ -69,7 +69,6 @@
|
|||
|
||||
#include "nsObjectFrame.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMMouseListenerIID, NS_IDOMMOUSELISTENER_IID);
|
||||
|
||||
class nsPluginInstanceOwner : public nsIPluginInstanceOwner,
|
||||
public nsIPluginTagInfo2,
|
||||
|
@ -230,12 +229,8 @@ nsObjectFrame::~nsObjectFrame()
|
|||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
|
||||
static NS_DEFINE_IID(kIHTMLContentIID, NS_IHTMLCONTENT_IID);
|
||||
static NS_DEFINE_IID(kILinkHandlerIID, NS_ILINKHANDLER_IID);
|
||||
static NS_DEFINE_IID(kCAppShellCID, NS_APPSHELL_CID);
|
||||
static NS_DEFINE_IID(kIPluginHostIID, NS_IPLUGINHOST_IID);
|
||||
static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
|
||||
|
||||
PRIntn
|
||||
|
@ -432,7 +427,7 @@ nsObjectFrame::CreateWidget(nsIPresContext* aPresContext,
|
|||
// Create our view and widget
|
||||
|
||||
nsresult result =
|
||||
nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID,
|
||||
nsComponentManager::CreateInstance(kViewCID, nsnull, NS_GET_IID(nsIView),
|
||||
(void **)&view);
|
||||
if (NS_OK != result) {
|
||||
return result;
|
||||
|
@ -900,8 +895,7 @@ nsObjectFrame::InstantiateWidget(nsIPresContext* aPresContext,
|
|||
PRInt32 height = NSTwipsToIntPixels(aMetrics.height, t2p);
|
||||
nsRect r = nsRect(x, y, width, height);
|
||||
|
||||
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
|
||||
if((rv = nsComponentManager::CreateInstance(aWidgetCID, nsnull, kIWidgetIID, (void**)&mWidget)) != NS_OK)
|
||||
if((rv = nsComponentManager::CreateInstance(aWidgetCID, nsnull, NS_GET_IID(nsIWidget), (void**)&mWidget)) != NS_OK)
|
||||
return rv;
|
||||
|
||||
nsIWidget *parent;
|
||||
|
@ -1052,7 +1046,7 @@ nsObjectFrame::HandleImage(nsIPresContext* aPresContext,
|
|||
|
||||
// adjust kidReflowState
|
||||
nsIHTMLContent* hc = nsnull;
|
||||
mContent->QueryInterface(kIHTMLContentIID, (void**) &hc);
|
||||
mContent->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**) &hc);
|
||||
|
||||
if(hc != nsnull)
|
||||
{
|
||||
|
@ -1095,7 +1089,7 @@ nsresult
|
|||
nsObjectFrame::GetBaseURL(nsIURI* &aURL)
|
||||
{
|
||||
nsIHTMLContent* htmlContent;
|
||||
if (NS_SUCCEEDED(mContent->QueryInterface(kIHTMLContentIID, (void**)&htmlContent)))
|
||||
if (NS_SUCCEEDED(mContent->QueryInterface(NS_GET_IID(nsIHTMLContent), (void**)&htmlContent)))
|
||||
{
|
||||
htmlContent->GetBaseURL(aURL);
|
||||
NS_RELEASE(htmlContent);
|
||||
|
@ -1574,7 +1568,7 @@ nsresult nsPluginInstanceOwner::QueryInterface(const nsIID& aIID,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aIID.Equals(kIDOMMouseListenerIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMMouseListener))) {
|
||||
*aInstancePtrResult = (void*)(nsIDOMMouseListener*) this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
|
@ -1777,7 +1771,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
|
|||
|
||||
if (NS_OK == rv)
|
||||
{
|
||||
rv = container->QueryInterface(kILinkHandlerIID, (void **)&lh);
|
||||
rv = container->QueryInterface(NS_GET_IID(nsILinkHandler), (void **)&lh);
|
||||
|
||||
if (NS_OK == rv)
|
||||
{
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче