Bug 16709. Set 'content ID' fields on elements as they are constructed from XUL.

This commit is contained in:
waterson%netscape.com 1999-12-06 23:05:31 +00:00
Родитель c3688d7937
Коммит 77a02a8fff
8 изменённых файлов: 28 добавлений и 12 удалений

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

@ -2717,14 +2717,15 @@ nsXULElement::HandleDOMEvent(nsIPresContext* aPresContext,
NS_IMETHODIMP
nsXULElement::GetContentID(PRUint32* aID)
{
*aID = 0;
return NS_ERROR_NOT_IMPLEMENTED;
*aID = mContentId;
return NS_OK;
}
NS_IMETHODIMP
nsXULElement::SetContentID(PRUint32 aID)
{
return NS_ERROR_NOT_IMPLEMENTED;
mContentId = aID;
return NS_OK;
}
NS_IMETHODIMP

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

@ -519,6 +519,7 @@ protected:
nsCOMPtr<nsISupportsArray> mChildren; // [OWNER]
nsCOMPtr<nsIEventListenerManager> mListenerManager; // [OWNER]
void* mScriptObject; // [OWNER]
PRInt32 mContentId;
// The state of our sloth for lazy content model construction via
// RDF; see nsIXULContent and nsRDFGenericBuilder.

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

@ -55,6 +55,7 @@
#include "nsIBrowserWindow.h"
#include "nsIChromeRegistry.h"
#include "nsIComponentManager.h"
#include "nsIContentSink.h" // for NS_CONTENT_ID_COUNTER_BASE
#include "nsIContentViewer.h"
#include "nsICSSStyleSheet.h"
#include "nsIDOMEvent.h"
@ -203,7 +204,6 @@ nsIXULPrototypeCache* nsXULDocument::gXULCache;
PRLogModuleInfo* nsXULDocument::gXULLog;
//----------------------------------------------------------------------
//
// PlaceholderChannel
@ -310,6 +310,7 @@ nsXULDocument::nsXULDocument(void)
mDisplaySelection(PR_FALSE),
mIsPopup(PR_FALSE),
mResolutionPhase(nsForwardReference::eStart),
mNextContentID(NS_CONTENT_ID_COUNTER_BASE),
mState(eState_Master),
mCurrentScriptProto(nsnull)
{
@ -3886,8 +3887,8 @@ nsXULDocument::RebuildWidgetItem(nsIContent* aElement)
nsresult
nsXULDocument::CreateElement(PRInt32 aNameSpaceID,
nsIAtom* aTag,
nsIContent** aResult)
nsIAtom* aTag,
nsIContent** aResult)
{
nsresult rv;
nsCOMPtr<nsIContent> result;
@ -3913,6 +3914,8 @@ nsXULDocument::CreateElement(PRInt32 aNameSpaceID,
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to set element's document");
if (NS_FAILED(rv)) return rv;
result->SetContentID(mNextContentID++);
*aResult = result;
NS_ADDREF(*aResult);
return NS_OK;
@ -4941,6 +4944,8 @@ nsXULDocument::CreateElement(nsXULPrototypeElement* aPrototype, nsIContent** aRe
}
}
result->SetContentID(mNextContentID++);
*aResult = result;
NS_ADDREF(*aResult);
return NS_OK;

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

@ -525,6 +525,7 @@ protected:
nsVoidArray mForwardReferences;
nsForwardReference::Phase mResolutionPhase;
PRInt32 mNextContentID;
// The following are pointers into the content model which provide access to
// the objects triggering either a popup or a tooltip. These are marked as

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

@ -55,6 +55,7 @@
#include "nsIBrowserWindow.h"
#include "nsIChromeRegistry.h"
#include "nsIComponentManager.h"
#include "nsIContentSink.h" // for NS_CONTENT_ID_COUNTER_BASE
#include "nsIContentViewer.h"
#include "nsICSSStyleSheet.h"
#include "nsIDOMEvent.h"
@ -203,7 +204,6 @@ nsIXULPrototypeCache* nsXULDocument::gXULCache;
PRLogModuleInfo* nsXULDocument::gXULLog;
//----------------------------------------------------------------------
//
// PlaceholderChannel
@ -310,6 +310,7 @@ nsXULDocument::nsXULDocument(void)
mDisplaySelection(PR_FALSE),
mIsPopup(PR_FALSE),
mResolutionPhase(nsForwardReference::eStart),
mNextContentID(NS_CONTENT_ID_COUNTER_BASE),
mState(eState_Master),
mCurrentScriptProto(nsnull)
{
@ -3886,8 +3887,8 @@ nsXULDocument::RebuildWidgetItem(nsIContent* aElement)
nsresult
nsXULDocument::CreateElement(PRInt32 aNameSpaceID,
nsIAtom* aTag,
nsIContent** aResult)
nsIAtom* aTag,
nsIContent** aResult)
{
nsresult rv;
nsCOMPtr<nsIContent> result;
@ -3913,6 +3914,8 @@ nsXULDocument::CreateElement(PRInt32 aNameSpaceID,
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to set element's document");
if (NS_FAILED(rv)) return rv;
result->SetContentID(mNextContentID++);
*aResult = result;
NS_ADDREF(*aResult);
return NS_OK;
@ -4941,6 +4944,8 @@ nsXULDocument::CreateElement(nsXULPrototypeElement* aPrototype, nsIContent** aRe
}
}
result->SetContentID(mNextContentID++);
*aResult = result;
NS_ADDREF(*aResult);
return NS_OK;

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

@ -525,6 +525,7 @@ protected:
nsVoidArray mForwardReferences;
nsForwardReference::Phase mResolutionPhase;
PRInt32 mNextContentID;
// The following are pointers into the content model which provide access to
// the objects triggering either a popup or a tooltip. These are marked as

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

@ -2717,14 +2717,15 @@ nsXULElement::HandleDOMEvent(nsIPresContext* aPresContext,
NS_IMETHODIMP
nsXULElement::GetContentID(PRUint32* aID)
{
*aID = 0;
return NS_ERROR_NOT_IMPLEMENTED;
*aID = mContentId;
return NS_OK;
}
NS_IMETHODIMP
nsXULElement::SetContentID(PRUint32 aID)
{
return NS_ERROR_NOT_IMPLEMENTED;
mContentId = aID;
return NS_OK;
}
NS_IMETHODIMP

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

@ -519,6 +519,7 @@ protected:
nsCOMPtr<nsISupportsArray> mChildren; // [OWNER]
nsCOMPtr<nsIEventListenerManager> mListenerManager; // [OWNER]
void* mScriptObject; // [OWNER]
PRInt32 mContentId;
// The state of our sloth for lazy content model construction via
// RDF; see nsIXULContent and nsRDFGenericBuilder.