Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
DisableJSScope Class Reference

#include <nsSpatialNavigationPrivate.h>

Collaboration diagram for DisableJSScope:
Collaboration graph

List of all members.

Public Member Functions

 DisableJSScope (nsIDOMWindow *window)
 ~DisableJSScope ()

Public Attributes

PRBool isEnabled

Detailed Description

Definition at line 230 of file nsSpatialNavigationPrivate.h.

Constructor & Destructor Documentation

Definition at line 233 of file nsSpatialNavigationPrivate.h.

    isEnabled(PR_FALSE), scriptContext(nsnull)
    // My passing null, we don't do a thing
    if (!window)

    // so, we want to set the focus to the next element, but
    // we do not want onFocus to fire.  The reason for this is
    // that we want to have the "enter" key be able to trigger
    // the targeted link after we have focused it.  However,
    // we have found a popular portal has a toolbar that, on
    // onFocus, decides to move the focus as if the targeted
    // content was clicked.  The only way that I know how to
    // do this is to disable javascript during this call.

    nsCOMPtr<nsIScriptGlobalObject> sgo (do_QueryInterface(window));
    if (!sgo)
    scriptContext = sgo->GetContext();
    if (!scriptContext)

    isEnabled = scriptContext->GetScriptsEnabled();
    if (isEnabled)
      scriptContext->SetScriptsEnabled(PR_FALSE, PR_TRUE);

Here is the call graph for this function:

Definition at line 263 of file nsSpatialNavigationPrivate.h.

    if (isEnabled && scriptContext)
      // enable javascript again..
      scriptContext->SetScriptsEnabled(PR_TRUE, PR_TRUE);

Here is the call graph for this function:

Member Data Documentation

Definition at line 272 of file nsSpatialNavigationPrivate.h.

Definition at line 273 of file nsSpatialNavigationPrivate.h.

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