Back to index

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

#include <nsHTMLDocument.h>

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

List of all members.

Public Types

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

Public Member Functions

 nsHTMLDocument ()
virtual ~nsHTMLDocument ()
virtual nsresult Init ()
virtual NS_HIDDEN_ (void) Destroy()
NS_IMETHOD QueryInterface (REFNSIID aIID, void **aInstancePtr)
 NS_IMETHOD_ (nsrefcnt) AddRef(void)
 NS_IMETHOD_ (nsrefcnt) Release(void)
virtual 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 nsStyleSet::sheetType GetAttrSheetType ()
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 nsresult StartDocumentLoad (const char *aCommand, nsIChannel *aChannel, nsILoadGroup *aLoadGroup, nsISupports *aContainer, nsIStreamListener **aDocListener, PRBool aReset=PR_TRUE, nsIContentSink *aSink=nsnull)
virtual void EndLoad ()
virtual nsresult AddImageMap (nsIDOMHTMLMapElement *aMap)
virtual void RemoveImageMap (nsIDOMHTMLMapElement *aMap)
virtual nsIDOMHTMLMapElementGetImageMap (const nsAString &aMapName)
virtual nsCompatibility GetCompatibilityMode ()
 Access compatibility mode for this document.
virtual void SetCompatibilityMode (nsCompatibility aMode)
virtual PRBool IsWriting ()
virtual PRBool GetIsFrameset ()
virtual void SetIsFrameset (PRBool aFrameset)
virtual NS_HIDDEN_ (nsContentList *) GetForms()
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 AttributeChanged (nsIContent *aChild, PRInt32 aNameSpaceID, nsIAtom *aAttribute, PRInt32 aModType)
virtual void AttributeWillChange (nsIContent *aChild, PRInt32 aNameSpaceID, nsIAtom *aAttribute)
virtual void FlushPendingNotifications (mozFlushType aType)
 Flush notifications for this document and its parent documents (since those may affect the layout of this one).
virtual PRBool IsCaseSensitive ()
NS_DECL_NSIDOMDOCUMENT NS_IMETHOD GetXmlEncoding (nsAString &aXmlVersion)
NS_IMETHOD GetXmlStandalone (PRBool *aXmlStandalone)
NS_IMETHOD SetXmlStandalone (PRBool aXmlStandalone)
NS_IMETHOD GetXmlVersion (nsAString &aXmlVersion)
NS_IMETHOD SetXmlVersion (const nsAString &aXmlVersion)
NS_IMETHOD GetBaseURI (nsAString &aBaseURI)
NS_IMETHOD GetTitle (nsAString &aTitle)
NS_IMETHOD SetTitle (const nsAString &aTitle)
NS_IMETHOD GetReferrer (nsAString &aReferrer)
NS_IMETHOD GetURL (nsAString &aURL)
NS_IMETHOD GetBody (nsIDOMHTMLElement **aBody)
NS_IMETHOD SetBody (nsIDOMHTMLElement *aBody)
NS_IMETHOD GetImages (nsIDOMHTMLCollection **aImages)
NS_IMETHOD GetApplets (nsIDOMHTMLCollection **aApplets)
NS_IMETHOD GetLinks (nsIDOMHTMLCollection **aLinks)
NS_IMETHOD GetForms (nsIDOMHTMLCollection **aForms)
NS_IMETHOD GetAnchors (nsIDOMHTMLCollection **aAnchors)
NS_IMETHOD GetCookie (nsAString &aCookie)
NS_IMETHOD SetCookie (const nsAString &aCookie)
NS_IMETHOD Open (void)
NS_IMETHOD Close (void)
NS_IMETHOD Write (const nsAString &text)
NS_IMETHOD Writeln (const nsAString &text)
NS_IMETHOD GetElementsByName (const nsAString &elementName, nsIDOMNodeList **_retval)
virtual
NS_DECL_NSIDOMNSHTMLDOCUMENT
PRBool 
WasDomainSet ()
virtual nsresult ResolveName (const nsAString &aName, nsIDOMHTMLFormElement *aForm, nsISupports **aResult)
virtual void AddedForm ()
 Called when form->BindToTree() is called so that document knows immediately when a form is added.
virtual void RemovedForm ()
 Called when form->SetDocument() is called so that document knows immediately when a form is removed.
virtual PRInt32 GetNumFormsSynchronous ()
 Called to get a better count of forms than document.forms can provide without calling FlushPendingNotifications (bug 138892).
PRBool IsXHTML ()
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 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 StyleRuleChanged (nsIStyleSheet *aStyleSheet, nsIStyleRule *aOldStyleRule, nsIStyleRule *aNewStyleRule)
virtual void StyleRuleAdded (nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)
virtual void StyleRuleRemoved (nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)
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_ (PRBool) CanSavePresentation(nsIRequest *aNewRequest)
virtual NS_HIDDEN_ (already_AddRefed< nsILayoutHistoryState >) GetLayoutHistoryState() const
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 IsLoadedAsData ()
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)
virtual nsContentListGetForms ()=0
 Get the list of form elements in the document.
void open ()
void close ()
void write (in DOMString text)
void writeln (in DOMString text)
nsIDOMNodeList getElementsByName (in DOMString elementName)
DOMString getSelection ()
nsIDOMDocument open (in ACString aContentType, in boolean aReplace)
void write ()
void writeln ()
void clear ()
void captureEvents (in long eventFlags)
void releaseEvents (in long eventFlags)
void routeEvent (in nsIDOMEvent evt)
boolean execCommand (in DOMString commandID, in boolean doShowUI, in DOMString value)
boolean execCommandShowHelp (in DOMString commandID)
boolean queryCommandEnabled (in DOMString commandID)
boolean queryCommandIndeterm (in DOMString commandID)
boolean queryCommandState (in DOMString commandID)
boolean queryCommandSupported (in DOMString commandID)
DOMString queryCommandText (in DOMString commandID)
DOMString queryCommandValue (in DOMString commandID)

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
attribute DOMString title
readonly attribute DOMString referrer
readonly attribute DOMString domain
readonly attribute DOMString URL
attribute nsIDOMHTMLElement body
readonly attribute
nsIDOMHTMLCollection 
images
readonly attribute
nsIDOMHTMLCollection 
applets
readonly attribute
nsIDOMHTMLCollection 
links
readonly attribute
nsIDOMHTMLCollection 
forms
readonly attribute
nsIDOMHTMLCollection 
anchors
attribute DOMString cookie
readonly attribute long width
readonly attribute long height
attribute DOMString alinkColor
attribute DOMString linkColor
attribute DOMString vlinkColor
attribute DOMString bgColor
attribute DOMString fgColor
attribute DOMString domain
readonly attribute
nsIDOMHTMLCollection 
embeds
readonly attribute DOMString compatMode
readonly attribute
nsIDOMHTMLCollection 
plugins
attribute DOMString designMode
 Midas additions.

Protected Member Functions

nsresult GetPixelDimensions (nsIPresShell *aShell, PRInt32 *aWidth, PRInt32 *aHeight)
nsresult RegisterNamedItems (nsIContent *aContent)
nsresult UnregisterNamedItems (nsIContent *aContent)
nsresult UpdateNameTableEntry (const nsAString &aName, nsIContent *aContent)
nsresult AddToIdTable (const nsAString &aId, nsIContent *aContent)
nsresult UpdateIdTableEntry (const nsAString &aId, nsIContent *aContent)
nsresult RemoveFromNameTable (const nsAString &aName, nsIContent *aContent)
nsresult RemoveFromIdTable (nsIContent *aContent)
void InvalidateHashTables ()
nsresult PrePopulateHashTables ()
nsIContentMatchId (nsIContent *aContent, const nsAString &aId)
PRBool GetBodyContent ()
void GetBodyElement (nsIDOMHTMLBodyElement **aBody)
void GetDomainURI (nsIURI **uri)
nsresult WriteCommon (const nsAString &aText, PRBool aNewlineTerminate)
nsresult ScriptWriteCommon (PRBool aNewlineTerminate)
nsresult OpenCommon (const nsACString &aContentType, PRBool aReplace)
nsresult CreateAndAddWyciwygChannel (void)
nsresult RemoveWyciwygChannel (void)
voidGenerateParserKey (void)
PRInt32 GetDefaultNamespaceID () const
 Returns the default namespace ID used for elements created in this document.
PRBool TryParentCharset (nsIDocumentCharsetInfo *aDocInfo, nsIDocument *aParentDocument, PRInt32 &charsetSource, nsACString &aCharset)
void StartAutodetection (nsIDocShell *aDocShell, nsACString &aCharset, const char *aCommand)
nsresult GetMidasCommandManager (nsICommandManager **aCommandManager)
PRBool ConvertToMidasInternalCommand (const nsAString &inCommandID, const nsAString &inParam, nsACString &outCommandID, nsACString &outParam, PRBool &isBoolean, PRBool &boolValue)
nsresult DoClipboardSecurityCheck (PRBool aPaste)
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)
void FillStyleSet (nsStyleSet *aStyleSet)
nsresult CreateElement (nsINodeInfo *aNodeInfo, PRInt32 aElementType, nsIContent **aResult)
PRBool IsSafeToFlush () const
void DispatchEventToWindow (nsEvent *aEvent)

Static Protected Member Functions

static PRBool MatchLinks (nsIContent *aContent, PRInt32 aNamespaceID, nsIAtom *aAtom, const nsAString &aData)
static PRBool MatchAnchors (nsIContent *aContent, PRInt32 aNamespaceID, nsIAtom *aAtom, const nsAString &aData)
static PRBool MatchNameAttribute (nsIContent *aContent, PRInt32 aNamespaceID, nsIAtom *aAtom, const nsAString &aData)
static void DocumentWriteTerminationFunc (nsISupports *aRef)
static PRBool TryHintCharset (nsIMarkupDocumentViewer *aMarkupDV, PRInt32 &aCharsetSource, nsACString &aCharset)
static PRBool TryUserForcedCharset (nsIMarkupDocumentViewer *aMarkupDV, nsIDocumentCharsetInfo *aDocInfo, PRInt32 &aCharsetSource, nsACString &aCharset)
static PRBool TryCacheCharset (nsICacheEntryDescriptor *aCacheDescriptor, PRInt32 &aCharsetSource, nsACString &aCharset)
static PRBool TryBookmarkCharset (nsIDocShell *aDocShell, nsIChannel *aChannel, PRInt32 &aCharsetSource, nsACString &aCharset)
static PRBool UseWeakDocTypeDefault (PRInt32 &aCharsetSource, nsACString &aCharset)
static PRBool TryDefaultCharset (nsIMarkupDocumentViewer *aMarkupDV, PRInt32 &aCharsetSource, nsACString &aCharset)
static PRBool TryChannelCharset (nsIChannel *aChannel, PRInt32 &aCharsetSource, nsACString &aCharset)

Protected Attributes

nsCompatibility mCompatMode
nsCOMArray< nsIDOMHTMLMapElementmImageMaps
nsCOMPtr< nsIDOMHTMLCollectionmImages
nsCOMPtr< nsIDOMHTMLCollectionmApplets
nsCOMPtr< nsIDOMHTMLCollectionmEmbeds
nsCOMPtr< nsIDOMHTMLCollectionmLinks
nsCOMPtr< nsIDOMHTMLCollectionmAnchors
nsRefPtr< nsContentListmForms
PRInt32 mNumForms
 

of forms in the document, synchronously set


PRInt32 mTexttype
PRUint32 mIsWriting: 1
PRUint32 mWriteLevel: 31
PRUint32 mLoadFlags
nsCOMPtr< nsIDOMNodemBodyContent
PRPackedBool mDomainWasSet
PRPackedBool mIsFrameset
PRPackedBool mTooDeepWriteRecursion
PLDHashTable mIdAndNameHashTable
nsCOMPtr< nsIWyciwygChannelmWyciwygChannel
nsCOMPtr< nsICommandManagermMidasCommandManager
PRBool mEditingIsOn
PRInt32 mDefaultNamespaceID
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

Static Protected Attributes

static PRUint32 gWyciwygSessionCnt = 0
static jsval sCutCopyInternal_id = JSVAL_VOID
static jsval sPasteInternal_id = JSVAL_VOID

Detailed Description

Definition at line 68 of file nsHTMLDocument.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 284 of file nsHTMLDocument.cpp.

  : mCompatMode(eCompatibility_NavQuirks),
    mTexttype(IBMBIDI_TEXTTYPE_LOGICAL),
    mDefaultNamespaceID(kNameSpaceID_None)
{

  // NOTE! nsDocument::operator new() zeroes out all members, so don't
  // bother initializing members to 0.

  mDefaultElementType = kNameSpaceID_XHTML;
}

Definition at line 296 of file nsHTMLDocument.cpp.

Here is the call graph for this function:


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;
}

Called when form->BindToTree() is called so that document knows immediately when a form is added.

Implements nsIHTMLDocument.

Definition at line 2620 of file nsHTMLDocument.cpp.

{
  ++mNumForms;
}
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]

Implements nsIHTMLDocument.

Definition at line 1091 of file nsHTMLDocument.cpp.

{
  // XXX We should order the maps based on their order in the document.
  // XXX Otherwise scripts that add/remove maps with duplicate names
  // XXX will cause problems
  NS_PRECONDITION(nsnull != aMap, "null ptr");
  if (nsnull == aMap) {
    return NS_ERROR_NULL_POINTER;
  }
  if (mImageMaps.AppendObject(aMap)) {
    return NS_OK;
  }
  return NS_ERROR_OUT_OF_MEMORY;
}

Here is the call graph for this function:

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);
  }
}
nsresult nsHTMLDocument::AddToIdTable ( const nsAString &  aId,
nsIContent aContent 
) [protected]

Definition at line 3173 of file nsHTMLDocument.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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 nsHTMLDocument::AttributeChanged ( nsIContent aChild,
PRInt32  aNameSpaceID,
nsIAtom aAttribute,
PRInt32  aModType 
) [virtual]

Reimplemented from nsDocument.

Definition at line 1268 of file nsHTMLDocument.cpp.

{
  NS_ABORT_IF_FALSE(aContent, "Null content!");
  NS_PRECONDITION(aAttribute, "Must have an attribute that's changing!");

  if (!IsXHTML() && aAttribute == nsHTMLAtoms::name &&
      aNameSpaceID == kNameSpaceID_None) {
    nsAutoString value;

    if (IsNamedItem(aContent, aContent->Tag(), value)) {
      nsresult rv = UpdateNameTableEntry(value, aContent);

      if (NS_FAILED(rv)) {
        return;
      }
    }
  } else if (aAttribute == aContent->GetIDAttributeName() &&
             aNameSpaceID == kNameSpaceID_None) {
    nsAutoString value;

    aContent->GetAttr(aNameSpaceID,
                      aContent->GetIDAttributeName(),
                      value);

    if (!value.IsEmpty()) {
      nsresult rv = AddToIdTable(value, aContent);

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

  nsDocument::AttributeChanged(aContent, aNameSpaceID, aAttribute, aModType);
}

Here is the call graph for this function:

void nsHTMLDocument::AttributeWillChange ( nsIContent aChild,
PRInt32  aNameSpaceID,
nsIAtom aAttribute 
) [virtual]

Reimplemented from nsDocument.

Definition at line 1238 of file nsHTMLDocument.cpp.

{
  NS_ABORT_IF_FALSE(aContent, "Null content!");
  NS_PRECONDITION(aAttribute, "Must have an attribute that's changing!");

  if (!IsXHTML() && aAttribute == nsHTMLAtoms::name &&
      aNameSpaceID == kNameSpaceID_None) {
    nsAutoString value;

    if (IsNamedItem(aContent, aContent->Tag(), value)) {
      nsresult rv = RemoveFromNameTable(value, aContent);

      if (NS_FAILED(rv)) {
        return;
      }
    }
  } else if (aAttribute == aContent->GetIDAttributeName() &&
             aNameSpaceID == kNameSpaceID_None) {
    nsresult rv = RemoveFromIdTable(aContent);

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

  nsDocument::AttributeWillChange(aContent, aNameSpaceID, aAttribute);
}

Here is the call graph for this function:

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 nsIDOMNSHTMLDocument::captureEvents ( in long  eventFlags) [inherited]
Deprecated:
These are old Netscape 4 methods.
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));
}
nsIDOMNode nsIDOMNode::cloneNode ( in boolean  deep) [inherited]

Here is the caller graph for this function:

Definition at line 2255 of file nsHTMLDocument.cpp.

{
  if (IsXHTML()) {
    // No calling document.close() on XHTML!

    return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
  }

  nsresult rv = NS_OK;

  if (mParser && mIsWriting) {
    ++mWriteLevel;
    if (mContentType.EqualsLiteral("text/html")) {
      rv = mParser->Parse(NS_LITERAL_STRING("</HTML>"),
                          GenerateParserKey(),
                          mContentType, PR_FALSE,
                          PR_TRUE);
    } else {
      rv = mParser->Parse(EmptyString(), GenerateParserKey(),
                          mContentType, PR_FALSE, PR_TRUE);
    }
    --mWriteLevel;
    mIsWriting = 0;
    mParser = nsnull;

    // XXX Make sure that all the document.written content is
    // reflowed.  We should remove this call once we change
    // nsHTMLDocument::OpenCommon() so that it completely destroys the
    // earlier document's content and frame hierarchy.  Right now, it
    // re-uses the earlier document's root content object and
    // corresponding frame objects.  These re-used frame objects think
    // that they have already been reflowed, so they drop initial
    // reflows.  For certain cases of document.written content, like a
    // frameset document, the dropping of the initial reflow means
    // that we end up in document.close() without appended any reflow
    // commands to the reflow queue and, consequently, without adding
    // the dummy layout request to the load group.  Since the dummy
    // layout request is not added to the load group, the onload
    // handler of the frameset fires before the frames get reflowed
    // and loaded.  That is the long explanation for why we need this
    // one line of code here!
    // XXXbz as far as I can tell this may not be needed anymore; all
    // the testcases in bug 57636 pass without this line...  Leaving
    // it be for now, though.  In any case, there's no reason to do
    // this if we have no presshell, since in that case none of the
    // above about reusing frames applies.
    if (GetNumberOfShells() != 0) {
      FlushPendingNotifications(Flush_Layout);
    }

    // Remove the wyciwyg channel request from the document load group
    // that we added in OpenCommon().  If all other requests between
    // document.open() and document.close() have completed, then this
    // method should cause the firing of an onload event.
    NS_ASSERTION(mWyciwygChannel, "nsHTMLDocument::Close(): Trying to remove "
                 "non-existent wyciwyg channel!");
    RemoveWyciwygChannel();
    NS_ASSERTION(!mWyciwygChannel, "nsHTMLDocument::Close(): "
                 "nsIWyciwygChannel could not be removed!");
  }

  return NS_OK;
}

Here is the call graph for this function:

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

Reimplemented from nsDocument.

Definition at line 1185 of file nsHTMLDocument.cpp.

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

  // Register new content. That is the content numbered from
  // aNewIndexInContainer and upwards.
  PRUint32 count = aContainer->GetChildCount();

  for (PRUint32 i = aNewIndexInContainer; i < count; ++i) {
    RegisterNamedItems(aContainer->GetChildAt(i));
  }

  nsDocument::ContentAppended(aContainer, aNewIndexInContainer);
}

Here is the call graph for this function:

void nsHTMLDocument::ContentInserted ( nsIContent aContainer,
nsIContent aChild,
PRInt32  aIndexInContainer 
) [virtual]

Reimplemented from nsDocument.

Definition at line 1202 of file nsHTMLDocument.cpp.

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

  nsresult rv = RegisterNamedItems(aContent);

  if (NS_FAILED(rv)) {
    return;
  }

  nsDocument::ContentInserted(aContainer, aContent, aIndexInContainer);
}

Here is the call graph for this function:

void nsHTMLDocument::ContentRemoved ( nsIContent aContainer,
nsIContent aChild,
PRInt32  aIndexInContainer 
) [virtual]

Reimplemented from nsDocument.

Definition at line 1217 of file nsHTMLDocument.cpp.

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

  if (aContainer == mRootContent) {
    // Reset mBodyContent in case we got a new body.

    mBodyContent = nsnull;
  }

  nsresult rv = UnregisterNamedItems(aContent);

  if (NS_FAILED(rv)) {
    return;
  }

  nsDocument::ContentRemoved(aContainer, aContent, aIndexInContainer);
}

Here is the call graph for this function:

Here is the caller graph for this function:

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));
}
PRBool nsHTMLDocument::ConvertToMidasInternalCommand ( const nsAString &  inCommandID,
const nsAString &  inParam,
nsACString &  outCommandID,
nsACString &  outParam,
PRBool isBoolean,
PRBool boolValue 
) [protected]

Definition at line 3897 of file nsHTMLDocument.cpp.

{
  NS_ConvertUTF16toUTF8 convertedCommandID(inCommandID);

  // Hack to support old boolean commands that were backwards (see bug 301490).
  PRBool invertBool = PR_FALSE;
  if (convertedCommandID.LowerCaseEqualsLiteral("usecss")) {
    convertedCommandID.Assign("styleWithCSS");
    invertBool = PR_TRUE;
  }
  else if (convertedCommandID.LowerCaseEqualsLiteral("readonly")) {
    convertedCommandID.Assign("contentReadOnly");
    invertBool = PR_TRUE;
  }

  PRUint32 i;
  PRBool found = PR_FALSE;
  for (i = 0; i < MidasCommandCount; ++i) {
    if (convertedCommandID.Equals(gMidasCommandTable[i].incomingCommandString,
                                  nsCaseInsensitiveCStringComparator())) {
      found = PR_TRUE;
      break;
    }
  }

  if (found) {
    // set outCommandID (what we use internally)
    outCommandID.Assign(gMidasCommandTable[i].internalCommandString);

    // set outParam & outIsBoolean based on flags from the table
    outIsBoolean = gMidasCommandTable[i].convertToBoolean;

    if (gMidasCommandTable[i].useNewParam) {
      outParam.Assign(gMidasCommandTable[i].internalParamString);
    }
    else {
      // handle checking of param passed in
      if (outIsBoolean) {
        // if this is a boolean value and it's not explicitly false
        // (e.g. no value) we default to "true". For old backwards commands
        // we invert the check (see bug 301490).
        if (invertBool) {
          outBooleanValue = inParam.LowerCaseEqualsLiteral("false");
        }
        else {
          outBooleanValue = !inParam.LowerCaseEqualsLiteral("false");
        }
        outParam.Truncate();
      }
      else {
        NS_ConvertUCS2toUTF8 convertedParam(inParam);

        // check to see if we need to convert the parameter
        PRUint32 j;
        for (j = 0; j < MidasParamCount; ++j) {
          if (convertedParam.Equals(gMidasParamTable[j].incomingParamString,
                                    nsCaseInsensitiveCStringComparator())) {
            outParam.Assign(gMidasParamTable[j].internalParamString);
            break;
          }
        }

        // if we didn't convert the parameter, just
        // pass through the parameter that was passed to us
        if (j == MidasParamCount)
          outParam.Assign(convertedParam);
      }
    }
  } // end else for useNewParam (do convert existing param)
  else {
    // reset results if the command is not found in our table
    outCommandID.SetLength(0);
    outParam.SetLength(0);
    outIsBoolean = PR_FALSE;
  }

  return found;
}

Definition at line 3597 of file nsHTMLDocument.cpp.

{
  nsresult rv = NS_OK;
  nsCAutoString url, originalSpec;

  mDocumentURI->GetSpec(originalSpec);

  // Generate the wyciwyg url
  url = NS_LITERAL_CSTRING("wyciwyg://")
      + nsPrintfCString("%d", gWyciwygSessionCnt++)
      + NS_LITERAL_CSTRING("/")
      + originalSpec;

  nsCOMPtr<nsIURI> wcwgURI;
  NS_NewURI(getter_AddRefs(wcwgURI), url);

  // Create the nsIWyciwygChannel to store out-of-band
  // document.write() script to cache
  nsCOMPtr<nsIChannel> channel;
  // Create a wyciwyg Channel
  rv = NS_NewChannel(getter_AddRefs(channel), wcwgURI);
  NS_ENSURE_SUCCESS(rv, rv);

  mWyciwygChannel = do_QueryInterface(channel);

  mWyciwygChannel->SetSecurityInfo(mSecurityInfo);

  // Inherit load flags from the original document's channel
  channel->SetLoadFlags(mLoadFlags);

  nsCOMPtr<nsILoadGroup> loadGroup = GetDocumentLoadGroup();

  // Use the Parent document's loadgroup to trigger load notifications
  if (loadGroup && channel) {
    rv = channel->SetLoadGroup(loadGroup);
    NS_ENSURE_SUCCESS(rv, rv);

    nsLoadFlags loadFlags = 0;
    channel->GetLoadFlags(&loadFlags);
    loadFlags |= nsIChannel::LOAD_DOCUMENT_URI;
    channel->SetLoadFlags(loadFlags);

    channel->SetOriginalURI(wcwgURI);

    rv = loadGroup->AddRequest(mWyciwygChannel, nsnull);
    NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to add request to load group.");
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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 nsHTMLDocument::CreateShell ( nsPresContext aContext,
nsIViewManager aViewManager,
nsStyleSet aStyleSet,
nsIPresShell **  aInstancePtrResult 
) [virtual]

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).

Reimplemented from nsDocument.

Definition at line 414 of file nsHTMLDocument.cpp.

{
  return doCreateShell(aContext, aViewManager, aStyleSet, mCompatMode,
                       aInstancePtrResult);
}

Here is the call graph for this function:

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:

Definition at line 3989 of file nsHTMLDocument.cpp.

{
  nsresult rv = NS_ERROR_FAILURE;

  nsCOMPtr<nsIJSContextStack> stack =
    do_GetService("@mozilla.org/js/xpc/ContextStack;1");

  if (stack) {
    JSContext *cx = nsnull;
    stack->Peek(&cx);

    NS_NAMED_LITERAL_CSTRING(classNameStr, "Clipboard");

    nsIScriptSecurityManager *secMan =
      nsContentUtils::GetSecurityManager();

    if (aPaste) {
      if (nsHTMLDocument::sPasteInternal_id == JSVAL_VOID) {
        nsHTMLDocument::sPasteInternal_id =
          STRING_TO_JSVAL(::JS_InternString(cx, "paste"));
      }
      rv = secMan->CheckPropertyAccess(cx, nsnull, classNameStr.get(),
                                       nsHTMLDocument::sPasteInternal_id,
                                       nsIXPCSecurityManager::ACCESS_GET_PROPERTY);
    } else {
      if (nsHTMLDocument::sCutCopyInternal_id == JSVAL_VOID) {
        nsHTMLDocument::sCutCopyInternal_id =
          STRING_TO_JSVAL(::JS_InternString(cx, "cutcopy"));
      }
      rv = secMan->CheckPropertyAccess(cx, nsnull, classNameStr.get(),
                                       nsHTMLDocument::sCutCopyInternal_id,
                                       nsIXPCSecurityManager::ACCESS_GET_PROPERTY);
    }
  }
  return rv;
}

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 nsHTMLDocument::DocumentWriteTerminationFunc ( nsISupports *  aRef) [static, protected]

Definition at line 986 of file nsHTMLDocument.cpp.

{
  nsCOMPtr<nsIArray> arr = do_QueryInterface(aRef);
  NS_ASSERTION(arr, "Must have array!");

  nsCOMPtr<nsIDocument> doc = do_QueryElementAt(arr, 0);
  NS_ASSERTION(doc, "Must have document!");
  
  nsCOMPtr<nsIParser> parser = do_QueryElementAt(arr, 1);
  NS_ASSERTION(parser, "Must have parser!");

  nsHTMLDocument *htmldoc = NS_STATIC_CAST(nsHTMLDocument *,
                                           NS_STATIC_CAST(nsIDocument*,
                                                          doc.get()));

  // Check whether htmldoc still has the same parser.  If not, it's
  // not for us to mess with it.
  if (htmldoc->mParser != parser) {
    return;
  }

  // If the document is in the middle of a document.write() call, this
  // most likely means that script on a page document.write()'d out a
  // script tag that did location="..." and we're right now finishing
  // up executing the script that was written with
  // document.write(). Since there's still script on the stack (the
  // script that called document.write()) we don't want to release the
  // parser now, that would cause the next document.write() call to
  // cancel the load that was initiated by the location="..." in the
  // script that was written out by document.write().

  if (!htmldoc->mWriteLevel && !htmldoc->mIsWriting) {
    // Release the document's parser so that the call to EndLoad()
    // doesn't just return early and set the termination function again.

    htmldoc->mParser = nsnull;
  }

  htmldoc->EndLoad();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from nsDocument.

Definition at line 1028 of file nsHTMLDocument.cpp.

{
  if (mParser) {
    nsCOMPtr<nsIJSContextStack> stack =
      do_GetService("@mozilla.org/js/xpc/ContextStack;1");

    if (stack) {
      JSContext *cx = nsnull;
      stack->Peek(&cx);

      if (cx) {
        nsIScriptContext *scx = nsJSUtils::GetDynamicScriptContext(cx);

        if (scx) {
          // The load of the document was terminated while we're
          // called from within JS and we have a parser (i.e. we're in
          // the middle of doing document.write()). In stead of
          // releasing the parser and ending the document load
          // directly, we'll make that happen once the script is done
          // executing. This way subsequent document.write() calls
          // won't end up creating a new parser and interrupting other
          // loads that were started while the script was
          // running. I.e. this makes the following case work as
          // expected:
          //
          //   document.write("foo");
          //   location.href = "http://www.mozilla.org";
          //   document.write("bar");

          nsCOMPtr<nsIMutableArray> arr;
          nsresult rv = NS_NewArray(getter_AddRefs(arr));
          if (NS_SUCCEEDED(rv)) {
            rv = arr->AppendElement(NS_STATIC_CAST(nsIDocument*, this),
                                    PR_FALSE);
            if (NS_SUCCEEDED(rv)) {
              rv = arr->AppendElement(mParser, PR_FALSE);
              if (NS_SUCCEEDED(rv)) {
                rv = scx->SetTerminationFunction(DocumentWriteTerminationFunc,
                                                 arr);
                // If we fail to set the termination function, just go ahead
                // and EndLoad now.  The slight bugginess involved is better
                // than leaking.
                if (NS_SUCCEEDED(rv)) {
                  return;
                }
              }
            }
          }
        }
      }
    }
  }

  nsDocument::EndLoad();
}

Here is the call graph for this function:

Here is the caller 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.

boolean nsIDOMNSHTMLDocument::execCommand ( in DOMString  commandID,
in boolean  doShowUI,
in DOMString  value 
) [inherited]
boolean nsIDOMNSHTMLDocument::execCommandShowHelp ( in DOMString  commandID) [inherited]
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:

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

Reimplemented from nsDocument.

Definition at line 1306 of file nsHTMLDocument.cpp.

{
  // Determine if it is safe to flush the sink notifications
  // by determining if it safe to flush all the presshells.
  if ((aType & Flush_Content) && mParser &&
      (!(aType & Flush_SinkNotifications) || IsSafeToFlush())) {
    nsCOMPtr<nsIContentSink> sink = mParser->GetContentSink();
    if (sink) {
      sink->FlushPendingNotifications(aType);
    }
  }
  
  nsDocument::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 3669 of file nsHTMLDocument.cpp.

{
  // The script loader provides us with the currently executing script element,
  // which is guaranteed to be unique per script.
  nsCOMPtr<nsIScriptElement> key;
  mScriptLoader->GetCurrentScript(getter_AddRefs(key));

  return key;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1856 of file nsHTMLDocument.cpp.

{
  if (!mAnchors) {
    mAnchors = new nsContentList(this, MatchAnchors, EmptyString());
    if (!mAnchors) {
      return NS_ERROR_OUT_OF_MEMORY;
    }
  }

  *aAnchors = mAnchors;
  NS_ADDREF(*aAnchors);

  return NS_OK;
}

Here is the call 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]

Definition at line 1763 of file nsHTMLDocument.cpp.

{
  if (!mApplets) {
    mApplets = new nsContentList(this, nsHTMLAtoms::applet,
                                 mDefaultNamespaceID);
    if (!mApplets) {
      return NS_ERROR_OUT_OF_MEMORY;
    }
  }

  *aApplets = mApplets;
  NS_ADDREF(*aApplets);

  return NS_OK;
}

Here is the call graph for this function:

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;
  }

Reimplemented from nsDocument.

Definition at line 404 of file nsHTMLDocument.cpp.

Here is the call graph for this function:

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);
}
NS_IMETHODIMP nsHTMLDocument::GetBaseURI ( nsAString &  aBaseURI)

Definition at line 1469 of file nsHTMLDocument.cpp.

{
  aURI.Truncate();
  nsIURI *uri = mDocumentBaseURI; // WEAK

  if (!uri) {
    uri = mDocumentURI;
  }

  if (uri) {
    nsCAutoString spec;
    uri->GetSpec(spec);

    CopyUTF8toUTF16(spec, aURI);
  }

  return NS_OK;
}

Here is the call graph for this function:

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:

Definition at line 1682 of file nsHTMLDocument.cpp.

{
  NS_ENSURE_ARG_POINTER(aBody);
  *aBody = nsnull;

  nsISupports* element = nsnull;
  nsCOMPtr<nsIDOMNode> node;

  if (mBodyContent || GetBodyContent()) {
    // There is a body element, return that as the body.
    element = mBodyContent;
  } else {
    // The document is most likely a frameset document so look for the
    // outer most frameset element

    nsCOMPtr<nsIDOMNodeList> nodeList;

    nsresult rv;
    if (IsXHTML()) {
      rv = GetElementsByTagNameNS(NS_LITERAL_STRING("http://www.w3.org/1999/xhtml"),
                                  NS_LITERAL_STRING("frameset"),
                                  getter_AddRefs(nodeList));
    } else {
      rv = GetElementsByTagName(NS_LITERAL_STRING("frameset"),
                                getter_AddRefs(nodeList));
    }

    if (nodeList) {
      rv |= nodeList->Item(0, getter_AddRefs(node));

      element = node;
    }

    NS_ENSURE_SUCCESS(rv, rv);
  }

  return element ? CallQueryInterface(element, aBody) : NS_OK;
}

Here is the call graph for this function:

Definition at line 3535 of file nsHTMLDocument.cpp.

{
  if (!mRootContent) {
    return PR_FALSE;
  }

  PRUint32 i, child_count = mRootContent->GetChildCount();

  for (i = 0; i < child_count; ++i) {
    nsIContent *child = mRootContent->GetChildAt(i);
    NS_ENSURE_TRUE(child, NS_ERROR_UNEXPECTED);

    if (child->IsContentOfType(nsIContent::eHTML) &&
        child->GetNodeInfo()->Equals(nsHTMLAtoms::body,
                                     mDefaultNamespaceID)) {
      mBodyContent = do_QueryInterface(child);

      return PR_TRUE;
    }
  }

  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3560 of file nsHTMLDocument.cpp.

{
  *aBody = nsnull;

  if (!mBodyContent && !GetBodyContent()) {
    // No body in this document.

    return;
  }

  CallQueryInterface(mBodyContent, aBody);
}

Here is the call 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();
}

Access compatibility mode for this document.

Implements nsIHTMLDocument.

Definition at line 1162 of file nsHTMLDocument.cpp.

{
  return mCompatMode;
}
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 nsHTMLDocument::GetCookie ( nsAString &  aCookie)

Definition at line 1872 of file nsHTMLDocument.cpp.

{
  aCookie.Truncate(); // clear current cookie in case service fails;
                      // no cookie isn't an error condition.

  // not having a cookie service isn't an error
  nsCOMPtr<nsICookieService> service = do_GetService(kCookieServiceCID);
  if (service) {
    // Get a URI from the document principal. We use the original
    // codebase in case the codebase was changed by SetDomain
    nsCOMPtr<nsIURI> codebaseURI;
    nsIPrincipal* principal = GetPrincipal();
    NS_ENSURE_STATE(principal);
    principal->GetURI(getter_AddRefs(codebaseURI));

    if (!codebaseURI) {
      // Document's principal is not a codebase (may be system), so
      // can't set cookies

      return NS_OK;
    }

    nsXPIDLCString cookie;
    service->GetCookieString(codebaseURI, mChannel, getter_Copies(cookie));
    CopyASCIItoUTF16(cookie, aCookie);
  }

  return NS_OK;
}

Here is the call graph for this function:

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;
}
PRInt32 nsHTMLDocument::GetDefaultNamespaceID ( ) const [inline, protected, virtual]

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

Reimplemented from nsDocument.

Definition at line 250 of file nsHTMLDocument.h.

  {
    return mDefaultNamespaceID;
  };

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:

void nsHTMLDocument::GetDomainURI ( nsIURI **  uri) [protected]

Definition at line 1562 of file nsHTMLDocument.cpp.

{
  *aURI = nsnull;

  nsIPrincipal *principal = GetPrincipal();
  if (!principal)
    return;

  principal->GetDomain(aURI);
  if (!*aURI) {
    principal->GetURI(aURI);
  }
}

Here is the call graph for this function:

nsIDOMElement nsIDOMDocument::getElementById ( in DOMString  elementId) [inherited]
nsIDOMNodeList nsIDOMHTMLDocument::getElementsByName ( in DOMString  elementName) [inherited]
NS_IMETHODIMP nsHTMLDocument::GetElementsByName ( const nsAString &  elementName,
nsIDOMNodeList **  _retval 
)

Definition at line 2605 of file nsHTMLDocument.cpp.

{
  nsContentList* elements = new nsContentList(this,
                                              MatchNameAttribute,
                                              aElementName);
  NS_ENSURE_TRUE(elements, NS_ERROR_OUT_OF_MEMORY);

  *aReturn = elements;
  NS_ADDREF(*aReturn);

  return NS_OK;
}

Here is the call graph for this function:

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]
virtual nsContentList* nsIHTMLDocument::GetForms ( ) [pure virtual, inherited]

Get the list of form elements in the document.

Here is the caller graph for this function:

Definition at line 3576 of file nsHTMLDocument.cpp.

{
  nsContentList *forms = nsHTMLDocument::GetForms();
  if (!forms)
    return NS_ERROR_OUT_OF_MEMORY;

  NS_ADDREF(*aForms = forms);
  return NS_OK;
}

Here is the call graph for this function:

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;
  }
}
nsIDOMHTMLMapElement * nsHTMLDocument::GetImageMap ( const nsAString &  aMapName) [virtual]

Implements nsIHTMLDocument.

Definition at line 1114 of file nsHTMLDocument.cpp.

{
  nsAutoString name;
  PRUint32 i, n = mImageMaps.Count();
  nsIDOMHTMLMapElement *firstMatch = nsnull;

  for (i = 0; i < n; ++i) {
    nsIDOMHTMLMapElement *map = mImageMaps[i];
    NS_ASSERTION(map, "Null map in map list!");

    PRBool match;
    nsresult rv;

    if (IsXHTML()) {
      rv = map->GetId(name);

      match = name.Equals(aMapName);
    } else {
      rv = map->GetName(name);

      match = name.Equals(aMapName, nsCaseInsensitiveStringComparator());
    }

    if (match && NS_SUCCEEDED(rv)) {
      // Quirk: if the first matching map is empty, remember it, but keep
      // searching for a non-empty one, only use it if none was found (bug 264624).
      if (mCompatMode == eCompatibility_NavQuirks) {
        nsCOMPtr<nsIDOMHTMLCollection> mapAreas;
        rv = map->GetAreas(getter_AddRefs(mapAreas));
        if (NS_SUCCEEDED(rv) && mapAreas) {
          PRUint32 length = 0;
          mapAreas->GetLength(&length);
          if (length == 0) {
            if (!firstMatch) {
              firstMatch = map;
            }
            continue;
          }
        }
      }
      return map;
    }
  }

  return firstMatch;
}

Here is the call graph for this function:

Definition at line 1747 of file nsHTMLDocument.cpp.

{
  if (!mImages) {
    mImages = new nsContentList(this, nsHTMLAtoms::img, mDefaultNamespaceID);
    if (!mImages) {
      return NS_ERROR_OUT_OF_MEMORY;
    }
  }

  *aImages = mImages;
  NS_ADDREF(*aImages);

  return NS_OK;
}

Here is the call graph for this function:

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;
  }
virtual PRBool nsHTMLDocument::GetIsFrameset ( ) [inline, virtual]

Implements nsIHTMLDocument.

Definition at line 117 of file nsHTMLDocument.h.

{ return mIsFrameset; }
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:

Definition at line 1812 of file nsHTMLDocument.cpp.

{
  if (!mLinks) {
    mLinks = new nsContentList(this, MatchLinks, EmptyString());
    if (!mLinks) {
      return NS_ERROR_OUT_OF_MEMORY;
    }
  }

  *aLinks = mLinks;
  NS_ADDREF(*aLinks);

  return NS_OK;
}

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:

Definition at line 3776 of file nsHTMLDocument.cpp.

{
  // initialize return value
  NS_ENSURE_ARG_POINTER(aCmdMgr);

  // check if we have it cached
  if (mMidasCommandManager) {
    NS_ADDREF(*aCmdMgr = mMidasCommandManager);
    return NS_OK;
  }

  *aCmdMgr = nsnull;
  if (!mScriptGlobalObject)
    return NS_ERROR_FAILURE;

  nsIDocShell *docshell = mScriptGlobalObject->GetDocShell();
  if (!docshell)
    return NS_ERROR_FAILURE;

  mMidasCommandManager = do_GetInterface(docshell);
  if (!mMidasCommandManager)
    return NS_ERROR_FAILURE;

  NS_ADDREF(*aCmdMgr = mMidasCommandManager);

  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();
}

Called to get a better count of forms than document.forms can provide without calling FlushPendingNotifications (bug 138892).

Implements nsIHTMLDocument.

Definition at line 2632 of file nsHTMLDocument.cpp.

{
  return mNumForms;
}
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:

nsresult nsHTMLDocument::GetPixelDimensions ( nsIPresShell aShell,
PRInt32 aWidth,
PRInt32 aHeight 
) [protected]

Definition at line 2638 of file nsHTMLDocument.cpp.

{
  *aWidth = *aHeight = 0;

  FlushPendingNotifications(Flush_Layout);

  // Find the <body> element: this is what we'll want to use for the
  // document's width and height values.
  if (!mBodyContent && !GetBodyContent()) {
    return NS_OK;
  }

  nsCOMPtr<nsIContent> body = do_QueryInterface(mBodyContent);

  // Now grab its frame
  nsIFrame* frame;
  nsresult rv = aShell->GetPrimaryFrameFor(body, &frame);
  if (NS_SUCCEEDED(rv) && frame) {
    nsSize                    size;
    nsIView* view = frame->GetView();

    // If we have a view check if it's scrollable. If not,
    // just use the view size itself
    if (view) {
      nsIScrollableView* scrollableView = view->ToScrollableView();

      if (scrollableView) {
        scrollableView->GetScrolledView(view);
      }

      nsRect r = view->GetBounds();
      size.height = r.height;
      size.width = r.width;
    }
    // If we don't have a view, use the frame size
    else {
      size = frame->GetSize();
    }

    // Convert from twips to pixels
    nsPresContext *context = aShell->GetPresContext();
    if (context) {
      float scale;
      scale = context->TwipsToPixels();

      *aWidth = NSTwipsToIntPixels(size.width, scale);
      *aHeight = NSTwipsToIntPixels(size.height, scale);
    }
  }

  return NS_OK;
}

Here is the call 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;
}
NS_IMETHODIMP nsHTMLDocument::GetReferrer ( nsAString &  aReferrer)

Definition at line 1556 of file nsHTMLDocument.cpp.

{
  return nsDocument::GetReferrer(aReferrer);
}
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;
  }
DOMString nsIDOMNSHTMLDocument::getSelection ( ) [inherited]
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:

NS_IMETHODIMP nsHTMLDocument::GetTitle ( nsAString &  aTitle)

Definition at line 1550 of file nsHTMLDocument.cpp.

{
  return nsDocument::GetTitle(aTitle);
}
NS_IMETHODIMP nsHTMLDocument::GetURL ( nsAString &  aURL)

Definition at line 1668 of file nsHTMLDocument.cpp.

{
  nsCAutoString str;

  if (mDocumentURI) {
    mDocumentURI->GetSpec(str);
  }

  CopyUTF8toUTF16(str, aURL);

  return NS_OK;
}

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");
    }
  }
}
NS_IMETHODIMP nsHTMLDocument::GetXmlEncoding ( nsAString &  aXmlVersion)

Definition at line 1490 of file nsHTMLDocument.cpp.

{
  if (IsXHTML()) {
    return nsDocument::GetXmlEncoding(aXmlEncoding);
  }

  SetDOMStringToNull(aXmlEncoding);

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 1502 of file nsHTMLDocument.cpp.

{
  if (IsXHTML()) {
    return nsDocument::GetXmlStandalone(aXmlStandalone);
  }

  *aXmlStandalone = PR_FALSE;

  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsHTMLDocument::GetXmlVersion ( nsAString &  aXmlVersion)

Definition at line 1525 of file nsHTMLDocument.cpp.

{
  if (IsXHTML()) {
    return nsDocument::GetXmlVersion(aXmlVersion);
  }

  SetDOMStringToNull(aXmlVersion);

  return NS_OK;
}

Here is the call graph for this function:

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);
}

Reimplemented from nsDocument.

Reimplemented in nsImageDocument, and nsMediaDocument.

Definition at line 317 of file nsHTMLDocument.cpp.

{
  nsresult rv = nsDocument::Init();
  NS_ENSURE_SUCCESS(rv, rv);

  // Now reset the case-sensitivity of the CSSLoader, since we default
  // to being HTML, not XHTML.  Also, reset the compatibility mode to
  // match our compat mode.
  CSSLoader()->SetCaseSensitive(IsXHTML());
  CSSLoader()->SetCompatibilityMode(mCompatMode);

  static PLDHashTableOps hash_table_ops =
  {
    PL_DHashAllocTable,
    PL_DHashFreeTable,
    IdAndNameHashGetKey,
    IdAndNameHashHashKey,
    IdAndNameHashMatchEntry,
    PL_DHashMoveEntryStub,
    IdAndNameHashClearEntry,
    PL_DHashFinalizeStub,
    IdAndNameHashInitEntry
  };

  PRBool ok = PL_DHashTableInit(&mIdAndNameHashTable, &hash_table_ops, nsnull,
                                sizeof(IdAndNameMapEntry), 16);
  if (!ok) {
    mIdAndNameHashTable.ops = nsnull;

    return NS_ERROR_OUT_OF_MEMORY;
  }

  PrePopulateHashTables();

  return NS_OK;
}

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:

Definition at line 3054 of file nsHTMLDocument.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from nsIDocument.

Definition at line 1322 of file nsHTMLDocument.cpp.

{
  return IsXHTML();
}

Here is the call 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.

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

Reimplemented in nsXMLDocument.

Definition at line 626 of file nsIDocument.h.

  {
    return PR_FALSE;
  }
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]
virtual PRBool nsHTMLDocument::IsWriting ( ) [inline, virtual]

Implements nsIHTMLDocument.

Definition at line 112 of file nsHTMLDocument.h.

  {
    return mWriteLevel != PRUint32(0);
  }

Definition at line 195 of file nsHTMLDocument.h.

Here is the caller graph for this function:

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]
PRBool nsHTMLDocument::MatchAnchors ( nsIContent aContent,
PRInt32  aNamespaceID,
nsIAtom aAtom,
const nsAString &  aData 
) [static, protected]

Definition at line 1828 of file nsHTMLDocument.cpp.

{
  nsINodeInfo *ni = aContent->GetNodeInfo();
  nsIDocument *doc = aContent->GetCurrentDoc();
  NS_WARN_IF_FALSE(doc,
                   "This method should not be called on content nodes that "
                   "are not in a document!");
  if (ni && doc) {
#ifdef DEBUG
    {
      nsCOMPtr<nsIHTMLDocument> htmldoc =
        do_QueryInterface(doc);
      NS_ASSERTION(htmldoc,
                   "Huh, how did this happen? This should only be used with "
                   "HTML documents!");
    }
#endif

    if (ni->Equals(nsHTMLAtoms::a, doc->GetDefaultNamespaceID())) {
      return aContent->HasAttr(kNameSpaceID_None, nsHTMLAtoms::name);
    }
  }

  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIContent* nsHTMLDocument::MatchId ( nsIContent aContent,
const nsAString &  aId 
) [protected]
PRBool nsHTMLDocument::MatchLinks ( nsIContent aContent,
PRInt32  aNamespaceID,
nsIAtom aAtom,
const nsAString &  aData 
) [static, protected]

Definition at line 1780 of file nsHTMLDocument.cpp.

{
  nsINodeInfo *ni = aContent->GetNodeInfo();
  nsIDocument *doc = aContent->GetDocument();

  if (ni && doc) {
    NS_ASSERTION(aContent->IsInDoc(),
                 "This method should never be called on content nodes that "
                 "are not in a document!");
#ifdef DEBUG
    {
      nsCOMPtr<nsIHTMLDocument> htmldoc =
        do_QueryInterface(aContent->GetCurrentDoc());
      NS_ASSERTION(htmldoc,
                   "Huh, how did this happen? This should only be used with "
                   "HTML documents!");
    }
#endif

    PRInt32 namespaceID = aContent->GetCurrentDoc()->GetDefaultNamespaceID();

    if (ni->Equals(nsHTMLAtoms::a, namespaceID) ||
        ni->Equals(nsHTMLAtoms::area, namespaceID)) {
      return aContent->HasAttr(kNameSpaceID_None, nsHTMLAtoms::href);
    }
  }

  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsHTMLDocument::MatchNameAttribute ( nsIContent aContent,
PRInt32  aNamespaceID,
nsIAtom aAtom,
const nsAString &  aData 
) [static, protected]

Definition at line 2588 of file nsHTMLDocument.cpp.

{
  NS_PRECONDITION(aContent, "Must have content node to work with!");
  
  // Getting attrs is expensive, so use HasAttr() first.
  if (!aContent->HasAttr(kNameSpaceID_None, nsHTMLAtoms::name)) {
    return PR_FALSE;
  }

  nsAutoString value;
  nsresult rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, value);

  return NS_SUCCEEDED(rv) && value.Equals(aData);
}

Here is the call graph for this function:

Here is the caller graph for this function:

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 nsHTMLDocument::NS_HIDDEN_ ( void  ) [virtual]

Reimplemented from nsDocument.

virtual nsHTMLDocument::NS_HIDDEN_ ( nsContentList ) [virtual]
virtual nsDocument::NS_HIDDEN_ ( void ) [virtual, inherited]
virtual nsDocument::NS_HIDDEN_ ( nsresult  ) [virtual, inherited]
virtual nsDocument::NS_HIDDEN_ ( PRBool  ) [virtual, inherited]
virtual nsDocument::NS_HIDDEN_ ( already_AddRefed< nsILayoutHistoryState ) const [virtual, inherited]
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:

nsIDOMDocument nsIDOMNSHTMLDocument::open ( in ACString  aContentType,
in boolean  aReplace 
) [inherited]
void nsIDOMHTMLDocument::open ( ) [inherited]

Definition at line 2231 of file nsHTMLDocument.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsHTMLDocument::OpenCommon ( const nsACString &  aContentType,
PRBool  aReplace 
) [protected]

Definition at line 1936 of file nsHTMLDocument.cpp.

{
  if (IsXHTML()) {
    // No calling document.open() on XHTML

    return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
  }

  nsresult rv = NS_OK;

  // If we already have a parser we ignore the document.open call.
  if (mParser) {

    return NS_OK;
  }

  if (!nsContentUtils::CanCallerAccess(NS_STATIC_CAST(nsIDOMHTMLDocument*, this))) {
    nsPIDOMWindow *win = GetWindow();
    if (win) {
      nsCOMPtr<nsIDOMElement> frameElement;
      rv = win->GetFrameElement(getter_AddRefs(frameElement));
      NS_ENSURE_SUCCESS(rv, rv);

      if (frameElement && !nsContentUtils::CanCallerAccess(frameElement)) {
        return NS_ERROR_DOM_SECURITY_ERR;
      }
    }
  }

  // check whether we're in the middle of unload.  If so, ignore this call.
  nsCOMPtr<nsIDocShell_MOZILLA_1_8_BRANCH2> shell =
    do_QueryReferent(mDocumentContainer);
  if (shell) {
    PRBool inUnload;
    shell->GetIsInUnload(&inUnload);
    if (inUnload) {
      return NS_OK;
    }
  }

  nsCOMPtr<nsIDocument> callerDoc =
    do_QueryInterface(nsContentUtils::GetDocumentFromContext());

  // Grab a reference to the calling documents security info (if any)
  // and principal as it may be lost in the call to Reset().
  nsCOMPtr<nsISupports> securityInfo;
  if (callerDoc) {
    securityInfo = callerDoc->GetSecurityInfo();
  }

  nsCOMPtr<nsIPrincipal> callerPrincipal;
  nsContentUtils::GetSecurityManager()->
    GetSubjectPrincipal(getter_AddRefs(callerPrincipal));

  // The URI for the document after this call. Get it from the calling
  // principal (if available), or set it to "about:blank" if no
  // principal is reachable.
  nsCOMPtr<nsIURI> uri;

  if (callerPrincipal) {
    callerPrincipal->GetURI(getter_AddRefs(uri));
  }
  if (!uri) {
    rv = NS_NewURI(getter_AddRefs(uri),
                   NS_LITERAL_CSTRING("about:blank"));
    NS_ENSURE_SUCCESS(rv, rv);
  }

  nsCOMPtr<nsIDocShell> docshell = do_QueryReferent(mDocumentContainer);

  // Stop current loads targeted at the window this document is in.
  if (mScriptGlobalObject && docshell) {
    nsCOMPtr<nsIContentViewer> cv;
    docshell->GetContentViewer(getter_AddRefs(cv));

    if (cv) {
      PRBool okToUnload;
      rv = cv->PermitUnload(&okToUnload);

      if (NS_SUCCEEDED(rv) && !okToUnload) {
        // We don't want to unload, so stop here, but don't throw an
        // exception.
        return NS_OK;
      }
    }

    nsCOMPtr<nsIWebNavigation> webnav(do_QueryInterface(docshell));
    webnav->Stop(nsIWebNavigation::STOP_NETWORK);
  }

  // The open occurred after the document finished loading.
  // So we reset the document and create a new one.
  nsCOMPtr<nsIChannel> channel;
  nsCOMPtr<nsILoadGroup> group = do_QueryReferent(mDocumentLoadGroup);

  rv = NS_NewChannel(getter_AddRefs(channel), uri, nsnull, group);

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

  // Before we reset the doc notify the globalwindow of the change.

  // Hold onto ourselves on the offchance that we're down to one ref
  nsRefPtr<nsHTMLDocument> kungFuDeathGrip(this);

  if (mScriptGlobalObject) {
    // Remember the old scope in case the call to SetNewDocument changes it.
    nsCOMPtr<nsIScriptGlobalObject> oldScope(do_QueryReferent(mScopeObject));

    // If callerPrincipal doesn't match our principal. make sure that
    // SetNewDocument gives us a new inner window and clears our scope.
    NS_ENSURE_TRUE(GetPrincipal(), NS_ERROR_OUT_OF_MEMORY);
    if (!callerPrincipal ||
        NS_FAILED(nsContentUtils::GetSecurityManager()->
          CheckSameOriginPrincipal(callerPrincipal, GetPrincipal()))) {
      SetIsInitialDocument(PR_FALSE);
    }      

    rv = mScriptGlobalObject->SetNewDocument((nsDocument *)this, nsnull,
                                             PR_FALSE, PR_FALSE);
    NS_ENSURE_SUCCESS(rv, rv);

    // Now make sure we're not flagged as the initial document anymore, now
    // that we've had stuff done to us.  From now on, if anyone tries to
    // document.open() us, they get a new inner window.
    SetIsInitialDocument(PR_FALSE);

    nsCOMPtr<nsIScriptGlobalObject> newScope(do_QueryReferent(mScopeObject));
    if (oldScope && newScope != oldScope) {
      nsContentUtils::ReparentContentWrappersInScope(oldScope, newScope);
    }
  }

  // XXX This is a nasty workaround for a scrollbar code bug
  // (http://bugzilla.mozilla.org/show_bug.cgi?id=55334).

  // Hold on to our root element
  nsCOMPtr<nsIContent> root(mRootContent);

  if (root) {
    PRInt32 rootIndex = mChildren.IndexOfChild(mRootContent);
    NS_ASSERTION(rootIndex >= 0, "Root must be in list!");
    
    PRUint32 count = root->GetChildCount();

    // Remove all the children from the root.
    while (count-- > 0) {
      root->RemoveChildAt(count, PR_TRUE);
    }

    count = mRootContent->GetAttrCount();

    // Remove all attributes from the root element
    while (count-- > 0) {
      nsCOMPtr<nsIAtom> name, prefix;
      PRInt32 nsid;

      root->GetAttrNameAt(count, &nsid, getter_AddRefs(name),
                          getter_AddRefs(prefix));

      root->UnsetAttr(nsid, name, PR_FALSE);
    }

    // Remove the root from the childlist
    mChildren.RemoveChildAt(rootIndex);

    mRootContent = nsnull;
  }

  // Call Reset(), this will now do the full reset, except removing
  // the root from the document, doing that confuses the scrollbar
  // code in mozilla since the document in the root element and all
  // the anonymous content (i.e. scrollbar elements) is set to
  // null.

  Reset(channel, group);

  if (root) {
    // Tear down the frames for the root element.
    ContentRemoved(nsnull, root, 0);

    // Put the root element back into the document, we don't notify
    // the document about this insertion since the sink will do that
    // for us, the sink will call InitialReflow() and that'll create
    // frames for the root element and the scrollbars work as expected
    // (since the document in the root element was never set to null)

    mChildren.AppendChild(root);
    mRootContent = root;
  }

  if (mEditingIsOn) {
    // Reset() blows away all event listeners in the document, and our
    // editor relies heavily on those. Midas is turned on, to make it
    // work, re-initialize it to give it a chance to add its event
    // listeners again.

    SetDesignMode(NS_LITERAL_STRING("off"));
    SetDesignMode(NS_LITERAL_STRING("on"));
  }

  // Zap the old title -- otherwise it would hang around until document.close()
  // (which might never come) if the new document doesn't explicitly set one.
  // Void the title to make sure that we actually respect any titles set by the
  // new document.
  SetTitle(EmptyString());
  mDocumentTitle.SetIsVoid(PR_TRUE);

  // Store the security info of the caller now that we're done
  // resetting the document.
  mSecurityInfo = securityInfo;

  // Restore the principal to that of the caller.
  mPrincipal = callerPrincipal;

  // Recover if we had a problem obtaining the caller principal. In
  // such a case we set the documents URI to be about:blank (uri is
  // set to that above already) and the appropriate principal will be
  // created as needed.
  if (!mPrincipal) {
    mDocumentURI = uri;
  }

  mParser = do_CreateInstance(kCParserCID, &rv);

  // This will be propagated to the parser when someone actually calls write()
  mContentType = aContentType;

  mIsWriting = 1;

  if (NS_SUCCEEDED(rv)) {
    nsCOMPtr<nsIHTMLContentSink> sink;

    rv = NS_NewHTMLContentSink(getter_AddRefs(sink), this, uri, docshell,
                               channel);
    NS_ENSURE_SUCCESS(rv, rv);

    static NS_DEFINE_CID(kNavDTDCID, NS_CNAVDTD_CID);
    nsCOMPtr<nsIDTD> theDTD(do_CreateInstance(kNavDTDCID));
    if(theDTD) {
      mParser->RegisterDTD(theDTD);
    }

    mParser->SetContentSink(sink);
  }

  // Prepare the docshell and the document viewer for the impending
  // out of band document.write()
  if (docshell) {
    docshell->PrepareForNewContentModel();

    // Now check whether we were opened with a "replace" argument.  If
    // so, we need to tell the docshell to not create a new history
    // entry for this load.
    // XXXbz we're basically duplicating the MAKE_LOAD_TYPE macro from
    // nsDocShell.h.  All this stuff needs better apis.
    PRUint32 loadType;
    if (aReplace) {
      loadType = nsIDocShell::LOAD_CMD_NORMAL |
        (nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY << 16);
    } else {
      // Make sure that we're doing a normal load, not whatever type
      // of load was previously done on this docshell.
      loadType = nsIDocShell::LOAD_CMD_NORMAL |
        (nsIWebNavigation::LOAD_FLAGS_NONE << 16);
    }
    docshell->SetLoadType(loadType);
    
    nsCOMPtr<nsIContentViewer> cv;
    docshell->GetContentViewer(getter_AddRefs(cv));
    nsCOMPtr<nsIDocumentViewer> docViewer = do_QueryInterface(cv);
    if (docViewer) {
      docViewer->LoadStart(NS_STATIC_CAST(nsIHTMLDocument *, this));
    }
  }

  // Add a wyciwyg channel request into the document load group
  NS_ASSERTION(!mWyciwygChannel, "nsHTMLDocument::OpenCommon(): wyciwyg "
               "channel already exists!");

  // In case the editor is listening and will see the new channel
  // being added, make sure mWriteLevel is non-zero so that the editor
  // knows that document.open/write/close() is being called on this
  // document.
  ++mWriteLevel;

  CreateAndAddWyciwygChannel();

  --mWriteLevel;

  return rv;
}

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:

boolean nsIDOMNSHTMLDocument::queryCommandEnabled ( in DOMString  commandID) [inherited]
boolean nsIDOMNSHTMLDocument::queryCommandIndeterm ( in DOMString  commandID) [inherited]
boolean nsIDOMNSHTMLDocument::queryCommandState ( in DOMString  commandID) [inherited]
boolean nsIDOMNSHTMLDocument::queryCommandSupported ( in DOMString  commandID) [inherited]
DOMString nsIDOMNSHTMLDocument::queryCommandText ( in DOMString  commandID) [inherited]
DOMString nsIDOMNSHTMLDocument::queryCommandValue ( in DOMString  commandID) [inherited]
NS_IMETHOD nsHTMLDocument::QueryInterface ( REFNSIID  aIID,
void **  aInstancePtr 
)

Here is the caller graph for this function:

Definition at line 3299 of file nsHTMLDocument.cpp.

{
  if (aContent->IsContentOfType(nsIContent::eTEXT)) {
    // Text nodes are not named items nor can they have children.
    return NS_OK;
  }

  nsAutoString value;

  if (!IsXHTML() && IsNamedItem(aContent, aContent->Tag(), value)) {
    UpdateNameTableEntry(value, aContent);
  }

  nsIAtom* idAttr = aContent->GetIDAttributeName();
  if (idAttr) {
    aContent->GetAttr(kNameSpaceID_None, idAttr, value);
    if (!value.IsEmpty()) {
      nsresult rv = UpdateIdTableEntry(value, aContent);
      
      if (NS_FAILED(rv)) {
        return rv;
      }
    }
  }

  PRUint32 i, count = aContent->GetChildCount();

  for (i = 0; i < count; ++i) {
    RegisterNamedItems(aContent->GetChildAt(i));
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIDOMNSHTMLDocument::releaseEvents ( in long  eventFlags) [inherited]
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:

Called when form->SetDocument() is called so that document knows immediately when a form is removed.

Implements nsIHTMLDocument.

Definition at line 2626 of file nsHTMLDocument.cpp.

{
  --mNumForms;
}
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;
}

Definition at line 3233 of file nsHTMLDocument.cpp.

{
  nsIAtom* idAttr = aContent->GetIDAttributeName();
  
  if (!idAttr || !aContent->HasAttr(kNameSpaceID_None, idAttr)) {
    return NS_OK;
  }

  nsAutoString value;
  aContent->GetAttr(kNameSpaceID_None, idAttr, value);

  if (value.IsEmpty()) {
    return NS_OK;
  }

  IdAndNameMapEntry *entry =
    NS_STATIC_CAST(IdAndNameMapEntry *,
                   PL_DHashTableOperate(&mIdAndNameHashTable,
                                        NS_STATIC_CAST(const nsAString *,
                                                       &value),
                                        PL_DHASH_LOOKUP));

  if (PL_DHASH_ENTRY_IS_FREE(entry) || entry->mIdContent != aContent) {
    return NS_OK;
  }

  PL_DHashTableRawRemove(&mIdAndNameHashTable, entry);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsHTMLDocument::RemoveFromNameTable ( const nsAString &  aName,
nsIContent aContent 
) [protected]

Definition at line 3214 of file nsHTMLDocument.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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