Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
nsDOMEvent.cpp File Reference
#include "nsCOMPtr.h"
#include "nsDOMEvent.h"
#include "nsEventStateManager.h"
#include "nsIFrame.h"
#include "nsIContent.h"
#include "nsIPresShell.h"
#include "nsIDocument.h"
#include "nsIPrivateCompositionEvent.h"
#include "nsIDOMEventTarget.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "prmem.h"
#include "nsLayoutAtoms.h"
#include "nsMutationEvent.h"
#include "nsContentUtils.h"
#include "nsIURI.h"
#include "nsIScriptSecurityManager.h"
#include "nsIScriptError.h"

Go to the source code of this file.


static void ReportUseOfDeprecatedMethod (nsIDOMEvent *aDOMEvent, const char *aWarning)
static PRBool PopupAllowedForEvent (const char *eventName)
nsresult NS_NewDOMEvent (nsIDOMEvent **aInstancePtrResult, nsPresContext *aPresContext, nsEvent *aEvent)


static const char *const sEventNames []
static char * sPopupAllowedEvents

Function Documentation

nsresult NS_NewDOMEvent ( nsIDOMEvent **  aInstancePtrResult,
nsPresContext aPresContext,
nsEvent aEvent 

Definition at line 1308 of file nsDOMEvent.cpp.

  nsDOMEvent* it = new nsDOMEvent(aPresContext, aEvent);
  if (nsnull == it) {

  return CallQueryInterface(it, aInstancePtrResult);

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool PopupAllowedForEvent ( const char *  eventName) [static]

Definition at line 955 of file nsDOMEvent.cpp.

  if (!sPopupAllowedEvents) {

    if (!sPopupAllowedEvents) {
      return PR_FALSE;

  nsDependentCString events(sPopupAllowedEvents);

  nsAFlatCString::const_iterator start, end;
  nsAFlatCString::const_iterator startiter(events.BeginReading(start));

  while (startiter != end) {
    nsAFlatCString::const_iterator enditer(end);

    if (!FindInReadable(nsDependentCString(eventName), startiter, enditer))
      return PR_FALSE;

    // the match is surrounded by spaces, or at a string boundary
    if ((startiter == start || *--startiter == ' ') &&
        (enditer == end || *enditer == ' ')) {
      return PR_TRUE;

    // Move on and see if there are other matches. (The delimitation
    // requirement makes it pointless to begin the next search before
    // the end of the invalid match just found.)
    startiter = enditer;

  return PR_FALSE;

Here is the call graph for this function:

Here is the caller graph for this function:

static void ReportUseOfDeprecatedMethod ( nsIDOMEvent aDOMEvent,
const char *  aWarning 
) [static]

Definition at line 355 of file nsDOMEvent.cpp.

  nsCOMPtr<nsIDocument> doc;
  nsCOMPtr<nsIDOMEventTarget> target;
  nsCOMPtr<nsIContent> content = do_QueryInterface(target);
  if (content) {
    doc = content->GetOwnerDoc();
  } else {
    doc = do_QueryInterface(target);
    if (!doc) {
      nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(target);
      if (window) {
        doc = do_QueryInterface(window->GetExtantDocument());

  nsAutoString type;
  const PRUnichar *strings[] = { type.get() };
                                  strings, NS_ARRAY_LENGTH(strings),
                                  doc ? doc->GetDocumentURI() : nsnull,
                                  EmptyString(), 0, 0,
                                  "DOM Events");

Here is the call graph for this function:

Variable Documentation

const char* const sEventNames[] [static]
Initial value:
  "mousedown", "mouseup", "click", "dblclick", "mouseover",
  "mouseout", "mousemove", "contextmenu", "keydown", "keyup", "keypress",
  "focus", "blur", "load", "beforeunload", "unload", "abort", "error",
  "submit", "reset", "change", "select", "input", "paint" ,"text",
  "compositionstart", "compositionend", "popupshowing", "popupshown",
  "popuphiding", "popuphidden", "close", "command", "broadcast", "commandupdate",
  "dragenter", "dragover", "dragexit", "dragdrop", "draggesture", "resize",
  "scroll","overflow", "underflow", "overflowchanged",
  "DOMSubtreeModified", "DOMNodeInserted", "DOMNodeRemoved", 
  "DOMNodeRemovedFromDocument", "DOMNodeInsertedIntoDocument",
  "DOMAttrModified", "DOMCharacterDataModified",
  "DOMActivate", "DOMFocusIn", "DOMFocusOut",
  "pageshow", "pagehide"


Definition at line 59 of file nsDOMEvent.cpp.

char* sPopupAllowedEvents [static]

Definition at line 80 of file nsDOMEvent.cpp.