Back to index

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

#include <nsDOMSVGEvent.h>

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

List of all members.

Public Types

enum  nsDOMEvents {
  eDOMEvents_mousedown = 0, eDOMEvents_mouseup, eDOMEvents_click, eDOMEvents_dblclick,
  eDOMEvents_mouseover, eDOMEvents_mouseout, eDOMEvents_mousemove, eDOMEvents_contextmenu,
  eDOMEvents_keydown, eDOMEvents_keyup, eDOMEvents_keypress, eDOMEvents_focus,
  eDOMEvents_blur, eDOMEvents_load, eDOMEvents_beforeunload, eDOMEvents_unload,
  eDOMEvents_abort, eDOMEvents_error, eDOMEvents_submit, eDOMEvents_reset,
  eDOMEvents_change, eDOMEvents_select, eDOMEvents_input, eDOMEvents_paint,
  eDOMEvents_text, eDOMEvents_compositionstart, eDOMEvents_compositionend, eDOMEvents_popupShowing,
  eDOMEvents_popupShown, eDOMEvents_popupHiding, eDOMEvents_popupHidden, eDOMEvents_close,
  eDOMEvents_command, eDOMEvents_broadcast, eDOMEvents_commandupdate, eDOMEvents_dragenter,
  eDOMEvents_dragover, eDOMEvents_dragexit, eDOMEvents_dragdrop, eDOMEvents_draggesture,
  eDOMEvents_resize, eDOMEvents_scroll, eDOMEvents_overflow, eDOMEvents_underflow,
  eDOMEvents_overflowchanged, eDOMEvents_subtreemodified, eDOMEvents_nodeinserted, eDOMEvents_noderemoved,
  eDOMEvents_noderemovedfromdocument, eDOMEvents_nodeinsertedintodocument, eDOMEvents_attrmodified, eDOMEvents_characterdatamodified,
  eDOMEvents_DOMActivate, eDOMEvents_DOMFocusIn, eDOMEvents_DOMFocusOut, eDOMEvents_pageshow,
  eDOMEvents_pagehide
}

Public Member Functions

 nsDOMSVGEvent (nsPresContext *aPresContext, nsEvent *aEvent)
void stopPropagation ()
 The stopPropagation method is used prevent further propagation of an event during event flow.
void preventDefault ()
 If an event is cancelable, the preventDefault method is used to signify that the event is to be canceled, meaning any default action normally taken by the implementation as a result of the event will not occur.
void initEvent (in DOMString eventTypeArg, in boolean canBubbleArg, in boolean cancelableArg)
 The initEvent method is used to initialize the value of an Event created through the DocumentEvent interface.
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENT
NS_DECL_NSIDOMNSEVENT
NS_IMETHOD 
DuplicatePrivateData ()
NS_IMETHOD SetTarget (nsIDOMEventTarget *aTarget)
NS_IMETHOD SetCurrentTarget (nsIDOMEventTarget *aCurrentTarget)
NS_IMETHOD SetOriginalTarget (nsIDOMEventTarget *aOriginalTarget)
NS_IMETHOD IsDispatchStopped (PRBool *aIsDispatchStopped)
NS_IMETHOD GetInternalNSEvent (nsEvent **aNSEvent)
NS_IMETHOD HasOriginalTarget (PRBool *aResult)
NS_IMETHOD SetTrusted (PRBool aTrusted)
NS_IMETHOD IsHandled (PRBool *aHandled)
NS_IMETHOD SetHandled (PRBool aHandled)
void preventBubble ()
void preventCapture ()
voidoperator new (size_t sz) CPP_THROW_NEW
void operator delete (void *aPtr)

Static Public Member Functions

static PopupControlState GetEventPopupControlState (nsEvent *aEvent)
static void PopupAllowedEventsChanged ()
static void Shutdown ()

Public Attributes

const unsigned short CAPTURING_PHASE = 1
 The current event phase is the capturing phase.
const unsigned short AT_TARGET = 2
 The event is currently being evaluated at the target EventTarget.
const unsigned short BUBBLING_PHASE = 3
 The current event phase is the bubbling phase.
readonly attribute DOMString type
 The name of the event (case-insensitive).
readonly attribute
nsIDOMEventTarget 
target
 Used to indicate the EventTarget to which the event was originally dispatched.
readonly attribute
nsIDOMEventTarget 
currentTarget
 Used to indicate the EventTarget whose EventListeners are currently being processed.
readonly attribute unsigned short eventPhase
 Used to indicate which phase of event flow is currently being evaluated.
readonly attribute boolean bubbles
 Used to indicate whether or not an event is a bubbling event.
readonly attribute boolean cancelable
 Used to indicate whether or not an event can have its default action prevented.
readonly attribute DOMTimeStamp timeStamp
 Used to specify the time (in milliseconds relative to the epoch) at which the event was created.
const long MOUSEDOWN = 0x00000001
const long MOUSEUP = 0x00000002
const long MOUSEOVER = 0x00000004
const long MOUSEOUT = 0x00000008
const long MOUSEMOVE = 0x00000010
const long MOUSEDRAG = 0x00000020
const long CLICK = 0x00000040
const long DBLCLICK = 0x00000080
const long KEYDOWN = 0x00000100
const long KEYUP = 0x00000200
const long KEYPRESS = 0x00000400
const long DRAGDROP = 0x00000800
const long FOCUS = 0x00001000
const long BLUR = 0x00002000
const long SELECT = 0x00004000
const long CHANGE = 0x00008000
const long RESET = 0x00010000
const long SUBMIT = 0x00020000
const long SCROLL = 0x00040000
const long LOAD = 0x00080000
const long UNLOAD = 0x00100000
const long XFER_DONE = 0x00200000
const long ABORT = 0x00400000
const long ERROR = 0x00800000
const long LOCATE = 0x01000000
const long MOVE = 0x02000000
const long RESIZE = 0x04000000
const long FORWARD = 0x08000000
const long HELP = 0x10000000
const long BACK = 0x20000000
const long TEXT = 0x40000000
const long ALT_MASK = 0x00000001
const long CONTROL_MASK = 0x00000002
const long SHIFT_MASK = 0x00000004
const long META_MASK = 0x00000008
readonly attribute
nsIDOMEventTarget 
originalTarget
 The original target of the event, before any retargetings.
readonly attribute
nsIDOMEventTarget 
explicitOriginalTarget
 The explicit original target of the event.
readonly attribute
nsIDOMEventTarget 
tmpRealOriginalTarget
readonly attribute boolean isTrusted

Protected Member Functions

nsresult SetEventType (const nsAString &aEventTypeArg)
already_AddRefed
< nsIDOMEventTarget
GetTargetFromFrame ()

Static Protected Member Functions

static const char * GetEventName (PRUint32 aEventType)

Protected Attributes

nsEventmEvent
nsCOMPtr< nsPresContextmPresContext
nsCOMPtr< nsIDOMEventTargetmTarget
nsCOMPtr< nsIDOMEventTargetmCurrentTarget
nsCOMPtr< nsIDOMEventTargetmOriginalTarget
nsCOMPtr< nsIDOMEventTargetmExplicitOriginalTarget
nsCOMPtr< nsIDOMEventTargetmTmpRealOriginalTarget
PRPackedBool mEventIsInternal
voidmScriptObject

Static Protected Attributes

static nsAutoPtr< char > gPool
static size_t gPoolSize
static PRBool gPoolInUse

Detailed Description

Definition at line 44 of file nsDOMSVGEvent.h.


Member Enumeration Documentation

enum nsDOMEvent::nsDOMEvents [inherited]
Enumerator:
eDOMEvents_mousedown 
eDOMEvents_mouseup 
eDOMEvents_click 
eDOMEvents_dblclick 
eDOMEvents_mouseover 
eDOMEvents_mouseout 
eDOMEvents_mousemove 
eDOMEvents_contextmenu 
eDOMEvents_keydown 
eDOMEvents_keyup 
eDOMEvents_keypress 
eDOMEvents_focus 
eDOMEvents_blur 
eDOMEvents_load 
eDOMEvents_beforeunload 
eDOMEvents_unload 
eDOMEvents_abort 
eDOMEvents_error 
eDOMEvents_submit 
eDOMEvents_reset 
eDOMEvents_change 
eDOMEvents_select 
eDOMEvents_input 
eDOMEvents_paint 
eDOMEvents_text 
eDOMEvents_compositionstart 
eDOMEvents_compositionend 
eDOMEvents_popupShowing 
eDOMEvents_popupShown 
eDOMEvents_popupHiding 
eDOMEvents_popupHidden 
eDOMEvents_close 
eDOMEvents_command 
eDOMEvents_broadcast 
eDOMEvents_commandupdate 
eDOMEvents_dragenter 
eDOMEvents_dragover 
eDOMEvents_dragexit 
eDOMEvents_dragdrop 
eDOMEvents_draggesture 
eDOMEvents_resize 
eDOMEvents_scroll 
eDOMEvents_overflow 
eDOMEvents_underflow 
eDOMEvents_overflowchanged 
eDOMEvents_subtreemodified 
eDOMEvents_nodeinserted 
eDOMEvents_noderemoved 
eDOMEvents_noderemovedfromdocument 
eDOMEvents_nodeinsertedintodocument 
eDOMEvents_attrmodified 
eDOMEvents_characterdatamodified 
eDOMEvents_DOMActivate 
eDOMEvents_DOMFocusIn 
eDOMEvents_DOMFocusOut 
eDOMEvents_pageshow 
eDOMEvents_pagehide 

Definition at line 69 of file nsDOMEvent.h.


Constructor & Destructor Documentation

nsDOMSVGEvent::nsDOMSVGEvent ( nsPresContext aPresContext,
nsEvent aEvent 
)

Definition at line 44 of file nsDOMSVGEvent.cpp.

  : nsDOMEvent(aPresContext,
               aEvent ? aEvent : new nsEvent(PR_FALSE, 0))
{
  if (aEvent) {
    mEventIsInternal = PR_FALSE;
  }
  else {
    mEventIsInternal = PR_TRUE;
    mEvent->eventStructType = NS_SVG_EVENT;
    mEvent->time = PR_Now();
  }

  mEvent->flags |= NS_EVENT_FLAG_CANT_CANCEL;
  if (mEvent->message == NS_SVG_LOAD || mEvent->message == NS_SVG_UNLOAD) {
    mEvent->flags |= NS_EVENT_FLAG_CANT_BUBBLE;
  }
}

Here is the call graph for this function:


Member Function Documentation

NS_METHOD nsDOMEvent::DuplicatePrivateData ( void  ) [virtual, inherited]

Implements nsIPrivateDOMEvent.

Definition at line 569 of file nsDOMEvent.cpp.

{
  // FIXME! Simplify this method and make it somehow easily extendable,
  //        Bug 329127
  
  NS_ASSERTION(mEvent, "No nsEvent for nsDOMEvent duplication!");
  if (mEventIsInternal) {
    return NS_OK;
  }

  nsEvent* newEvent = nsnull;
  PRUint32 msg = mEvent->message;
  PRBool isInputEvent = PR_FALSE;

  switch (mEvent->eventStructType) {
    case NS_EVENT:
    {
      newEvent = new nsEvent(PR_FALSE, msg);
      break;
    }
    case NS_GUI_EVENT:
    {
      // Not copying widget, it is a weak reference.
      newEvent = new nsGUIEvent(PR_FALSE, msg, nsnull);
      break;
    }
    case NS_SIZE_EVENT:
    {
      nsSizeEvent* sizeEvent = new nsSizeEvent(PR_FALSE, msg, nsnull);
      NS_ENSURE_TRUE(sizeEvent, NS_ERROR_OUT_OF_MEMORY);
      sizeEvent->mWinWidth = NS_STATIC_CAST(nsSizeEvent*, mEvent)->mWinWidth;
      sizeEvent->mWinHeight = NS_STATIC_CAST(nsSizeEvent*, mEvent)->mWinHeight;
      newEvent = sizeEvent;
      break;
    }
    case NS_SIZEMODE_EVENT:
    {
      newEvent = new nsSizeModeEvent(PR_FALSE, msg, nsnull);
      NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
      NS_STATIC_CAST(nsSizeModeEvent*, newEvent)->mSizeMode =
        NS_STATIC_CAST(nsSizeModeEvent*, mEvent)->mSizeMode;
      break;
    }
    case NS_ZLEVEL_EVENT:
    {
      nsZLevelEvent* zLevelEvent = new nsZLevelEvent(PR_FALSE, msg, nsnull);
      NS_ENSURE_TRUE(zLevelEvent, NS_ERROR_OUT_OF_MEMORY);
      nsZLevelEvent* oldZLevelEvent = NS_STATIC_CAST(nsZLevelEvent*, mEvent);
      zLevelEvent->mPlacement = oldZLevelEvent->mPlacement;
      zLevelEvent->mImmediate = oldZLevelEvent->mImmediate;
      zLevelEvent->mAdjusted = oldZLevelEvent->mAdjusted;
      newEvent = zLevelEvent;
      break;
    }
    case NS_PAINT_EVENT:
    {
      newEvent = new nsPaintEvent(PR_FALSE, msg, nsnull);
      break;
    }
    case NS_SCROLLBAR_EVENT:
    {
      newEvent = new nsScrollbarEvent(PR_FALSE, msg, nsnull);
      NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
      NS_STATIC_CAST(nsScrollbarEvent*, newEvent)->position =
        NS_STATIC_CAST(nsScrollbarEvent*, mEvent)->position;
      break;
    }
    case NS_INPUT_EVENT:
    {
      newEvent = new nsInputEvent(PR_FALSE, msg, nsnull);
      isInputEvent = PR_TRUE;
      break;
    }
    case NS_KEY_EVENT:
    {
      nsKeyEvent* keyEvent = new nsKeyEvent(PR_FALSE, msg, nsnull);
      NS_ENSURE_TRUE(keyEvent, NS_ERROR_OUT_OF_MEMORY);
      nsKeyEvent* oldKeyEvent = NS_STATIC_CAST(nsKeyEvent*, mEvent);
      isInputEvent = PR_TRUE;
      keyEvent->keyCode = oldKeyEvent->keyCode;
      keyEvent->charCode = oldKeyEvent->charCode;
      keyEvent->isChar = oldKeyEvent->isChar;
      newEvent = keyEvent;
      break;
    }
    case NS_MOUSE_EVENT:
    {
      nsMouseEvent* oldMouseEvent = NS_STATIC_CAST(nsMouseEvent*, mEvent);
      nsMouseEvent* mouseEvent =
        new nsMouseEvent(PR_FALSE, msg, nsnull, oldMouseEvent->reason);
      NS_ENSURE_TRUE(mouseEvent, NS_ERROR_OUT_OF_MEMORY);
      isInputEvent = PR_TRUE;
      mouseEvent->clickCount = oldMouseEvent->clickCount;
      mouseEvent->acceptActivation = oldMouseEvent->acceptActivation;
      newEvent = mouseEvent;
      break;
    }
    case NS_MENU_EVENT:
    {
      newEvent = new nsMenuEvent(PR_FALSE, msg, nsnull);
      NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
      NS_STATIC_CAST(nsMenuEvent*, newEvent)->mCommand =
        NS_STATIC_CAST(nsMenuEvent*, mEvent)->mCommand;
      break;
    }
    case NS_SCRIPT_ERROR_EVENT:
    {
      newEvent = new nsScriptErrorEvent(PR_FALSE, msg);
      NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
      NS_STATIC_CAST(nsScriptErrorEvent*, newEvent)->lineNr =
        NS_STATIC_CAST(nsScriptErrorEvent*, mEvent)->lineNr;
      break;
    }
    case NS_TEXT_EVENT:
    {
      newEvent = new nsTextEvent(PR_FALSE, msg, nsnull);
      isInputEvent = PR_TRUE;
      break;
    }
    case NS_COMPOSITION_EVENT:
    {
      newEvent = new nsCompositionEvent(PR_FALSE, msg, nsnull);
      isInputEvent = PR_TRUE;
      break;
    }
    case NS_RECONVERSION_EVENT:
    {
      newEvent = new nsReconversionEvent(PR_FALSE, msg, nsnull);
      isInputEvent = PR_TRUE;
      break;
    }
    case NS_MOUSE_SCROLL_EVENT:
    {
      nsMouseScrollEvent* mouseScrollEvent =
        new nsMouseScrollEvent(PR_FALSE, msg, nsnull);
      NS_ENSURE_TRUE(mouseScrollEvent, NS_ERROR_OUT_OF_MEMORY);
      isInputEvent = PR_TRUE;
      nsMouseScrollEvent* oldMouseScrollEvent =
        NS_STATIC_CAST(nsMouseScrollEvent*, mEvent);
      mouseScrollEvent->scrollFlags = oldMouseScrollEvent->scrollFlags;
      mouseScrollEvent->delta = oldMouseScrollEvent->delta;
      newEvent = mouseScrollEvent;
      break;
    }
    case NS_SCROLLPORT_EVENT:
    {
      newEvent = new nsScrollPortEvent(PR_FALSE, msg, nsnull);
      NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
      NS_STATIC_CAST(nsScrollPortEvent*, newEvent)->orient =
        NS_STATIC_CAST(nsScrollPortEvent*, mEvent)->orient;
      break;
    }
    case NS_MUTATION_EVENT:
    {
      nsMutationEvent* mutationEvent = new nsMutationEvent(PR_FALSE, msg);
      NS_ENSURE_TRUE(mutationEvent, NS_ERROR_OUT_OF_MEMORY);
      nsMutationEvent* oldMutationEvent =
        NS_STATIC_CAST(nsMutationEvent*, mEvent);
      mutationEvent->mRelatedNode = oldMutationEvent->mRelatedNode;
      mutationEvent->mAttrName = oldMutationEvent->mAttrName;
      mutationEvent->mPrevAttrValue = oldMutationEvent->mPrevAttrValue;
      mutationEvent->mNewAttrValue = oldMutationEvent->mNewAttrValue;
      mutationEvent->mAttrChange = oldMutationEvent->mAttrChange;
      newEvent = mutationEvent;
      break;
    }
    case NS_ACCESSIBLE_EVENT:
    {
      newEvent = new nsAccessibleEvent(PR_FALSE, msg, nsnull);
      isInputEvent = PR_TRUE;
      break;
    }
    case NS_FORM_EVENT:
    {
      newEvent = new nsFormEvent(PR_FALSE, msg);
      break;
    }
    case NS_FOCUS_EVENT:
    {
      newEvent = new nsFocusEvent(PR_FALSE, msg, nsnull);
      NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
      NS_STATIC_CAST(nsFocusEvent*, newEvent)->isMozWindowTakingFocus =
        NS_STATIC_CAST(nsFocusEvent*, mEvent)->isMozWindowTakingFocus;
      break;
    }
    case NS_POPUP_EVENT:
    {
      newEvent = new nsInputEvent(PR_FALSE, msg, nsnull);
      NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
      isInputEvent = PR_TRUE;
      newEvent->eventStructType = NS_POPUP_EVENT;
      break;
    }
    case NS_APPCOMMAND_EVENT:
    {
      newEvent = new nsAppCommandEvent(PR_FALSE, msg, nsnull);
      NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
      isInputEvent = PR_TRUE;
      NS_STATIC_CAST(nsAppCommandEvent*, newEvent)->appCommand =
        NS_STATIC_CAST(nsAppCommandEvent*, mEvent)->appCommand;
      break;
    }
    case NS_POPUPBLOCKED_EVENT:
    {
      NS_WARNING("nsPopupBlockedEvent should never be an external event!");
      newEvent = new nsPopupBlockedEvent(PR_FALSE, msg);
      break;
    }
    case NS_BEFORE_PAGE_UNLOAD_EVENT:
    {
      newEvent = new nsBeforePageUnloadEvent(PR_FALSE, msg);
      NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
      NS_STATIC_CAST(nsBeforePageUnloadEvent*, newEvent)->text =
        NS_STATIC_CAST(nsBeforePageUnloadEvent*, mEvent)->text;
      break;
    }
    case NS_UI_EVENT:
    {
      newEvent = new nsUIEvent(PR_FALSE, msg,
                               NS_STATIC_CAST(nsUIEvent*, mEvent)->detail);
      break;
    }
    case NS_QUERYCARETRECT_EVENT:
    {
      newEvent = new nsQueryCaretRectEvent(PR_FALSE, msg, nsnull);
      isInputEvent = PR_TRUE;
      break;
    }
    case NS_PAGETRANSITION_EVENT:
    {
      newEvent =
        new nsPageTransitionEvent(PR_FALSE, msg,
                                  ((nsPageTransitionEvent*) mEvent)->persisted);
      break;
    }
#ifdef MOZ_SVG
    case NS_SVG_EVENT:
    {
      newEvent = new nsEvent(PR_FALSE, msg);
      NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
      newEvent->eventStructType = NS_SVG_EVENT;
      break;
    }
    case NS_SVGZOOM_EVENT:
    {
      newEvent = new nsGUIEvent(PR_FALSE, msg, nsnull);
      NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
      newEvent->eventStructType = NS_SVGZOOM_EVENT;
      break;
    }
#endif // MOZ_SVG
    case NS_XUL_COMMAND_EVENT:
    {
      newEvent = new nsXULCommandEvent(PR_FALSE, msg, nsnull);
      NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
      isInputEvent = PR_TRUE;
      newEvent->eventStructType = NS_XUL_COMMAND_EVENT;
      NS_STATIC_CAST(nsXULCommandEvent*, newEvent)->sourceEvent =
        NS_STATIC_CAST(nsXULCommandEvent*, mEvent)->sourceEvent;
      break;
    }
    default:
    {
      NS_WARNING("Unknown event type!!!");
      return NS_ERROR_FAILURE;
    }
  }

  NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);

  if (isInputEvent) {
    nsInputEvent* oldInputEvent = NS_STATIC_CAST(nsInputEvent*, mEvent);
    nsInputEvent* newInputEvent = NS_STATIC_CAST(nsInputEvent*, newEvent);
    newInputEvent->isShift = oldInputEvent->isShift;
    newInputEvent->isControl = oldInputEvent->isControl;
    newInputEvent->isAlt = oldInputEvent->isAlt;
    newInputEvent->isMeta = oldInputEvent->isMeta;
  }

  if (!mTarget) {
    // GetTarget sets mTarget
    nsCOMPtr<nsIDOMEventTarget> dummy;
    GetTarget(getter_AddRefs(dummy));
  }
  newEvent->flags                  = mEvent->flags;
  newEvent->internalAppFlags       = mEvent->internalAppFlags;
  newEvent->time                   = mEvent->time;
  newEvent->point                  = mEvent->point;
  newEvent->refPoint               = mEvent->refPoint;

  mEvent = newEvent;
  mPresContext = nsnull;
  mEventIsInternal = PR_TRUE;

  return NS_OK;
}

Here is the call graph for this function:

const char * nsDOMEvent::GetEventName ( PRUint32  aEventType) [static, protected, inherited]

Definition at line 1152 of file nsDOMEvent.cpp.

{
  switch(aEventType) {
  case NS_MOUSE_LEFT_BUTTON_DOWN:
  case NS_MOUSE_MIDDLE_BUTTON_DOWN:
  case NS_MOUSE_RIGHT_BUTTON_DOWN:
    return sEventNames[eDOMEvents_mousedown];
  case NS_MOUSE_LEFT_BUTTON_UP:
  case NS_MOUSE_MIDDLE_BUTTON_UP:
  case NS_MOUSE_RIGHT_BUTTON_UP:
    return sEventNames[eDOMEvents_mouseup];
  case NS_MOUSE_LEFT_CLICK:
  case NS_MOUSE_MIDDLE_CLICK:
  case NS_MOUSE_RIGHT_CLICK:
    return sEventNames[eDOMEvents_click];
  case NS_MOUSE_LEFT_DOUBLECLICK:
  case NS_MOUSE_MIDDLE_DOUBLECLICK:
  case NS_MOUSE_RIGHT_DOUBLECLICK:
    return sEventNames[eDOMEvents_dblclick];
  case NS_MOUSE_ENTER_SYNTH:
    return sEventNames[eDOMEvents_mouseover];
  case NS_MOUSE_EXIT_SYNTH:
    return sEventNames[eDOMEvents_mouseout];
  case NS_MOUSE_MOVE:
    return sEventNames[eDOMEvents_mousemove];
  case NS_KEY_UP:
    return sEventNames[eDOMEvents_keyup];
  case NS_KEY_DOWN:
    return sEventNames[eDOMEvents_keydown];
  case NS_KEY_PRESS:
    return sEventNames[eDOMEvents_keypress];
  case NS_COMPOSITION_START:
    return sEventNames[eDOMEvents_compositionstart];
  case NS_COMPOSITION_END:
    return sEventNames[eDOMEvents_compositionend];
  case NS_FOCUS_CONTENT:
    return sEventNames[eDOMEvents_focus];
  case NS_BLUR_CONTENT:
    return sEventNames[eDOMEvents_blur];
  case NS_XUL_CLOSE:
    return sEventNames[eDOMEvents_close];
  case NS_PAGE_LOAD:
  case NS_IMAGE_LOAD:
  case NS_SCRIPT_LOAD:
    return sEventNames[eDOMEvents_load];
  case NS_BEFORE_PAGE_UNLOAD:
    return sEventNames[eDOMEvents_beforeunload];
  case NS_PAGE_UNLOAD:
    return sEventNames[eDOMEvents_unload];
  case NS_IMAGE_ABORT:
    return sEventNames[eDOMEvents_abort];
  case NS_IMAGE_ERROR:
  case NS_SCRIPT_ERROR:
    return sEventNames[eDOMEvents_error];
  case NS_FORM_SUBMIT:
    return sEventNames[eDOMEvents_submit];
  case NS_FORM_RESET:
    return sEventNames[eDOMEvents_reset];
  case NS_FORM_CHANGE:
    return sEventNames[eDOMEvents_change];
  case NS_FORM_SELECTED:
    return sEventNames[eDOMEvents_select];
  case NS_FORM_INPUT:
    return sEventNames[eDOMEvents_input];
  case NS_PAINT:
    return sEventNames[eDOMEvents_paint];
  case NS_RESIZE_EVENT:
    return sEventNames[eDOMEvents_resize];
  case NS_SCROLL_EVENT:
    return sEventNames[eDOMEvents_scroll];
  case NS_TEXT_TEXT:
    return sEventNames[eDOMEvents_text];
  case NS_XUL_POPUP_SHOWING:
    return sEventNames[eDOMEvents_popupShowing];
  case NS_XUL_POPUP_SHOWN:
    return sEventNames[eDOMEvents_popupShown];
  case NS_XUL_POPUP_HIDING:
    return sEventNames[eDOMEvents_popupHiding];
  case NS_XUL_POPUP_HIDDEN:
    return sEventNames[eDOMEvents_popupHidden];
  case NS_XUL_COMMAND:
    return sEventNames[eDOMEvents_command];
  case NS_XUL_BROADCAST:
    return sEventNames[eDOMEvents_broadcast];
  case NS_XUL_COMMAND_UPDATE:
    return sEventNames[eDOMEvents_commandupdate];
  case NS_DRAGDROP_ENTER:
    return sEventNames[eDOMEvents_dragenter];
  case NS_DRAGDROP_OVER_SYNTH:
    return sEventNames[eDOMEvents_dragover];
  case NS_DRAGDROP_EXIT_SYNTH:
    return sEventNames[eDOMEvents_dragexit];
  case NS_DRAGDROP_DROP:
    return sEventNames[eDOMEvents_dragdrop];
  case NS_DRAGDROP_GESTURE:
    return sEventNames[eDOMEvents_draggesture];
  case NS_SCROLLPORT_OVERFLOW:
    return sEventNames[eDOMEvents_overflow];
  case NS_SCROLLPORT_UNDERFLOW:
    return sEventNames[eDOMEvents_underflow];
  case NS_SCROLLPORT_OVERFLOWCHANGED:
    return sEventNames[eDOMEvents_overflowchanged];
  case NS_MUTATION_SUBTREEMODIFIED:
    return sEventNames[eDOMEvents_subtreemodified];
  case NS_MUTATION_NODEINSERTED:
    return sEventNames[eDOMEvents_nodeinserted];
  case NS_MUTATION_NODEREMOVED:
    return sEventNames[eDOMEvents_noderemoved];
  case NS_MUTATION_NODEREMOVEDFROMDOCUMENT:
    return sEventNames[eDOMEvents_noderemovedfromdocument];
  case NS_MUTATION_NODEINSERTEDINTODOCUMENT:
    return sEventNames[eDOMEvents_nodeinsertedintodocument];
  case NS_MUTATION_ATTRMODIFIED:
    return sEventNames[eDOMEvents_attrmodified];
  case NS_MUTATION_CHARACTERDATAMODIFIED:
    return sEventNames[eDOMEvents_characterdatamodified];
  case NS_CONTEXTMENU:
  case NS_CONTEXTMENU_KEY:
    return sEventNames[eDOMEvents_contextmenu];
  case NS_UI_ACTIVATE:
    return sEventNames[eDOMEvents_DOMActivate];
  case NS_UI_FOCUSIN:
    return sEventNames[eDOMEvents_DOMFocusIn];
  case NS_UI_FOCUSOUT:
    return sEventNames[eDOMEvents_DOMFocusOut];
  case NS_PAGE_SHOW:
    return sEventNames[eDOMEvents_pageshow];
  case NS_PAGE_HIDE:
    return sEventNames[eDOMEvents_pagehide];
#ifdef MOZ_SVG
  case NS_SVG_LOAD:
    return sEventNames[eDOMEvents_SVGLoad];
  case NS_SVG_UNLOAD:
    return sEventNames[eDOMEvents_SVGUnload];
  case NS_SVG_ABORT:
    return sEventNames[eDOMEvents_SVGAbort];
  case NS_SVG_ERROR:
    return sEventNames[eDOMEvents_SVGError];
  case NS_SVG_RESIZE:
    return sEventNames[eDOMEvents_SVGResize];
  case NS_SVG_SCROLL:
    return sEventNames[eDOMEvents_SVGScroll];
  case NS_SVG_ZOOM:
    return sEventNames[eDOMEvents_SVGZoom];
#endif // MOZ_SVG
  default:
    break;
  }
  // XXXldb We can hit this case in many ways, partly thanks to
  // nsDOMEvent::SetEventType being incomplete, and partly due to some
  // event types not having message constants at all (e.g., popup
  // blocked events).  Shouldn't we use the event's userType when we
  // can?
  return nsnull;
}

Definition at line 994 of file nsDOMEvent.cpp.

{
  // generally if an event handler is running, new windows are disallowed.
  // check for exceptions:
  PopupControlState abuse = openAbused;

  switch(aEvent->eventStructType) {
  case NS_EVENT :
    // For these following events only allow popups if they're
    // triggered while handling user input. See
    // nsPresShell::HandleEventInternal() for details.
    if (nsEventStateManager::IsHandlingUserInput()) {
      switch(aEvent->message) {
      case NS_FORM_SELECTED :
        if (::PopupAllowedForEvent("select"))
          abuse = openControlled;
        break;
      case NS_FORM_CHANGE :
        if (::PopupAllowedForEvent("change"))
          abuse = openControlled;
        break;
      }
    }
    break;
  case NS_GUI_EVENT :
    // For this following event only allow popups if it's triggered
    // while handling user input. See
    // nsPresShell::HandleEventInternal() for details.
    if (nsEventStateManager::IsHandlingUserInput()) {
      switch(aEvent->message) {
      case NS_FORM_INPUT :
        if (::PopupAllowedForEvent("input"))
          abuse = openControlled;
        break;
      }
    }
    break;
  case NS_INPUT_EVENT :
    // For this following event only allow popups if it's triggered
    // while handling user input. See
    // nsPresShell::HandleEventInternal() for details.
    if (nsEventStateManager::IsHandlingUserInput()) {
      switch(aEvent->message) {
      case NS_FORM_CHANGE :
        if (::PopupAllowedForEvent("change"))
          abuse = openControlled;
        break;
      }
    }
    break;
  case NS_KEY_EVENT :
    if (NS_IS_TRUSTED_EVENT(aEvent)) {
      PRUint32 key = NS_STATIC_CAST(nsKeyEvent *, aEvent)->keyCode;
      switch(aEvent->message) {
      case NS_KEY_PRESS :
        // return key on focused button. see note at NS_MOUSE_LEFT_CLICK.
        if (key == nsIDOMKeyEvent::DOM_VK_RETURN)
          abuse = openAllowed;
        else if (::PopupAllowedForEvent("keypress"))
          abuse = openControlled;
        break;
      case NS_KEY_UP :
        // space key on focused button. see note at NS_MOUSE_LEFT_CLICK.
        if (key == nsIDOMKeyEvent::DOM_VK_SPACE)
          abuse = openAllowed;
        else if (::PopupAllowedForEvent("keyup"))
          abuse = openControlled;
        break;
      case NS_KEY_DOWN :
        if (::PopupAllowedForEvent("keydown"))
          abuse = openControlled;
        break;
      }
    }
    break;
  case NS_MOUSE_EVENT :
    if (NS_IS_TRUSTED_EVENT(aEvent)) {
      switch(aEvent->message) {
      case NS_MOUSE_LEFT_BUTTON_UP :
        if (::PopupAllowedForEvent("mouseup"))
          abuse = openControlled;
        break;
      case NS_MOUSE_LEFT_BUTTON_DOWN :
        if (::PopupAllowedForEvent("mousedown"))
          abuse = openControlled;
        break;
      case NS_MOUSE_LEFT_CLICK :
        /* Click events get special treatment because of their
           historical status as a more legitimate event handler. If
           click popups are enabled in the prefs, clear the popup
           status completely. */
        if (::PopupAllowedForEvent("click"))
          abuse = openAllowed;
        break;
      case NS_MOUSE_LEFT_DOUBLECLICK :
        if (::PopupAllowedForEvent("dblclick"))
          abuse = openControlled;
        break;
      }
    }
    break;
  case NS_SCRIPT_ERROR_EVENT :
    switch(aEvent->message) {
    case NS_SCRIPT_ERROR :
      // Any error event will allow popups, if enabled in the pref.
      if (::PopupAllowedForEvent("error"))
        abuse = openControlled;
      break;
    }
    break;
  case NS_FORM_EVENT :
    // For these following events only allow popups if they're
    // triggered while handling user input. See
    // nsPresShell::HandleEventInternal() for details.
    if (nsEventStateManager::IsHandlingUserInput()) {
      switch(aEvent->message) {
      case NS_FORM_SUBMIT :
        if (::PopupAllowedForEvent("submit"))
          abuse = openControlled;
        break;
      case NS_FORM_RESET :
        if (::PopupAllowedForEvent("reset"))
          abuse = openControlled;
        break;
      }
    }
    break;
  }

  return abuse;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsDOMEvent::GetInternalNSEvent ( nsEvent **  aNSEvent) [virtual, inherited]

Implements nsIPrivateDOMEvent.

Definition at line 945 of file nsDOMEvent.cpp.

{
  NS_ENSURE_ARG_POINTER(aNSEvent);
  *aNSEvent = mEvent;
  return NS_OK;
}

Definition at line 231 of file nsDOMEvent.cpp.

{
  if (!mPresContext) { return nsnull; }

  // Get the target frame (have to get the ESM first)
  nsIFrame* targetFrame = nsnull;
  mPresContext->EventStateManager()->GetEventTarget(&targetFrame);
  if (!targetFrame) { return nsnull; }

  // get the real content
  nsCOMPtr<nsIContent> realEventContent;
  targetFrame->GetContentForEvent(mPresContext, mEvent, getter_AddRefs(realEventContent));
  if (!realEventContent) { return nsnull; }

  // Finally, we have the real content.  QI it and return.
  nsIDOMEventTarget* target = nsnull;
  CallQueryInterface(realEventContent, &target);
  return target;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsDOMEvent::HasOriginalTarget ( PRBool aResult) [virtual, inherited]

Implements nsIPrivateDOMEvent.

Definition at line 287 of file nsDOMEvent.cpp.

{
  *aResult = (mOriginalTarget != nsnull);
  return NS_OK;
}
void nsIDOMEvent::initEvent ( in DOMString  eventTypeArg,
in boolean  canBubbleArg,
in boolean  cancelableArg 
) [inherited]

The initEvent method is used to initialize the value of an Event created through the DocumentEvent interface.

This method may only be called before the Event has been dispatched via the dispatchEvent method, though it may be called multiple times during that phase if necessary. If called multiple times the final invocation takes precedence. If called from a subclass of Event interface only the values specified in the initEvent method are modified, all other attributes are left unchanged.

Parameters:
eventTypeArgSpecifies the event type. This type may be any event type currently defined in this specification or a new event type.. The string must be an XML name. Any new event type must not begin with any upper, lower, or mixed case version of the string "DOM". This prefix is reserved for future DOM event sets. It is also strongly recommended that third parties adding their own events use their own prefix to avoid confusion and lessen the probability of conflicts with other new events.
canBubbleArgSpecifies whether or not the event can bubble.
cancelableArgSpecifies whether or not the event's default action can be prevented.
NS_IMETHODIMP nsDOMEvent::IsDispatchStopped ( PRBool aIsDispatchStopped) [virtual, inherited]

Implements nsIPrivateDOMEvent.

Definition at line 912 of file nsDOMEvent.cpp.

{
  if (mEvent->flags & NS_EVENT_FLAG_STOP_DISPATCH) {
    *aIsDispatchStopped = PR_TRUE;
  } else {
    *aIsDispatchStopped = PR_FALSE;
  }
  return NS_OK;
}
NS_IMETHODIMP nsDOMEvent::IsHandled ( PRBool aHandled) [inherited]

Definition at line 923 of file nsDOMEvent.cpp.

{
  if (mEvent->internalAppFlags | NS_APP_EVENT_FLAG_HANDLED) {
    *aIsHandled = PR_TRUE;
  } else {
    *aIsHandled = PR_FALSE;
  }
  return NS_OK;
}
void nsRecycledSingle< nsDOMEvent >::operator delete ( void aPtr) [inline, inherited]

Definition at line 114 of file nsRecycled.h.

  {
      if (gPool == aPtr)
      {
         gPoolInUse = PR_FALSE;
         return;
      }
      else
      {
         ::operator delete(aPtr);
      }
  }
void* nsRecycledSingle< nsDOMEvent >::operator new ( size_t  sz) [inline, inherited]

Definition at line 68 of file nsRecycled.h.

  {
      void* result = nsnull;
  
      if (!gPoolInUse)
      {
         if (gPoolSize >= sz)
         {
            result = gPool;
         }
         else
         {
            // Original pool, if any, is deleted by this plain assignment.
            result = ::operator new(sz);
            gPool = (char*)result;
            gPoolSize = sz;
         }
         gPoolInUse = PR_TRUE;
      }
      else
      {
         if (sz > gPoolSize)
         {
            // This would be a good opportunity to throw away our
            // current pool and replace it with this, larger one.

            // Original pool will die as a regular allocated buffer
            // when its time is due.
            gPool.forget();
            result = ::operator new(sz);
            gPool = (char*)result;
            gPoolSize = sz;
         }
         else
         {
            result = ::operator new(sz);
         }
      }
      
     if (result) {
        memset(result, 0, sz);
     }
     
     return result;
  }

Here is the call graph for this function:

Definition at line 1128 of file nsDOMEvent.cpp.

{
  if (sPopupAllowedEvents) {
    nsMemory::Free(sPopupAllowedEvents);
  }

  nsAdoptingCString str =
    nsContentUtils::GetCharPref("dom.popup_allowed_events");

  // We'll want to do this even if str is empty to avoid looking up
  // this pref all the time if it's not set.
  sPopupAllowedEvents = ToNewCString(str);
}

Here is the call graph for this function:

Here is the caller graph for this function:

If an event is cancelable, the preventDefault method is used to signify that the event is to be canceled, meaning any default action normally taken by the implementation as a result of the event will not occur.

If, during any stage of event flow, the preventDefault method is called the event is canceled. Any default action associated with the event will not occur. Calling this method for a non-cancelable event has no effect. Once preventDefault has been called it will remain in effect throughout the remainder of the event's propagation. This method may be used during any stage of event flow.

NS_METHOD nsDOMEvent::SetCurrentTarget ( nsIDOMEventTarget aCurrentTarget) [virtual, inherited]

Implements nsIPrivateDOMEvent.

Definition at line 881 of file nsDOMEvent.cpp.

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

    NS_ASSERTION(!win || !win->IsInnerWindow(),
                 "Uh, inner window set as event target!");
  }
#endif

  mCurrentTarget = aCurrentTarget;
  return NS_OK;
}

Here is the call graph for this function:

nsresult nsDOMEvent::SetEventType ( const nsAString &  aEventTypeArg) [protected, inherited]

Definition at line 425 of file nsDOMEvent.cpp.

{
  nsCOMPtr<nsIAtom> atom = do_GetAtom(NS_LITERAL_STRING("on") + aEventTypeArg);
  mEvent->message = NS_USER_DEFINED_EVENT;

  if (mEvent->eventStructType == NS_MOUSE_EVENT) {
    if (atom == nsLayoutAtoms::onmousedown)
      mEvent->message = NS_MOUSE_LEFT_BUTTON_DOWN;
    else if (atom == nsLayoutAtoms::onmouseup)
      mEvent->message = NS_MOUSE_LEFT_BUTTON_UP;
    else if (atom == nsLayoutAtoms::onclick)
      mEvent->message = NS_MOUSE_LEFT_CLICK;
    else if (atom == nsLayoutAtoms::ondblclick)
      mEvent->message = NS_MOUSE_LEFT_DOUBLECLICK;
    else if (atom == nsLayoutAtoms::onmouseover)
      mEvent->message = NS_MOUSE_ENTER_SYNTH;
    else if (atom == nsLayoutAtoms::onmouseout)
      mEvent->message = NS_MOUSE_EXIT_SYNTH;
    else if (atom == nsLayoutAtoms::onmousemove)
      mEvent->message = NS_MOUSE_MOVE;
    else if (atom == nsLayoutAtoms::oncontextmenu)
      mEvent->message = NS_CONTEXTMENU;
  } else if (mEvent->eventStructType == NS_KEY_EVENT) {
    if (atom == nsLayoutAtoms::onkeydown)
      mEvent->message = NS_KEY_DOWN;
    else if (atom == nsLayoutAtoms::onkeyup)
      mEvent->message = NS_KEY_UP;
    else if (atom == nsLayoutAtoms::onkeypress)
      mEvent->message = NS_KEY_PRESS;
  } else if (mEvent->eventStructType == NS_COMPOSITION_EVENT) {
    if (atom == nsLayoutAtoms::oncompositionstart)
      mEvent->message = NS_COMPOSITION_START;
    else if (atom == nsLayoutAtoms::oncompositionend)
      mEvent->message = NS_COMPOSITION_END;
  } else if (mEvent->eventStructType == NS_EVENT) {
    if (atom == nsLayoutAtoms::onfocus)
      mEvent->message = NS_FOCUS_CONTENT;
    else if (atom == nsLayoutAtoms::onblur)
      mEvent->message = NS_BLUR_CONTENT;
    else if (atom == nsLayoutAtoms::onsubmit)
      mEvent->message = NS_FORM_SUBMIT;
    else if (atom == nsLayoutAtoms::onreset)
      mEvent->message = NS_FORM_RESET;
    else if (atom == nsLayoutAtoms::onchange)
      mEvent->message = NS_FORM_CHANGE;
    else if (atom == nsLayoutAtoms::onselect)
      mEvent->message = NS_FORM_SELECTED;
    else if (atom == nsLayoutAtoms::onload)
      mEvent->message = NS_PAGE_LOAD;
    else if (atom == nsLayoutAtoms::onunload)
      mEvent->message = NS_PAGE_UNLOAD;
    else if (atom == nsLayoutAtoms::onabort)
      mEvent->message = NS_IMAGE_ABORT;
    else if (atom == nsLayoutAtoms::onerror)
      mEvent->message = NS_IMAGE_ERROR;
  } else if (mEvent->eventStructType == NS_MUTATION_EVENT) {
    if (atom == nsLayoutAtoms::onDOMAttrModified)
      mEvent->message = NS_MUTATION_ATTRMODIFIED;
    else if (atom == nsLayoutAtoms::onDOMCharacterDataModified)
      mEvent->message = NS_MUTATION_CHARACTERDATAMODIFIED;
    else if (atom == nsLayoutAtoms::onDOMNodeInserted)
      mEvent->message = NS_MUTATION_NODEINSERTED;
    else if (atom == nsLayoutAtoms::onDOMNodeRemoved)
      mEvent->message = NS_MUTATION_NODEREMOVED;
    else if (atom == nsLayoutAtoms::onDOMNodeInsertedIntoDocument)
      mEvent->message = NS_MUTATION_NODEINSERTEDINTODOCUMENT;
    else if (atom == nsLayoutAtoms::onDOMNodeRemovedFromDocument)
      mEvent->message = NS_MUTATION_NODEREMOVEDFROMDOCUMENT;
    else if (atom == nsLayoutAtoms::onDOMSubtreeModified)
      mEvent->message = NS_MUTATION_SUBTREEMODIFIED;
  } else if (mEvent->eventStructType == NS_UI_EVENT) {
    if (atom == nsLayoutAtoms::onDOMActivate)
      mEvent->message = NS_UI_ACTIVATE;
    else if (atom == nsLayoutAtoms::onDOMFocusIn)
      mEvent->message = NS_UI_FOCUSIN;
    else if (atom == nsLayoutAtoms::onDOMFocusOut)
      mEvent->message = NS_UI_FOCUSOUT;
    else if (atom == nsLayoutAtoms::oninput)
      mEvent->message = NS_FORM_INPUT;
  } else if (mEvent->eventStructType == NS_PAGETRANSITION_EVENT) {
    if (atom == nsLayoutAtoms::onpageshow)
      mEvent->message = NS_PAGE_SHOW;
    else if (atom == nsLayoutAtoms::onpagehide)
      mEvent->message = NS_PAGE_HIDE;
  }
#ifdef MOZ_SVG
  else if (mEvent->eventStructType == NS_SVG_EVENT) {
    if (atom == nsLayoutAtoms::onSVGLoad)
      mEvent->message = NS_SVG_LOAD;
    else if (atom == nsLayoutAtoms::onSVGUnload)
      mEvent->message = NS_SVG_UNLOAD;
    else if (atom == nsLayoutAtoms::onSVGAbort)
      mEvent->message = NS_SVG_ABORT;
    else if (atom == nsLayoutAtoms::onSVGError)
      mEvent->message = NS_SVG_ERROR;
    else if (atom == nsLayoutAtoms::onSVGResize)
      mEvent->message = NS_SVG_RESIZE;
    else if (atom == nsLayoutAtoms::onSVGScroll)
      mEvent->message = NS_SVG_SCROLL;
  } else if (mEvent->eventStructType == NS_SVGZOOM_EVENT) {
    if (atom == nsLayoutAtoms::onSVGZoom)
      mEvent->message = NS_SVG_ZOOM;
  }
#endif // MOZ_SVG

  if (mEvent->message == NS_USER_DEFINED_EVENT)
    mEvent->userType = new nsStringKey(aEventTypeArg);

  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsDOMEvent::SetHandled ( PRBool  aHandled) [inherited]

Definition at line 934 of file nsDOMEvent.cpp.

NS_METHOD nsDOMEvent::SetOriginalTarget ( nsIDOMEventTarget aOriginalTarget) [virtual, inherited]

Implements nsIPrivateDOMEvent.

Definition at line 896 of file nsDOMEvent.cpp.

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

    NS_ASSERTION(!win || !win->IsInnerWindow(),
                 "Uh, inner window set as event target!");
  }
#endif

  mOriginalTarget = aOriginalTarget;
  return NS_OK;
}

Here is the call graph for this function:

NS_METHOD nsDOMEvent::SetTarget ( nsIDOMEventTarget aTarget) [virtual, inherited]

Implements nsIPrivateDOMEvent.

Definition at line 866 of file nsDOMEvent.cpp.

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

    NS_ASSERTION(!win || !win->IsInnerWindow(),
                 "Uh, inner window set as event target!");
  }
#endif

  mTarget = aTarget;
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsDOMEvent::SetTrusted ( PRBool  aTrusted) [virtual, inherited]

Implements nsIPrivateDOMEvent.

Definition at line 294 of file nsDOMEvent.cpp.

Here is the caller graph for this function:

void nsDOMEvent::Shutdown ( ) [static, inherited]

Definition at line 1144 of file nsDOMEvent.cpp.

{
  if (sPopupAllowedEvents) {
    nsMemory::Free(sPopupAllowedEvents);
  }
}

The stopPropagation method is used prevent further propagation of an event during event flow.

If this method is called by any EventListener the event will cease propagating through the tree. The event will complete dispatch to all listeners on the current EventTarget before event flow stops. This method may be used during any stage of event flow.


Member Data Documentation

const long nsIDOMNSEvent::ABORT = 0x00400000 [inherited]

Definition at line 72 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::ALT_MASK = 0x00000001 [inherited]

Definition at line 82 of file nsIDOMNSEvent.idl.

const unsigned short nsIDOMEvent::AT_TARGET = 2 [inherited]

The event is currently being evaluated at the target EventTarget.

Definition at line 66 of file nsIDOMEvent.idl.

const long nsIDOMNSEvent::BACK = 0x20000000 [inherited]

Definition at line 79 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::BLUR = 0x00002000 [inherited]

Definition at line 63 of file nsIDOMNSEvent.idl.

readonly attribute boolean nsIDOMEvent::bubbles [inherited]

Used to indicate whether or not an event is a bubbling event.

If the event can bubble the value is true, else the value is false.

Definition at line 102 of file nsIDOMEvent.idl.

const unsigned short nsIDOMEvent::BUBBLING_PHASE = 3 [inherited]

The current event phase is the bubbling phase.

Definition at line 71 of file nsIDOMEvent.idl.

Used to indicate whether or not an event can have its default action prevented.

If the default action can be prevented the value is true, else the value is false.

Definition at line 109 of file nsIDOMEvent.idl.

const unsigned short nsIDOMEvent::CAPTURING_PHASE = 1 [inherited]

The current event phase is the capturing phase.

Definition at line 61 of file nsIDOMEvent.idl.

const long nsIDOMNSEvent::CHANGE = 0x00008000 [inherited]

Definition at line 65 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::CLICK = 0x00000040 [inherited]

Definition at line 56 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::CONTROL_MASK = 0x00000002 [inherited]

Definition at line 83 of file nsIDOMNSEvent.idl.

Used to indicate the EventTarget whose EventListeners are currently being processed.

This is particularly useful during capturing and bubbling.

Definition at line 90 of file nsIDOMEvent.idl.

const long nsIDOMNSEvent::DBLCLICK = 0x00000080 [inherited]

Definition at line 57 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::DRAGDROP = 0x00000800 [inherited]

Definition at line 61 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::ERROR = 0x00800000 [inherited]

Definition at line 73 of file nsIDOMNSEvent.idl.

readonly attribute unsigned short nsIDOMEvent::eventPhase [inherited]

Used to indicate which phase of event flow is currently being evaluated.

Definition at line 96 of file nsIDOMEvent.idl.

The explicit original target of the event.

If the event was retargeted for some reason other than an anonymous boundary crossing, this will be set to the target before the retargeting occurs. For example, mouse events are retargeted to their parent node when they happen over text nodes (bug 185889), and in that case .target will show the parent and .explicitOriginalTarget will show the text node. .explicitOriginalTarget differs from .originalTarget in that it will never contain anonymous content.

Definition at line 99 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::FOCUS = 0x00001000 [inherited]

Definition at line 62 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::FORWARD = 0x08000000 [inherited]

Definition at line 77 of file nsIDOMNSEvent.idl.

nsAutoPtr<char> nsRecycledSingle< nsDOMEvent >::gPool [static, protected, inherited]

Definition at line 128 of file nsRecycled.h.

PRBool nsRecycledSingle< nsDOMEvent >::gPoolInUse [static, protected, inherited]

Definition at line 130 of file nsRecycled.h.

size_t nsRecycledSingle< nsDOMEvent >::gPoolSize [static, protected, inherited]

Definition at line 129 of file nsRecycled.h.

const long nsIDOMNSEvent::HELP = 0x10000000 [inherited]

Definition at line 78 of file nsIDOMNSEvent.idl.

Definition at line 117 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::KEYDOWN = 0x00000100 [inherited]

Definition at line 58 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::KEYPRESS = 0x00000400 [inherited]

Definition at line 60 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::KEYUP = 0x00000200 [inherited]

Definition at line 59 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::LOAD = 0x00080000 [inherited]

Definition at line 69 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::LOCATE = 0x01000000 [inherited]

Definition at line 74 of file nsIDOMNSEvent.idl.

Definition at line 179 of file nsDOMEvent.h.

const long nsIDOMNSEvent::META_MASK = 0x00000008 [inherited]

Definition at line 85 of file nsIDOMNSEvent.idl.

nsEvent* nsDOMEvent::mEvent [protected, inherited]

Definition at line 176 of file nsDOMEvent.h.

Definition at line 183 of file nsDOMEvent.h.

Definition at line 181 of file nsDOMEvent.h.

Definition at line 180 of file nsDOMEvent.h.

const long nsIDOMNSEvent::MOUSEDOWN = 0x00000001 [inherited]

Definition at line 50 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::MOUSEDRAG = 0x00000020 [inherited]

Definition at line 55 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::MOUSEMOVE = 0x00000010 [inherited]

Definition at line 54 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::MOUSEOUT = 0x00000008 [inherited]

Definition at line 53 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::MOUSEOVER = 0x00000004 [inherited]

Definition at line 52 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::MOUSEUP = 0x00000002 [inherited]

Definition at line 51 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::MOVE = 0x02000000 [inherited]

Definition at line 75 of file nsIDOMNSEvent.idl.

Definition at line 177 of file nsDOMEvent.h.

void* nsDOMEvent::mScriptObject [protected, inherited]

Definition at line 185 of file nsDOMEvent.h.

Definition at line 178 of file nsDOMEvent.h.

Definition at line 182 of file nsDOMEvent.h.

The original target of the event, before any retargetings.

Definition at line 88 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::RESET = 0x00010000 [inherited]

Definition at line 66 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::RESIZE = 0x04000000 [inherited]

Definition at line 76 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::SCROLL = 0x00040000 [inherited]

Definition at line 68 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::SELECT = 0x00004000 [inherited]

Definition at line 64 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::SHIFT_MASK = 0x00000004 [inherited]

Definition at line 84 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::SUBMIT = 0x00020000 [inherited]

Definition at line 67 of file nsIDOMNSEvent.idl.

Used to indicate the EventTarget to which the event was originally dispatched.

Definition at line 83 of file nsIDOMEvent.idl.

const long nsIDOMNSEvent::TEXT = 0x40000000 [inherited]

Definition at line 80 of file nsIDOMNSEvent.idl.

Used to specify the time (in milliseconds relative to the epoch) at which the event was created.

Due to the fact that some systems may not provide this information the value of timeStamp may be not available for all events. When not available, a value of 0 will be returned. Examples of epoch time are the time of the system start or 0:0:0 UTC 1st January 1970.

Definition at line 119 of file nsIDOMEvent.idl.

Definition at line 105 of file nsIDOMNSEvent.idl.

readonly attribute DOMString nsIDOMEvent::type [inherited]

The name of the event (case-insensitive).

The name must be an XML name.

Definition at line 77 of file nsIDOMEvent.idl.

const long nsIDOMNSEvent::UNLOAD = 0x00100000 [inherited]

Definition at line 70 of file nsIDOMNSEvent.idl.

const long nsIDOMNSEvent::XFER_DONE = 0x00200000 [inherited]

Definition at line 71 of file nsIDOMNSEvent.idl.


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