Bug 848796 part 1. Rename nsXULDocument to mozilla::dom::XULDocument. r=ms2ger

--HG--
rename : content/xul/document/src/nsXULDocument.cpp => content/xul/document/src/XULDocument.cpp
rename : content/xul/document/src/nsXULDocument.h => content/xul/document/src/XULDocument.h
This commit is contained in:
Boris Zbarsky 2013-03-26 11:31:53 -04:00
parent c0294663b4
commit 0944e82e31
14 changed files with 335 additions and 310 deletions

View File

@ -88,7 +88,7 @@ def pa
end
# define a "pxul" command to display the type of a XUL element from
# an nsXULDocument* pointer.
# an nsXULElement* pointer.
def pxul
set $p = $arg0
print $p->mNodeInfo.mRawPtr->mInner.mName->mStaticAtom->mString

View File

@ -1398,7 +1398,7 @@ BrowserGlue.prototype = {
}
// Add the entry to the persisted set for this document if it's not there.
// This code is mostly borrowed from nsXULDocument::Persist.
// This code is mostly borrowed from XULDocument::Persist.
let docURL = aSource.ValueUTF8.split("#")[0];
let docResource = this._rdf.GetResource(docURL);
let persistResource = this._rdf.GetResource("http://home.netscape.com/NC-rdf#persist");

View File

@ -19,7 +19,7 @@ let localStore = {
delete this.toolbar;
let toolbar = this.RDF.GetResource(BROWSER_URL + "#PersonalToolbar");
// Add the entry to the persisted set for this document if it's not there.
// See nsXULDocument::Persist.
// See XULDocument::Persist.
let doc = this.RDF.GetResource(BROWSER_URL);
let persist = this.RDF.GetResource("http://home.netscape.com/NC-rdf#persist");
if (!this.store.HasAssertion(doc, persist, toolbar, true)) {

View File

@ -330,7 +330,7 @@ nsScriptSecurityManager::GetChannelPrincipal(nsIChannel* aChannel,
}
// OK, get the principal from the URI. Make sure this does the same thing
// as nsDocument::Reset and nsXULDocument::StartDocumentLoad.
// as nsDocument::Reset and XULDocument::StartDocumentLoad.
nsCOMPtr<nsIURI> uri;
nsresult rv = NS_GetFinalChannelURI(aChannel, getter_AddRefs(uri));
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -9,7 +9,7 @@
#include "nsServiceManagerUtils.h"
#include "nsIContentViewer.h"
#include "nsIDocument.h"
#include "nsXULDocument.h"
#include "XULDocument.h"
#include "nsIWindowMediator.h"
#include "nsPIDOMWindow.h"
#include "nsIWebNavigation.h"
@ -425,7 +425,7 @@ TraceActiveWindowGlobal(const uint64_t& aId, nsGlobalWindow*& aWindow, void* aCl
#ifdef MOZ_XUL
nsIDocument* doc = aWindow->GetExtantDoc();
if (doc && doc->IsXUL()) {
nsXULDocument* xulDoc = static_cast<nsXULDocument*>(doc);
XULDocument* xulDoc = static_cast<XULDocument*>(doc);
xulDoc->TraceProtos(closure->mTrc, closure->mGCNumber);
}
#endif

View File

@ -1945,7 +1945,7 @@ nsDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup)
nsCOMPtr<nsIURI> uri;
nsCOMPtr<nsIPrincipal> principal;
if (aChannel) {
// Note: this code is duplicated in nsXULDocument::StartDocumentLoad and
// Note: this code is duplicated in XULDocument::StartDocumentLoad and
// nsScriptSecurityManager::GetChannelPrincipal.
// Note: this should match nsDocShell::OnLoadingSite
NS_GetFinalChannelURI(aChannel, getter_AddRefs(uri));

View File

@ -65,7 +65,7 @@
#include "nsXULControllers.h"
#include "nsIBoxObject.h"
#include "nsPIBoxObject.h"
#include "nsXULDocument.h"
#include "XULDocument.h"
#include "nsXULPopupListener.h"
#include "nsRuleWalker.h"
#include "nsIDOMCSSStyleDeclaration.h"
@ -106,6 +106,7 @@
#include "mozilla/dom/XULElementBinding.h"
using namespace mozilla;
using namespace mozilla::dom;
//----------------------------------------------------------------------
@ -436,7 +437,7 @@ nsXULElement::GetElementsByAttribute(const nsAString& aAttribute,
void* attrValue = new nsString(aValue);
nsRefPtr<nsContentList> list =
new nsContentList(this,
nsXULDocument::MatchAttribute,
XULDocument::MatchAttribute,
nsContentUtils::DestroyMatchString,
attrValue,
true,
@ -478,7 +479,7 @@ nsXULElement::GetElementsByAttributeNS(const nsAString& aNamespaceURI,
void* attrValue = new nsString(aValue);
nsRefPtr<nsContentList> list =
new nsContentList(this,
nsXULDocument::MatchAttribute,
XULDocument::MatchAttribute,
nsContentUtils::DestroyMatchString,
attrValue,
true,
@ -2492,7 +2493,7 @@ nsXULPrototypeScript::DeserializeOutOfLine(nsIObjectInputStream* aInput,
if (mSrcURI) {
// NB: we must check the XUL script cache early, to avoid
// multiple deserialization attempts for a given script.
// Note that nsXULDocument::LoadScript
// Note that XULDocument::LoadScript
// checks the XUL script cache too, in order to handle the
// serialization case.
//
@ -2600,7 +2601,7 @@ nsXULPrototypeScript::Compile(const PRUnichar* aText,
// protodoc's?
// If we start using the protodoc's, make sure
// the DowngradePrincipalIfNeeded stuff in
// nsXULDocument::OnStreamComplete still works!
// XULDocument::OnStreamComplete still works!
aDocument->NodePrincipal(),
urlspec.get(),
aLineNo,

View File

@ -199,7 +199,11 @@ public:
nsXULPrototypeAttribute* mAttributes; // [OWNER]
};
class nsXULDocument;
namespace mozilla {
namespace dom {
class XULDocument;
} // namespace dom
} // namespace mozilla
class nsXULPrototypeScript : public nsXULPrototypeNode
{
@ -242,7 +246,7 @@ public:
uint32_t mLineNo;
bool mSrcLoading;
bool mOutOfLine;
nsXULDocument* mSrcLoadWaiters; // [OWNER] but not COMPtr
mozilla::dom::XULDocument* mSrcLoadWaiters; // [OWNER] but not COMPtr
uint32_t mLangVersion;
private:
JSScript* mScriptObject;

View File

@ -20,7 +20,7 @@ ifdef MOZ_XUL
CPPSRCS += \
nsXULCommandDispatcher.cpp \
nsXULContentSink.cpp \
nsXULDocument.cpp \
XULDocument.cpp \
nsXULPrototypeCache.cpp \
nsXULPrototypeDocument.cpp \
$(NULL)

View File

@ -3,8 +3,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsXULDocument_h__
#define nsXULDocument_h__
#ifndef mozilla_dom_XULDocument_h
#define mozilla_dom_XULDocument_h
#include "nsCOMPtr.h"
#include "nsXULPrototypeDocument.h"
@ -81,15 +81,19 @@ private:
/**
* The XUL document class
*/
class nsXULDocument : public mozilla::dom::XMLDocument,
public nsIXULDocument,
public nsIDOMXULDocument,
public nsIStreamLoaderObserver,
public nsICSSLoaderObserver
namespace mozilla {
namespace dom {
class XULDocument : public XMLDocument,
public nsIXULDocument,
public nsIDOMXULDocument,
public nsIStreamLoaderObserver,
public nsICSSLoaderObserver
{
public:
nsXULDocument();
virtual ~nsXULDocument();
XULDocument();
virtual ~XULDocument();
// nsISupports interface
NS_DECL_ISUPPORTS_INHERITED
@ -140,7 +144,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMDocument interface
NS_FORWARD_NSIDOMDOCUMENT(mozilla::dom::XMLDocument::)
NS_FORWARD_NSIDOMDOCUMENT(XMLDocument::)
// And explicitly import the things from nsDocument that we just shadowed
using nsDocument::GetImplementation;
using nsDocument::GetTitle;
@ -150,7 +154,7 @@ public:
using nsDocument::GetMozFullScreenElement;
// nsDocument interface overrides
virtual mozilla::dom::Element* GetElementById(const nsAString & elementId);
virtual Element* GetElementById(const nsAString & elementId);
// nsIDOMXULDocument interface
NS_DECL_NSIDOMXULDOCUMENT
@ -176,8 +180,7 @@ public:
nsIAtom* aAttrName,
void* aData);
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULDocument,
mozilla::dom::XMLDocument)
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULDocument, XMLDocument)
virtual nsXPCClassInfo* GetClassInfo();
@ -186,15 +189,15 @@ public:
protected:
// Implementation methods
friend nsresult
NS_NewXULDocument(nsIXULDocument** aResult);
(::NS_NewXULDocument(nsIXULDocument** aResult));
nsresult Init(void);
nsresult StartLayout(void);
nsresult
AddElementToRefMap(mozilla::dom::Element* aElement);
AddElementToRefMap(Element* aElement);
void
RemoveElementFromRefMap(mozilla::dom::Element* aElement);
RemoveElementFromRefMap(Element* aElement);
nsresult GetViewportSize(int32_t* aWidth, int32_t* aHeight);
@ -220,10 +223,10 @@ protected:
nsCOMArray<nsIContent>& aElements);
nsresult
AddElementToDocumentPre(mozilla::dom::Element* aElement);
AddElementToDocumentPre(Element* aElement);
nsresult
AddElementToDocumentPost(mozilla::dom::Element* aElement);
AddElementToDocumentPost(Element* aElement);
nsresult
ExecuteOnBroadcastHandlerFor(nsIContent* aBroadcaster,
@ -264,7 +267,7 @@ protected:
// NOTE, THIS IS STILL IN PROGRESS, TALK TO PINK OR SCC BEFORE
// CHANGING
nsXULDocument* mNextSrcLoadWaiter; // [OWNER] but not COMPtr
XULDocument* mNextSrcLoadWaiter; // [OWNER] but not COMPtr
// Tracks elements with a 'ref' attribute, or an 'id' attribute where
// the element's namespace has no registered ID attribute name.
@ -376,7 +379,7 @@ protected:
* Note that the resulting content node is not bound to any tree
*/
nsresult CreateElementFromPrototype(nsXULPrototypeElement* aPrototype,
mozilla::dom::Element** aResult,
Element** aResult,
bool aIsRoot);
/**
@ -384,7 +387,7 @@ protected:
* later resolution.
*/
nsresult CreateOverlayElement(nsXULPrototypeElement* aPrototype,
mozilla::dom::Element** aResult);
Element** aResult);
/**
* Add attributes from the prototype to the element.
@ -452,13 +455,13 @@ protected:
class BroadcasterHookup : public nsForwardReference
{
protected:
nsXULDocument* mDocument; // [WEAK]
nsRefPtr<mozilla::dom::Element> mObservesElement; // [OWNER]
XULDocument* mDocument; // [WEAK]
nsRefPtr<Element> mObservesElement; // [OWNER]
bool mResolved;
public:
BroadcasterHookup(nsXULDocument* aDocument,
mozilla::dom::Element* aObservesElement)
BroadcasterHookup(XULDocument* aDocument,
Element* aObservesElement)
: mDocument(aDocument),
mObservesElement(aObservesElement),
mResolved(false)
@ -480,14 +483,14 @@ protected:
class OverlayForwardReference : public nsForwardReference
{
protected:
nsXULDocument* mDocument; // [WEAK]
XULDocument* mDocument; // [WEAK]
nsCOMPtr<nsIContent> mOverlay; // [OWNER]
bool mResolved;
nsresult Merge(nsIContent* aTargetNode, nsIContent* aOverlayNode, bool aNotify);
public:
OverlayForwardReference(nsXULDocument* aDocument, nsIContent* aOverlay)
OverlayForwardReference(XULDocument* aDocument, nsIContent* aOverlay)
: mDocument(aDocument), mOverlay(aOverlay), mResolved(false) {}
virtual ~OverlayForwardReference();
@ -518,14 +521,14 @@ protected:
// values of the out params should not be relied on (though *aListener and
// *aBroadcaster do need to be released if non-null, of course).
nsresult
FindBroadcaster(mozilla::dom::Element* aElement,
FindBroadcaster(Element* aElement,
nsIDOMElement** aListener,
nsString& aBroadcasterID,
nsString& aAttribute,
nsIDOMElement** aBroadcaster);
nsresult
CheckBroadcasterHookup(mozilla::dom::Element* aElement,
CheckBroadcasterHookup(Element* aElement,
bool* aNeedsHookup,
bool* aDidResolve);
@ -625,13 +628,13 @@ protected:
class CachedChromeStreamListener : public nsIStreamListener {
protected:
nsXULDocument* mDocument;
bool mProtoLoaded;
XULDocument* mDocument;
bool mProtoLoaded;
virtual ~CachedChromeStreamListener();
public:
CachedChromeStreamListener(nsXULDocument* aDocument,
CachedChromeStreamListener(XULDocument* aDocument,
bool aProtoLoaded);
NS_DECL_ISUPPORTS
@ -644,12 +647,12 @@ protected:
class ParserObserver : public nsIRequestObserver {
protected:
nsRefPtr<nsXULDocument> mDocument;
nsRefPtr<XULDocument> mDocument;
nsRefPtr<nsXULPrototypeDocument> mPrototype;
virtual ~ParserObserver();
public:
ParserObserver(nsXULDocument* aDocument,
ParserObserver(XULDocument* aDocument,
nsXULPrototypeDocument* aPrototype);
NS_DECL_ISUPPORTS
@ -720,4 +723,7 @@ private:
};
#endif // nsXULDocument_h__
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_XULDocument_h

View File

@ -5,7 +5,7 @@
#include "nsXULPrototypeDocument.h"
#include "nsXULDocument.h"
#include "XULDocument.h"
#include "nsAString.h"
#include "nsIObjectInputStream.h"
@ -34,6 +34,7 @@
using mozilla::dom::DestroyProtoAndIfaceCache;
using mozilla::AutoPushJSContext;
using mozilla::dom::XULDocument;
static NS_DEFINE_CID(kDOMScriptObjectFactoryCID,
NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
@ -637,7 +638,7 @@ nsXULPrototypeDocument::GetNodeInfoManager()
nsresult
nsXULPrototypeDocument::AwaitLoadDone(nsXULDocument* aDocument, bool* aResult)
nsXULPrototypeDocument::AwaitLoadDone(XULDocument* aDocument, bool* aResult)
{
nsresult rv = NS_OK;

View File

@ -18,18 +18,23 @@ class nsIAtom;
class nsIPrincipal;
class nsIURI;
class nsNodeInfoManager;
class nsXULDocument;
class nsXULPrototypeElement;
class nsXULPrototypePI;
class nsXULPDGlobalObject;
struct JSTracer;
namespace mozilla {
namespace dom {
class XULDocument;
} // namespace dom
} // namespace mozilla
/**
* A "prototype" document that stores shared document information
* for the XUL cache.
* Among other things, stores the tree of nsXULPrototype*
* objects, from which the real DOM tree is built later in
* nsXULDocument::ResumeWalk.
* XULDocument::ResumeWalk.
*/
class nsXULPrototypeDocument : public nsIScriptGlobalObjectOwner,
public nsISerializable
@ -93,10 +98,10 @@ public:
/**
* If current prototype document has not yet finished loading,
* appends aDocument to the list of documents to notify (via
* nsXULDocument::OnPrototypeLoadDone()) and sets aLoaded to false.
* XULDocument::OnPrototypeLoadDone()) and sets aLoaded to false.
* Otherwise sets aLoaded to true.
*/
nsresult AwaitLoadDone(nsXULDocument* aDocument, bool* aResult);
nsresult AwaitLoadDone(mozilla::dom::XULDocument* aDocument, bool* aResult);
/**
* Notifies each document registered via AwaitLoadDone on this
@ -130,7 +135,7 @@ protected:
nsRefPtr<nsXULPDGlobalObject> mGlobalObject;
bool mLoaded;
nsTArray< nsRefPtr<nsXULDocument> > mPrototypeWaiters;
nsTArray< nsRefPtr<mozilla::dom::XULDocument> > mPrototypeWaiters;
nsRefPtr<nsNodeInfoManager> mNodeInfoManager;

View File

@ -692,7 +692,7 @@
ERROR(NS_CONTENT_BLOCKED, SUCCESS(8)),
ERROR(NS_CONTENT_BLOCKED_SHOW_ALT, SUCCESS(9)),
ERROR(NS_PROPTABLE_PROP_OVERWRITTEN, SUCCESS(11)),
/* Error codes for FindBroadcaster in nsXULDocument.cpp */
/* Error codes for FindBroadcaster in XULDocument.cpp */
ERROR(NS_FINDBROADCASTER_NOT_FOUND, SUCCESS(12)),
ERROR(NS_FINDBROADCASTER_FOUND, SUCCESS(13)),
ERROR(NS_FINDBROADCASTER_AWAIT_OVERLAYS, SUCCESS(14)),