Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes
nsSVGDocument Class Reference

#include <nsSVGDocument.h>

Inheritance diagram for nsSVGDocument:
Inheritance graph
[legend]
Collaboration diagram for nsSVGDocument:
Collaboration graph
[legend]

List of all members.

Public Types

typedef PRBool(* nsSubDocEnumFunc )(nsIDocument *aDocument, void *aData)
 Enumerate all subdocuments.

Public Member Functions

 nsSVGDocument ()
virtual ~nsSVGDocument ()
virtual
NS_DECL_ISUPPORTS_INHERITED
void 
Reset (nsIChannel *aChannel, nsILoadGroup *aLoadGroup)
 Reset the document using the given channel and loadgroup.
virtual void ResetToURI (nsIURI *aURI, nsILoadGroup *aLoadGroup)
 Reset this document to aURI and aLoadGroup.
virtual nsresult StartDocumentLoad (const char *aCommand, nsIChannel *channel, nsILoadGroup *aLoadGroup, nsISupports *aContainer, nsIStreamListener **aDocListener, PRBool aReset=PR_TRUE, nsIContentSink *aSink=nsnull)
virtual void EndLoad ()
virtual PRBool IsLoadedAsData ()
NS_IMETHOD CloneNode (PRBool aDeep, nsIDOMNode **aReturn)
NS_IMETHOD GetElementById (const nsAString &aElementId, nsIDOMElement **aReturn)
NS_DECL_NSIINTERFACEREQUESTOR
NS_DECL_NSICHANNELEVENTSINK
virtual
NS_DECL_NSIDOMXMLDOCUMENT
nsresult 
Init ()
void SetLoadedAsData (PRBool aLoadedAsData)
virtual void StopDocumentLoad ()
virtual nsIPrincipalGetPrincipal ()
 Return the principal responsible for this document.
virtual void SetPrincipal (nsIPrincipal *aPrincipal)
 Set the principal responsible for this document.
virtual void SetContentType (const nsAString &aContentType)
 Get the Content-Type of this document.
virtual nsresult SetBaseURI (nsIURI *aURI)
virtual void GetBaseTarget (nsAString &aBaseTarget) const
 Get/Set the base target of a link in a document.
virtual void SetBaseTarget (const nsAString &aBaseTarget)
virtual void SetDocumentCharacterSet (const nsACString &aCharSetID)
 Return a standard name for the document's character set.
virtual nsresult AddCharSetObserver (nsIObserver *aObserver)
 Add an observer that gets notified whenever the charset changes.
virtual void RemoveCharSetObserver (nsIObserver *aObserver)
 Remove a charset observer.
virtual nsILineBreakerGetLineBreaker ()
 Return the Line Breaker for the document.
virtual void SetLineBreaker (nsILineBreaker *aLineBreaker)
virtual nsIWordBreakerGetWordBreaker ()
virtual void SetWordBreaker (nsIWordBreaker *aWordBreaker)
virtual void GetHeaderData (nsIAtom *aHeaderField, nsAString &aData) const
 Access HTTP header data (this may also get set from other sources, like HTML META tags).
virtual void SetHeaderData (nsIAtom *aheaderField, const nsAString &aData)
virtual nsresult CreateShell (nsPresContext *aContext, nsIViewManager *aViewManager, nsStyleSet *aStyleSet, nsIPresShell **aInstancePtrResult)
 Create a new presentation shell that will use aContext for it's presentation context (presentation context's must not be shared among multiple presentation shell's).
virtual PRBool DeleteShell (nsIPresShell *aShell)
virtual PRUint32 GetNumberOfShells () const
virtual nsIPresShellGetShellAt (PRUint32 aIndex) const
virtual nsresult SetSubDocumentFor (nsIContent *aContent, nsIDocument *aSubDoc)
 Set the sub document for aContent to aSubDoc.
virtual nsIDocumentGetSubDocumentFor (nsIContent *aContent) const
 Get the sub document for aContent.
virtual nsIContentFindContentForSubDocument (nsIDocument *aDocument) const
 Find the content node for which aDocument is a sub document.
virtual nsresult SetRootContent (nsIContent *aRoot)
 Set aRoot as the root content object for this document.
virtual nsIContentGetChildAt (PRUint32 aIndex) const
 Get the direct children of the document - content in the prolog, the root content and content in the epilog.
virtual PRInt32 IndexOf (nsIContent *aPossibleChild) const
virtual PRUint32 GetChildCount () const
virtual nsresult RemoveChildAt (PRUint32 aIndex, PRBool aNotify)
 Remove a child from this document.
virtual PRInt32 GetNumberOfStyleSheets () const
 Get the style sheets owned by this document.
virtual nsIStyleSheetGetStyleSheetAt (PRInt32 aIndex) const
 Get a particular stylesheet.
virtual PRInt32 GetIndexOfStyleSheet (nsIStyleSheet *aSheet) const
 Get the index of a particular stylesheet.
virtual void AddStyleSheet (nsIStyleSheet *aSheet)
 Add a stylesheet to the document.
virtual void RemoveStyleSheet (nsIStyleSheet *aSheet)
 Remove a stylesheet from the document.
virtual void UpdateStyleSheets (nsCOMArray< nsIStyleSheet > &aOldSheets, nsCOMArray< nsIStyleSheet > &aNewSheets)
 Replace the stylesheets in aOldSheets with the stylesheets in aNewSheets.
virtual void AddStyleSheetToStyleSets (nsIStyleSheet *aSheet)
virtual void RemoveStyleSheetFromStyleSets (nsIStyleSheet *aSheet)
virtual void InsertStyleSheetAt (nsIStyleSheet *aSheet, PRInt32 aIndex)
 Insert a sheet at a particular spot in the stylesheet list (zero-based)
virtual void SetStyleSheetApplicableState (nsIStyleSheet *aSheet, PRBool aApplicable)
 Notify the document that the applicable state of the sheet changed and that observers should be notified and style sets updated.
virtual PRInt32 GetNumberOfCatalogStyleSheets () const
 Just like the style sheet API, but for "catalog" sheets, extra sheets inserted at the UA level.
virtual nsIStyleSheetGetCatalogStyleSheetAt (PRInt32 aIndex) const
virtual void AddCatalogStyleSheet (nsIStyleSheet *aSheet)
virtual void EnsureCatalogStyleSheet (const char *aStyleSheetURI)
virtual nsIChannelGetChannel () const
 Get the channel that was passed to StartDocumentLoad or Reset for this document.
virtual nsHTMLStyleSheetGetAttributeStyleSheet () const
 Get this document's attribute stylesheet.
virtual nsIHTMLCSSStyleSheetGetInlineStyleSheet () const
 Get this document's inline style sheet.
virtual nsIScriptGlobalObjectGetScriptGlobalObject () const
 Set the object from which a document can get a script context.
virtual void SetScriptGlobalObject (nsIScriptGlobalObject *aGlobalObject)
virtual nsIScriptGlobalObjectGetScriptHandlingObject (PRBool &aHasHadScriptHandlingObject) const
 Get/set the object from which the context for the event/script handling can be got.
virtual void SetScriptHandlingObject (nsIScriptGlobalObject *aScriptObject)
void ClearScriptHandlingObject ()
virtual nsIScriptGlobalObjectGetScopeObject ()
 Get the object that is used as the scope for all of the content wrappers whose owner document is this document.
virtual nsPIDOMWindowGetWindow ()
 Return the window containing the document (the outer window).
virtual nsIScriptLoaderGetScriptLoader ()
 Get the script loader for this document.
virtual void AddObserver (nsIDocumentObserver *aObserver)
 Add a new observer of document change notifications.
virtual PRBool RemoveObserver (nsIDocumentObserver *aObserver)
 Remove an observer of document change notifications.
virtual void BeginUpdate (nsUpdateType aUpdateType)
virtual void EndUpdate (nsUpdateType aUpdateType)
virtual void BeginLoad ()
virtual void CharacterDataChanged (nsIContent *aContent, PRBool aAppend)
virtual void ContentStatesChanged (nsIContent *aContent1, nsIContent *aContent2, PRInt32 aStateMask)
virtual void AttributeWillChange (nsIContent *aChild, PRInt32 aNameSpaceID, nsIAtom *aAttribute)
virtual void AttributeChanged (nsIContent *aChild, PRInt32 aNameSpaceID, nsIAtom *aAttribute, PRInt32 aModType)
virtual void ContentAppended (nsIContent *aContainer, PRInt32 aNewIndexInContainer)
virtual void ContentInserted (nsIContent *aContainer, nsIContent *aChild, PRInt32 aIndexInContainer)
virtual void ContentRemoved (nsIContent *aContainer, nsIContent *aChild, PRInt32 aIndexInContainer)
virtual void StyleRuleChanged (nsIStyleSheet *aStyleSheet, nsIStyleRule *aOldStyleRule, nsIStyleRule *aNewStyleRule)
virtual void StyleRuleAdded (nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)
virtual void StyleRuleRemoved (nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)
virtual void FlushPendingNotifications (mozFlushType aType)
 Flush notifications for this document and its parent documents (since those may affect the layout of this one).
virtual nsIScriptEventManagerGetScriptEventManager ()
virtual void SetXMLDeclaration (const PRUnichar *aVersion, const PRUnichar *aEncoding, const PRInt32 aStandalone)
 Set and get XML declaration.
virtual void GetXMLDeclaration (nsAString &aVersion, nsAString &aEncoding, nsAString &Standalone)
virtual PRBool IsScriptEnabled ()
virtual nsresult HandleDOMEvent (nsPresContext *aPresContext, nsEvent *aEvent, nsIDOMEvent **aDOMEvent, PRUint32 aFlags, nsEventStatus *aEventStatus)
virtual void OnPageShow (PRBool aPersisted)
 Notification that the page has been shown, for documents which are loaded into a DOM window.
virtual void OnPageHide (PRBool aPersisted)
 Notification that the page has been hidden, for documents which are loaded into a DOM window.
NS_IMETHOD WalkRadioGroup (const nsAString &aName, nsIRadioVisitor *aVisitor)
 Walk through the radio group, visiting each note with avisitor->Visit()
NS_IMETHOD SetCurrentRadioButton (const nsAString &aName, nsIDOMHTMLInputElement *aRadio)
 Set the current radio button in a group.
NS_IMETHOD GetCurrentRadioButton (const nsAString &aName, nsIDOMHTMLInputElement **aRadio)
 Get the current radio button in a group.
NS_IMETHOD GetPositionInGroup (nsIDOMHTMLInputElement *aRadio, PRInt32 *aPositionIndex, PRInt32 *aItemsInGroup)
 Get the radio group position and the number of radio buttons in the group.
NS_IMETHOD GetNextRadioButton (const nsAString &aName, const PRBool aPrevious, nsIDOMHTMLInputElement *aFocusedRadio, nsIDOMHTMLInputElement **aRadioOut)
 Get the next/prev radio button in a group.
NS_IMETHOD AddToRadioGroup (const nsAString &aName, nsIFormControl *aRadio)
 Add radio button to radio group.
NS_IMETHOD RemoveFromRadioGroup (const nsAString &aName, nsIFormControl *aRadio)
 Remove radio button from radio group.
nsresult GetRadioGroup (const nsAString &aName, nsRadioGroupStruct **aRadioGroup)
virtual nsIDOMGCParticipantGetSCCIndex ()
 Get a reference node for what is known to be a strongly connected component of nsIDOMGCParticipants.
virtual void AppendReachableList (nsCOMArray< nsIDOMGCParticipant > &aArray)
 Append the list of nsIDOMGCPartipants reachable from this one via C++ getters exposed to script that return a different result from |GetSCCIndex|.
NS_DECL_NSIDOMNODE
NS_DECL_NSIDOM3NODE
NS_DECL_NSIDOMDOCUMENT
NS_DECL_NSIDOM3DOCUMENT
NS_DECL_NSIDOMXMLDOCUMENT
NS_DECL_NSIDOMNSDOCUMENT
NS_DECL_NSIDOMDOCUMENTEVENT
NS_DECL_NSIDOM3DOCUMENTEVENT
NS_DECL_NSIDOMDOCUMENTSTYLE
NS_DECL_NSIDOMNSDOCUMENTSTYLE
NS_DECL_NSIDOMDOCUMENTVIEW
NS_DECL_NSIDOMDOCUMENTRANGE
NS_DECL_NSIDOMDOCUMENTTRAVERSAL
NS_DECL_NSIDOMDOCUMENTXBL
NS_IMETHOD 
AddEventListenerByIID (nsIDOMEventListener *aListener, const nsIID &aIID)
NS_IMETHOD RemoveEventListenerByIID (nsIDOMEventListener *aListener, const nsIID &aIID)
NS_IMETHOD GetListenerManager (nsIEventListenerManager **aInstancePtrResult)
NS_IMETHOD HandleEvent (nsIDOMEvent *aEvent)
NS_IMETHOD GetSystemEventGroup (nsIDOMEventGroup **aGroup)
virtual nsresult AddXMLEventsContent (nsIContent *aXMLEventsElement)
virtual nsresult CreateElem (nsIAtom *aName, nsIAtom *aPrefix, PRInt32 aNamespaceID, PRBool aDocumentDefaultType, nsIContent **aResult)
 Create an element with the specified name, prefix and namespace ID.
virtual NS_HIDDEN_ (void *) GetProperty(nsIAtom *aPropertyName
virtual NS_HIDDEN_ (nsresult) SetProperty(nsIAtom *aPropertyName
virtual NS_HIDDEN_ (nsresult) DeleteProperty(nsIAtom *aPropertyName)
virtual NS_HIDDEN_ (void *) UnsetProperty(nsIAtom *aPropertyName
virtual NS_HIDDEN_ (nsresult) Sanitize()
virtual NS_HIDDEN_ (void) EnumerateSubDocuments(nsSubDocEnumFunc aCallback
virtual NS_HIDDEN_ (PRBool) CanSavePresentation(nsIRequest *aNewRequest)
virtual NS_HIDDEN_ (void) Destroy()
virtual NS_HIDDEN_ (already_AddRefed< nsILayoutHistoryState >) GetLayoutHistoryState() const
virtual NS_HIDDEN_ (void) BlockOnload()
virtual NS_HIDDEN_ (void) UnblockOnload()
virtual NS_HIDDEN_ (void) AddStyleRelevantLink(nsIContent *aContent
virtual NS_HIDDEN_ (void) ForgetLink(nsIContent *aContent)
virtual NS_HIDDEN_ (void) NotifyURIVisitednessChanged(nsIURI *aURI)
const nsAFlatStringGetDocumentTitle () const
 Return the title of the document.
nsIURIGetDocumentURI () const
 Return the URI for the document.
void SetDocumentURI (nsIURI *aURI)
already_AddRefed< nsILoadGroupGetDocumentLoadGroup () const
 Return the LoadGroup for the document.
nsIURIGetBaseURI () const
 Return the base URI for relative URIs in the document (the document uri unless it's overridden by SetBaseURI, HTML <base> tags, etc.).
const nsAFlatCStringGetDocumentCharacterSet () const
 Return a standard name for the document's character set.
PRInt32 GetDocumentCharacterSetSource () const
void SetDocumentCharacterSetSource (PRInt32 aCharsetSource)
NS_IMETHOD GetContentType (nsAString &aContentType)=0
 Get the Content-Type of this document.
void GetContentLanguage (nsAString &aContentLanguage) const
 Return the language of this document.
PRBool GetBidiEnabled () const
 Check if the document contains bidi data.
void SetBidiEnabled (PRBool aBidiEnabled)
 Indicate the document contains bidi data.
nsIDocumentGetParentDocument () const
 Return the parent document of this document.
void SetParentDocument (nsIDocument *aParent)
 Set the parent document of this document.
nsIContentGetRootContent () const
 Return the root content object for this document.
nsICSSLoaderCSSLoader () const
 Get this document's CSSLoader.
PRInt32 GetAndIncrementContentID ()
nsIBindingManagerBindingManager () const
nsNodeInfoManagerNodeInfoManager () const
 Only to be used inside Gecko, you can't really do anything with the pointer outside Gecko anyway.
void SetContainer (nsISupports *aContainer)
 Set the container (docshell) for this document.
already_AddRefed< nsISupports > GetContainer () const
 Get the container (docshell) for this document.
virtual PRBool IsCaseSensitive ()
nsISupports * GetSecurityInfo ()
 Get the security info (i.e.
virtual voidGetProperty (nsIAtom *aPropertyName, nsresult *aStatus=nsnull) const =0
virtual nsresult SetProperty (nsIAtom *aPropertyName, void *aValue, NSPropertyDtorFunc aDtor=nsnull)=0
virtual nsresult DeleteProperty (nsIAtom *aPropertyName)=0
virtual voidUnsetProperty (nsIAtom *aPropertyName, nsresult *aStatus=nsnull)=0
nsPropertyTablePropertyTable ()
void SetPartID (PRUint32 aID)
 Sets the ID used to identify this part of the multipart document.
PRUint32 GetPartID () const
 Return the ID used to identify this part of the multipart document.
virtual nsresult Sanitize ()=0
 Sanitize the document by resetting all input elements and forms that have autocomplete=off to their default values.
virtual void EnumerateSubDocuments (nsSubDocEnumFunc aCallback, void *aData)=0
virtual PRBool CanSavePresentation (nsIRequest *aNewRequest)=0
 Check whether it is safe to cache the presentation of this document and all of its subdocuments.
virtual void Destroy ()=0
 Notify the document that its associated ContentViewer is being destroyed.
virtual already_AddRefed
< nsILayoutHistoryState
GetLayoutHistoryState () const =0
 Get the layout history state that should be used to save and restore state for nodes in this document.
virtual void BlockOnload ()=0
 Methods that can be used to prevent onload firing while an event that should block onload is posted.
virtual void UnblockOnload ()=0
virtual void AddStyleRelevantLink (nsIContent *aContent, nsIURI *aURI)=0
 Notification that an element is a link with a given URI that is relevant to style.
virtual void ForgetLink (nsIContent *aContent)=0
 Notification that an element is a link and its URI might have been changed or the element removed.
virtual void NotifyURIVisitednessChanged (nsIURI *aURI)=0
 Notification that the visitedness state of a URI has been changed and style related to elements linking to that URI should be updated.
PRBool IsInitialDocument () const
 Ask this document whether it's the initial document in its window.
void SetIsInitialDocument (PRBool aIsInitialDocument)
 Tell this document that it's the initial document in its window.
boolean load (in DOMString url)
 Load an XML document.
nsIDOMRange evaluateFIXptr (in DOMString expression)
 Evaluate FIXptr expression.
nsIXPointerResult evaluateXPointer (in DOMString expression)
 Evaluate XPointer expression.
nsIDOMElement createElement (in DOMString tagName) raises (DOMException)
nsIDOMDocumentFragment createDocumentFragment ()
nsIDOMText createTextNode (in DOMString data)
nsIDOMComment createComment (in DOMString data)
nsIDOMCDATASection createCDATASection (in DOMString data) raises (DOMException)
nsIDOMProcessingInstruction createProcessingInstruction (in DOMString target, in DOMString data) raises (DOMException)
nsIDOMAttr createAttribute (in DOMString name) raises (DOMException)
nsIDOMEntityReference createEntityReference (in DOMString name) raises (DOMException)
nsIDOMNodeList getElementsByTagName (in DOMString tagname)
nsIDOMNode importNode (in nsIDOMNode importedNode, in boolean deep) raises (DOMException)
nsIDOMElement createElementNS (in DOMString namespaceURI, in DOMString qualifiedName) raises (DOMException)
nsIDOMAttr createAttributeNS (in DOMString namespaceURI, in DOMString qualifiedName) raises (DOMException)
nsIDOMNodeList getElementsByTagNameNS (in DOMString namespaceURI, in DOMString localName)
nsIDOMElement getElementById (in DOMString elementId)
nsIDOMNode insertBefore (in nsIDOMNode newChild, in nsIDOMNode refChild) raises (DOMException)
nsIDOMNode replaceChild (in nsIDOMNode newChild, in nsIDOMNode oldChild) raises (DOMException)
nsIDOMNode removeChild (in nsIDOMNode oldChild) raises (DOMException)
nsIDOMNode appendChild (in nsIDOMNode newChild) raises (DOMException)
boolean hasChildNodes ()
nsIDOMNode cloneNode (in boolean deep)
void normalize ()
boolean isSupported (in DOMString feature, in DOMString version)
boolean hasAttributes ()
nsIBoxObject getBoxObjectFor (in nsIDOMElement elt)
void setBoxObjectFor (in nsIDOMElement elt, in nsIBoxObject boxObject)
nsIDOMEvent createEvent (in DOMString eventType) raises (DOMException)
nsIDOMEventGroup createEventGroup ()
nsIDOMRange createRange ()
nsIDOMNodeIterator createNodeIterator (in nsIDOMNode root, in unsigned long whatToShow, in nsIDOMNodeFilter filter, in boolean entityReferenceExpansion) raises (DOMException)
nsIDOMTreeWalker createTreeWalker (in nsIDOMNode root, in unsigned long whatToShow, in nsIDOMNodeFilter filter, in boolean entityReferenceExpansion) raises (DOMException)
nsIDOMNodeList getAnonymousNodes (in nsIDOMElement elt)
nsIDOMElement getAnonymousElementByAttribute (in nsIDOMElement elt, in DOMString attrName, in DOMString attrValue)
void addBinding (in nsIDOMElement elt, in DOMString bindingURL)
void removeBinding (in nsIDOMElement elt, in DOMString bindingURL)
nsIDOMElement getBindingParent (in nsIDOMNode node)
nsIDOMDocument loadBindingDocument (in DOMString documentURL)
nsIDOMNode adoptNode (in nsIDOMNode source) raises (DOMException)
void normalizeDocument ()
nsIDOMNode renameNode (in nsIDOMNode node, in DOMString namespaceURI, in DOMString qualifiedName) raises (DOMException)
unsigned short compareDocumentPosition (in nsIDOMNode other) raises (DOMException)
boolean isSameNode (in nsIDOMNode other)
DOMString lookupPrefix (in DOMString namespaceURI)
boolean isDefaultNamespace (in DOMString namespaceURI)
DOMString lookupNamespaceURI (in DOMString prefix)
boolean isEqualNode (in nsIDOMNode arg)
nsISupports getFeature (in DOMString feature, in DOMString version)
nsIVariant setUserData (in DOMString key, in nsIVariant data, in nsIDOMUserDataHandler handler)
nsIVariant getUserData (in DOMString key)
void addEventListener (in DOMString type, in nsIDOMEventListener listener, in boolean useCapture)
 This method allows the registration of event listeners on the event target.
void addEventListener (in DOMString type, in nsIDOMEventListener listener, in boolean useCapture, in boolean wantsUntrusted)
 This method is the same as the addEventListener() method defined in nsIDOMEventTarget, but it takes one additional argument which lets callers control whether or not they want to receive untrusted events (synthetic events generated by untrusted code)
void removeEventListener (in DOMString type, in nsIDOMEventListener listener, in boolean useCapture)
 This method allows the removal of event listeners from the event target.
boolean dispatchEvent (in nsIDOMEvent evt) raises (DOMException)
 This method allows the dispatch of events into the implementations event model.
void addGroupedEventListener (in DOMString type, in nsIDOMEventListener listener, in boolean useCapture, in nsIDOMEventGroup evtGroup)
void removeGroupedEventListener (in DOMString type, in nsIDOMEventListener listener, in boolean useCapture, in nsIDOMEventGroup evtGroup)
boolean canTrigger (in DOMString type)
boolean isRegisteredHere (in DOMString type)
void getInterface (in nsIIDRef uuid,[iid_is(uuid), retval] out nsQIResult result)
 Retrieves the specified interface pointer.
void onChannelRedirect (in nsIChannel oldChannel, in nsIChannel newChannel, in unsigned long flags)
 Called when a redirect occurs.

Public Attributes

virtual nsresultaStatus = nsnull) const
virtual voidaValue
virtual void NSPropertyDtorFunc aDtor = nsnull)
virtual voidaData
virtual nsIURIaURI
attribute boolean async
 Whether to load synchronously or asynchronously.
readonly attribute
nsIDOMDocumentType 
doctype
readonly attribute
nsIDOMDOMImplementation 
implementation
readonly attribute nsIDOMElement documentElement
const unsigned short ELEMENT_NODE = 1
const unsigned short ATTRIBUTE_NODE = 2
const unsigned short TEXT_NODE = 3
const unsigned short CDATA_SECTION_NODE = 4
const unsigned short ENTITY_REFERENCE_NODE = 5
const unsigned short ENTITY_NODE = 6
const unsigned short PROCESSING_INSTRUCTION_NODE = 7
const unsigned short COMMENT_NODE = 8
const unsigned short DOCUMENT_NODE = 9
const unsigned short DOCUMENT_TYPE_NODE = 10
const unsigned short DOCUMENT_FRAGMENT_NODE = 11
const unsigned short NOTATION_NODE = 12
readonly attribute DOMString nodeName
attribute DOMString nodeValue
readonly attribute unsigned short nodeType
readonly attribute nsIDOMNode parentNode
readonly attribute nsIDOMNodeList childNodes
readonly attribute nsIDOMNode firstChild
readonly attribute nsIDOMNode lastChild
readonly attribute nsIDOMNode previousSibling
readonly attribute nsIDOMNode nextSibling
readonly attribute
nsIDOMNamedNodeMap 
attributes
readonly attribute nsIDOMDocument ownerDocument
readonly attribute DOMString namespaceURI
attribute DOMString prefix
readonly attribute DOMString localName
readonly attribute DOMString characterSet
attribute DOMString dir
readonly attribute nsIDOMLocation location
attribute DOMString title
readonly attribute DOMString contentType
readonly attribute DOMString lastModified
readonly attribute DOMString referrer
readonly attribute DOMString preferredStylesheetSet
 This attribute indicates the preferredStylesheetSet as set by the author.
readonly attribute
nsIDOMStyleSheetList 
styleSheets
readonly attribute
nsIDOMAbstractView 
defaultView
readonly attribute DOMString inputEncoding
readonly attribute DOMString xmlEncoding
attribute boolean xmlStandalone
attribute DOMString xmlVersion
attribute boolean strictErrorChecking
attribute DOMString documentURI
readonly attribute
nsIDOMDOMConfiguration 
domConfig
readonly attribute DOMString baseURI
const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01
const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02
const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04
const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08
const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10
const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20
attribute DOMString textContent
const unsigned long REDIRECT_TEMPORARY = 1 << 0
 This is a temporary redirect.
const unsigned long REDIRECT_PERMANENT = 1 << 1
 This is a permanent redirect.
const unsigned long REDIRECT_INTERNAL = 1 << 2
 This is an internal redirect, i.e.
readonly attribute DOMString title
readonly attribute DOMString referrer
readonly attribute DOMString domain
readonly attribute DOMString URL
readonly attribute
nsIDOMSVGSVGElement 
rootElement

Protected Member Functions

virtual nsresult GetLoadGroup (nsILoadGroup **aLoadGroup)
void DispatchContentLoadedEvents ()
void RetrieveRelevantHeaders (nsIChannel *aChannel)
void UpdateLinkMap ()
void DestroyLinkMap ()
nsresult doCreateShell (nsPresContext *aContext, nsIViewManager *aViewManager, nsStyleSet *aStyleSet, nsCompatibility aCompatMode, nsIPresShell **aInstancePtrResult)
nsresult ResetStylesheetsToURI (nsIURI *aURI)
virtual nsStyleSet::sheetType GetAttrSheetType ()
void FillStyleSet (nsStyleSet *aStyleSet)
nsresult CreateElement (nsINodeInfo *aNodeInfo, PRInt32 aElementType, nsIContent **aResult)
PRBool IsSafeToFlush () const
virtual PRInt32 GetDefaultNamespaceID () const
 Returns the default namespace ID used for elements created in this document.
void DispatchEventToWindow (nsEvent *aEvent)

Static Protected Member Functions

static PRBool TryChannelCharset (nsIChannel *aChannel, PRInt32 &aCharsetSource, nsACString &aCharset)

Protected Attributes

nsCOMPtr< nsIEventQueueServicemEventQService
nsCOMPtr< nsIScriptContextmScriptContext
PRPackedBool mChannelIsPending
PRPackedBool mLoadedAsData
PRPackedBool mLoadedAsInteractiveData
PRPackedBool mAsync
PRPackedBool mLoopingForSyncLoad
nsCString mReferrer
nsString mLastModified
nsCOMPtr< nsIPrincipalmPrincipal
nsVoidArray mCharSetObservers
PLDHashTablemSubDocuments
nsSmallVoidArray mPresShells
nsAttrAndChildArray mChildren
nsCOMPtr< nsIParsermParser
nsCOMArray< nsIStyleSheetmStyleSheets
nsCOMArray< nsIStyleSheetmCatalogSheets
nsDocumentObserverList mObservers
nsCOMPtr< nsIScriptGlobalObjectmScriptGlobalObject
nsWeakPtr mScriptObject
nsWeakPtr mScopeObject
nsCOMPtr< nsIEventListenerManagermListenerManager
nsCOMPtr< nsIDOMStyleSheetListmDOMStyleSheets
nsCOMPtr< nsIScriptLoadermScriptLoader
nsDocHeaderDatamHeaderData
nsCOMPtr< nsILineBreakermLineBreaker
nsCOMPtr< nsIWordBreakermWordBreaker
nsRefPtr< nsDocumentChildNodesmChildNodes
nsHashtable mRadioGroups
PRPackedBool mIsGoingAway:1
PRPackedBool mInDestructor:1
PRPackedBool mVisible:1
PRPackedBool mHasHadScriptHandlingObject:1
PRUint8 mXMLDeclarationBits
PRUint8 mDefaultElementType
nsSupportsHashtable * mBoxObjectTable
nsCOMPtr< nsIChannelmChannel
nsRefPtr< nsHTMLStyleSheetmAttrStyleSheet
nsCOMPtr< nsIHTMLCSSStyleSheetmStyleAttrStyleSheet
nsRefPtr< nsXMLEventsManagermXMLEventsManager
nsCOMPtr< nsIScriptEventManagermScriptEventManager
nsString mBaseTarget
nsString mDocumentTitle
nsCOMPtr< nsIURImDocumentURI
nsCOMPtr< nsIURImDocumentBaseURI
nsWeakPtr mDocumentLoadGroup
nsWeakPtr mDocumentContainer
nsCString mCharacterSet
PRInt32 mCharacterSetSource
nsIDocumentmParentDocument
nsIContentmRootContent
PRInt32 mNextContentID
nsCOMPtr< nsIBindingManagermBindingManager
nsNodeInfoManagermNodeInfoManager
nsICSSLoadermCSSLoader
nsPropertyTable mPropertyTable
PRBool mBidiEnabled
nsXPIDLCString mContentLanguage
nsCString mContentType
nsCOMPtr< nsISupports > mSecurityInfo
PRUint32 mPartID
PRBool mIsInitialDocumentInWindow

Detailed Description

Definition at line 45 of file nsSVGDocument.h.


Member Typedef Documentation

typedef PRBool(* nsIDocument::nsSubDocEnumFunc)(nsIDocument *aDocument, void *aData) [inherited]

Enumerate all subdocuments.

The enumerator callback should return PR_TRUE to continue enumerating, or PR_FALSE to stop.

Definition at line 699 of file nsIDocument.h.


Constructor & Destructor Documentation

Definition at line 49 of file nsSVGDocument.cpp.

{
}

Definition at line 53 of file nsSVGDocument.cpp.

{
}

Member Function Documentation

void nsIDOMDocumentXBL::addBinding ( in nsIDOMElement  elt,
in DOMString  bindingURL 
) [inherited]
void nsDocument::AddCatalogStyleSheet ( nsIStyleSheet aSheet) [virtual, inherited]

Implements nsIDocument.

Definition at line 2101 of file nsDocument.cpp.

{
  mCatalogSheets.AppendObject(aSheet);
  aSheet->SetOwningDocument(this);

  PRBool applicable;
  aSheet->GetApplicable(applicable);
                                                                                
  if (applicable) {
    // This is like |AddStyleSheetToStyleSets|, but for an agent sheet.
    for (PRInt32 i = 0, i_end = mPresShells.Count(); i < i_end; ++i)
      NS_STATIC_CAST(nsIPresShell*, mPresShells.ElementAt(i))->StyleSet()->
        AppendStyleSheet(nsStyleSet::eAgentSheet, aSheet);
  }
                                                                                
  NS_DOCUMENT_NOTIFY_OBSERVERS(StyleSheetAdded, (this, aSheet, PR_FALSE));
}

Here is the call graph for this function:

nsresult nsDocument::AddCharSetObserver ( nsIObserver aObserver) [virtual, inherited]

Add an observer that gets notified whenever the charset changes.

Implements nsIDocument.

Definition at line 1464 of file nsDocument.cpp.

{
  NS_ENSURE_ARG_POINTER(aObserver);

  NS_ENSURE_TRUE(mCharSetObservers.AppendElement(aObserver), NS_ERROR_FAILURE);

  return NS_OK;
}
void nsIDOMNSEventTarget::addEventListener ( in DOMString  type,
in nsIDOMEventListener  listener,
in boolean  useCapture,
in boolean  wantsUntrusted 
) [inherited]

This method is the same as the addEventListener() method defined in nsIDOMEventTarget, but it takes one additional argument which lets callers control whether or not they want to receive untrusted events (synthetic events generated by untrusted code)

Parameters:
typeSee the type argument to the same method in nsIDOMEventTarget.
listenerSee the listener argument to the same method in nsIDOMEventTarget.
useCaptureSee the listener argument to the same method in nsIDOMEventTarget.
wantsUntrustedIf false, the listener will not receive any untrusted events (see above), if true, the listener will receive events whether or not they're trusted
void nsIDOMEventTarget::addEventListener ( in DOMString  type,
in nsIDOMEventListener  listener,
in boolean  useCapture 
) [inherited]

This method allows the registration of event listeners on the event target.

If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase.

If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.

Parameters:
typeThe event type for which the user is registering
listenerThe listener parameter takes an interface implemented by the user which contains the methods to be called when the event occurs.
useCaptureIf true, useCapture indicates that the user wishes to initiate capture. After initiating capture, all events of the specified type will be dispatched to the registered EventListener before being dispatched to any EventTargets beneath them in the tree. Events which are bubbling upward through the tree will not trigger an EventListener designated to use capture.
nsresult nsDocument::AddEventListenerByIID ( nsIDOMEventListener aListener,
const nsIID aIID 
) [virtual, inherited]

Implements nsIDOMEventReceiver.

Definition at line 4263 of file nsDocument.cpp.

{
  nsCOMPtr<nsIEventListenerManager> manager;

  GetListenerManager(getter_AddRefs(manager));
  if (manager) {
    manager->AddEventListenerByIID(aListener, aIID, NS_EVENT_FLAG_BUBBLE);
    return NS_OK;
  }

  return NS_ERROR_FAILURE;
}

Here is the call graph for this function:

void nsIDOM3EventTarget::addGroupedEventListener ( in DOMString  type,
in nsIDOMEventListener  listener,
in boolean  useCapture,
in nsIDOMEventGroup  evtGroup 
) [inherited]
void nsDocument::AddObserver ( nsIDocumentObserver aObserver) [virtual, inherited]

Add a new observer of document change notifications.

Whenever content is changed, appended, inserted or removed the observers are informed.

Implements nsIDocument.

Definition at line 2264 of file nsDocument.cpp.

{
  // XXX Make sure the observer isn't already in the list
  if (!mObservers.Contains(aObserver)) {
    mObservers.AppendElement(aObserver);
  }
}
virtual void nsIDocument::AddStyleRelevantLink ( nsIContent aContent,
nsIURI aURI 
) [pure virtual, inherited]

Notification that an element is a link with a given URI that is relevant to style.

Here is the caller graph for this function:

void nsDocument::AddStyleSheet ( nsIStyleSheet aSheet) [virtual, inherited]

Add a stylesheet to the document.

Implements nsIDocument.

Definition at line 1955 of file nsDocument.cpp.

{
  NS_PRECONDITION(aSheet, "null arg");
  mStyleSheets.AppendObject(aSheet);
  aSheet->SetOwningDocument(this);

  PRBool applicable;
  aSheet->GetApplicable(applicable);

  if (applicable) {
    AddStyleSheetToStyleSets(aSheet);
  }

  NS_DOCUMENT_NOTIFY_OBSERVERS(StyleSheetAdded, (this, aSheet, PR_TRUE));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsDocument::AddStyleSheetToStyleSets ( nsIStyleSheet aSheet) [virtual, inherited]

Definition at line 1944 of file nsDocument.cpp.

{
  PRInt32 count = mPresShells.Count();
  PRInt32 indx;
  for (indx = 0; indx < count; ++indx) {
    NS_STATIC_CAST(nsIPresShell*, mPresShells.ElementAt(indx))->StyleSet()->
      AddDocStyleSheet(aSheet, this);
  }
}
NS_IMETHODIMP nsDocument::AddToRadioGroup ( const nsAString &  aName,
nsIFormControl aRadio 
) [virtual, inherited]

Add radio button to radio group.

Note that forms do not do anything for this method since they already store radio groups on their own.

Parameters:
aNameradio group's name
aRadioradio button's pointer

Implements nsIRadioGroupContainer.

Definition at line 4698 of file nsDocument.cpp.

{
  nsRadioGroupStruct* radioGroup = nsnull;
  GetRadioGroup(aName, &radioGroup);
  if (radioGroup) {
    radioGroup->mRadioButtons.AppendElement(aRadio);
    NS_IF_ADDREF(aRadio);
  }

  return NS_OK;
}
nsresult nsDocument::AddXMLEventsContent ( nsIContent aXMLEventsElement) [virtual, inherited]

Implements nsIDocument.

Definition at line 1030 of file nsDocument.cpp.

nsIDOMNode nsIDOM3Document::adoptNode ( in nsIDOMNode  source) raises (DOMException) [inherited]
nsIDOMNode nsIDOMNode::appendChild ( in nsIDOMNode  newChild) raises (DOMException) [inherited]
void nsDocument::AppendReachableList ( nsCOMArray< nsIDOMGCParticipant > &  aArray) [virtual, inherited]

Append the list of nsIDOMGCPartipants reachable from this one via C++ getters exposed to script that return a different result from |GetSCCIndex|.

The caller is responsible for taking the transitive closure of |AppendReachableList|.

This will only be called on objects that are returned by GetSCCIndex.

null pointers may be appended; they will be ignored by the caller.

Implements nsIDOMGCParticipant.

Definition at line 3451 of file nsDocument.cpp.

Here is the call graph for this function:

void nsDocument::AttributeChanged ( nsIContent aChild,
PRInt32  aNameSpaceID,
nsIAtom aAttribute,
PRInt32  aModType 
) [virtual, inherited]

Implements nsIDocument.

Reimplemented in nsHTMLDocument, and nsXULDocument.

Definition at line 2539 of file nsDocument.cpp.

{
  NS_ABORT_IF_FALSE(aChild, "Null child!");

  NS_DOCUMENT_NOTIFY_OBSERVERS(AttributeChanged, (this, aChild, aNameSpaceID,
                                                  aAttribute, aModType));
}
void nsDocument::AttributeWillChange ( nsIContent aChild,
PRInt32  aNameSpaceID,
nsIAtom aAttribute 
) [virtual, inherited]

Implements nsIDocument.

Reimplemented in nsHTMLDocument.

Definition at line 2532 of file nsDocument.cpp.

{
  NS_ASSERTION(aChild, "Null child!");
}
void nsDocument::BeginLoad ( ) [virtual, inherited]

Implements nsIDocument.

Definition at line 2324 of file nsDocument.cpp.

void nsDocument::BeginUpdate ( nsUpdateType  aUpdateType) [virtual, inherited]

Implements nsIDocument.

Definition at line 2287 of file nsDocument.cpp.

nsIBindingManager* nsIDocument::BindingManager ( ) const [inline, inherited]

Definition at line 557 of file nsIDocument.h.

  {
    return mBindingManager;
  }

Here is the caller graph for this function:

virtual void nsIDocument::BlockOnload ( ) [pure virtual, inherited]

Methods that can be used to prevent onload firing while an event that should block onload is posted.

onload is guaranteed to not fire until either all calls to BlockOnload() have been matched by calls to UnblockOnload() or the load has been stopped altogether (by the user pressing the Stop button, say). onload may fire synchronously from inside the UnblockOnload() call.

Here is the caller graph for this function:

virtual PRBool nsIDocument::CanSavePresentation ( nsIRequest aNewRequest) [pure virtual, inherited]

Check whether it is safe to cache the presentation of this document and all of its subdocuments.

This method checks the following conditions recursively:

  • Some document types, such as plugin documents, cannot be safely cached.
  • If there are any pending requests, we don't allow the presentation to be cached. Ideally these requests would be suspended and resumed, but that is difficult in some cases, such as XMLHttpRequest.
  • If there are any beforeunload or unload listeners, we must fire them for correctness, but this likely puts the document into a state where it would not function correctly if restored.

|aNewRequest| should be the request for a new document which will replace this document in the docshell. The new document's request will be ignored when checking for active requests. If there is no request associated with the new document, this parameter may be null.

Implemented in nsPluginDocument.

Here is the caller graph for this function:

boolean nsIDOM3EventTarget::canTrigger ( in DOMString  type) [inherited]
void nsDocument::CharacterDataChanged ( nsIContent aContent,
PRBool  aAppend 
) [virtual, inherited]

Implements nsIDocument.

Definition at line 2473 of file nsDocument.cpp.

{
  NS_ABORT_IF_FALSE(aContent, "Null content!");

  NS_DOCUMENT_NOTIFY_OBSERVERS(CharacterDataChanged, (this, aContent, aAppend));
}
NS_IMETHODIMP nsXMLDocument::CloneNode ( PRBool  aDeep,
nsIDOMNode **  aReturn 
) [inherited]

Reimplemented in nsXULDocument.

Definition at line 662 of file nsXMLDocument.cpp.

{
  NS_ENSURE_ARG_POINTER(aReturn);
  *aReturn = nsnull;

  nsresult rv;
  nsCOMPtr<nsIDOMDocumentType> docType, newDocType;
  nsCOMPtr<nsIDOMDocument> newDoc;

  // Get the doctype prior to new document construction. There's no big 
  // advantage now to dealing with the doctype separately, but maybe one 
  // day we'll do something significant with the doctype on document creation.
  GetDoctype(getter_AddRefs(docType));
  if (docType) {
    nsCOMPtr<nsIDOMNode> newDocTypeNode;
    rv = docType->CloneNode(PR_TRUE, getter_AddRefs(newDocTypeNode));
    if (NS_FAILED(rv)) return rv;
    newDocType = do_QueryInterface(newDocTypeNode);
  }

  PRBool hasHadScriptObject = PR_TRUE;
  nsIScriptGlobalObject* scriptObject =
    GetScriptHandlingObject(hasHadScriptObject);
  NS_ENSURE_STATE(scriptObject || !hasHadScriptObject);

  // Create an empty document
  nsAutoString emptyStr;
  emptyStr.Truncate();
  rv = NS_NewDOMDocument_MOZILLA_1_8_BRANCH(getter_AddRefs(newDoc), emptyStr,
                                            emptyStr, newDocType, mDocumentURI,
                                            scriptObject, PR_TRUE);
  if (NS_FAILED(rv)) return rv;

  if (aDeep) {
    // If there was a doctype, a new one has already been inserted into the
    // new document. We might have to add nodes before it.
    PRBool beforeDocType = (docType.get() != nsnull);
    nsCOMPtr<nsIDOMNodeList> childNodes;
    
    GetChildNodes(getter_AddRefs(childNodes));
    if (childNodes) {
      PRUint32 index, count;
      childNodes->GetLength(&count);
      for (index=0; index < count; index++) {
        nsCOMPtr<nsIDOMNode> child;
        childNodes->Item(index, getter_AddRefs(child));
        if (child && (child != docType)) {
          nsCOMPtr<nsIDOMNode> newChild;
          rv = child->CloneNode(aDeep, getter_AddRefs(newChild));
          if (NS_FAILED(rv)) return rv;
          
          nsCOMPtr<nsIDOMNode> dummyNode;
          if (beforeDocType) {
            rv = newDoc->InsertBefore(newChild, 
                                      docType, 
                                      getter_AddRefs(dummyNode));
            if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
          }
          else {
            rv = newDoc->AppendChild(newChild, 
                                     getter_AddRefs(dummyNode));
            if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
          }
        }
        else {
          beforeDocType = PR_FALSE;
        }
      }
    }
  }

  return CallQueryInterface(newDoc, aReturn);
}

Here is the call graph for this function:

nsIDOMNode nsIDOMNode::cloneNode ( in boolean  deep) [inherited]
unsigned short nsIDOM3Node::compareDocumentPosition ( in nsIDOMNode  other) raises (DOMException) [inherited]
void nsDocument::ContentAppended ( nsIContent aContainer,
PRInt32  aNewIndexInContainer 
) [virtual, inherited]

Implements nsIDocument.

Reimplemented in nsHTMLDocument, and nsXULDocument.

Definition at line 2490 of file nsDocument.cpp.

{
  NS_ABORT_IF_FALSE(aContainer, "Null container!");

  // XXXdwh There is a hacky ordering dependency between the binding
  // manager and the frame constructor that forces us to walk the
  // observer list in a forward order
  // XXXldb So one should notify the other rather than both being
  // registered.
  NS_DOCUMENT_FORWARD_NOTIFY_OBSERVERS(ContentAppended,
                                       (this, aContainer,
                                        aNewIndexInContainer));
}
void nsDocument::ContentInserted ( nsIContent aContainer,
nsIContent aChild,
PRInt32  aIndexInContainer 
) [virtual, inherited]

Implements nsIDocument.

Reimplemented in nsHTMLDocument, and nsXULDocument.

Definition at line 2506 of file nsDocument.cpp.

{
  NS_ABORT_IF_FALSE(aChild, "Null child!");

  // XXXdwh There is a hacky ordering dependency between the binding manager
  // and the frame constructor that forces us to walk the observer list
  // in a forward order
  // XXXldb So one should notify the other rather than both being
  // registered.
  NS_DOCUMENT_FORWARD_NOTIFY_OBSERVERS(ContentInserted,
                                       (this, aContainer, aChild,
                                        aIndexInContainer));
}
void nsDocument::ContentRemoved ( nsIContent aContainer,
nsIContent aChild,
PRInt32  aIndexInContainer 
) [virtual, inherited]

Implements nsIDocument.

Reimplemented in nsHTMLDocument, and nsXULDocument.

Definition at line 2522 of file nsDocument.cpp.

{
  NS_ABORT_IF_FALSE(aChild, "Null child!");

  NS_DOCUMENT_FORWARD_NOTIFY_OBSERVERS(ContentRemoved,
                                       (this, aContainer, aChild, aIndexInContainer));
}
void nsDocument::ContentStatesChanged ( nsIContent aContent1,
nsIContent aContent2,
PRInt32  aStateMask 
) [virtual, inherited]

Implements nsIDocument.

Definition at line 2481 of file nsDocument.cpp.

{
  NS_DOCUMENT_NOTIFY_OBSERVERS(ContentStatesChanged,
                               (this, aContent1, aContent2, aStateMask));
}
nsIDOMAttr nsIDOMDocument::createAttribute ( in DOMString  name) raises (DOMException) [inherited]
nsIDOMAttr nsIDOMDocument::createAttributeNS ( in DOMString  namespaceURI,
in DOMString  qualifiedName 
) raises (DOMException) [inherited]
nsIDOMCDATASection nsIDOMDocument::createCDATASection ( in DOMString  data) raises (DOMException) [inherited]
nsIDOMComment nsIDOMDocument::createComment ( in DOMString  data) [inherited]
nsresult nsDocument::CreateElem ( nsIAtom aName,
nsIAtom aPrefix,
PRInt32  aNamespaceID,
PRBool  aDocumentDefaultType,
nsIContent **  aResult 
) [virtual, inherited]

Create an element with the specified name, prefix and namespace ID.

If aDocumentDefaultType is true we create an element of the default type for that document (currently XHTML in HTML documents and XUL in XUL documents), otherwise we use the type specified by the namespace ID.

Implements nsIDocument.

Definition at line 4850 of file nsDocument.cpp.

{
  nsresult rv;
#ifdef DEBUG
  nsAutoString qName;
  if (aPrefix) {
    aPrefix->ToString(qName);
    qName.Append(':');
  }
  const char *name;
  aName->GetUTF8String(&name);
  AppendUTF8toUTF16(name, qName);

  rv = nsContentUtils::CheckQName(qName, PR_TRUE);
  NS_ASSERTION(NS_SUCCEEDED(rv),
               "Don't pass invalid names to nsDocument::CreateElem, "
               "check caller.");
#endif

  *aResult = nsnull;
  
  PRInt32 elementType = aDocumentDefaultType ? mDefaultElementType :
                                               aNamespaceID;

  nsCOMPtr<nsINodeInfo> nodeInfo;
  rv = mNodeInfoManager->GetNodeInfo(aName, aPrefix, aNamespaceID,
                                     getter_AddRefs(nodeInfo));
  NS_ENSURE_SUCCESS(rv, rv);

  return CreateElement(nodeInfo, elementType, aResult);
}

Here is the call graph for this function:

nsIDOMElement nsIDOMDocument::createElement ( in DOMString  tagName) raises (DOMException) [inherited]
nsresult nsDocument::CreateElement ( nsINodeInfo aNodeInfo,
PRInt32  aElementType,
nsIContent **  aResult 
) [protected, inherited]

Definition at line 2652 of file nsDocument.cpp.

{
  *aReturn = nsnull;

  nsresult rv = nsContentUtils::CheckQName(aTagName, PR_FALSE);
  NS_ENSURE_SUCCESS(rv, rv);

  NS_ASSERTION(IsCaseSensitive(),
               "nsDocument::CreateElement() called on document that is not "
               "case sensitive. Fix caller, or fix "
               "nsDocument::CreateElement()!");

  nsCOMPtr<nsIAtom> name = do_GetAtom(aTagName);

  nsCOMPtr<nsIContent> content;
  rv = CreateElem(name, nsnull, GetDefaultNamespaceID(), PR_TRUE,
                  getter_AddRefs(content));
  NS_ENSURE_SUCCESS(rv, rv);

  return CallQueryInterface(content, aReturn);
}

Here is the call graph for this function:

nsIDOMElement nsIDOMDocument::createElementNS ( in DOMString  namespaceURI,
in DOMString  qualifiedName 
) raises (DOMException) [inherited]
nsIDOMEntityReference nsIDOMDocument::createEntityReference ( in DOMString  name) raises (DOMException) [inherited]
nsIDOMEvent nsIDOMDocumentEvent::createEvent ( in DOMString  eventType) raises (DOMException) [inherited]
nsIDOMNodeIterator nsIDOMDocumentTraversal::createNodeIterator ( in nsIDOMNode  root,
in unsigned long  whatToShow,
in nsIDOMNodeFilter  filter,
in boolean  entityReferenceExpansion 
) raises (DOMException) [inherited]
nsIDOMProcessingInstruction nsIDOMDocument::createProcessingInstruction ( in DOMString  target,
in DOMString  data 
) raises (DOMException) [inherited]
nsresult nsDocument::CreateShell ( nsPresContext aContext,
nsIViewManager aViewManager,
nsStyleSet aStyleSet,
nsIPresShell **  aInstancePtrResult 
) [virtual, inherited]

Create a new presentation shell that will use aContext for it's presentation context (presentation context's must not be shared among multiple presentation shell's).

Implements nsIDocument.

Reimplemented in nsHTMLDocument.

Definition at line 1658 of file nsDocument.cpp.

{
  // Don't add anything here.  Add it to |doCreateShell| instead.
  // This exists so that subclasses can pass other values for the 4th
  // parameter some of the time.
  return doCreateShell(aContext, aViewManager, aStyleSet,
                       eCompatibility_FullStandards, aInstancePtrResult);
}
nsIDOMText nsIDOMDocument::createTextNode ( in DOMString  data) [inherited]
nsIDOMTreeWalker nsIDOMDocumentTraversal::createTreeWalker ( in nsIDOMNode  root,
in unsigned long  whatToShow,
in nsIDOMNodeFilter  filter,
in boolean  entityReferenceExpansion 
) raises (DOMException) [inherited]
nsICSSLoader* nsIDocument::CSSLoader ( ) const [inline, inherited]

Get this document's CSSLoader.

This is guaranteed to not return null.

Definition at line 442 of file nsIDocument.h.

                                  {
    return mCSSLoader;
  }

Here is the caller graph for this function:

virtual nsresult nsIDocument::DeleteProperty ( nsIAtom aPropertyName) [pure virtual, inherited]

Here is the caller graph for this function:

PRBool nsDocument::DeleteShell ( nsIPresShell aShell) [virtual, inherited]

Implements nsIDocument.

Definition at line 1696 of file nsDocument.cpp.

{
  return mPresShells.RemoveElement(aShell);
}
virtual void nsIDocument::Destroy ( ) [pure virtual, inherited]

Notify the document that its associated ContentViewer is being destroyed.

This releases circular references so that the document can go away. Destroy() is only called on documents that have a content viewer.

Implemented in nsImageDocument.

void nsDocument::DestroyLinkMap ( ) [protected, inherited]

Definition at line 5386 of file nsDocument.cpp.

void nsDocument::DispatchContentLoadedEvents ( ) [protected, inherited]

Definition at line 2348 of file nsDocument.cpp.

{
  // Fire a DOM event notifying listeners that this document has been
  // loaded (excluding images and other loads initiated by this
  // document).
  nsCOMPtr<nsIDOMEvent> event;
  CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));

  nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));

  if (privateEvent) {
    event->InitEvent(NS_LITERAL_STRING("DOMContentLoaded"), PR_TRUE, PR_TRUE);
    privateEvent->SetTrusted(PR_TRUE);

    PRBool defaultActionEnabled;
    DispatchEvent(event, &defaultActionEnabled);
  }

  // If this document is a [i]frame, fire a DOMFrameContentLoaded
  // event on all parent documents notifying that the HTML (excluding
  // other external files such as images and stylesheets) in a frame
  // has finished loading.

  nsCOMPtr<nsIDocShellTreeItem> docShellParent;

  // target_frame is the [i]frame element that will be used as the
  // target for the event. It's the [i]frame whose content is done
  // loading.
  nsCOMPtr<nsIDOMEventTarget> target_frame;

  if (mScriptGlobalObject) {
    nsCOMPtr<nsIDocShellTreeItem> docShellAsItem =
      do_QueryInterface(mScriptGlobalObject->GetDocShell());

    if (docShellAsItem) {
      docShellAsItem->GetSameTypeParent(getter_AddRefs(docShellParent));

      nsCOMPtr<nsIDocument> parent_doc;

      GetDocumentFromDocShellTreeItem(docShellParent,
                                      getter_AddRefs(parent_doc));

      if (parent_doc) {
        target_frame = do_QueryInterface(parent_doc->FindContentForSubDocument(this));
      }
    }
  }

  if (target_frame) {
    while (docShellParent) {
      nsCOMPtr<nsIDocument> ancestor_doc;

      GetDocumentFromDocShellTreeItem(docShellParent,
                                      getter_AddRefs(ancestor_doc));

      if (!ancestor_doc) {
        break;
      }

      nsCOMPtr<nsIDOMDocumentEvent> document_event =
        do_QueryInterface(ancestor_doc);

      if (document_event) {
        document_event->CreateEvent(NS_LITERAL_STRING("Events"),
                                    getter_AddRefs(event));

        privateEvent = do_QueryInterface(event);
      }

      if (event && privateEvent) {
        event->InitEvent(NS_LITERAL_STRING("DOMFrameContentLoaded"), PR_TRUE,
                         PR_TRUE);

        privateEvent->SetTarget(target_frame);
        privateEvent->SetTrusted(PR_TRUE);

        // To dispatch this event we must manually call
        // HandleDOMEvent() on the ancestor document since the target
        // is not in the same document, so the event would never reach
        // the ancestor document if we used the normal event
        // dispatching code.

        nsEvent* innerEvent;
        privateEvent->GetInternalNSEvent(&innerEvent);
        if (innerEvent) {
          nsEventStatus status = nsEventStatus_eIgnore;

          nsIPresShell *shell = ancestor_doc->GetShellAt(0);
          if (shell) {
            nsCOMPtr<nsPresContext> context = shell->GetPresContext();

            if (context) {
              // The event argument to HandleDOMEvent() is inout, and
              // that doesn't mix well with nsCOMPtr's. We'll need to
              // perform some refcounting magic here.
              nsIDOMEvent *tmp_event = event;
              NS_ADDREF(tmp_event);

              ancestor_doc->HandleDOMEvent(context, innerEvent, &tmp_event,
                                           NS_EVENT_FLAG_INIT, &status);

              NS_IF_RELEASE(tmp_event);
            }
          }
        }
      }

      nsCOMPtr<nsIDocShellTreeItem> tmp(docShellParent);
      tmp->GetSameTypeParent(getter_AddRefs(docShellParent));
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

boolean nsIDOMEventTarget::dispatchEvent ( in nsIDOMEvent  evt) raises (DOMException) [inherited]

This method allows the dispatch of events into the implementations event model.

Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

Parameters:
evtSpecifies the event type, behavior, and contextual information to be used in processing the event.
Returns:
Indicates whether any of the listeners which handled the event called preventDefault. If preventDefault was called the value is false, else the value is true.
Exceptions:
UNSPECIFIED_EVENT_TYPE_ERR,:Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as null or an empty string will also trigger this exception.
void nsDocument::DispatchEventToWindow ( nsEvent aEvent) [protected, inherited]

Definition at line 5204 of file nsDocument.cpp.

{
  nsIScriptGlobalObject *sgo = GetScriptGlobalObject();
  if (!sgo)
    return;

  nsEventStatus status = nsEventStatus_eIgnore;

  // There's not always a prescontext that we can use for the event.
  // So, we force creation of a DOMEvent so that it can explicitly targeted.

  nsCOMPtr<nsIEventListenerManager> lm;
  GetListenerManager(getter_AddRefs(lm));
  if (!lm)
    return;

  nsCOMPtr<nsIDOMEvent> domEvt;
  lm->CreateEvent(nsnull, aEvent, EmptyString(), getter_AddRefs(domEvt));
  if (!domEvt)
    return;

  nsCOMPtr<nsIPrivateDOMEvent> privEvt = do_QueryInterface(domEvt);
  NS_ASSERTION(privEvt, "DOM Event objects must implement nsIPrivateDOMEvent");

  privEvt->SetTarget(this);

  nsIDOMEvent *domEvtPtr = domEvt;
  sgo->HandleDOMEvent(nsnull, aEvent, &domEvtPtr, NS_EVENT_FLAG_INIT, &status);

  NS_ASSERTION(domEvtPtr == domEvt, "event modified during dipatch");
}

Here is the call graph for this function:

nsresult nsDocument::doCreateShell ( nsPresContext aContext,
nsIViewManager aViewManager,
nsStyleSet aStyleSet,
nsCompatibility  aCompatMode,
nsIPresShell **  aInstancePtrResult 
) [protected, inherited]

Definition at line 1670 of file nsDocument.cpp.

{
  *aInstancePtrResult = nsnull;
  
  FillStyleSet(aStyleSet);
  
  nsCOMPtr<nsIPresShell> shell;
  nsresult rv = NS_NewPresShell(getter_AddRefs(shell));
  if (NS_FAILED(rv)) {
    return rv;
  }

  rv = shell->Init(this, aContext, aViewManager, aStyleSet, aCompatMode);
  NS_ENSURE_SUCCESS(rv, rv);

  // Note: we don't hold a ref to the shell (it holds a ref to us)
  mPresShells.AppendElement(shell);
  shell.swap(*aInstancePtrResult);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsXMLDocument::EndLoad ( ) [virtual, inherited]

Reimplemented from nsDocument.

Reimplemented in nsXULDocument.

Definition at line 625 of file nsXMLDocument.cpp.

{
  mChannelIsPending = PR_FALSE;
  mLoopingForSyncLoad = PR_FALSE;

  if (mLoadedAsData || mLoadedAsInteractiveData) {
    // Generate a document load event for the case when an XML
    // document was loaded as pure data without any presentation
    // attached to it.
    nsEvent event(PR_TRUE, NS_PAGE_LOAD);
    nsEventStatus status = nsEventStatus_eIgnore;

    nsIScriptGlobalObject* sgo = nsnull;
    nsCOMPtr<nsIScriptGlobalObjectOwner> container =
      do_QueryReferent(mDocumentContainer);
    if (container) {
      sgo = container->GetScriptGlobalObject();
    }

    nsCxPusher pusher;
    if (pusher.Push(sgo)) {
      HandleDOMEvent(nsnull, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
    }
  }    
  nsDocument::EndLoad();  
}

Here is the call graph for this function:

void nsDocument::EndUpdate ( nsUpdateType  aUpdateType) [virtual, inherited]

Implements nsIDocument.

Definition at line 2304 of file nsDocument.cpp.

{
  NS_DOCUMENT_NOTIFY_OBSERVERS(EndUpdate, (this, aUpdateType));

  --mUpdateNestLevel;
  if (mUpdateNestLevel == 0) {
    // This set of updates may have created XBL bindings.  Let the
    // binding manager know we're done.
    nsIBindingManager* bm = mBindingManager;
    NS_STATIC_CAST(nsBindingManager*, bm)->EndOutermostUpdate();
  }

  if (mScriptLoader) {
    NS_STATIC_CAST(nsScriptLoader*,
                   NS_STATIC_CAST(nsIScriptLoader*,
                                  mScriptLoader))->RemoveExecuteBlocker();
  }
}
void nsDocument::EnsureCatalogStyleSheet ( const char *  aStyleSheetURI) [virtual, inherited]

Implements nsIDocument.

Definition at line 2120 of file nsDocument.cpp.

{
  nsICSSLoader* cssLoader = CSSLoader();
  PRBool enabled;
  if (NS_SUCCEEDED(cssLoader->GetEnabled(&enabled)) && enabled) {
    PRInt32 sheetCount = GetNumberOfCatalogStyleSheets();
    for (PRInt32 i = 0; i < sheetCount; i++) {
      nsIStyleSheet* sheet = GetCatalogStyleSheetAt(i);
      NS_ASSERTION(sheet, "unexpected null stylesheet in the document");
      if (sheet) {
        nsCOMPtr<nsIURI> uri;
        sheet->GetSheetURI(getter_AddRefs(uri));
        nsCAutoString uriStr;
        uri->GetSpec(uriStr);
        if (uriStr.Equals(aStyleSheetURI))
          return;
      }
    }

    nsCOMPtr<nsIURI> uri;
    NS_NewURI(getter_AddRefs(uri), aStyleSheetURI);
    if (uri) {
      nsCOMPtr<nsICSSLoader_MOZILLA_1_8_BRANCH> loader = do_QueryInterface(cssLoader);
      nsCOMPtr<nsICSSStyleSheet> sheet;
      loader->LoadSheetSync(uri, PR_TRUE, getter_AddRefs(sheet));
      if (sheet) {
        BeginUpdate(UPDATE_STYLE);
        AddCatalogStyleSheet(sheet);
        EndUpdate(UPDATE_STYLE);
      }
    }
  }
}

Here is the call graph for this function:

virtual void nsIDocument::EnumerateSubDocuments ( nsSubDocEnumFunc  aCallback,
void aData 
) [pure virtual, inherited]

Here is the caller graph for this function:

nsIDOMRange nsIDOMXMLDocument::evaluateFIXptr ( in DOMString  expression) [inherited]

Evaluate FIXptr expression.

FIXptr is a W3C NOTE, see

http://lists.w3.org/Archives/Public/www-xml-linking-comments/2001AprJun/att-0074/01-NOTE-FIXptr-20010425.htm

Parameters:
expressionFIXptr string.
Returns:
The range object that results from evaluation
nsIXPointerResult nsIDOMXMLDocument::evaluateXPointer ( in DOMString  expression) [inherited]

Evaluate XPointer expression.

void nsDocument::FillStyleSet ( nsStyleSet aStyleSet) [protected, inherited]

Definition at line 1243 of file nsDocument.cpp.

{
  NS_PRECONDITION(aStyleSet, "Must have a style set");
  NS_PRECONDITION(aStyleSet->SheetCount(nsStyleSet::ePresHintSheet) == 0,
                  "Style set already has a preshint sheet?");
  NS_PRECONDITION(aStyleSet->SheetCount(nsStyleSet::eHTMLPresHintSheet) == 0,
                  "Style set already has a HTML preshint sheet?");
  NS_PRECONDITION(aStyleSet->SheetCount(nsStyleSet::eDocSheet) == 0,
                  "Style set already has document sheets?");
  NS_PRECONDITION(aStyleSet->SheetCount(nsStyleSet::eStyleAttrSheet) == 0,
                  "Style set already has style attr sheets?");
  NS_PRECONDITION(mStyleAttrStyleSheet, "No style attr stylesheet?");
  NS_PRECONDITION(mAttrStyleSheet, "No attr stylesheet?");
  
  aStyleSet->AppendStyleSheet(GetAttrSheetType(), mAttrStyleSheet);

  aStyleSet->AppendStyleSheet(nsStyleSet::eStyleAttrSheet,
                              mStyleAttrStyleSheet);

  PRInt32 i;
  for (i = mStyleSheets.Count() - 1; i >= 0; --i) {
    nsIStyleSheet* sheet = mStyleSheets[i];
    PRBool sheetApplicable;
    sheet->GetApplicable(sheetApplicable);
    if (sheetApplicable) {
      aStyleSet->AddDocStyleSheet(sheet, this);
    }
  }

  for (i = mCatalogSheets.Count() - 1; i >= 0; --i) {
    nsIStyleSheet* sheet = mCatalogSheets[i];
    PRBool sheetApplicable;
    sheet->GetApplicable(sheetApplicable);
    if (sheetApplicable) {
      aStyleSet->AppendStyleSheet(nsStyleSet::eAgentSheet, sheet);
    }
  }
}

Here is the call graph for this function:

nsIContent * nsDocument::FindContentForSubDocument ( nsIDocument aDocument) const [virtual, inherited]

Find the content node for which aDocument is a sub document.

Implements nsIDocument.

Definition at line 1841 of file nsDocument.cpp.

Here is the call graph for this function:

void nsDocument::FlushPendingNotifications ( mozFlushType  aType) [virtual, inherited]

Flush notifications for this document and its parent documents (since those may affect the layout of this one).

Implements nsIDocument.

Reimplemented in nsHTMLDocument.

Definition at line 4427 of file nsDocument.cpp.

{
  if (aType == (aType & (Flush_Content | Flush_SinkNotifications)) ||
      !mScriptGlobalObject) {
    // Nothing to do here
    return;
  }

  // We should be able to replace all this nsIDocShell* code with code
  // that uses mParentDocument, but mParentDocument is never set in
  // the current code!

  nsCOMPtr<nsIDocShellTreeItem> docShellAsItem =
    do_QueryInterface(mScriptGlobalObject->GetDocShell());

  if (docShellAsItem) {
    nsCOMPtr<nsIDocShellTreeItem> docShellParent;
    docShellAsItem->GetSameTypeParent(getter_AddRefs(docShellParent));

    nsCOMPtr<nsIDOMWindow> win(do_GetInterface(docShellParent));

    if (win) {
      nsCOMPtr<nsIDOMDocument> dom_doc;
      win->GetDocument(getter_AddRefs(dom_doc));

      nsCOMPtr<nsIDocument> doc(do_QueryInterface(dom_doc));

      // If we have a parent we must flush the parent too to ensure that our
      // container is reflown if its size was changed.  But if it's not safe to
      // flush ourselves, then don't flush the parent, since that can cause
      // things like resizes of our frame's widget, which we can't handle while
      // flushing is unsafe.
      if (doc && IsSafeToFlush()) {
        doc->FlushPendingNotifications(aType);
      }
    }
  }

  PRInt32 i, count = mPresShells.Count();

  for (i = 0; i < count; i++) {
    nsCOMPtr<nsIPresShell> shell =
      NS_STATIC_CAST(nsIPresShell*, mPresShells[i]);

    if (shell) {
      shell->FlushPendingNotifications(aType);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void nsIDocument::ForgetLink ( nsIContent aContent) [pure virtual, inherited]

Notification that an element is a link and its URI might have been changed or the element removed.

If the element is still a link relevant to style, then someone must ensure that AddStyleRelevantLink is (eventually) called on it again.

Here is the caller graph for this function:

Definition at line 552 of file nsIDocument.h.

  {
    return mNextContentID++;
  }

Here is the caller graph for this function:

nsIDOMElement nsIDOMDocumentXBL::getAnonymousElementByAttribute ( in nsIDOMElement  elt,
in DOMString  attrName,
in DOMString  attrValue 
) [inherited]
virtual nsHTMLStyleSheet* nsDocument::GetAttributeStyleSheet ( ) const [inline, virtual, inherited]

Get this document's attribute stylesheet.

May return null if there isn't one.

Implements nsIDocument.

Definition at line 527 of file nsDocument.h.

                                                           {
    return mAttrStyleSheet;
  }
nsStyleSet::sheetType nsDocument::GetAttrSheetType ( ) [protected, virtual, inherited]

Reimplemented in nsHTMLDocument.

Definition at line 1237 of file nsDocument.cpp.

void nsDocument::GetBaseTarget ( nsAString &  aBaseTarget) const [virtual, inherited]

Get/Set the base target of a link in a document.

Implements nsIDocument.

Definition at line 1424 of file nsDocument.cpp.

{
  aBaseTarget.Assign(mBaseTarget);
}
nsIURI* nsIDocument::GetBaseURI ( ) const [inline, inherited]

Return the base URI for relative URIs in the document (the document uri unless it's overridden by SetBaseURI, HTML <base> tags, etc.).

The returned URI could be null if there is no document URI.

Definition at line 183 of file nsIDocument.h.

Here is the caller graph for this function:

PRBool nsIDocument::GetBidiEnabled ( ) const [inline, inherited]

Check if the document contains bidi data.

If so, we have to apply the Unicode Bidi Algorithm.

Definition at line 258 of file nsIDocument.h.

  {
    return mBidiEnabled;
  }

Here is the caller graph for this function:

nsIStyleSheet * nsDocument::GetCatalogStyleSheetAt ( PRInt32  aIndex) const [virtual, inherited]

Implements nsIDocument.

Definition at line 2094 of file nsDocument.cpp.

{
  NS_ENSURE_TRUE(0 <= aIndex && aIndex < mCatalogSheets.Count(), nsnull);
  return mCatalogSheets[aIndex];
}
virtual nsIChannel* nsDocument::GetChannel ( ) const [inline, virtual, inherited]

Get the channel that was passed to StartDocumentLoad or Reset for this document.

Note that this may be null in some cases (eg if StartDocumentLoad or Reset were never called)

Implements nsIDocument.

Definition at line 519 of file nsDocument.h.

                                         {
    return mChannel;
  }
nsIContent * nsDocument::GetChildAt ( PRUint32  aIndex) const [virtual, inherited]

Get the direct children of the document - content in the prolog, the root content and content in the epilog.

Implements nsIDocument.

Definition at line 1890 of file nsDocument.cpp.

{
  return mChildren.GetSafeChildAt(aIndex);
}
PRUint32 nsDocument::GetChildCount ( ) const [virtual, inherited]

Implements nsIDocument.

Definition at line 1902 of file nsDocument.cpp.

{
  return mChildren.ChildCount();
}
already_AddRefed<nsISupports> nsIDocument::GetContainer ( ) const [inline, inherited]

Get the container (docshell) for this document.

Definition at line 593 of file nsIDocument.h.

  {
    nsISupports* container = nsnull;
    if (mDocumentContainer)
      CallQueryReferent(mDocumentContainer.get(), &container);

    return container;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIDocument::GetContentLanguage ( nsAString &  aContentLanguage) const [inline, inherited]

Return the language of this document.

Definition at line 246 of file nsIDocument.h.

  {
    CopyASCIItoUCS2(mContentLanguage, aContentLanguage);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHOD nsIDocument::GetContentType ( nsAString &  aContentType) [pure virtual, inherited]

Get the Content-Type of this document.

(This will always return NS_OK, but has this signature to be compatible with nsIDOMNSDocument::GetContentType())

Implemented in nsXULDocument.

NS_IMETHODIMP nsDocument::GetCurrentRadioButton ( const nsAString &  aName,
nsIDOMHTMLInputElement **  aRadio 
) [virtual, inherited]

Get the current radio button in a group.

Parameters:
aNamethe group name
aRadiothe currently selected radio button [OUT]

Implements nsIRadioGroupContainer.

Definition at line 4600 of file nsDocument.cpp.

{
  nsRadioGroupStruct* radioGroup = nsnull;
  GetRadioGroup(aName, &radioGroup);
  if (radioGroup) {
    *aRadio = radioGroup->mSelectedRadioButton;
    NS_IF_ADDREF(*aRadio);
  }

  return NS_OK;
}
virtual PRInt32 nsDocument::GetDefaultNamespaceID ( ) const [inline, protected, virtual, inherited]

Returns the default namespace ID used for elements created in this document.

Implements nsIDocument.

Reimplemented in nsHTMLDocument, and nsXULDocument.

Definition at line 792 of file nsDocument.h.

  {
    return kNameSpaceID_None;
  };

Return a standard name for the document's character set.

This will trigger a startDocumentLoad if necessary to answer the question.

Definition at line 200 of file nsIDocument.h.

  {
    return mCharacterSet;
  }

Here is the caller graph for this function:

PRInt32 nsIDocument::GetDocumentCharacterSetSource ( ) const [inline, inherited]

Definition at line 211 of file nsIDocument.h.

  {
    return mCharacterSetSource;
  }

Return the LoadGroup for the document.

May return null.

Definition at line 169 of file nsIDocument.h.

  {
    nsILoadGroup *group = nsnull;
    if (mDocumentLoadGroup)
      CallQueryReferent(mDocumentLoadGroup.get(), &group);

    return group;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

const nsAFlatString& nsIDocument::GetDocumentTitle ( ) const [inline, inherited]

Return the title of the document.

May return null.

Definition at line 139 of file nsIDocument.h.

  {
    return mDocumentTitle;
  }

Here is the caller graph for this function:

nsIURI* nsIDocument::GetDocumentURI ( ) const [inline, inherited]

Return the URI for the document.

May return null.

Definition at line 147 of file nsIDocument.h.

  {
    return mDocumentURI;
  }

Here is the caller graph for this function:

NS_IMETHODIMP nsXMLDocument::GetElementById ( const nsAString &  aElementId,
nsIDOMElement **  aReturn 
) [inherited]

Reimplemented in nsXULDocument.

Definition at line 775 of file nsXMLDocument.cpp.

{
  NS_ENSURE_ARG_POINTER(aReturn);
  *aReturn = nsnull;

  NS_WARN_IF_FALSE(!aElementId.IsEmpty(), "getElementById(\"\"), fix caller?");
  if (aElementId.IsEmpty())
    return NS_OK;

  // If we tried to load a document and something went wrong, we might not have
  // root content. This can happen when you do document.load() and the document
  // to load is not XML, for example.
  if (!mRootContent)
    return NS_OK;

  // XXX For now, we do a brute force search of the content tree.
  // We should come up with a more efficient solution.
  // Note that content is *not* refcounted here, so do *not* release it!
  nsIContent *content = MatchElementId(mRootContent,
                                       NS_ConvertUCS2toUTF8(aElementId),
                                       aElementId);

  if (!content) {
    return NS_OK;
  }

  return CallQueryInterface(content, aReturn);
}

Here is the call graph for this function:

nsIDOMElement nsIDOMDocument::getElementById ( in DOMString  elementId) [inherited]
nsIDOMNodeList nsIDOMDocument::getElementsByTagName ( in DOMString  tagname) [inherited]
nsIDOMNodeList nsIDOMDocument::getElementsByTagNameNS ( in DOMString  namespaceURI,
in DOMString  localName 
) [inherited]
nsISupports nsIDOM3Node::getFeature ( in DOMString  feature,
in DOMString  version 
) [inherited]
void nsDocument::GetHeaderData ( nsIAtom aHeaderField,
nsAString &  aData 
) const [virtual, inherited]

Access HTTP header data (this may also get set from other sources, like HTML META tags).

Implements nsIDocument.

Definition at line 1526 of file nsDocument.cpp.

{
  aData.Truncate();
  const nsDocHeaderData* data = mHeaderData;
  while (data) {
    if (data->mField == aHeaderField) {
      aData = data->mData;

      break;
    }
    data = data->mNext;
  }
}
PRInt32 nsDocument::GetIndexOfStyleSheet ( nsIStyleSheet aSheet) const [virtual, inherited]

Get the index of a particular stylesheet.

This will always consider the "special" sheets as part of the sheet list.

Parameters:
aSheetthe sheet to get the index of
Returns:
aIndex the index of the sheet in the full list

Implements nsIDocument.

Definition at line 1938 of file nsDocument.cpp.

{
  return mStyleSheets.IndexOf(aSheet);
}
virtual nsIHTMLCSSStyleSheet* nsDocument::GetInlineStyleSheet ( ) const [inline, virtual, inherited]

Get this document's inline style sheet.

May return null if there isn't one

Implements nsIDocument.

Definition at line 535 of file nsDocument.h.

                                                            {
    return mStyleAttrStyleSheet;
  }
void nsIInterfaceRequestor::getInterface ( in nsIIDRef  uuid,
[iid_is(uuid), retval] out nsQIResult  result 
) [inherited]

Retrieves the specified interface pointer.

Parameters:
uuidThe IID of the interface being requested.
result[out] The interface pointer to be filled in if the interface is accessible.
Returns:
NS_OK - interface was successfully returned. NS_NOINTERFACE - interface not accessible. NS_ERROR* - method failure.
virtual already_AddRefed<nsILayoutHistoryState> nsIDocument::GetLayoutHistoryState ( ) const [pure virtual, inherited]

Get the layout history state that should be used to save and restore state for nodes in this document.

This may return null; if that happens state saving and restoration is not possible.

Here is the caller graph for this function:

nsILineBreaker * nsDocument::GetLineBreaker ( ) [virtual, inherited]

Return the Line Breaker for the document.

Implements nsIDocument.

Definition at line 1480 of file nsDocument.cpp.

Here is the call graph for this function:

nsresult nsDocument::GetListenerManager ( nsIEventListenerManager **  aInstancePtrResult) [virtual, inherited]

Implements nsIDOMEventReceiver.

Definition at line 4141 of file nsDocument.cpp.

{
  if (mListenerManager) {
    *aInstancePtrResult = mListenerManager;
    NS_ADDREF(*aInstancePtrResult);

    return NS_OK;
  }

  nsresult rv = NS_NewEventListenerManager(getter_AddRefs(mListenerManager));
  NS_ENSURE_SUCCESS(rv, rv);

  mListenerManager->SetListenerTarget(NS_STATIC_CAST(nsIDocument *,this));

  *aInstancePtrResult = mListenerManager;
  NS_ADDREF(*aInstancePtrResult);

  return NS_OK;
}

Here is the call graph for this function:

nsresult nsXMLDocument::GetLoadGroup ( nsILoadGroup **  aLoadGroup) [protected, virtual, inherited]

Definition at line 348 of file nsXMLDocument.cpp.

{
  NS_ENSURE_ARG_POINTER(aLoadGroup);
  *aLoadGroup = nsnull;

  if (mScriptContext) {
    nsCOMPtr<nsIDOMWindow> window =
      do_QueryInterface(mScriptContext->GetGlobalObject());

    if (window) {
      nsCOMPtr<nsIDOMDocument> domdoc;
      window->GetDocument(getter_AddRefs(domdoc));
      nsCOMPtr<nsIDocument> doc = do_QueryInterface(domdoc);
      if (doc) {
        *aLoadGroup = doc->GetDocumentLoadGroup().get(); // already_AddRefed
      }
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsDocument::GetNextRadioButton ( const nsAString &  aName,
const PRBool  aPrevious,
nsIDOMHTMLInputElement aFocusedRadio,
nsIDOMHTMLInputElement **  aRadio 
) [virtual, inherited]

Get the next/prev radio button in a group.

Parameters:
aNamethe group name
aPrevious,truegets previous radio button, false gets next
aFocusedRadiothe currently focused radio button
aRadiothe currently selected radio button [OUT]

Implements nsIRadioGroupContainer.

Definition at line 4640 of file nsDocument.cpp.

{
  // XXX Can we combine the HTML radio button method impls of 
  //     nsDocument and nsHTMLFormControl?
  // XXX Why is HTML radio button stuff in nsDocument, as 
  //     opposed to nsHTMLDocument?
  *aRadioOut = nsnull;

  nsRadioGroupStruct* radioGroup = nsnull;
  GetRadioGroup(aName, &radioGroup);
  if (!radioGroup) {
    return NS_ERROR_FAILURE;
  }

  // Return the radio button relative to the focused radio button.
  // If no radio is focused, get the radio relative to the selected one.
  nsCOMPtr<nsIDOMHTMLInputElement> currentRadio;
  if (aFocusedRadio) {
    currentRadio = aFocusedRadio;
  }
  else {
    currentRadio = radioGroup->mSelectedRadioButton;
    if (!currentRadio) {
      return NS_ERROR_FAILURE;
    }
  }
  nsCOMPtr<nsIFormControl> radioControl(do_QueryInterface(currentRadio));
  PRInt32 index = radioGroup->mRadioButtons.IndexOf(radioControl);
  if (index < 0) {
    return NS_ERROR_FAILURE;
  }

  PRInt32 numRadios = radioGroup->mRadioButtons.Count();
  PRBool disabled;
  nsCOMPtr<nsIDOMHTMLInputElement> radio;
  do {
    if (aPrevious) {
      if (--index < 0) {
        index = numRadios -1;
      }
    }
    else if (++index >= numRadios) {
      index = 0;
    }
    radio = do_QueryInterface(NS_STATIC_CAST(nsIFormControl*, 
                              radioGroup->mRadioButtons.ElementAt(index)));
    NS_ASSERTION(radio, "mRadioButtons holding a non-radio button");
    radio->GetDisabled(&disabled);
  } while (disabled && radio != currentRadio);

  NS_IF_ADDREF(*aRadioOut = radio);
  return NS_OK;
}

Here is the call graph for this function:

PRInt32 nsDocument::GetNumberOfCatalogStyleSheets ( ) const [virtual, inherited]

Just like the style sheet API, but for "catalog" sheets, extra sheets inserted at the UA level.

Implements nsIDocument.

Definition at line 2088 of file nsDocument.cpp.

{
  return mCatalogSheets.Count();
}
PRUint32 nsDocument::GetNumberOfShells ( ) const [virtual, inherited]

Implements nsIDocument.

Definition at line 1702 of file nsDocument.cpp.

{
  return mPresShells.Count();
}

Here is the caller graph for this function:

PRInt32 nsDocument::GetNumberOfStyleSheets ( ) const [virtual, inherited]

Get the style sheets owned by this document.

These are ordered, highest priority last

Implements nsIDocument.

Definition at line 1925 of file nsDocument.cpp.

{
  return mStyleSheets.Count();
}
nsIDocument* nsIDocument::GetParentDocument ( ) const [inline, inherited]

Return the parent document of this document.

Will return null unless this document is within a compound document and has a parent. Note that this parent chain may cross chrome boundaries.

Definition at line 307 of file nsIDocument.h.

  {
    return mParentDocument;
  }

Here is the caller graph for this function:

PRUint32 nsIDocument::GetPartID ( ) const [inline, inherited]

Return the ID used to identify this part of the multipart document.

Definition at line 684 of file nsIDocument.h.

                             {
    return mPartID;
  }

Here is the caller graph for this function:

NS_IMETHODIMP nsDocument::GetPositionInGroup ( nsIDOMHTMLInputElement aRadio,
PRInt32 aPositionIndex,
PRInt32 aItemsInGroup 
) [virtual, inherited]

Get the radio group position and the number of radio buttons in the group.

that the radio button is in. If the radio button not grouped with any other radio buttons this method will treat it as being in a group of one.

Parameters:
aRadioradio button's pointer
aPositionIndexout indicates 0-indexed position in the radio group, or just 0 if a group cannot be found
aItemsInGroupthe number of radio buttons in the group

Implements nsIRadioGroupContainer.

Definition at line 4614 of file nsDocument.cpp.

{
  *aPositionIndex = 0;
  *aItemsInGroup = 1;
  nsAutoString name;
  aRadio->GetName(name);
  if (name.IsEmpty()) {
    return NS_OK;
  }

  nsRadioGroupStruct* radioGroup = nsnull;
  nsresult rv = GetRadioGroup(name, &radioGroup);
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsIFormControl> radioControl(do_QueryInterface(aRadio));
  NS_ASSERTION(radioControl, "Radio button should implement nsIFormControl");
  *aPositionIndex = radioGroup->mRadioButtons.IndexOf(radioControl);
  NS_ASSERTION(*aPositionIndex >= 0, "Radio button not found in its own group");
  *aItemsInGroup = radioGroup->mRadioButtons.Count();

  return NS_OK;
}

Here is the call graph for this function:

nsIPrincipal * nsDocument::GetPrincipal ( ) [virtual, inherited]

Return the principal responsible for this document.

Implements nsIDocument.

Reimplemented in nsXULDocument.

Definition at line 1345 of file nsDocument.cpp.

{
  if (!mPrincipal) {
    nsIScriptSecurityManager *securityManager =
      nsContentUtils::GetSecurityManager();

    if (!securityManager) {
      return nsnull;
    }

    NS_WARN_IF_FALSE(mDocumentURI, "no URI!");
    nsresult rv =
      securityManager->GetCodebasePrincipal(mDocumentURI,
                                            getter_AddRefs(mPrincipal));

    if (NS_FAILED(rv)) {
      return nsnull;
    }
  }

  return mPrincipal;
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void* nsIDocument::GetProperty ( nsIAtom aPropertyName,
nsresult aStatus = nsnull 
) const [pure virtual, inherited]

Here is the caller graph for this function:

nsresult nsDocument::GetRadioGroup ( const nsAString &  aName,
nsRadioGroupStruct **  aRadioGroup 
) [inherited]

Definition at line 4568 of file nsDocument.cpp.

{
  nsStringKey key(aName);
  nsRadioGroupStruct *radioGroup =
    NS_STATIC_CAST(nsRadioGroupStruct *, mRadioGroups.Get(&key));

  if (!radioGroup) {
    radioGroup = new nsRadioGroupStruct();
    NS_ENSURE_TRUE(radioGroup, NS_ERROR_OUT_OF_MEMORY);
    mRadioGroups.Put(&key, radioGroup);
  }

  *aRadioGroup = radioGroup;

  return NS_OK;
}
nsIContent* nsIDocument::GetRootContent ( ) const [inline, inherited]

Return the root content object for this document.

Definition at line 339 of file nsIDocument.h.

  {
    return mRootContent;
  }

Here is the caller graph for this function:

nsIDOMGCParticipant * nsDocument::GetSCCIndex ( ) [virtual, inherited]

Get a reference node for what is known to be a strongly connected component of nsIDOMGCParticipants.

For example, DOM trees are strongly connected, so can return the root node to greatly reduce the number of nodes on which we need to run graph algorithms.

Note that it's acceptable for nodes in a single strongly connected component to return different values for GetSCCIndex, as long as those two values claim that they're reachable from each other in AppendReachableList.

Implements nsIDOMGCParticipant.

Definition at line 3445 of file nsDocument.cpp.

{
  return this;
}

Get the object that is used as the scope for all of the content wrappers whose owner document is this document.

Unlike the script global object, this will only return null when the global object for this document is truly gone. Use this object when you're trying to find a content wrapper in XPConnect.

Implements nsIDocument_MOZILLA_1_8_0_BRANCH.

Definition at line 2174 of file nsDocument.cpp.

Here is the call graph for this function:

Implements nsIDocument.

Definition at line 4478 of file nsDocument.cpp.

{
  if (!mScriptEventManager) {
    mScriptEventManager = new nsScriptEventManager(this);
    // automatically AddRefs
  }

  return mScriptEventManager;
}
nsIScriptGlobalObject * nsDocument::GetScriptGlobalObject ( ) const [virtual, inherited]

Set the object from which a document can get a script context.

This is the context within which all scripts (during document creation and during event handling) will run.

Implements nsIDocument.

Definition at line 2155 of file nsDocument.cpp.

{
   // If we're going away, we've already released the reference to our
   // ScriptGlobalObject.  We can, however, try to obtain it for the
   // caller through our docshell.

   if (mIsGoingAway) {
     nsCOMPtr<nsIInterfaceRequestor> requestor =
       do_QueryReferent(mDocumentContainer);
     if (requestor) {
       nsCOMPtr<nsIScriptGlobalObject> globalObject = do_GetInterface(requestor);
       return globalObject;
     }
   }

   return mScriptGlobalObject;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIScriptGlobalObject * nsDocument::GetScriptHandlingObject ( PRBool aHasHadScriptHandlingObject) const [virtual, inherited]

Get/set the object from which the context for the event/script handling can be got.

Normally GetScriptHandlingObject() returns the same object as GetScriptGlobalObject(), but if the document is loaded as data, non-null may be returned, even if GetScriptGlobalObject() returns null. aHasHadScriptHandlingObject is set PR_TRUE if document has had the object for event/script handling. Do not process any events/script if the method returns null, but aHasHadScriptHandlingObject is true.

Implements nsIDocument_MOZILLA_1_8_BRANCH3.

Definition at line 2210 of file nsDocument.cpp.

{
  aHasHadScriptHandlingObject = mHasHadScriptHandlingObject;
  if (mScriptGlobalObject) {
    return mScriptGlobalObject;
  }

  nsCOMPtr<nsIScriptGlobalObject> scriptHandlingObject =
    do_QueryReferent(mScriptObject);
  nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(scriptHandlingObject);
  if (win) {
    NS_ASSERTION(win->IsInnerWindow(), "Should have inner window here!");
    nsPIDOMWindow* outer = win->GetOuterWindow();
    if (!outer || outer->GetCurrentInnerWindow() != win) {
      NS_WARNING("Wrong inner/outer window combination!");
      return nsnull;
    }
  }
  return scriptHandlingObject;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIScriptLoader * nsDocument::GetScriptLoader ( ) [virtual, inherited]

Get the script loader for this document.

Implements nsIDocument.

Definition at line 2256 of file nsDocument.cpp.

{
  return mScriptLoader;
}

Here is the caller graph for this function:

nsISupports* nsIDocument::GetSecurityInfo ( ) [inline, inherited]

Get the security info (i.e.

SSL state etc) that the document got from the channel/document that created the content of the document.

See also:
nsIChannel

Definition at line 649 of file nsIDocument.h.

  {
    return mSecurityInfo;
  }
nsIPresShell * nsDocument::GetShellAt ( PRUint32  aIndex) const [virtual, inherited]

Implements nsIDocument.

Definition at line 1708 of file nsDocument.cpp.

{
  return (nsIPresShell*)mPresShells.SafeElementAt(aIndex);
}

Here is the caller graph for this function:

nsIStyleSheet * nsDocument::GetStyleSheetAt ( PRInt32  aIndex) const [virtual, inherited]

Get a particular stylesheet.

Parameters:
aIndexthe index the stylesheet lives at. This is zero-based
Returns:
the stylesheet at aIndex. Null if aIndex is out of range.
Exceptions:
noexceptions

Implements nsIDocument.

Definition at line 1931 of file nsDocument.cpp.

{
  NS_ENSURE_TRUE(0 <= aIndex && aIndex < mStyleSheets.Count(), nsnull);
  return mStyleSheets[aIndex];
}
nsIDocument * nsDocument::GetSubDocumentFor ( nsIContent aContent) const [virtual, inherited]

Get the sub document for aContent.

Implements nsIDocument.

Definition at line 1808 of file nsDocument.cpp.

Here is the call graph for this function:

NS_IMETHODIMP nsDocument::GetSystemEventGroup ( nsIDOMEventGroup **  aGroup) [virtual, inherited]

Implements nsIDOMEventReceiver.

Definition at line 4169 of file nsDocument.cpp.

{
  nsCOMPtr<nsIEventListenerManager> manager;
  if (NS_SUCCEEDED(GetListenerManager(getter_AddRefs(manager))) && manager) {
    return manager->GetSystemEventGroupLM(aGroup);
  }

  return NS_ERROR_FAILURE;
}

Here is the call graph for this function:

nsIVariant nsIDOM3Node::getUserData ( in DOMString  key) [inherited]
nsPIDOMWindow * nsDocument::GetWindow ( ) [virtual, inherited]

Return the window containing the document (the outer window).

Implements nsIDocument.

Definition at line 2244 of file nsDocument.cpp.

{
  nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(GetScriptGlobalObject()));

  if (!win) {
    return nsnull;
  }

  return win->GetOuterWindow();
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIWordBreaker * nsDocument::GetWordBreaker ( ) [virtual, inherited]

Implements nsIDocument.

Definition at line 1503 of file nsDocument.cpp.

{
  if (!mWordBreaker) {
    // no word breaker, find a default one
    nsresult rv;
    nsCOMPtr<nsIWordBreakerFactory> wbf =
      do_GetService(NS_LWBRK_CONTRACTID, &rv);
    NS_ENSURE_SUCCESS(rv, nsnull);

    wbf->GetBreaker(EmptyString(), getter_AddRefs(mWordBreaker));
    NS_ENSURE_TRUE(wbf, nsnull);
  }

  return mWordBreaker;
}

Here is the call graph for this function:

void nsDocument::GetXMLDeclaration ( nsAString &  aVersion,
nsAString &  aEncoding,
nsAString &  Standalone 
) [virtual, inherited]

Implements nsIDocument.

Definition at line 4514 of file nsDocument.cpp.

{
  aVersion.Truncate();
  aEncoding.Truncate();
  aStandalone.Truncate();

  if (!(mXMLDeclarationBits & XML_DECLARATION_BITS_DECLARATION_EXISTS)) {
    return;
  }

  // always until we start supporting 1.1 etc.
  aVersion.AssignLiteral("1.0");

  if (mXMLDeclarationBits & XML_DECLARATION_BITS_ENCODING_EXISTS) {
    // This is what we have stored, not necessarily what was written
    // in the original
    GetCharacterSet(aEncoding);
  }

  if (mXMLDeclarationBits & XML_DECLARATION_BITS_STANDALONE_EXISTS) {
    if (mXMLDeclarationBits & XML_DECLARATION_BITS_STANDALONE_YES) {
      aStandalone.AssignLiteral("yes");
    } else {
      aStandalone.AssignLiteral("no");
    }
  }
}
nsresult nsDocument::HandleDOMEvent ( nsPresContext aPresContext,
nsEvent aEvent,
nsIDOMEvent **  aDOMEvent,
PRUint32  aFlags,
nsEventStatus aEventStatus 
) [virtual, inherited]

Implements nsIDocument.

Reimplemented in nsXULDocument.

Definition at line 4180 of file nsDocument.cpp.

{
  // Make sure to tell the event that dispatch has started.
  NS_MARK_EVENT_DISPATCH_STARTED(aEvent);

  nsresult mRet = NS_OK;
  PRBool externalDOMEvent = PR_FALSE;

  nsIDOMEvent* domEvent = nsnull;

  if (NS_EVENT_FLAG_INIT & aFlags) {
    if (aDOMEvent) {
      if (*aDOMEvent) {
        externalDOMEvent = PR_TRUE;
      }
    }
    else {
      aDOMEvent = &domEvent;
    }
    aEvent->flags |= aFlags;
    aFlags &= ~(NS_EVENT_FLAG_CANT_BUBBLE | NS_EVENT_FLAG_CANT_CANCEL);
    aFlags |= NS_EVENT_FLAG_BUBBLE | NS_EVENT_FLAG_CAPTURE;
  }

  // Capturing stage
  if (NS_EVENT_FLAG_CAPTURE & aFlags && nsnull != mScriptGlobalObject) {
    mScriptGlobalObject->HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
                                        aFlags & NS_EVENT_CAPTURE_MASK,
                                        aEventStatus);
  }

  // Local handling stage
  // Check for null mDOMSlots or ELM, check if we're a non-bubbling
  // event in the bubbling state (bubbling state is indicated by the
  // presence of the NS_EVENT_FLAG_BUBBLE flag and not the
  // NS_EVENT_FLAG_INIT).
  if (mListenerManager &&
      !(NS_EVENT_FLAG_CANT_BUBBLE & aEvent->flags &&
        NS_EVENT_FLAG_BUBBLE & aFlags && !(NS_EVENT_FLAG_INIT & aFlags))) {
    aEvent->flags |= aFlags;
    mListenerManager->HandleEvent(aPresContext, aEvent, aDOMEvent, this,
                                  aFlags, aEventStatus);
    aEvent->flags &= ~aFlags;
  }

  // Bubbling stage
  if (NS_EVENT_FLAG_BUBBLE & aFlags && nsnull != mScriptGlobalObject) {
    mScriptGlobalObject->HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
                                        aFlags & NS_EVENT_BUBBLE_MASK,
                                        aEventStatus);
  }

  if (NS_EVENT_FLAG_INIT & aFlags) {
    // We're leaving the DOM event loop so if we created a DOM event,
    // release here.
    if (*aDOMEvent && !externalDOMEvent) {
      nsrefcnt rc;
      NS_RELEASE2(*aDOMEvent, rc);
      if (0 != rc) {
        // Okay, so someone in the DOM loop (a listener, JS object)
        // still has a ref to the DOM Event but the internal data
        // hasn't been malloc'd.  Force a copy of the data here so the
        // DOM Event is still valid.
        nsCOMPtr<nsIPrivateDOMEvent> privateEvent =
          do_QueryInterface(*aDOMEvent);
        if (privateEvent) {
          privateEvent->DuplicatePrivateData();
        }
      }
      aDOMEvent = nsnull;
    }

    // Now that we're done with this event, remove the flag that says
    // we're in the process of dispatching this event.
    NS_MARK_EVENT_DISPATCH_DONE(aEvent);
  }

  return mRet;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsDocument::HandleEvent ( nsIDOMEvent aEvent) [virtual, inherited]

Implements nsIDOMEventReceiver.

Reimplemented in nsImageDocument.

Definition at line 4162 of file nsDocument.cpp.

{
  PRBool defaultActionEnabled;
  return DispatchEvent(aEvent, &defaultActionEnabled);
}
nsIDOMNode nsIDOMDocument::importNode ( in nsIDOMNode  importedNode,
in boolean  deep 
) raises (DOMException) [inherited]
PRInt32 nsDocument::IndexOf ( nsIContent aPossibleChild) const [virtual, inherited]

Implements nsIDocument.

Definition at line 1896 of file nsDocument.cpp.

{
  return mChildren.IndexOfChild(aPossibleChild);
}
nsresult nsXMLDocument::Init ( void  ) [virtual, inherited]

Reimplemented from nsDocument.

Reimplemented in nsXULDocument.

Definition at line 229 of file nsXMLDocument.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsIDOMNode nsIDOMNode::insertBefore ( in nsIDOMNode  newChild,
in nsIDOMNode  refChild 
) raises (DOMException) [inherited]
void nsDocument::InsertStyleSheetAt ( nsIStyleSheet aSheet,
PRInt32  aIndex 
) [virtual, inherited]

Insert a sheet at a particular spot in the stylesheet list (zero-based)

Parameters:
aSheetthe sheet to insert
aIndexthe index to insert at. This index will be adjusted for the "special" sheets.
Exceptions:
noexceptions

Implements nsIDocument.

Definition at line 2043 of file nsDocument.cpp.

{
  NS_PRECONDITION(aSheet, "null ptr");
  mStyleSheets.InsertObjectAt(aSheet, aIndex);

  aSheet->SetOwningDocument(this);

  PRBool applicable;
  aSheet->GetApplicable(applicable);

  if (applicable) {
    AddStyleSheetToStyleSets(aSheet);
  }

  NS_DOCUMENT_NOTIFY_OBSERVERS(StyleSheetAdded, (this, aSheet, PR_TRUE));
}

Here is the call graph for this function:

virtual PRBool nsIDocument::IsCaseSensitive ( ) [inline, virtual, inherited]

Reimplemented in nsHTMLDocument.

Definition at line 617 of file nsIDocument.h.

  {
    return PR_TRUE;
  }

Here is the caller graph for this function:

boolean nsIDOM3Node::isDefaultNamespace ( in DOMString  namespaceURI) [inherited]

Ask this document whether it's the initial document in its window.

Definition at line 891 of file nsIDocument.h.

PRBool nsXMLDocument::IsLoadedAsData ( ) [virtual, inherited]

Reimplemented from nsIDocument.

Definition at line 653 of file nsXMLDocument.cpp.

{
  return mLoadedAsData;
}
boolean nsIDOM3EventTarget::isRegisteredHere ( in DOMString  type) [inherited]
PRBool nsDocument::IsSafeToFlush ( ) const [protected, inherited]

Definition at line 4900 of file nsDocument.cpp.

{
  PRBool isSafeToFlush = PR_TRUE;
  PRInt32 i = 0, n = mPresShells.Count();
  while (i < n && isSafeToFlush) {
    nsCOMPtr<nsIPresShell> shell =
      NS_STATIC_CAST(nsIPresShell*, mPresShells[i]);

    if (shell) {
      shell->IsSafeToFlush(isSafeToFlush);
    }
    ++i;
  }
  return isSafeToFlush;
}

Here is the caller graph for this function:

boolean nsIDOM3Node::isSameNode ( in nsIDOMNode  other) [inherited]
PRBool nsDocument::IsScriptEnabled ( ) [virtual, inherited]

Implements nsIDocument.

Definition at line 4544 of file nsDocument.cpp.

{
  nsCOMPtr<nsIScriptSecurityManager> sm(do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID));
  NS_ENSURE_TRUE(sm, PR_TRUE);

  nsIPrincipal* principal = GetPrincipal();
  NS_ENSURE_TRUE(principal, PR_TRUE);

  nsIScriptGlobalObject* globalObject = GetScriptGlobalObject();
  NS_ENSURE_TRUE(globalObject, PR_TRUE);

  nsIScriptContext *scriptContext = globalObject->GetContext();
  NS_ENSURE_TRUE(scriptContext, PR_TRUE);

  JSContext* cx = (JSContext *) scriptContext->GetNativeContext();
  NS_ENSURE_TRUE(cx, PR_TRUE);

  PRBool enabled;
  nsresult rv = sm->CanExecuteScripts(cx, principal, &enabled);
  NS_ENSURE_SUCCESS(rv, PR_TRUE);
  return enabled;
}

Here is the call graph for this function:

boolean nsIDOMNode::isSupported ( in DOMString  feature,
in DOMString  version 
) [inherited]
boolean nsIDOMXMLDocument::load ( in DOMString  url) [inherited]

Load an XML document.

Parameters:
urlURL to an XML document.
Returns:
True if load successfull.
nsIDOMDocument nsIDOMDocumentXBL::loadBindingDocument ( in DOMString  documentURL) [inherited]
DOMString nsIDOM3Node::lookupNamespaceURI ( in DOMString  prefix) [inherited]
DOMString nsIDOM3Node::lookupPrefix ( in DOMString  namespaceURI) [inherited]
nsNodeInfoManager* nsIDocument::NodeInfoManager ( ) const [inline, inherited]

Only to be used inside Gecko, you can't really do anything with the pointer outside Gecko anyway.

Definition at line 566 of file nsIDocument.h.

  {
    return mNodeInfoManager;
  }

Here is the caller graph for this function:

void nsIDOMNode::normalize ( ) [inherited]
virtual void nsIDocument::NotifyURIVisitednessChanged ( nsIURI aURI) [pure virtual, inherited]

Notification that the visitedness state of a URI has been changed and style related to elements linking to that URI should be updated.

virtual nsDocument::NS_HIDDEN_ ( void ) [virtual, inherited]
virtual nsDocument::NS_HIDDEN_ ( nsresult  ) [virtual, inherited]
virtual nsDocument::NS_HIDDEN_ ( nsresult  ) [virtual, inherited]
virtual nsDocument::NS_HIDDEN_ ( void ) [virtual, inherited]
virtual nsDocument::NS_HIDDEN_ ( nsresult  ) [virtual, inherited]
virtual nsDocument::NS_HIDDEN_ ( void  ) [virtual, inherited]

Reimplemented in nsHTMLDocument.

virtual nsDocument::NS_HIDDEN_ ( PRBool  ) [virtual, inherited]
virtual nsDocument::NS_HIDDEN_ ( void  ) [virtual, inherited]

Reimplemented in nsHTMLDocument.

virtual nsDocument::NS_HIDDEN_ ( already_AddRefed< nsILayoutHistoryState ) const [virtual, inherited]
virtual nsDocument::NS_HIDDEN_ ( void  ) [virtual, inherited]

Reimplemented in nsHTMLDocument.

virtual nsDocument::NS_HIDDEN_ ( void  ) [virtual, inherited]

Reimplemented in nsHTMLDocument.

virtual nsDocument::NS_HIDDEN_ ( void  ) [virtual, inherited]

Reimplemented in nsHTMLDocument.

virtual nsDocument::NS_HIDDEN_ ( void  ) [virtual, inherited]

Reimplemented in nsHTMLDocument.

virtual nsDocument::NS_HIDDEN_ ( void  ) [virtual, inherited]

Reimplemented in nsHTMLDocument.

void nsIChannelEventSink::onChannelRedirect ( in nsIChannel  oldChannel,
in nsIChannel  newChannel,
in unsigned long  flags 
) [inherited]

Called when a redirect occurs.

This may happen due to an HTTP 3xx status code.

Parameters:
oldChannelThe channel that's being redirected.
newChannelThe new channel. This channel is not opened yet.
flagsFlags indicating the type of redirect. A bitmask consisting of flags from above. One of REDIRECT_TEMPORARY and REDIRECT_PERMANENT will always be set.
Exceptions:
<any>Throwing an exception will cancel the load. No network request for the new channel will be made.
void nsDocument::OnPageHide ( PRBool  aPersisted) [virtual, inherited]

Notification that the page has been hidden, for documents which are loaded into a DOM window.

This corresponds to the unloading of the document, or to the document's presentation being saved but removed from an existing DOM window. This notification fires applicable DOM events to the content window. See nsIDOMPageTransitionEvent.idl for a description of the |aPersisted| parameter.

Implements nsIDocument.

Definition at line 5265 of file nsDocument.cpp.

{
  // Send out notifications that our <link> elements are detached,
  // but only if this is not a full unload.
  if (aPersisted) {
    nsRefPtr<nsContentList> links = NS_GetContentList(this,
                                                      nsHTMLAtoms::link,
                                                      kNameSpaceID_Unknown,
                                                      mRootContent);

    if (links) {
      PRUint32 linkCount = links->Length(PR_TRUE);
      for (PRUint32 i = 0; i < linkCount; ++i) {
        nsCOMPtr<nsILink> link = do_QueryInterface(links->Item(i, PR_FALSE));
        if (link) {
          link->LinkRemoved();
        }
      }
    }
  }

  // Now send out a PageHide event.
  nsPageTransitionEvent event(PR_TRUE, NS_PAGE_HIDE, aPersisted);
  DispatchEventToWindow(&event);

  mVisible = PR_FALSE;
}

Here is the call graph for this function:

void nsDocument::OnPageShow ( PRBool  aPersisted) [virtual, inherited]

Notification that the page has been shown, for documents which are loaded into a DOM window.

This corresponds to the completion of document load, or to the page's presentation being restored into an existing DOM window. This notification fires applicable DOM events to the content window. See nsIDOMPageTransitionEvent.idl for a description of the |aPersisted| parameter.

Implements nsIDocument.

Definition at line 5237 of file nsDocument.cpp.

{
  mVisible = PR_TRUE;
  UpdateLinkMap();
  
  if (aPersisted) {
    // Send out notifications that our <link> elements are attached.
    nsRefPtr<nsContentList> links = NS_GetContentList(this,
                                                      nsHTMLAtoms::link,
                                                      kNameSpaceID_Unknown,
                                                      mRootContent);

    if (links) {
      PRUint32 linkCount = links->Length(PR_TRUE);
      for (PRUint32 i = 0; i < linkCount; ++i) {
        nsCOMPtr<nsILink> link = do_QueryInterface(links->Item(i, PR_FALSE));
        if (link) {
          link->LinkAdded();
        }
      }
    }
  }

  nsPageTransitionEvent event(PR_TRUE, NS_PAGE_SHOW, aPersisted);
  DispatchEventToWindow(&event);
}

Here is the call graph for this function:

nsPropertyTable* nsIDocument::PropertyTable ( ) [inline, inherited]

Definition at line 672 of file nsIDocument.h.

{ return &mPropertyTable; }

Here is the caller graph for this function:

void nsIDOMDocumentXBL::removeBinding ( in nsIDOMElement  elt,
in DOMString  bindingURL 
) [inherited]
void nsDocument::RemoveCharSetObserver ( nsIObserver aObserver) [virtual, inherited]

Remove a charset observer.

Implements nsIDocument.

Definition at line 1474 of file nsDocument.cpp.

{
  mCharSetObservers.RemoveElement(aObserver);
}
nsIDOMNode nsIDOMNode::removeChild ( in nsIDOMNode  oldChild) raises (DOMException) [inherited]
nsresult nsDocument::RemoveChildAt ( PRUint32  aIndex,
PRBool  aNotify 
) [virtual, inherited]

Remove a child from this document.

Parameters:
aIndexthe index of the child to remove
aNotifywhether to notify the document that the remove has occurred

Implements nsIDocument_MOZILLA_1_8_0_BRANCH.

Definition at line 1908 of file nsDocument.cpp.

{
  extern nsresult
  doRemoveChildAt(PRUint32 aIndex, PRBool aNotify, nsIContent* aKid,
                  nsIContent* aParent, nsIDocument* aDocument,
                  nsAttrAndChildArray& aChildArray);

  nsIContent* kid = GetChildAt(aIndex);
  if (kid) {
    return doRemoveChildAt(aIndex, aNotify, kid, nsnull, this,
                           mChildren);
  }
  
  return NS_OK;
}

Here is the call graph for this function:

void nsIDOMEventTarget::removeEventListener ( in DOMString  type,
in nsIDOMEventListener  listener,
in boolean  useCapture 
) [inherited]

This method allows the removal of event listeners from the event target.

If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.

Parameters:
typeSpecifies the event type of the EventListener being removed.
listenerThe EventListener parameter indicates the EventListener to be removed.
useCaptureSpecifies whether the EventListener being removed was registered as a capturing listener or not. If a listener was registered twice, one with capture and one without, each must be removed separately. Removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa.
nsresult nsDocument::RemoveEventListenerByIID ( nsIDOMEventListener aListener,
const nsIID aIID 
) [virtual, inherited]

Implements nsIDOMEventReceiver.

Definition at line 4278 of file nsDocument.cpp.

{
  if (!mListenerManager) {
    return NS_ERROR_FAILURE;
  }

  mListenerManager->RemoveEventListenerByIID(aListener, aIID,
                                             NS_EVENT_FLAG_BUBBLE);
  return NS_OK;
}
NS_IMETHODIMP nsDocument::RemoveFromRadioGroup ( const nsAString &  aName,
nsIFormControl aRadio 
) [virtual, inherited]

Remove radio button from radio group.

Note that forms do not do anything for this method since they already store radio groups on their own.

Parameters:
aNameradio group's name
aRadioradio button's pointer

Implements nsIRadioGroupContainer.

Definition at line 4712 of file nsDocument.cpp.

{
  nsRadioGroupStruct* radioGroup = nsnull;
  GetRadioGroup(aName, &radioGroup);
  if (radioGroup) {
    if (radioGroup->mRadioButtons.RemoveElement(aRadio)) {
      NS_IF_RELEASE(aRadio);
    }
  }

  return NS_OK;
}
void nsIDOM3EventTarget::removeGroupedEventListener ( in DOMString  type,
in nsIDOMEventListener  listener,
in boolean  useCapture,
in nsIDOMEventGroup  evtGroup 
) [inherited]
PRBool nsDocument::RemoveObserver ( nsIDocumentObserver aObserver) [virtual, inherited]

Remove an observer of document change notifications.

This will return false if the observer cannot be found.

Implements nsIDocument.

Definition at line 2273 of file nsDocument.cpp.

{
  // If we're in the process of destroying the document (and we're
  // informing the observers of the destruction), don't remove the
  // observers from the list. This is not a big deal, since we
  // don't hold a live reference to the observers.
  if (!mInDestructor) {
    return mObservers.RemoveElement(aObserver);
  }

  return mObservers.Contains(aObserver);
}
void nsDocument::RemoveStyleSheet ( nsIStyleSheet aSheet) [virtual, inherited]

Remove a stylesheet from the document.

Implements nsIDocument.

Definition at line 1980 of file nsDocument.cpp.

{
  NS_PRECONDITION(aSheet, "null arg");
  nsCOMPtr<nsIStyleSheet> sheet = aSheet; // hold ref so it won't die too soon

  if (!mStyleSheets.RemoveObject(aSheet)) {
    NS_NOTREACHED("stylesheet not found");
    return;
  }

  if (!mIsGoingAway) {
    PRBool applicable = PR_TRUE;
    aSheet->GetApplicable(applicable);
    if (applicable) {
      RemoveStyleSheetFromStyleSets(aSheet);
    }

    NS_DOCUMENT_NOTIFY_OBSERVERS(StyleSheetRemoved, (this, aSheet, PR_TRUE));
  }

  aSheet->SetOwningDocument(nsnull);
}

Here is the call graph for this function:

void nsDocument::RemoveStyleSheetFromStyleSets ( nsIStyleSheet aSheet) [virtual, inherited]

Definition at line 1972 of file nsDocument.cpp.

{
  for (PRInt32 i = 0, i_end = mPresShells.Count(); i < i_end; ++i)
    NS_STATIC_CAST(nsIPresShell*, mPresShells.ElementAt(i))->StyleSet()->
      RemoveStyleSheet(nsStyleSet::eDocSheet, aSheet);
}

Here is the call graph for this function:

nsIDOMNode nsIDOM3Document::renameNode ( in nsIDOMNode  node,
in DOMString  namespaceURI,
in DOMString  qualifiedName 
) raises (DOMException) [inherited]
nsIDOMNode nsIDOMNode::replaceChild ( in nsIDOMNode  newChild,
in nsIDOMNode  oldChild 
) raises (DOMException) [inherited]
void nsXMLDocument::Reset ( nsIChannel aChannel,
nsILoadGroup aLoadGroup 
) [virtual, inherited]

Reset the document using the given channel and loadgroup.

This works like ResetToURI, but also sets the document's channel to aChannel.

Reimplemented from nsDocument.

Reimplemented in nsXULDocument.

Definition at line 240 of file nsXMLDocument.cpp.

{
  nsDocument::Reset(aChannel, aLoadGroup);

  mScriptContext = nsnull;
}
nsresult nsDocument::ResetStylesheetsToURI ( nsIURI aURI) [protected, inherited]

Definition at line 1143 of file nsDocument.cpp.

{
  NS_PRECONDITION(aURI, "Null URI passed to ResetStylesheetsToURI");

  mozAutoDocUpdate(this, UPDATE_STYLE, PR_TRUE);
  
  // The stylesheets should forget us
  PRInt32 indx = mStyleSheets.Count();
  while (--indx >= 0) {
    nsIStyleSheet* sheet = mStyleSheets[indx];
    sheet->SetOwningDocument(nsnull);

    PRBool applicable;
    sheet->GetApplicable(applicable);
    if (applicable) {
      RemoveStyleSheetFromStyleSets(sheet);
    }

    // XXX Tell observers?
  }

  indx = mCatalogSheets.Count();
  while (--indx >= 0) {
    nsIStyleSheet* sheet = mCatalogSheets[indx];
    sheet->SetOwningDocument(nsnull);

    PRBool applicable;
    sheet->GetApplicable(applicable);
    if (applicable) {
      for (PRInt32 i = 0, i_end = mPresShells.Count(); i < i_end; ++i) {
        NS_STATIC_CAST(nsIPresShell*, mPresShells.ElementAt(i))->StyleSet()->
          RemoveStyleSheet(nsStyleSet::eAgentSheet, sheet);
      }
    }

    // XXX Tell observers?
  }


  // Release all the sheets
  mStyleSheets.Clear();
  // NOTE:  We don't release the catalog sheets.  It doesn't really matter
  // now, but it could in the future -- in which case not releasing them
  // is probably the right thing to do.

  // Now reset our inline style and attribute sheets.
  nsresult rv;
  nsStyleSet::sheetType attrSheetType = GetAttrSheetType();
  if (mAttrStyleSheet) {
    // Remove this sheet from all style sets
    PRInt32 count = mPresShells.Count();
    for (indx = 0; indx < count; ++indx) {
      NS_STATIC_CAST(nsIPresShell*, mPresShells.ElementAt(indx))->StyleSet()->
        RemoveStyleSheet(attrSheetType, mAttrStyleSheet);
    }
    rv = mAttrStyleSheet->Reset(aURI);
  } else {
    rv = NS_NewHTMLStyleSheet(getter_AddRefs(mAttrStyleSheet), aURI, this);
  }
  NS_ENSURE_SUCCESS(rv, rv);

  // Don't use AddStyleSheet, since it'll put the sheet into style
  // sets in the document level, which is not desirable here.
  mAttrStyleSheet->SetOwningDocument(this);
  
  if (mStyleAttrStyleSheet) {
    // Remove this sheet from all style sets
    PRInt32 count = mPresShells.Count();
    for (indx = 0; indx < count; ++indx) {
      NS_STATIC_CAST(nsIPresShell*, mPresShells.ElementAt(indx))->StyleSet()->
        RemoveStyleSheet(nsStyleSet::eStyleAttrSheet, mStyleAttrStyleSheet);
    }
    rv = mStyleAttrStyleSheet->Reset(aURI);
  } else {
    rv = NS_NewHTMLCSSStyleSheet(getter_AddRefs(mStyleAttrStyleSheet), aURI,
                                                this);
  }
  NS_ENSURE_SUCCESS(rv, rv);

  // The loop over style sets below will handle putting this sheet
  // into style sets as needed.
  mStyleAttrStyleSheet->SetOwningDocument(this);

  // Now set up our style sets
  PRInt32 count = mPresShells.Count();
  for (indx = 0; indx < count; ++indx) {
    FillStyleSet(NS_STATIC_CAST(nsIPresShell*,
                                mPresShells.ElementAt(indx))->StyleSet());
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsXMLDocument::ResetToURI ( nsIURI aURI,
nsILoadGroup aLoadGroup 
) [virtual, inherited]

Reset this document to aURI and aLoadGroup.

aURI must not be null.

Reimplemented from nsDocument.

Reimplemented in nsXULDocument.

Definition at line 248 of file nsXMLDocument.cpp.

Here is the call graph for this function:

void nsDocument::RetrieveRelevantHeaders ( nsIChannel aChannel) [protected, inherited]

Definition at line 4750 of file nsDocument.cpp.

{
  nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
  PRTime modDate = LL_ZERO;
  nsresult rv;

  if (httpChannel) {
    nsCAutoString tmp;
    rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("last-modified"),
                                        tmp);

    if (NS_SUCCEEDED(rv)) {
      PRTime time;
      PRStatus st = PR_ParseTimeString(tmp.get(), PR_TRUE, &time);
      if (st == PR_SUCCESS) {
        modDate = time;
      }
    }

    // The misspelled key 'referer' is as per the HTTP spec
    rv = httpChannel->GetRequestHeader(NS_LITERAL_CSTRING("referer"),
                                       mReferrer);
    if (NS_FAILED(rv)) {
      mReferrer.Truncate();
    }

    static const char *const headers[] = {
      "default-style",
      "content-style-type",
      "content-language",
      "content-disposition",
      "refresh",
      // add more http headers if you need
      // XXXbz don't add content-location support without reading bug
      // 238654 and its dependencies/dups first.
      0
    };
    
    nsCAutoString headerVal;
    const char *const *name = headers;
    while (*name) {
      rv =
        httpChannel->GetResponseHeader(nsDependentCString(*name), headerVal);
      if (NS_SUCCEEDED(rv) && !headerVal.IsEmpty()) {
        nsCOMPtr<nsIAtom> key = do_GetAtom(*name);
        SetHeaderData(key, NS_ConvertASCIItoUCS2(headerVal));
      }
      ++name;
    }
  } else {
    nsCOMPtr<nsIFileChannel> fileChannel = do_QueryInterface(aChannel);
    if (fileChannel) {
      nsCOMPtr<nsIFile> file;
      fileChannel->GetFile(getter_AddRefs(file));
      if (file) {
        PRTime msecs;
        rv = file->GetLastModifiedTime(&msecs);

        if (NS_SUCCEEDED(rv)) {
          PRInt64 intermediateValue;
          LL_I2L(intermediateValue, PR_USEC_PER_MSEC);
          LL_MUL(modDate, msecs, intermediateValue);
        }
      }
    } else {
      nsCOMPtr<nsIMultiPartChannel> partChannel = do_QueryInterface(aChannel);
      if (partChannel) {
        nsCAutoString contentDisp;
        rv = partChannel->GetContentDisposition(contentDisp);
        if (NS_SUCCEEDED(rv) && !contentDisp.IsEmpty()) {
          SetHeaderData(nsHTMLAtoms::headerContentDisposition,
                        NS_ConvertASCIItoUCS2(contentDisp));
        }
      }
    }
  }

  if (LL_IS_ZERO(modDate)) {
    // We got nothing from our attempt to ask nsIFileChannel and
    // nsIHttpChannel for the last modified time. Return the current
    // time.
    modDate = PR_Now();
  }

  mLastModified.Truncate();
  if (LL_NE(modDate, LL_ZERO)) {
    PRExplodedTime prtime;
    PR_ExplodeTime(modDate, PR_LocalTimeParameters, &prtime);
    // "MM/DD/YYYY hh:mm:ss"
    char formatedTime[24];
    if (PR_snprintf(formatedTime, sizeof(formatedTime),
                    "%02ld/%02ld/%04hd %02ld:%02ld:%02ld",
                    prtime.tm_month + 1, prtime.tm_mday, prtime.tm_year,
                    prtime.tm_hour     ,  prtime.tm_min,  prtime.tm_sec)) {
      CopyASCIItoUTF16(nsDependentCString(formatedTime), mLastModified);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual nsresult nsIDocument::Sanitize ( ) [pure virtual, inherited]

Sanitize the document by resetting all input elements and forms that have autocomplete=off to their default values.

void nsDocument::SetBaseTarget ( const nsAString &  aBaseTarget) [virtual, inherited]

Implements nsIDocument.

Definition at line 1430 of file nsDocument.cpp.

{
  mBaseTarget.Assign(aBaseTarget);
}
nsresult nsDocument::SetBaseURI ( nsIURI aURI) [virtual, inherited]

Implements nsIDocument.

Definition at line 1400 of file nsDocument.cpp.

{
  nsresult rv = NS_OK;

  if (aURI) {
    nsIPrincipal* principal = GetPrincipal();
    NS_ENSURE_TRUE(principal, NS_ERROR_FAILURE);
    
    nsIScriptSecurityManager* securityManager =
      nsContentUtils::GetSecurityManager();
    rv = securityManager->
      CheckLoadURIWithPrincipal(principal, aURI,
                                nsIScriptSecurityManager::STANDARD);
    if (NS_SUCCEEDED(rv)) {
      mDocumentBaseURI = aURI;
    }
  } else {
    mDocumentBaseURI = nsnull;
  }

  return rv;
}

Here is the call graph for this function:

void nsIDocument::SetBidiEnabled ( PRBool  aBidiEnabled) [inline, inherited]

Indicate the document contains bidi data.

Currently, we cannot disable bidi, because once bidi is enabled, it affects a frame model irreversibly, and plays even though the document no longer contains bidi data.

Definition at line 269 of file nsIDocument.h.

  {
    mBidiEnabled = aBidiEnabled;
  }

Here is the caller graph for this function:

void nsIDOMNSDocument::setBoxObjectFor ( in nsIDOMElement  elt,
in nsIBoxObject  boxObject 
) [inherited]
void nsIDocument::SetContainer ( nsISupports *  aContainer) [inline, inherited]

Set the container (docshell) for this document.

Definition at line 585 of file nsIDocument.h.

Here is the call graph for this function:

void nsDocument::SetContentType ( const nsAString &  aContentType) [virtual, inherited]

Get the Content-Type of this document.

Set the Content-Type of this document.

Implements nsIDocument.

Reimplemented in nsXULDocument.

Definition at line 1383 of file nsDocument.cpp.

{
  NS_ASSERTION(mContentType.IsEmpty() ||
               mContentType.Equals(NS_ConvertUCS2toUTF8(aContentType)),
               "Do you really want to change the content-type?");

  CopyUTF16toUTF8(aContentType, mContentType);
}

Here is the call graph for this function:

NS_IMETHODIMP nsDocument::SetCurrentRadioButton ( const nsAString &  aName,
nsIDOMHTMLInputElement aRadio 
) [virtual, inherited]

Set the current radio button in a group.

Parameters:
aNamethe group name
aRadiothe currently selected radio button

Implements nsIRadioGroupContainer.

Definition at line 4587 of file nsDocument.cpp.

{
  nsRadioGroupStruct* radioGroup = nsnull;
  GetRadioGroup(aName, &radioGroup);
  if (radioGroup) {
    radioGroup->mSelectedRadioButton = aRadio;
  }

  return NS_OK;
}
void nsDocument::SetDocumentCharacterSet ( const nsACString &  aCharSetID) [virtual, inherited]

Return a standard name for the document's character set.

This will trigger a startDocumentLoad if necessary to answer the question.

Implements nsIDocument.

Definition at line 1436 of file nsDocument.cpp.

{
  if (!mCharacterSet.Equals(aCharSetID)) {
    mCharacterSet = aCharSetID;

#ifdef DEBUG
    nsCOMPtr<nsICharsetAlias> calias(do_GetService(kCharsetAliasCID));
    if (calias) {
      nsCAutoString canonicalName;
      calias->GetPreferred(aCharSetID, canonicalName);
      NS_ASSERTION(canonicalName.Equals(aCharSetID),
                   "charset name must be canonical");
    }
#endif

    PRInt32 n = mCharSetObservers.Count();

    for (PRInt32 i = 0; i < n; i++) {
      nsIObserver* observer =
        NS_STATIC_CAST(nsIObserver *, mCharSetObservers.ElementAt(i));

      observer->Observe(NS_STATIC_CAST(nsIDocument *, this), "charset",
                        NS_ConvertASCIItoUTF16(aCharSetID).get());
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIDocument::SetDocumentCharacterSetSource ( PRInt32  aCharsetSource) [inline, inherited]

Definition at line 216 of file nsIDocument.h.

  {
    mCharacterSetSource = aCharsetSource;
  }

Here is the caller graph for this function:

void nsIDocument::SetDocumentURI ( nsIURI aURI) [inline, inherited]

Definition at line 151 of file nsIDocument.h.

void nsDocument::SetHeaderData ( nsIAtom aheaderField,
const nsAString &  aData 
) [virtual, inherited]

Implements nsIDocument.

Definition at line 1541 of file nsDocument.cpp.

{
  if (!aHeaderField) {
    NS_ERROR("null headerField");
    return;
  }

  if (!mHeaderData) {
    if (!aData.IsEmpty()) { // don't bother storing empty string
      mHeaderData = new nsDocHeaderData(aHeaderField, aData);
    }
  }
  else {
    nsDocHeaderData* data = mHeaderData;
    nsDocHeaderData** lastPtr = &mHeaderData;
    PRBool found = PR_FALSE;
    do {  // look for existing and replace
      if (data->mField == aHeaderField) {
        if (!aData.IsEmpty()) {
          data->mData.Assign(aData);
        }
        else {  // don't store empty string
          *lastPtr = data->mNext;
          data->mNext = nsnull;
          delete data;
        }
        found = PR_TRUE;

        break;
      }
      lastPtr = &(data->mNext);
      data = *lastPtr;
    } while (data);

    if (!aData.IsEmpty() && !found) {
      // didn't find, append
      *lastPtr = new nsDocHeaderData(aHeaderField, aData);
    }
  }

  if (aHeaderField == nsHTMLAtoms::headerContentLanguage) {
    CopyUTF16toUTF8(aData, mContentLanguage);
  }
  
  if (aHeaderField == nsHTMLAtoms::headerDefaultStyle) {
    // switch alternate style sheets based on default
    // XXXldb What if we don't have all the sheets yet?  Should this use
    // the DOM API for preferred stylesheet set that's "coming soon"?
    nsAutoString type;
    nsAutoString title;
    PRInt32 index;

    CSSLoader()->SetPreferredSheet(aData);

    PRInt32 count = mStyleSheets.Count();
    for (index = 0; index < count; index++) {
      nsIStyleSheet* sheet = mStyleSheets[index];
      sheet->GetType(type);
      if (!type.EqualsLiteral("text/html")) {
        sheet->GetTitle(title);
        if (!title.IsEmpty()) {  // if sheet has title
          PRBool enabled =
            (!aData.IsEmpty() &&
             title.Equals(aData, nsCaseInsensitiveStringComparator()));

          sheet->SetEnabled(enabled);
        }
      }
    }
  }

  if (aHeaderField == nsHTMLAtoms::refresh) {
    // We get into this code before we have a script global yet, so get to
    // our container via mDocumentContainer.
    nsCOMPtr<nsIRefreshURI> refresher = do_QueryReferent(mDocumentContainer);
    if (refresher) {
      // Note: using mDocumentURI instead of mBaseURI here, for consistency
      // (used to just use the current URI of our webnavigation, but that
      // should really be the same thing).  Note that this code can run
      // before the current URI of the webnavigation has been updated, so we
      // can't assert equality here.
      refresher->SetupRefreshURIFromHeader(mDocumentURI,
                                           NS_LossyConvertUTF16toASCII(aData));
    }
  }
}

Here is the call graph for this function:

void nsIDocument_MOZILLA_1_8_BRANCH2::SetIsInitialDocument ( PRBool  aIsInitialDocument) [inline, inherited]

Tell this document that it's the initial document in its window.

See comments on mIsInitialDocumentInWindow for when this should be called.

Definition at line 900 of file nsIDocument.h.

  {
    mIsInitialDocumentInWindow = aIsInitialDocument;
  }

Here is the caller graph for this function:

void nsDocument::SetLineBreaker ( nsILineBreaker aLineBreaker) [virtual, inherited]

Implements nsIDocument.

Definition at line 1497 of file nsDocument.cpp.

{
  mLineBreaker = aLineBreaker;
}
void nsXMLDocument::SetLoadedAsData ( PRBool  aLoadedAsData) [inline, inherited]

Definition at line 98 of file nsXMLDocument.h.

{ mLoadedAsData = aLoadedAsData; }
void nsIDocument::SetParentDocument ( nsIDocument aParent) [inline, inherited]

Set the parent document of this document.

Definition at line 315 of file nsIDocument.h.

  {
    mParentDocument = aParent;
  }

Here is the caller graph for this function:

void nsIDocument::SetPartID ( PRUint32  aID) [inline, inherited]

Sets the ID used to identify this part of the multipart document.

Definition at line 677 of file nsIDocument.h.

                               {
    mPartID = aID;
  }

Here is the caller graph for this function:

void nsDocument::SetPrincipal ( nsIPrincipal aPrincipal) [virtual, inherited]

Set the principal responsible for this document.

Implements nsIDocument.

Reimplemented in nsXULDocument.

Definition at line 1369 of file nsDocument.cpp.

{
  mPrincipal = aNewPrincipal;
}
virtual nsresult nsIDocument::SetProperty ( nsIAtom aPropertyName,
void aValue,
NSPropertyDtorFunc  aDtor = nsnull 
) [pure virtual, inherited]

Here is the caller graph for this function:

nsresult nsDocument::SetRootContent ( nsIContent aRoot) [virtual, inherited]

Set aRoot as the root content object for this document.

If aRoot is non-null, this should not be called on documents that currently have a root content without first clearing out the document's children. Passing in null to unbind the existing root content is allowed. This method will bind aRoot to the document; the caller need not call BindToTree on aRoot.

Note that this method never sends out nsIDocumentObserver notifications; doing that is the caller's responsibility.

Implements nsIDocument.

Definition at line 1856 of file nsDocument.cpp.

{
  if (aRoot) {
    NS_ASSERTION(!mRootContent,
                 "Already have a root content!  Clear out first!");
    nsresult rv = aRoot->BindToTree(this, nsnull, nsnull, PR_TRUE);

    if (NS_SUCCEEDED(rv)) {
      rv = mChildren.AppendChild(aRoot);
    }

    if (NS_FAILED(rv)) {
      aRoot->UnbindFromTree();
    } else {
      mRootContent = aRoot;
    }
    
    return rv;
  }

  if (mRootContent) {
    DestroyLinkMap();
    mRootContent->UnbindFromTree();
    PRInt32 pos = mChildren.IndexOfChild(mRootContent);
    if (pos >= 0) {
      mChildren.RemoveChildAt(pos);
    }
    mRootContent = nsnull;
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsDocument::SetScriptGlobalObject ( nsIScriptGlobalObject aGlobalObject) [virtual, inherited]

Implements nsIDocument.

Reimplemented in nsImageDocument, and nsPluginDocument.

Definition at line 2181 of file nsDocument.cpp.

{
#ifdef DEBUG
  {
    nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(aScriptGlobalObject));

    NS_ASSERTION(!win || win->IsInnerWindow(),
                 "Script global object must be an inner window!");
  }
#endif

  if (mScriptGlobalObject && !aScriptGlobalObject) {
    // We're detaching from the window.  We need to grab a pointer to
    // our layout history state now.
    mLayoutHistoryState = GetLayoutHistoryState();
  }

  mScriptGlobalObject = aScriptGlobalObject;

  if (aScriptGlobalObject) {
    mScriptObject = nsnull;
    mHasHadScriptHandlingObject = PR_TRUE;
    // Go back to using the docshell for the layout history state
    mLayoutHistoryState = nsnull;
    mScopeObject = do_GetWeakReference(aScriptGlobalObject);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsDocument::SetScriptHandlingObject ( nsIScriptGlobalObject aScriptObject) [virtual, inherited]

Implements nsIDocument_MOZILLA_1_8_BRANCH3.

Definition at line 2232 of file nsDocument.cpp.

{
  NS_ASSERTION(!mScriptGlobalObject ||
               mScriptGlobalObject == aScriptObject,
               "Wrong script object!");
  mScriptObject = do_GetWeakReference(aScriptObject);
  if (aScriptObject) {
    mHasHadScriptHandlingObject = PR_TRUE;
  }
}

Here is the call graph for this function:

void nsDocument::SetStyleSheetApplicableState ( nsIStyleSheet aSheet,
PRBool  aApplicable 
) [virtual, inherited]

Notify the document that the applicable state of the sheet changed and that observers should be notified and style sets updated.

Implements nsIDocument.

Definition at line 2062 of file nsDocument.cpp.

{
  NS_PRECONDITION(aSheet, "null arg");

  // If we're actually in the document style sheet list
  if (-1 != mStyleSheets.IndexOf(aSheet)) {
    if (aApplicable) {
      AddStyleSheetToStyleSets(aSheet);
    } else {
      RemoveStyleSheetFromStyleSets(aSheet);
    }
  }

  // We have to always notify, since this will be called for sheets
  // that are children of sheets in our style set, as well as some
  // sheets for nsHTMLEditor.

  NS_DOCUMENT_NOTIFY_OBSERVERS(StyleSheetApplicableStateChanged,
                               (this, aSheet, aApplicable));
}
nsresult nsDocument::SetSubDocumentFor ( nsIContent aContent,
nsIDocument aSubDoc 
) [virtual, inherited]

Set the sub document for aContent to aSubDoc.

Implements nsIDocument.

Definition at line 1738 of file nsDocument.cpp.

{
  NS_ENSURE_TRUE(aContent, NS_ERROR_UNEXPECTED);

  if (!aSubDoc) {
    // aSubDoc is nsnull, remove the mapping

    if (mSubDocuments) {
      SubDocMapEntry *entry =
        NS_STATIC_CAST(SubDocMapEntry*,
                       PL_DHashTableOperate(mSubDocuments, aContent,
                                            PL_DHASH_LOOKUP));

      if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
        entry->mSubDocument->SetParentDocument(nsnull);

        PL_DHashTableRawRemove(mSubDocuments, entry);
      }
    }
  } else {
    if (!mSubDocuments) {
      // Create a new hashtable

      static PLDHashTableOps hash_table_ops =
      {
        PL_DHashAllocTable,
        PL_DHashFreeTable,
        PL_DHashGetKeyStub,
        PL_DHashVoidPtrKeyStub,
        PL_DHashMatchEntryStub,
        PL_DHashMoveEntryStub,
        SubDocClearEntry,
        PL_DHashFinalizeStub,
        SubDocInitEntry
      };

      mSubDocuments = PL_NewDHashTable(&hash_table_ops, nsnull,
                                       sizeof(SubDocMapEntry), 16);
      if (!mSubDocuments) {
        return NS_ERROR_OUT_OF_MEMORY;
      }
    }

    // Add a mapping to the hash table
    SubDocMapEntry *entry =
      NS_STATIC_CAST(SubDocMapEntry*,
                     PL_DHashTableOperate(mSubDocuments, aContent,
                                          PL_DHASH_ADD));

    if (!entry) {
      return NS_ERROR_OUT_OF_MEMORY;
    }

    if (entry->mSubDocument) {
      entry->mSubDocument->SetParentDocument(nsnull);

      // Release the old sub document
      NS_RELEASE(entry->mSubDocument);
    }

    entry->mSubDocument = aSubDoc;
    NS_ADDREF(entry->mSubDocument);

    aSubDoc->SetParentDocument(this);
  }

  return NS_OK;
}

Here is the call graph for this function:

nsIVariant nsIDOM3Node::setUserData ( in DOMString  key,
in nsIVariant  data,
in nsIDOMUserDataHandler  handler 
) [inherited]
void nsDocument::SetWordBreaker ( nsIWordBreaker aWordBreaker) [virtual, inherited]

Implements nsIDocument.

Definition at line 1520 of file nsDocument.cpp.

{
  mWordBreaker = aWordBreaker;
}
void nsDocument::SetXMLDeclaration ( const PRUnichar aVersion,
const PRUnichar aEncoding,
const PRInt32  aStandalone 
) [virtual, inherited]

Set and get XML declaration.

If aVersion is null there is no declaration. aStandalone takes values -1, 0 and 1 indicating respectively that there was no standalone parameter in the declaration, that it was given as no, or that it was given as yes.

Implements nsIDocument.

Definition at line 4489 of file nsDocument.cpp.

nsresult nsXMLDocument::StartDocumentLoad ( const char *  aCommand,
nsIChannel channel,
nsILoadGroup aLoadGroup,
nsISupports *  aContainer,
nsIStreamListener **  aDocListener,
PRBool  aReset = PR_TRUE,
nsIContentSink aSink = nsnull 
) [virtual, inherited]

Reimplemented from nsDocument.

Reimplemented in nsXULDocument.

Definition at line 546 of file nsXMLDocument.cpp.

{
  if (nsCRT::strcmp(kLoadAsData, aCommand) == 0) {
    mLoadedAsData = PR_TRUE;
    // We need to disable script & style loading in this case.
    // We leave them disabled even in EndLoad(), and let anyone
    // who puts the document on display to worry about enabling.

    // scripts
    nsIScriptLoader *loader = GetScriptLoader();
    if (loader) {
      loader->SetEnabled(PR_FALSE); // Do not load/process scripts when loading as data
    }

    // styles
    CSSLoader()->SetEnabled(PR_FALSE); // Do not load/process styles when loading as data
  } else if (nsCRT::strcmp("loadAsInteractiveData", aCommand) == 0) {
    mLoadedAsInteractiveData = PR_TRUE;
    aCommand = kLoadAsData; // XBL, for example, needs scripts and styles
  }

  nsresult rv = nsDocument::StartDocumentLoad(aCommand,
                                              aChannel, aLoadGroup,
                                              aContainer, 
                                              aDocListener, aReset, aSink);
  if (NS_FAILED(rv)) return rv;

  PRInt32 charsetSource = kCharsetFromDocTypeDefault;
  nsCAutoString charset(NS_LITERAL_CSTRING("UTF-8"));
  TryChannelCharset(aChannel, charsetSource, charset);

  nsCOMPtr<nsIURI> aUrl;
  rv = aChannel->GetURI(getter_AddRefs(aUrl));
  if (NS_FAILED(rv)) return rv;

  static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID);

  mParser = do_CreateInstance(kCParserCID, &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsIXMLContentSink> sink;
    
  if (aSink) {
    sink = do_QueryInterface(aSink);
  }
  else {
    nsCOMPtr<nsIDocShell> docShell;
    if (aContainer) {
      docShell = do_QueryInterface(aContainer);
      NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
    }
    rv = NS_NewXMLContentSink(getter_AddRefs(sink), this, aUrl, docShell,
                              aChannel);
    NS_ENSURE_SUCCESS(rv, rv);
  }

  // Set the parser as the stream listener for the document loader...
  rv = CallQueryInterface(mParser, aDocListener);
  NS_ENSURE_SUCCESS(rv, rv);

  NS_ASSERTION(mChannel, "How can we not have a channel here?");
  mChannelIsPending = PR_TRUE;
  
  SetDocumentCharacterSet(charset);
  mParser->SetDocumentCharset(charset, charsetSource);
  mParser->SetCommand(aCommand);
  mParser->SetContentSink(sink);
  mParser->Parse(aUrl, nsnull, PR_FALSE, (void *)this);

  return NS_OK;
}

Here is the call graph for this function:

void nsDocument::StopDocumentLoad ( ) [virtual, inherited]

Implements nsIDocument.

Definition at line 1323 of file nsDocument.cpp.

{
  if (mParser) {
    mParser->Terminate();
  }
}

Here is the caller graph for this function:

void nsDocument::StyleRuleAdded ( nsIStyleSheet aStyleSheet,
nsIStyleRule aStyleRule 
) [virtual, inherited]

Implements nsIDocument.

Definition at line 2560 of file nsDocument.cpp.

{
  NS_DOCUMENT_NOTIFY_OBSERVERS(StyleRuleAdded,
                               (this, aStyleSheet, aStyleRule));
}
void nsDocument::StyleRuleChanged ( nsIStyleSheet aStyleSheet,
nsIStyleRule aOldStyleRule,
nsIStyleRule aNewStyleRule 
) [virtual, inherited]

Implements nsIDocument.

Definition at line 2550 of file nsDocument.cpp.

{
  NS_DOCUMENT_NOTIFY_OBSERVERS(StyleRuleChanged,
                               (this, aStyleSheet,
                                aOldStyleRule, aNewStyleRule));
}
void nsDocument::StyleRuleRemoved ( nsIStyleSheet aStyleSheet,
nsIStyleRule aStyleRule 
) [virtual, inherited]

Implements nsIDocument.

Definition at line 2568 of file nsDocument.cpp.

{
  NS_DOCUMENT_NOTIFY_OBSERVERS(StyleRuleRemoved,
                               (this, aStyleSheet, aStyleRule));
}
PRBool nsDocument::TryChannelCharset ( nsIChannel aChannel,
PRInt32 aCharsetSource,
nsACString &  aCharset 
) [static, protected, inherited]

Definition at line 1629 of file nsDocument.cpp.

{
  if(kCharsetFromChannel <= aCharsetSource) {
    return PR_TRUE;
  }

  if (aChannel) {
    nsCAutoString charsetVal;
    nsresult rv = aChannel->GetContentCharset(charsetVal);
    if (NS_SUCCEEDED(rv)) {
      nsCOMPtr<nsICharsetAlias> calias(do_GetService(kCharsetAliasCID));
      if (calias) {
        nsCAutoString preferred;
        rv = calias->GetPreferred(charsetVal,
                                  preferred);
        if(NS_SUCCEEDED(rv)) {
          aCharset = preferred;
          aCharsetSource = kCharsetFromChannel;
          return PR_TRUE;
        }
      }
    }
  }
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void nsIDocument::UnblockOnload ( ) [pure virtual, inherited]
virtual void* nsIDocument::UnsetProperty ( nsIAtom aPropertyName,
nsresult aStatus = nsnull 
) [pure virtual, inherited]
void nsDocument::UpdateLinkMap ( ) [protected, inherited]

Definition at line 5393 of file nsDocument.cpp.

{
  NS_ASSERTION(mVisible,
               "Should only be updating the link map in visible documents");
  if (!mVisible)
    return;
    
  PRInt32 count = mVisitednessChangedURIs.Count();
  for (PRInt32 i = 0; i < count; ++i) {
    NotifyURIVisitednessChanged(mVisitednessChangedURIs[i]);
  }
  mVisitednessChangedURIs.Clear();
}
void nsDocument::UpdateStyleSheets ( nsCOMArray< nsIStyleSheet > &  aOldSheets,
nsCOMArray< nsIStyleSheet > &  aNewSheets 
) [virtual, inherited]

Replace the stylesheets in aOldSheets with the stylesheets in aNewSheets.

The two lists must have equal length, and the sheet at positon J in the first list will be replaced by the sheet at position J in the second list. Some sheets in the second list may be null; if so the corresponding sheets in the first list will simply be removed.

Implements nsIDocument.

Definition at line 2004 of file nsDocument.cpp.

{
  BeginUpdate(UPDATE_STYLE);

  // XXX Need to set the sheet on the ownernode, if any
  NS_PRECONDITION(aOldSheets.Count() == aNewSheets.Count(),
                  "The lists must be the same length!");
  PRInt32 count = aOldSheets.Count();

  nsCOMPtr<nsIStyleSheet> oldSheet;
  PRInt32 i;
  for (i = 0; i < count; ++i) {
    oldSheet = aOldSheets[i];

    // First remove the old sheet.
    NS_ASSERTION(oldSheet, "None of the old sheets should be null");
    PRInt32 oldIndex = mStyleSheets.IndexOf(oldSheet);
    RemoveStyleSheet(oldSheet);  // This does the right notifications

    // Now put the new one in its place.  If it's null, just ignore it.
    nsIStyleSheet* newSheet = aNewSheets[i];
    if (newSheet) {
      mStyleSheets.InsertObjectAt(newSheet, oldIndex);
      newSheet->SetOwningDocument(this);
      PRBool applicable = PR_TRUE;
      newSheet->GetApplicable(applicable);
      if (applicable) {
        AddStyleSheetToStyleSets(newSheet);
      }

      NS_DOCUMENT_NOTIFY_OBSERVERS(StyleSheetAdded, (this, newSheet, PR_TRUE));
    }
  }

  EndUpdate(UPDATE_STYLE);
}

Here is the call graph for this function:

NS_IMETHODIMP nsDocument::WalkRadioGroup ( const nsAString &  aName,
nsIRadioVisitor aVisitor 
) [virtual, inherited]

Walk through the radio group, visiting each note with avisitor->Visit()

Parameters:
aNamethe group name
aVisitorthe visitor to visit with

Implements nsIRadioGroupContainer.

Definition at line 4727 of file nsDocument.cpp.

{
  nsRadioGroupStruct* radioGroup = nsnull;
  GetRadioGroup(aName, &radioGroup);
  if (!radioGroup) {
    return NS_OK;
  }

  PRBool stop = PR_FALSE;
  for (int i = 0; i < radioGroup->mRadioButtons.Count(); i++) {
    aVisitor->Visit(NS_STATIC_CAST(nsIFormControl *,
                                   radioGroup->mRadioButtons.ElementAt(i)),
                    &stop);
    if (stop) {
      return NS_OK;
    }
  }

  return NS_OK;
}

Here is the call graph for this function:


Member Data Documentation

virtual void* nsDocument::aData [inherited]

Definition at line 749 of file nsDocument.h.

Definition at line 739 of file nsDocument.h.

Definition at line 735 of file nsDocument.h.

Whether to load synchronously or asynchronously.

The default is async==true.

Definition at line 52 of file nsIDOMXMLDocument.idl.

const unsigned short nsIDOMNode::ATTRIBUTE_NODE = 2 [inherited]

Definition at line 57 of file nsIDOMNode.idl.

Definition at line 80 of file nsIDOMNode.idl.

virtual nsIURI* nsDocument::aURI [inherited]

Definition at line 758 of file nsDocument.h.

virtual void* nsDocument::aValue [inherited]

Definition at line 738 of file nsDocument.h.

readonly attribute DOMString nsIDOM3Node::baseURI [inherited]

Definition at line 50 of file nsIDOM3Node.idl.

const unsigned short nsIDOMNode::CDATA_SECTION_NODE = 4 [inherited]

Definition at line 59 of file nsIDOMNode.idl.

readonly attribute DOMString nsIDOMNSDocument::characterSet [inherited]

Definition at line 49 of file nsIDOMNSDocument.idl.

Definition at line 75 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::COMMENT_NODE = 8 [inherited]

Definition at line 63 of file nsIDOMNode.idl.

readonly attribute DOMString nsIDOMNSDocument::contentType [inherited]

Definition at line 56 of file nsIDOMNSDocument.idl.

Definition at line 54 of file nsIDOMDocumentView.idl.

attribute DOMString nsIDOMNSDocument::dir [inherited]

Definition at line 50 of file nsIDOMNSDocument.idl.

Definition at line 60 of file nsIDOMDocument.idl.

const unsigned short nsIDOMNode::DOCUMENT_FRAGMENT_NODE = 11 [inherited]

Definition at line 66 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::DOCUMENT_NODE = 9 [inherited]

Definition at line 64 of file nsIDOMNode.idl.

const unsigned short nsIDOM3Node::DOCUMENT_POSITION_CONTAINED_BY = 0x10 [inherited]

Definition at line 57 of file nsIDOM3Node.idl.

const unsigned short nsIDOM3Node::DOCUMENT_POSITION_CONTAINS = 0x08 [inherited]

Definition at line 56 of file nsIDOM3Node.idl.

const unsigned short nsIDOM3Node::DOCUMENT_POSITION_DISCONNECTED = 0x01 [inherited]

Definition at line 53 of file nsIDOM3Node.idl.

const unsigned short nsIDOM3Node::DOCUMENT_POSITION_FOLLOWING = 0x04 [inherited]

Definition at line 55 of file nsIDOM3Node.idl.

Definition at line 58 of file nsIDOM3Node.idl.

const unsigned short nsIDOM3Node::DOCUMENT_POSITION_PRECEDING = 0x02 [inherited]

Definition at line 54 of file nsIDOM3Node.idl.

const unsigned short nsIDOMNode::DOCUMENT_TYPE_NODE = 10 [inherited]

Definition at line 65 of file nsIDOMNode.idl.

Definition at line 62 of file nsIDOMDocument.idl.

attribute DOMString nsIDOM3Document::documentURI [inherited]

Definition at line 63 of file nsIDOM3Document.idl.

readonly attribute DOMString nsIDOMSVGDocument::domain [inherited]

Definition at line 48 of file nsIDOMSVGDocument.idl.

Definition at line 68 of file nsIDOM3Document.idl.

const unsigned short nsIDOMNode::ELEMENT_NODE = 1 [inherited]

Definition at line 56 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::ENTITY_NODE = 6 [inherited]

Definition at line 61 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::ENTITY_REFERENCE_NODE = 5 [inherited]

Definition at line 60 of file nsIDOMNode.idl.

Definition at line 76 of file nsIDOMNode.idl.

Definition at line 61 of file nsIDOMDocument.idl.

readonly attribute DOMString nsIDOM3Document::inputEncoding [inherited]

Definition at line 51 of file nsIDOM3Document.idl.

Definition at line 77 of file nsIDOMNode.idl.

readonly attribute DOMString nsIDOMNSDocument::lastModified [inherited]

Definition at line 57 of file nsIDOMNSDocument.idl.

readonly attribute DOMString nsIDOMNode::localName [inherited]

Definition at line 107 of file nsIDOMNode.idl.

Definition at line 52 of file nsIDOMNSDocument.idl.

PRPackedBool nsXMLDocument::mAsync [protected, inherited]

Definition at line 116 of file nsXMLDocument.h.

Definition at line 889 of file nsDocument.h.

nsString nsDocument::mBaseTarget [protected, inherited]

Definition at line 895 of file nsDocument.h.

PRBool nsIDocument::mBidiEnabled [protected, inherited]

Definition at line 831 of file nsIDocument.h.

Definition at line 820 of file nsIDocument.h.

nsSupportsHashtable* nsDocument::mBoxObjectTable [protected, inherited]

Definition at line 885 of file nsDocument.h.

Definition at line 841 of file nsDocument.h.

nsCOMPtr<nsIChannel> nsDocument::mChannel [protected, inherited]

Definition at line 888 of file nsDocument.h.

Definition at line 113 of file nsXMLDocument.h.

nsCString nsIDocument::mCharacterSet [protected, inherited]

Definition at line 806 of file nsIDocument.h.

PRInt32 nsIDocument::mCharacterSetSource [protected, inherited]

Definition at line 807 of file nsIDocument.h.

Definition at line 827 of file nsDocument.h.

Definition at line 868 of file nsDocument.h.

Definition at line 834 of file nsDocument.h.

Definition at line 833 of file nsIDocument.h.

nsCString nsIDocument::mContentType [protected, inherited]

Definition at line 834 of file nsIDocument.h.

nsICSSLoader* nsIDocument::mCSSLoader [protected, inherited]

Definition at line 823 of file nsIDocument.h.

PRUint8 nsDocument::mDefaultElementType [protected, inherited]

Definition at line 883 of file nsDocument.h.

Definition at line 800 of file nsIDocument.h.

Definition at line 804 of file nsIDocument.h.

Definition at line 802 of file nsIDocument.h.

nsString nsIDocument::mDocumentTitle [protected, inherited]

Definition at line 798 of file nsIDocument.h.

nsCOMPtr<nsIURI> nsIDocument::mDocumentURI [protected, inherited]

Definition at line 799 of file nsIDocument.h.

Definition at line 862 of file nsDocument.h.

Definition at line 103 of file nsXMLDocument.h.

Definition at line 879 of file nsDocument.h.

nsDocHeaderData* nsDocument::mHeaderData [protected, inherited]

Definition at line 864 of file nsDocument.h.

PRPackedBool nsDocument::mInDestructor [protected, inherited]

Definition at line 875 of file nsDocument.h.

PRPackedBool nsDocument::mIsGoingAway [protected, inherited]

Definition at line 873 of file nsDocument.h.

Definition at line 910 of file nsIDocument.h.

nsString nsDocument::mLastModified [protected, inherited]

Definition at line 824 of file nsDocument.h.

Definition at line 865 of file nsDocument.h.

Definition at line 861 of file nsDocument.h.

Definition at line 114 of file nsXMLDocument.h.

Definition at line 115 of file nsXMLDocument.h.

Definition at line 117 of file nsXMLDocument.h.

PRInt32 nsIDocument::mNextContentID [protected, inherited]

Definition at line 818 of file nsIDocument.h.

Definition at line 821 of file nsIDocument.h.

Definition at line 844 of file nsDocument.h.

nsIDocument* nsIDocument::mParentDocument [protected, inherited]

Definition at line 810 of file nsIDocument.h.

nsCOMPtr<nsIParser> nsDocument::mParser [protected, inherited]

Definition at line 838 of file nsDocument.h.

PRUint32 nsIDocument::mPartID [protected, inherited]

Definition at line 841 of file nsIDocument.h.

nsSmallVoidArray nsDocument::mPresShells [protected, inherited]

Definition at line 831 of file nsDocument.h.

nsCOMPtr<nsIPrincipal> nsDocument::mPrincipal [protected, inherited]

Definition at line 825 of file nsDocument.h.

Definition at line 828 of file nsIDocument.h.

nsHashtable nsDocument::mRadioGroups [protected, inherited]

Definition at line 870 of file nsDocument.h.

nsCString nsDocument::mReferrer [protected, inherited]

Definition at line 823 of file nsDocument.h.

nsIContent* nsIDocument::mRootContent [protected, inherited]

Definition at line 814 of file nsIDocument.h.

nsWeakPtr nsDocument::mScopeObject [protected, inherited]

Definition at line 859 of file nsDocument.h.

Definition at line 105 of file nsXMLDocument.h.

Definition at line 893 of file nsDocument.h.

Definition at line 849 of file nsDocument.h.

Definition at line 863 of file nsDocument.h.

nsWeakPtr nsDocument::mScriptObject [protected, inherited]

Definition at line 854 of file nsDocument.h.

nsCOMPtr<nsISupports> nsIDocument::mSecurityInfo [protected, inherited]

Definition at line 837 of file nsIDocument.h.

Definition at line 890 of file nsDocument.h.

Definition at line 840 of file nsDocument.h.

PLDHashTable* nsDocument::mSubDocuments [protected, inherited]

Definition at line 829 of file nsDocument.h.

PRPackedBool nsDocument::mVisible [protected, inherited]

Definition at line 877 of file nsDocument.h.

Definition at line 866 of file nsDocument.h.

PRUint8 nsDocument::mXMLDeclarationBits [protected, inherited]

Definition at line 881 of file nsDocument.h.

Definition at line 891 of file nsDocument.h.

readonly attribute DOMString nsIDOMNode::namespaceURI [inherited]

Definition at line 101 of file nsIDOMNode.idl.

Definition at line 79 of file nsIDOMNode.idl.

readonly attribute DOMString nsIDOMNode::nodeName [inherited]

Definition at line 69 of file nsIDOMNode.idl.

readonly attribute unsigned short nsIDOMNode::nodeType [inherited]

Definition at line 73 of file nsIDOMNode.idl.

attribute DOMString nsIDOMNode::nodeValue [inherited]

Definition at line 70 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::NOTATION_NODE = 12 [inherited]

Definition at line 67 of file nsIDOMNode.idl.

Definition at line 82 of file nsIDOMNode.idl.

Definition at line 74 of file nsIDOMNode.idl.

This attribute indicates the preferredStylesheetSet as set by the author.

It is determined from the order of stylesheet declarations and the Default-Style HTTP headers. See [[HTML4]]. If there is no preferred stylesheet set, this attribute returns the empty string. The case of this attribute must exactly match the case given by the author where the preferred stylesheet is specified or implied.

Definition at line 59 of file nsIDOMNSDocumentStyle.idl.

attribute DOMString nsIDOMNode::prefix [inherited]

Definition at line 103 of file nsIDOMNode.idl.

Definition at line 78 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::PROCESSING_INSTRUCTION_NODE = 7 [inherited]

Definition at line 62 of file nsIDOMNode.idl.

const unsigned long nsIChannelEventSink::REDIRECT_INTERNAL = 1 << 2 [inherited]

This is an internal redirect, i.e.

it was not initiated by the remote server, but is specific to the channel implementation.

The new URI may be identical to the old one.

Definition at line 81 of file nsIChannelEventSink.idl.

const unsigned long nsIChannelEventSink::REDIRECT_PERMANENT = 1 << 1 [inherited]

This is a permanent redirect.

New requests for this resource should use the URI of the new channel (This might be an HTTP 301 reponse). If this flag is not set, this is a temporary redirect.

The new URI may be identical to the old one.

Definition at line 73 of file nsIChannelEventSink.idl.

const unsigned long nsIChannelEventSink::REDIRECT_TEMPORARY = 1 << 0 [inherited]

This is a temporary redirect.

New requests for this resource should continue to use the URI of the old channel.

The new URI may be identical to the old one.

Definition at line 64 of file nsIChannelEventSink.idl.

readonly attribute DOMString nsIDOMSVGDocument::referrer [inherited]

Definition at line 47 of file nsIDOMSVGDocument.idl.

readonly attribute DOMString nsIDOMNSDocument::referrer [inherited]

Definition at line 58 of file nsIDOMNSDocument.idl.

Definition at line 50 of file nsIDOMSVGDocument.idl.

Definition at line 61 of file nsIDOM3Document.idl.

Definition at line 55 of file nsIDOMDocumentStyle.idl.

const unsigned short nsIDOMNode::TEXT_NODE = 3 [inherited]

Definition at line 58 of file nsIDOMNode.idl.

attribute DOMString nsIDOM3Node::textContent [inherited]

Definition at line 64 of file nsIDOM3Node.idl.

readonly attribute DOMString nsIDOMSVGDocument::title [inherited]

Definition at line 46 of file nsIDOMSVGDocument.idl.

attribute DOMString nsIDOMNSDocument::title [inherited]

Definition at line 54 of file nsIDOMNSDocument.idl.

readonly attribute DOMString nsIDOMSVGDocument::URL [inherited]

Definition at line 49 of file nsIDOMSVGDocument.idl.

readonly attribute DOMString nsIDOM3Document::xmlEncoding [inherited]

Definition at line 53 of file nsIDOM3Document.idl.

Definition at line 55 of file nsIDOM3Document.idl.

attribute DOMString nsIDOM3Document::xmlVersion [inherited]

Definition at line 58 of file nsIDOM3Document.idl.


The documentation for this class was generated from the following files: