Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
nsDocument.cpp File Reference
#include "plstr.h"
#include "prprf.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsDocument.h"
#include "nsUnicharUtils.h"
#include "nsIPrivateDOMEvent.h"
#include "nsIEventStateManager.h"
#include "nsContentList.h"
#include "nsIObserver.h"
#include "nsIBaseWindow.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsCOMArray.h"
#include "nsGUIEvent.h"
#include "nsIDOMStyleSheet.h"
#include "nsDOMAttribute.h"
#include "nsIDOMDOMImplementation.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMAbstractView.h"
#include "nsIDOMDocumentXBL.h"
#include "nsGenericElement.h"
#include "nsIDOMEventGroup.h"
#include "nsIDOMCDATASection.h"
#include "nsIDOMProcessingInstruction.h"
#include "nsDOMString.h"
#include "nsRange.h"
#include "nsIDOMText.h"
#include "nsIDOMComment.h"
#include "nsDOMDocumentType.h"
#include "nsTreeWalker.h"
#include "nsIServiceManager.h"
#include "nsContentCID.h"
#include "nsDOMError.h"
#include "nsIScrollableView.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsContentUtils.h"
#include "nsNodeInfoManager.h"
#include "nsIXBLService.h"
#include "nsIXPointer.h"
#include "nsIFileChannel.h"
#include "nsIMultiPartChannel.h"
#include "nsIRefreshURI.h"
#include "nsIWebNavigation.h"
#include "nsNetUtil.h"
#include "nsIScriptSecurityManager.h"
#include "nsIPrincipal.h"
#include "nsIPrivateDOMImplementation.h"
#include "nsIDOMWindowInternal.h"
#include "nsPIDOMWindow.h"
#include "nsIDOMElement.h"
#include "nsIBoxObject.h"
#include "nsPIBoxObject.h"
#include "nsXULAtoms.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIRadioVisitor.h"
#include "nsIFormControl.h"
#include "nsXMLEventsManager.h"
#include "nsBidiUtils.h"
#include "nsILineBreakerFactory.h"
#include "nsIWordBreakerFactory.h"
#include "nsLWBrkCIID.h"
#include "nsHTMLAtoms.h"
#include "nsScriptEventManager.h"
#include "nsIXPathEvaluatorInternal.h"
#include "nsIParserService.h"
#include "nsContentCreatorFunctions.h"
#include "nsIScriptContext.h"
#include "nsBindingManager.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIRequest.h"
#include "nsILink.h"
#include "nsICharsetAlias.h"
#include "nsIParser.h"
#include "nsDateTimeFormatCID.h"
#include "nsIDateTimeFormat.h"
#include "nsLayoutStatics.h"
#include "prlog.h"

Go to the source code of this file.

Classes

class  SubDocMapEntry
struct  FindContentData
struct  nsRadioGroupStruct
 A struct that holds all the information about a radio group. More...
class  nsDOMImplementation
class  nsXPathDocumentTearoff
struct  DirTable
struct  SubDocEnumArgs
class  URIVisitNotifier

Functions

static NS_DEFINE_CID (kDOMEventGroupCID, NS_DOMEVENTGROUP_CID)
static NS_DEFINE_CID (kCharsetAliasCID, NS_CHARSETALIAS_CID)
static NS_DEFINE_CID (kDateTimeFormatCID, NS_DATETIMEFORMAT_CID)
static PLDHashOperator PR_CALLBACK nsUint32ToContentHashEntryVisitorCallback (nsISupportsHashKey *aEntry, void *aClosure)
nsresult NS_NewDOMImplementation (nsIDOMDOMImplementation **aInstancePtrResult)
 DropBoxObjectDocumentReference (nsHashKey *aKey, void *aData, void *aClosure)
 if (aIID.Equals(NS_GET_IID(nsIDOMXPathEvaluator))&&(!gCheckedForXPathDOM||gHaveXPathDOM))
 SubDocClearEntry (PLDHashTable *table, PLDHashEntryHdr *entry)
 SubDocInitEntry (PLDHashTable *table, PLDHashEntryHdr *entry, const void *key)
 FindContentEnumerator (PLDHashTable *table, PLDHashEntryHdr *hdr, PRUint32 number, void *arg)
static void GetDocumentFromDocShellTreeItem (nsIDocShellTreeItem *aDocShell, nsIDocument **aDocument)
static nsresult GetElementByAttribute (nsIContent *aContent, nsIAtom *aAttrName, const nsAString &aAttrValue, PRBool aUniversalMatch, nsIDOMElement **aResult)
 SubDocHashEnum (PLDHashTable *table, PLDHashEntryHdr *hdr, PRUint32 number, void *arg)
 CanCacheSubDocument (PLDHashTable *table, PLDHashEntryHdr *hdr, PRUint32 number, void *arg)
static PRUint32 GetURIHash (nsIURI *aURI)

Variables

PRBool gCheckedForXPathDOM = PR_FALSE
PRBool gHaveXPathDOM = PR_FALSE
static const DirTable dirAttributes []

Class Documentation

struct nsRadioGroupStruct

A struct that holds all the information about a radio group.

Definition at line 292 of file nsDocument.cpp.

Collaboration diagram for nsRadioGroupStruct:
Class Members
nsSmallVoidArray mRadioButtons
nsCOMPtr< nsIDOMHTMLInputElement > mSelectedRadioButton A strong pointer to the currently selected radio button.
struct DirTable

Definition at line 3371 of file nsDocument.cpp.

Class Members
const char * mName
PRUint8 mValue
struct SubDocEnumArgs

Definition at line 5018 of file nsDocument.cpp.

Collaboration diagram for SubDocEnumArgs:
Class Members
nsSubDocEnumFunc callback
void * data

Function Documentation

CanCacheSubDocument ( PLDHashTable table,
PLDHashEntryHdr hdr,
PRUint32  number,
void arg 
)

Definition at line 5047 of file nsDocument.cpp.

{
  SubDocMapEntry *entry = NS_STATIC_CAST(SubDocMapEntry*, hdr);
  PRBool *canCacheArg = NS_STATIC_CAST(PRBool*, arg);

  nsIDocument *subdoc = entry->mSubDocument;

  // The aIgnoreRequest we were passed is only for us, so don't pass it on.
  PRBool canCache = subdoc ? subdoc->CanSavePresentation(nsnull) : PR_FALSE;
  if (!canCache) {
    *canCacheArg = PR_FALSE;
    return PL_DHASH_STOP;
  }

  return PL_DHASH_NEXT;
}

Here is the call graph for this function:

DropBoxObjectDocumentReference ( nsHashKey *  aKey,
void aData,
void aClosure 
)

Definition at line 814 of file nsDocument.cpp.

{
  nsISupports* data = NS_STATIC_CAST(nsISupports*, aData);
  nsCOMPtr<nsPIBoxObject> boxObject(do_QueryInterface(data));
  if (boxObject) {
    boxObject->SetDocument(nsnull);
  }
  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

FindContentEnumerator ( PLDHashTable table,
PLDHashEntryHdr hdr,
PRUint32  number,
void arg 
)

Definition at line 1825 of file nsDocument.cpp.

Here is the caller graph for this function:

static void GetDocumentFromDocShellTreeItem ( nsIDocShellTreeItem aDocShell,
nsIDocument **  aDocument 
) [static]

Definition at line 2330 of file nsDocument.cpp.

{
  *aDocument = nsnull;

  nsCOMPtr<nsIDOMWindow> window(do_GetInterface(aDocShell));

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

    if (dom_doc) {
      CallQueryInterface(dom_doc, aDocument);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult GetElementByAttribute ( nsIContent aContent,
nsIAtom aAttrName,
const nsAString &  aAttrValue,
PRBool  aUniversalMatch,
nsIDOMElement **  aResult 
) [static]

Definition at line 3057 of file nsDocument.cpp.

{
  nsAutoString value;
  nsresult rv = aContent->GetAttr(kNameSpaceID_None, aAttrName, value);
  if (rv == NS_CONTENT_ATTR_HAS_VALUE &&
      (aUniversalMatch || value.Equals(aAttrValue))) {
    return CallQueryInterface(aContent, aResult);
  }

  PRUint32 childCount = aContent->GetChildCount();

  for (PRUint32 i = 0; i < childCount; ++i) {
    nsIContent *current = aContent->GetChildAt(i);

    GetElementByAttribute(current, aAttrName, aAttrValue, aUniversalMatch,
                          aResult);

    if (*aResult)
      return NS_OK;
  }

  return NS_OK;
}

Here is the call graph for this function:

static PRUint32 GetURIHash ( nsIURI aURI) [static]

Definition at line 5293 of file nsDocument.cpp.

{
  nsCAutoString str;
  aURI->GetSpec(str);
  return HashString(str);
}

Here is the call graph for this function:

if ( aIID.  EqualsNS_GET_IID(nsIDOMXPathEvaluator))&&(!gCheckedForXPathDOM||gHaveXPathDOM)

Definition at line 959 of file nsDocument.cpp.

                                               {
    if (!mXPathDocument) {
      nsCOMPtr<nsIDOMXPathEvaluator> evaluator;
      nsresult rv;
      evaluator = do_CreateInstance(NS_XPATH_EVALUATOR_CONTRACTID, &rv);
      gCheckedForXPathDOM = PR_TRUE;
      gHaveXPathDOM = (evaluator != nsnull);
      if (rv == NS_ERROR_FACTORY_NOT_REGISTERED) {
          return NS_ERROR_NO_INTERFACE;
      }
      NS_ENSURE_SUCCESS(rv, rv);

      nsCOMPtr<nsIXPathEvaluatorInternal> internal =
          do_QueryInterface(evaluator);
      if (internal) {
          internal->SetDocument(this);
      }

      mXPathDocument = new nsXPathDocumentTearoff(evaluator, this);
      NS_ENSURE_TRUE(mXPathDocument, NS_ERROR_OUT_OF_MEMORY);
    }
    foundInterface = mXPathDocument;
  }

Here is the call graph for this function:

static NS_DEFINE_CID ( kDOMEventGroupCID  ,
NS_DOMEVENTGROUP_CID   
) [static]
static NS_DEFINE_CID ( kCharsetAliasCID  ,
NS_CHARSETALIAS_CID   
) [static]
static NS_DEFINE_CID ( kDateTimeFormatCID  ,
NS_DATETIMEFORMAT_CID   
) [static]

Definition at line 502 of file nsDocument.cpp.

{
  *aInstancePtrResult = new nsDOMImplementation(nsnull);
  if (!*aInstancePtrResult) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  NS_ADDREF(*aInstancePtrResult);

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 239 of file nsDocument.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

SubDocClearEntry ( PLDHashTable table,
PLDHashEntryHdr entry 
)

Definition at line 1714 of file nsDocument.cpp.

Here is the caller graph for this function:

SubDocHashEnum ( PLDHashTable table,
PLDHashEntryHdr hdr,
PRUint32  number,
void arg 
)

Definition at line 5025 of file nsDocument.cpp.

SubDocInitEntry ( PLDHashTable table,
PLDHashEntryHdr entry,
const void key 
)

Definition at line 1723 of file nsDocument.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Initial value:

Definition at line 3376 of file nsDocument.cpp.

Definition at line 929 of file nsDocument.cpp.

Definition at line 930 of file nsDocument.cpp.