Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
nsHTMLScriptEventHandler Class Reference
Inheritance diagram for nsHTMLScriptEventHandler:
Inheritance graph
Collaboration diagram for nsHTMLScriptEventHandler:
Collaboration graph

List of all members.

Public Member Functions

 nsHTMLScriptEventHandler (nsIDOMHTMLScriptElement *aOuter)
virtual ~nsHTMLScriptEventHandler ()
ParseEventString (const nsAString &aValue)
boolean IsSameEvent (in AString aObjectName, in AString aEventName, in unsigned long aArgCount)
void Invoke (in nsISupports aTargetObject, in voidPtr aArgs, in unsigned long aArgCount)

Protected Attributes

nsCStringArray mArgNames
nsString mEventName

Detailed Description

Definition at line 66 of file nsHTMLScriptElement.cpp.

Constructor & Destructor Documentation

Definition at line 93 of file nsHTMLScriptElement.cpp.


  // Weak reference...
  mOuter = aOuter;

Definition at line 70 of file nsHTMLScriptElement.cpp.


Member Function Documentation

void nsIScriptEventHandler::Invoke ( in nsISupports  aTargetObject,
in voidPtr  aArgs,
in unsigned long  aArgCount 
) [inherited]


Executes this script handler.

aTargetObjectObject to which the script handler is bound.
aArgsArray of arguments passed to the script handler. This is an array of jsvals.
aArgCountNumber of elements in the aArgs array.
boolean nsIScriptEventHandler::IsSameEvent ( in AString  aObjectName,
in AString  aEventName,
in unsigned long  aArgCount 
) [inherited]


Determines if this script event handler is bound to the given object and event name.

aObjectNameName of the object raising the event.
aEventNameName of the event being raised.
aArgCountNumber of arguments expected by the event handler.

Definition at line 114 of file nsHTMLScriptElement.cpp.

  nsAutoString eventSig(aValue);
  nsAutoString::const_iterator start, next, end;

  // Clear out the arguments array...

  // Eliminate all whitespace.

  // Parse out the event name from the signature...

  next = start;
  if (FindCharInReadable('(', next, end)) {
    mEventName = Substring(start, next);
  } else {
    // There is no opening parenthesis...
    return NS_ERROR_FAILURE;

  ++next;  // skip over the '('
  --end;   // Move back 1 character -- hopefully to the ')'
  if (*end != ')') {
    // The arguments are not enclosed in parentheses...
    return NS_ERROR_FAILURE;

  // Javascript expects all argument names to be ASCII.
  NS_LossyConvertUCS2toASCII sig(Substring(next, end));

  // Store each (comma separated) argument in mArgNames
  mArgNames.ParseString(sig.get(), ",");

  return NS_OK;

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

nsCStringArray nsHTMLScriptEventHandler::mArgNames [protected]

Definition at line 86 of file nsHTMLScriptElement.cpp.

Definition at line 89 of file nsHTMLScriptElement.cpp.

Definition at line 83 of file nsHTMLScriptElement.cpp.

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