mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 21:28:55 +00:00
Adding old 4.x capture/release compatibility code, changing dom event VK_* names to DOM_VK_*
This commit is contained in:
parent
b4f1ed1265
commit
7304187269
@ -89,7 +89,6 @@ static NS_DEFINE_IID(kIDOMNSDocumentIID, NS_IDOMNSDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
static NS_DEFINE_IID(kIDOMAttrIID, NS_IDOMATTR_IID);
|
||||
static NS_DEFINE_IID(kIScriptEventListenerIID, NS_ISCRIPTEVENTLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDOMEventCapturerIID, NS_IDOMEVENTCAPTURER_IID);
|
||||
static NS_DEFINE_IID(kIPrivateDOMEventIID, NS_IPRIVATEDOMEVENT_IID);
|
||||
static NS_DEFINE_IID(kIEventListenerManagerIID, NS_IEVENTLISTENERMANAGER_IID);
|
||||
static NS_DEFINE_IID(kIPostDataIID, NS_IPOSTDATA_IID);
|
||||
@ -770,12 +769,6 @@ nsresult nsDocument::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMEventCapturerIID)) {
|
||||
nsIDOMEventCapturer* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMEventReceiverIID)) {
|
||||
nsIDOMEventReceiver* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
@ -2424,27 +2417,6 @@ nsresult nsDocument::RemoveEventListener(const nsString& aType, nsIDOMEventListe
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsresult nsDocument::CaptureEvent(const nsString& aType)
|
||||
{
|
||||
nsIEventListenerManager *mManager;
|
||||
|
||||
if (NS_OK == GetListenerManager(&mManager)) {
|
||||
//mManager->CaptureEvent(aListener);
|
||||
NS_RELEASE(mManager);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsresult nsDocument::ReleaseEvent(const nsString& aType)
|
||||
{
|
||||
if (nsnull != mListenerManager) {
|
||||
//mListenerManager->ReleaseEvent(aListener);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
PRBool nsDocument::AddProperty(JSContext *aContext, jsval aID, jsval *aVp)
|
||||
{
|
||||
return PR_TRUE;
|
||||
@ -2665,6 +2637,7 @@ void nsDocument::FinishConvertToXIF(nsXIFConverter& aConverter, nsIDOMNode* aNod
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::ToXIF(nsXIFConverter& aConverter, nsIDOMNode* aNode)
|
||||
{
|
||||
|
@ -24,10 +24,10 @@
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIDiskDocument.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIScriptContextOwner.h"
|
||||
#include "nsIDOMEventCapturer.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsXIFConverter.h"
|
||||
#include "nsIJSScriptObject.h"
|
||||
@ -107,9 +107,9 @@ class nsDocument : public nsIDocument,
|
||||
public nsIDOMNSDocument,
|
||||
public nsIDiskDocument,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventCapturer,
|
||||
public nsIJSScriptObject,
|
||||
public nsSupportsWeakReference
|
||||
public nsSupportsWeakReference,
|
||||
public nsIDOMEventReceiver
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -357,10 +357,6 @@ public:
|
||||
NS_IMETHOD AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn);
|
||||
NS_IMETHOD CloneNode(PRBool aDeep, nsIDOMNode** aReturn);
|
||||
|
||||
// nsIDOMEventCapturer interface
|
||||
NS_IMETHOD CaptureEvent(const nsString& aType);
|
||||
NS_IMETHOD ReleaseEvent(const nsString& aType);
|
||||
|
||||
// nsIDOMEventReceiver interface
|
||||
NS_IMETHOD AddEventListenerByIID(nsIDOMEventListener *aListener, const nsIID& aIID);
|
||||
NS_IMETHOD RemoveEventListenerByIID(nsIDOMEventListener *aListener, const nsIID& aIID);
|
||||
|
@ -601,6 +601,30 @@ NS_METHOD nsDOMEvent::GetRangeOffset(PRInt32* aRangeOffset)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_METHOD nsDOMEvent::GetCancelBubble(PRBool* aCancelBubble)
|
||||
{
|
||||
if (mEvent->flags & NS_EVENT_FLAG_BUBBLE || mEvent->flags & NS_EVENT_FLAG_INIT) {
|
||||
*aCancelBubble = (mEvent->flags &= NS_EVENT_FLAG_STOP_DISPATCH) ? PR_TRUE : PR_FALSE;
|
||||
}
|
||||
else {
|
||||
*aCancelBubble = PR_FALSE;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsDOMEvent::SetCancelBubble(PRBool aCancelBubble)
|
||||
{
|
||||
if (mEvent->flags & NS_EVENT_FLAG_BUBBLE || mEvent->flags & NS_EVENT_FLAG_INIT) {
|
||||
if (aCancelBubble) {
|
||||
mEvent->flags |= NS_EVENT_FLAG_STOP_DISPATCH;
|
||||
}
|
||||
else {
|
||||
mEvent->flags &= ~NS_EVENT_FLAG_STOP_DISPATCH;
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
||||
{
|
||||
//XXX Write me!
|
||||
|
@ -128,6 +128,9 @@ public:
|
||||
|
||||
NS_IMETHOD GetRangeOffset(PRInt32* aRangeOffset);
|
||||
|
||||
NS_IMETHOD GetCancelBubble(PRBool* aCancelBubble);
|
||||
NS_IMETHOD SetCancelBubble(PRBool aCancelBubble);
|
||||
|
||||
// nsIPrivateDOMEvent interface
|
||||
NS_IMETHOD DuplicatePrivateData();
|
||||
NS_IMETHOD SetTarget(nsIDOMNode* aNode);
|
||||
|
@ -432,6 +432,16 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NS_VK_HOME:
|
||||
case NS_VK_END:
|
||||
if (!mCurrentFocus) {
|
||||
nsIScrollableView* sv = GetNearestScrollingView(aView);
|
||||
if (sv) {
|
||||
nsKeyEvent * keyEvent = (nsKeyEvent *)aEvent;
|
||||
sv->ScrollByWhole((keyEvent->keyCode != NS_VK_HOME) ? PR_TRUE : PR_FALSE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NS_VK_DOWN:
|
||||
case NS_VK_UP:
|
||||
if (!mCurrentFocus) {
|
||||
|
@ -78,6 +78,7 @@
|
||||
#include "nsGenericDOMNodeList.h"
|
||||
#include "nsICSSLoader.h"
|
||||
#include "nsIHTTPChannel.h"
|
||||
#include "nsIEventListenerManager.h"
|
||||
|
||||
#include "nsICharsetDetector.h"
|
||||
#include "nsICharsetDetectionAdaptor.h"
|
||||
@ -2215,6 +2216,36 @@ nsHTMLDocument::GetSelection(nsString& aReturn)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocument::CaptureEvents(PRInt32 aEventFlags)
|
||||
{
|
||||
nsIEventListenerManager *manager;
|
||||
|
||||
if (NS_OK == GetListenerManager(&manager)) {
|
||||
//mManager->CaptureEvent(aListener);
|
||||
NS_RELEASE(manager);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocument::ReleaseEvents(PRInt32 aEventFlags)
|
||||
{
|
||||
if (nsnull != mListenerManager) {
|
||||
//mListenerManager->ReleaseEvent(aListener);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocument::RouteEvent(nsIDOMEvent* aEvt)
|
||||
{
|
||||
//XXX Not the best solution -joki
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRIntn
|
||||
nsHTMLDocument::RemoveStrings(PLHashEntry *he, PRIntn i, void *arg)
|
||||
{
|
||||
|
@ -32,6 +32,7 @@ class nsIDOMBarProp;
|
||||
class nsIDOMScreen;
|
||||
class nsIDOMHistory;
|
||||
class nsIDOMWindowCollection;
|
||||
class nsIDOMEvent;
|
||||
class nsIDOMWindow;
|
||||
|
||||
#define NS_IDOMWINDOW_IID \
|
||||
@ -160,6 +161,16 @@ public:
|
||||
|
||||
NS_IMETHOD SetInterval(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn)=0;
|
||||
|
||||
NS_IMETHOD CaptureEvents(PRInt32 aEventFlags)=0;
|
||||
|
||||
NS_IMETHOD ReleaseEvents(PRInt32 aEventFlags)=0;
|
||||
|
||||
NS_IMETHOD RouteEvent(nsIDOMEvent* aEvt)=0;
|
||||
|
||||
NS_IMETHOD EnableExternalCapture()=0;
|
||||
|
||||
NS_IMETHOD DisableExternalCapture()=0;
|
||||
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent, PRInt32 aXPos, PRInt32 aYPos, const nsString& aPopupType, const nsString& aAnchorAlignment, const nsString& aPopupAlignment, nsIDOMWindow** aReturn)=0;
|
||||
|
||||
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn)=0;
|
||||
@ -234,6 +245,11 @@ public:
|
||||
NS_IMETHOD ClearInterval(PRInt32 aTimerID); \
|
||||
NS_IMETHOD SetTimeout(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn); \
|
||||
NS_IMETHOD SetInterval(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn); \
|
||||
NS_IMETHOD CaptureEvents(PRInt32 aEventFlags); \
|
||||
NS_IMETHOD ReleaseEvents(PRInt32 aEventFlags); \
|
||||
NS_IMETHOD RouteEvent(nsIDOMEvent* aEvt); \
|
||||
NS_IMETHOD EnableExternalCapture(); \
|
||||
NS_IMETHOD DisableExternalCapture(); \
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent, PRInt32 aXPos, PRInt32 aYPos, const nsString& aPopupType, const nsString& aAnchorAlignment, const nsString& aPopupAlignment, nsIDOMWindow** aReturn); \
|
||||
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn); \
|
||||
NS_IMETHOD OpenDialog(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn); \
|
||||
@ -306,6 +322,11 @@ public:
|
||||
NS_IMETHOD ClearInterval(PRInt32 aTimerID) { return _to ClearInterval(aTimerID); } \
|
||||
NS_IMETHOD SetTimeout(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn) { return _to SetTimeout(cx, argv, argc, aReturn); } \
|
||||
NS_IMETHOD SetInterval(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn) { return _to SetInterval(cx, argv, argc, aReturn); } \
|
||||
NS_IMETHOD CaptureEvents(PRInt32 aEventFlags) { return _to CaptureEvents(aEventFlags); } \
|
||||
NS_IMETHOD ReleaseEvents(PRInt32 aEventFlags) { return _to ReleaseEvents(aEventFlags); } \
|
||||
NS_IMETHOD RouteEvent(nsIDOMEvent* aEvt) { return _to RouteEvent(aEvt); } \
|
||||
NS_IMETHOD EnableExternalCapture() { return _to EnableExternalCapture(); } \
|
||||
NS_IMETHOD DisableExternalCapture() { return _to DisableExternalCapture(); } \
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent, PRInt32 aXPos, PRInt32 aYPos, const nsString& aPopupType, const nsString& aAnchorAlignment, const nsString& aPopupAlignment, nsIDOMWindow** aReturn) { return _to CreatePopup(aElement, aPopupContent, aXPos, aYPos, aPopupType, aAnchorAlignment, aPopupAlignment, aReturn); } \
|
||||
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn) { return _to Open(cx, argv, argc, aReturn); } \
|
||||
NS_IMETHOD OpenDialog(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn) { return _to OpenDialog(cx, argv, argc, aReturn); } \
|
||||
|
@ -34,41 +34,41 @@ class nsIDOMNSUIEvent : public nsISupports {
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_IDOMNSUIEVENT_IID; return iid; }
|
||||
enum {
|
||||
EVENT_MOUSEDOWN = 1,
|
||||
EVENT_MOUSEUP = 2,
|
||||
EVENT_MOUSEOVER = 4,
|
||||
EVENT_MOUSEOUT = 8,
|
||||
EVENT_MOUSEMOVE = 16,
|
||||
EVENT_MOUSEDRAG = 32,
|
||||
EVENT_CLICK = 64,
|
||||
EVENT_DBLCLICK = 128,
|
||||
EVENT_KEYDOWN = 256,
|
||||
EVENT_KEYUP = 512,
|
||||
EVENT_KEYPRESS = 1024,
|
||||
EVENT_DRAGDROP = 2048,
|
||||
EVENT_FOCUS = 4096,
|
||||
EVENT_BLUR = 8192,
|
||||
EVENT_SELECT = 16384,
|
||||
EVENT_CHANGE = 32768,
|
||||
EVENT_RESET = 65536,
|
||||
EVENT_SUBMIT = 131072,
|
||||
EVENT_SCROLL = 262144,
|
||||
EVENT_LOAD = 524288,
|
||||
EVENT_UNLOAD = 1048576,
|
||||
EVENT_XFER_DONE = 2097152,
|
||||
EVENT_ABORT = 4194304,
|
||||
EVENT_ERROR = 8388608,
|
||||
EVENT_LOCATE = 16777216,
|
||||
EVENT_MOVE = 33554432,
|
||||
EVENT_RESIZE = 67108864,
|
||||
EVENT_FORWARD = 134217728,
|
||||
EVENT_HELP = 268435456,
|
||||
EVENT_BACK = 536870912,
|
||||
EVENT_TEXT = 1073741824,
|
||||
EVENT_ALT_MASK = 1,
|
||||
EVENT_CONTROL_MASK = 2,
|
||||
EVENT_SHIFT_MASK = 4,
|
||||
EVENT_META_MASK = 8
|
||||
MOUSEDOWN = 1,
|
||||
MOUSEUP = 2,
|
||||
MOUSEOVER = 4,
|
||||
MOUSEOUT = 8,
|
||||
MOUSEMOVE = 16,
|
||||
MOUSEDRAG = 32,
|
||||
CLICK = 64,
|
||||
DBLCLICK = 128,
|
||||
KEYDOWN = 256,
|
||||
KEYUP = 512,
|
||||
KEYPRESS = 1024,
|
||||
DRAGDROP = 2048,
|
||||
FOCUS = 4096,
|
||||
BLUR = 8192,
|
||||
SELECT = 16384,
|
||||
CHANGE = 32768,
|
||||
RESET = 65536,
|
||||
SUBMIT = 131072,
|
||||
SCROLL = 262144,
|
||||
LOAD = 524288,
|
||||
UNLOAD = 1048576,
|
||||
XFER_DONE = 2097152,
|
||||
ABORT = 4194304,
|
||||
ERROR = 8388608,
|
||||
LOCATE = 16777216,
|
||||
MOVE = 33554432,
|
||||
RESIZE = 67108864,
|
||||
FORWARD = 134217728,
|
||||
HELP = 268435456,
|
||||
BACK = 536870912,
|
||||
TEXT = 1073741824,
|
||||
ALT_MASK = 1,
|
||||
CONTROL_MASK = 2,
|
||||
SHIFT_MASK = 4,
|
||||
META_MASK = 8
|
||||
};
|
||||
|
||||
NS_IMETHOD GetLayerX(PRInt32* aLayerX)=0;
|
||||
@ -84,6 +84,9 @@ public:
|
||||
NS_IMETHOD GetRangeParent(nsIDOMNode** aRangeParent)=0;
|
||||
|
||||
NS_IMETHOD GetRangeOffset(PRInt32* aRangeOffset)=0;
|
||||
|
||||
NS_IMETHOD GetCancelBubble(PRBool* aCancelBubble)=0;
|
||||
NS_IMETHOD SetCancelBubble(PRBool aCancelBubble)=0;
|
||||
};
|
||||
|
||||
|
||||
@ -95,6 +98,8 @@ public:
|
||||
NS_IMETHOD GetWhich(PRUint32* aWhich); \
|
||||
NS_IMETHOD GetRangeParent(nsIDOMNode** aRangeParent); \
|
||||
NS_IMETHOD GetRangeOffset(PRInt32* aRangeOffset); \
|
||||
NS_IMETHOD GetCancelBubble(PRBool* aCancelBubble); \
|
||||
NS_IMETHOD SetCancelBubble(PRBool aCancelBubble); \
|
||||
|
||||
|
||||
|
||||
@ -106,6 +111,8 @@ public:
|
||||
NS_IMETHOD GetWhich(PRUint32* aWhich) { return _to GetWhich(aWhich); } \
|
||||
NS_IMETHOD GetRangeParent(nsIDOMNode** aRangeParent) { return _to GetRangeParent(aRangeParent); } \
|
||||
NS_IMETHOD GetRangeOffset(PRInt32* aRangeOffset) { return _to GetRangeOffset(aRangeOffset); } \
|
||||
NS_IMETHOD GetCancelBubble(PRBool* aCancelBubble) { return _to GetCancelBubble(aCancelBubble); } \
|
||||
NS_IMETHOD SetCancelBubble(PRBool aCancelBubble) { return _to SetCancelBubble(aCancelBubble); } \
|
||||
|
||||
|
||||
#endif // nsIDOMNSUIEvent_h__
|
||||
|
@ -34,118 +34,118 @@ class nsIDOMUIEvent : public nsIDOMEvent {
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_IDOMUIEVENT_IID; return iid; }
|
||||
enum {
|
||||
VK_CANCEL = 3,
|
||||
VK_BACK = 8,
|
||||
VK_TAB = 9,
|
||||
VK_CLEAR = 12,
|
||||
VK_RETURN = 13,
|
||||
VK_ENTER = 14,
|
||||
VK_SHIFT = 16,
|
||||
VK_CONTROL = 17,
|
||||
VK_ALT = 18,
|
||||
VK_PAUSE = 19,
|
||||
VK_CAPS_LOCK = 20,
|
||||
VK_ESCAPE = 27,
|
||||
VK_SPACE = 32,
|
||||
VK_PAGE_UP = 33,
|
||||
VK_PAGE_DOWN = 34,
|
||||
VK_END = 35,
|
||||
VK_HOME = 36,
|
||||
VK_LEFT = 37,
|
||||
VK_UP = 38,
|
||||
VK_RIGHT = 39,
|
||||
VK_DOWN = 40,
|
||||
VK_PRINTSCREEN = 44,
|
||||
VK_INSERT = 45,
|
||||
VK_DELETE = 46,
|
||||
VK_0 = 48,
|
||||
VK_1 = 49,
|
||||
VK_2 = 50,
|
||||
VK_3 = 51,
|
||||
VK_4 = 52,
|
||||
VK_5 = 53,
|
||||
VK_6 = 54,
|
||||
VK_7 = 55,
|
||||
VK_8 = 56,
|
||||
VK_9 = 57,
|
||||
VK_SEMICOLON = 59,
|
||||
VK_EQUALS = 61,
|
||||
VK_A = 65,
|
||||
VK_B = 66,
|
||||
VK_C = 67,
|
||||
VK_D = 68,
|
||||
VK_E = 69,
|
||||
VK_F = 70,
|
||||
VK_G = 71,
|
||||
VK_H = 72,
|
||||
VK_I = 73,
|
||||
VK_J = 74,
|
||||
VK_K = 75,
|
||||
VK_L = 76,
|
||||
VK_M = 77,
|
||||
VK_N = 78,
|
||||
VK_O = 79,
|
||||
VK_P = 80,
|
||||
VK_Q = 81,
|
||||
VK_R = 82,
|
||||
VK_S = 83,
|
||||
VK_T = 84,
|
||||
VK_U = 85,
|
||||
VK_V = 86,
|
||||
VK_W = 87,
|
||||
VK_X = 88,
|
||||
VK_Y = 89,
|
||||
VK_Z = 90,
|
||||
VK_NUMPAD0 = 96,
|
||||
VK_NUMPAD1 = 97,
|
||||
VK_NUMPAD2 = 98,
|
||||
VK_NUMPAD3 = 99,
|
||||
VK_NUMPAD4 = 100,
|
||||
VK_NUMPAD5 = 101,
|
||||
VK_NUMPAD6 = 102,
|
||||
VK_NUMPAD7 = 103,
|
||||
VK_NUMPAD8 = 104,
|
||||
VK_NUMPAD9 = 105,
|
||||
VK_MULTIPLY = 106,
|
||||
VK_ADD = 107,
|
||||
VK_SEPARATOR = 108,
|
||||
VK_SUBTRACT = 109,
|
||||
VK_DECIMAL = 110,
|
||||
VK_DIVIDE = 111,
|
||||
VK_F1 = 112,
|
||||
VK_F2 = 113,
|
||||
VK_F3 = 114,
|
||||
VK_F4 = 115,
|
||||
VK_F5 = 116,
|
||||
VK_F6 = 117,
|
||||
VK_F7 = 118,
|
||||
VK_F8 = 119,
|
||||
VK_F9 = 120,
|
||||
VK_F10 = 121,
|
||||
VK_F11 = 122,
|
||||
VK_F12 = 123,
|
||||
VK_F13 = 124,
|
||||
VK_F14 = 125,
|
||||
VK_F15 = 126,
|
||||
VK_F16 = 127,
|
||||
VK_F17 = 128,
|
||||
VK_F18 = 129,
|
||||
VK_F19 = 130,
|
||||
VK_F20 = 131,
|
||||
VK_F21 = 132,
|
||||
VK_F22 = 133,
|
||||
VK_F23 = 134,
|
||||
VK_F24 = 135,
|
||||
VK_NUM_LOCK = 144,
|
||||
VK_SCROLL_LOCK = 145,
|
||||
VK_COMMA = 188,
|
||||
VK_PERIOD = 190,
|
||||
VK_SLASH = 191,
|
||||
VK_BACK_QUOTE = 192,
|
||||
VK_OPEN_BRACKET = 219,
|
||||
VK_BACK_SLASH = 220,
|
||||
VK_CLOSE_BRACKET = 221,
|
||||
VK_QUOTE = 222
|
||||
DOM_VK_CANCEL = 3,
|
||||
DOM_VK_BACK = 8,
|
||||
DOM_VK_TAB = 9,
|
||||
DOM_VK_CLEAR = 12,
|
||||
DOM_VK_RETURN = 13,
|
||||
DOM_VK_ENTER = 14,
|
||||
DOM_VK_SHIFT = 16,
|
||||
DOM_VK_CONTROL = 17,
|
||||
DOM_VK_ALT = 18,
|
||||
DOM_VK_PAUSE = 19,
|
||||
DOM_VK_CAPS_LOCK = 20,
|
||||
DOM_VK_ESCAPE = 27,
|
||||
DOM_VK_SPACE = 32,
|
||||
DOM_VK_PAGE_UP = 33,
|
||||
DOM_VK_PAGE_DOWN = 34,
|
||||
DOM_VK_END = 35,
|
||||
DOM_VK_HOME = 36,
|
||||
DOM_VK_LEFT = 37,
|
||||
DOM_VK_UP = 38,
|
||||
DOM_VK_RIGHT = 39,
|
||||
DOM_VK_DOWN = 40,
|
||||
DOM_VK_PRINTSCREEN = 44,
|
||||
DOM_VK_INSERT = 45,
|
||||
DOM_VK_DELETE = 46,
|
||||
DOM_VK_0 = 48,
|
||||
DOM_VK_1 = 49,
|
||||
DOM_VK_2 = 50,
|
||||
DOM_VK_3 = 51,
|
||||
DOM_VK_4 = 52,
|
||||
DOM_VK_5 = 53,
|
||||
DOM_VK_6 = 54,
|
||||
DOM_VK_7 = 55,
|
||||
DOM_VK_8 = 56,
|
||||
DOM_VK_9 = 57,
|
||||
DOM_VK_SEMICOLON = 59,
|
||||
DOM_VK_EQUALS = 61,
|
||||
DOM_VK_A = 65,
|
||||
DOM_VK_B = 66,
|
||||
DOM_VK_C = 67,
|
||||
DOM_VK_D = 68,
|
||||
DOM_VK_E = 69,
|
||||
DOM_VK_F = 70,
|
||||
DOM_VK_G = 71,
|
||||
DOM_VK_H = 72,
|
||||
DOM_VK_I = 73,
|
||||
DOM_VK_J = 74,
|
||||
DOM_VK_K = 75,
|
||||
DOM_VK_L = 76,
|
||||
DOM_VK_M = 77,
|
||||
DOM_VK_N = 78,
|
||||
DOM_VK_O = 79,
|
||||
DOM_VK_P = 80,
|
||||
DOM_VK_Q = 81,
|
||||
DOM_VK_R = 82,
|
||||
DOM_VK_S = 83,
|
||||
DOM_VK_T = 84,
|
||||
DOM_VK_U = 85,
|
||||
DOM_VK_V = 86,
|
||||
DOM_VK_W = 87,
|
||||
DOM_VK_X = 88,
|
||||
DOM_VK_Y = 89,
|
||||
DOM_VK_Z = 90,
|
||||
DOM_VK_NUMPAD0 = 96,
|
||||
DOM_VK_NUMPAD1 = 97,
|
||||
DOM_VK_NUMPAD2 = 98,
|
||||
DOM_VK_NUMPAD3 = 99,
|
||||
DOM_VK_NUMPAD4 = 100,
|
||||
DOM_VK_NUMPAD5 = 101,
|
||||
DOM_VK_NUMPAD6 = 102,
|
||||
DOM_VK_NUMPAD7 = 103,
|
||||
DOM_VK_NUMPAD8 = 104,
|
||||
DOM_VK_NUMPAD9 = 105,
|
||||
DOM_VK_MULTIPLY = 106,
|
||||
DOM_VK_ADD = 107,
|
||||
DOM_VK_SEPARATOR = 108,
|
||||
DOM_VK_SUBTRACT = 109,
|
||||
DOM_VK_DECIMAL = 110,
|
||||
DOM_VK_DIVIDE = 111,
|
||||
DOM_VK_F1 = 112,
|
||||
DOM_VK_F2 = 113,
|
||||
DOM_VK_F3 = 114,
|
||||
DOM_VK_F4 = 115,
|
||||
DOM_VK_F5 = 116,
|
||||
DOM_VK_F6 = 117,
|
||||
DOM_VK_F7 = 118,
|
||||
DOM_VK_F8 = 119,
|
||||
DOM_VK_F9 = 120,
|
||||
DOM_VK_F10 = 121,
|
||||
DOM_VK_F11 = 122,
|
||||
DOM_VK_F12 = 123,
|
||||
DOM_VK_F13 = 124,
|
||||
DOM_VK_F14 = 125,
|
||||
DOM_VK_F15 = 126,
|
||||
DOM_VK_F16 = 127,
|
||||
DOM_VK_F17 = 128,
|
||||
DOM_VK_F18 = 129,
|
||||
DOM_VK_F19 = 130,
|
||||
DOM_VK_F20 = 131,
|
||||
DOM_VK_F21 = 132,
|
||||
DOM_VK_F22 = 133,
|
||||
DOM_VK_F23 = 134,
|
||||
DOM_VK_F24 = 135,
|
||||
DOM_VK_NUM_LOCK = 144,
|
||||
DOM_VK_SCROLL_LOCK = 145,
|
||||
DOM_VK_COMMA = 188,
|
||||
DOM_VK_PERIOD = 190,
|
||||
DOM_VK_SLASH = 191,
|
||||
DOM_VK_BACK_QUOTE = 192,
|
||||
DOM_VK_OPEN_BRACKET = 219,
|
||||
DOM_VK_BACK_SLASH = 220,
|
||||
DOM_VK_CLOSE_BRACKET = 221,
|
||||
DOM_VK_QUOTE = 222
|
||||
};
|
||||
|
||||
NS_IMETHOD GetScreenX(PRInt32* aScreenX)=0;
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "jsapi.h"
|
||||
|
||||
class nsIDOMElement;
|
||||
class nsIDOMEvent;
|
||||
class nsIDOMHTMLCollection;
|
||||
|
||||
#define NS_IDOMNSHTMLDOCUMENT_IID \
|
||||
@ -68,6 +69,12 @@ public:
|
||||
NS_IMETHOD Write(JSContext* cx, jsval* argv, PRUint32 argc)=0;
|
||||
|
||||
NS_IMETHOD Writeln(JSContext* cx, jsval* argv, PRUint32 argc)=0;
|
||||
|
||||
NS_IMETHOD CaptureEvents(PRInt32 aEventFlags)=0;
|
||||
|
||||
NS_IMETHOD ReleaseEvents(PRInt32 aEventFlags)=0;
|
||||
|
||||
NS_IMETHOD RouteEvent(nsIDOMEvent* aEvt)=0;
|
||||
};
|
||||
|
||||
|
||||
@ -91,6 +98,9 @@ public:
|
||||
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc); \
|
||||
NS_IMETHOD Write(JSContext* cx, jsval* argv, PRUint32 argc); \
|
||||
NS_IMETHOD Writeln(JSContext* cx, jsval* argv, PRUint32 argc); \
|
||||
NS_IMETHOD CaptureEvents(PRInt32 aEventFlags); \
|
||||
NS_IMETHOD ReleaseEvents(PRInt32 aEventFlags); \
|
||||
NS_IMETHOD RouteEvent(nsIDOMEvent* aEvt); \
|
||||
|
||||
|
||||
|
||||
@ -114,6 +124,9 @@ public:
|
||||
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc) { return _to Open(cx, argv, argc); } \
|
||||
NS_IMETHOD Write(JSContext* cx, jsval* argv, PRUint32 argc) { return _to Write(cx, argv, argc); } \
|
||||
NS_IMETHOD Writeln(JSContext* cx, jsval* argv, PRUint32 argc) { return _to Writeln(cx, argv, argc); } \
|
||||
NS_IMETHOD CaptureEvents(PRInt32 aEventFlags) { return _to CaptureEvents(aEventFlags); } \
|
||||
NS_IMETHOD ReleaseEvents(PRInt32 aEventFlags) { return _to ReleaseEvents(aEventFlags); } \
|
||||
NS_IMETHOD RouteEvent(nsIDOMEvent* aEvt) { return _to RouteEvent(aEvt); } \
|
||||
|
||||
|
||||
#endif // nsIDOMNSHTMLDocument_h__
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
void dump(in wstring str);
|
||||
void alert(/* ... */);
|
||||
boolean confirm(/* ... */);
|
||||
boolean confirm(/* ... */);
|
||||
DOMString prompt(/* ... */);
|
||||
void focus();
|
||||
void blur();
|
||||
@ -58,6 +58,12 @@
|
||||
long setTimeout(/* ... */);
|
||||
long setInterval(/* ... */);
|
||||
|
||||
void captureEvents(in long eventFlags);
|
||||
void releaseEvents(in long eventFlags);
|
||||
void routeEvent(in Event evt);
|
||||
void enableExternalCapture();
|
||||
void disableExternalCapture();
|
||||
|
||||
Window createPopup(in Element element, in Element popupContent,
|
||||
in long xPos, in long yPos,
|
||||
in DOMString popupType, in DOMString anchorAlignment,
|
||||
@ -67,14 +73,6 @@
|
||||
Window openDialog(/* ... */);
|
||||
};
|
||||
|
||||
interface EventCapturer : EventReceiver {
|
||||
/* IID: { 0xa6cf906c, 0x15b3, 0x11d2, \
|
||||
{ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 } } */
|
||||
|
||||
void captureEvent(in wstring type);
|
||||
void releaseEvent(in wstring type);
|
||||
};
|
||||
|
||||
interface EventTarget {
|
||||
/* IID: { 0x1c773b30, 0xd1cf, 0x11d2, \
|
||||
{ 0xbd, 0x95, 0x00, 0x80, 0x5f, 0x8a, 0xe3, 0xf4 } } */
|
||||
|
@ -31,11 +31,3 @@
|
||||
in DOMString nameSpace)
|
||||
raises(DOMException); Range createRange();
|
||||
};
|
||||
|
||||
interface EventCapturer : EventReceiver {
|
||||
/* IID: { 0xa6cf906c, 0x15b3, 0x11d2, \
|
||||
{ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 } } */
|
||||
|
||||
void captureEvent(in wstring type);
|
||||
void releaseEvent(in wstring type);
|
||||
};
|
||||
|
@ -3,17 +3,17 @@
|
||||
{ 0x00, 0x80, 0x5f, 0x8a, 0xe3, 0x8a, 0xdd, 0x32 } } */
|
||||
|
||||
|
||||
const unsigned short BUBBLING_PHASE = 1;
|
||||
const unsigned short CAPTURING_PHASE = 2;
|
||||
const unsigned short AT_TARGET = 3;
|
||||
const unsigned short BUBBLING_PHASE = 1;
|
||||
const unsigned short CAPTURING_PHASE = 2;
|
||||
const unsigned short AT_TARGET = 3;
|
||||
|
||||
readonly attribute wstring type;
|
||||
readonly attribute Node target;
|
||||
readonly attribute Node currentNode;
|
||||
readonly attribute unsigned short eventPhase;
|
||||
|
||||
void preventBubble();
|
||||
void preventCapture();
|
||||
void preventDefault();
|
||||
void preventBubble();
|
||||
void preventCapture();
|
||||
void preventDefault();
|
||||
};
|
||||
|
||||
|
@ -2,126 +2,126 @@
|
||||
/* IID: { 0xa6cf90c3, 0x15b3, 0x11d2, \
|
||||
{ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 } } */
|
||||
|
||||
const int VK_CANCEL = 0x03;
|
||||
const int VK_BACK = 0x08;
|
||||
const int VK_TAB = 0x09;
|
||||
const int VK_CLEAR = 0x0C;
|
||||
const int VK_RETURN = 0x0D;
|
||||
const int VK_ENTER = 0x0E;
|
||||
const int VK_SHIFT = 0x10;
|
||||
const int VK_CONTROL = 0x11;
|
||||
const int VK_ALT = 0x12;
|
||||
const int VK_PAUSE = 0x13;
|
||||
const int VK_CAPS_LOCK = 0x14;
|
||||
const int VK_ESCAPE = 0x1B;
|
||||
const int VK_SPACE = 0x20;
|
||||
const int VK_PAGE_UP = 0x21;
|
||||
const int VK_PAGE_DOWN = 0x22;
|
||||
const int VK_END = 0x23;
|
||||
const int VK_HOME = 0x24;
|
||||
const int VK_LEFT = 0x25;
|
||||
const int VK_UP = 0x26;
|
||||
const int VK_RIGHT = 0x27;
|
||||
const int VK_DOWN = 0x28;
|
||||
const int VK_PRINTSCREEN = 0x2C;
|
||||
const int VK_INSERT = 0x2D;
|
||||
const int VK_DELETE = 0x2E;
|
||||
const int DOM_VK_CANCEL = 0x03;
|
||||
const int DOM_VK_BACK = 0x08;
|
||||
const int DOM_VK_TAB = 0x09;
|
||||
const int DOM_VK_CLEAR = 0x0C;
|
||||
const int DOM_VK_RETURN = 0x0D;
|
||||
const int DOM_VK_ENTER = 0x0E;
|
||||
const int DOM_VK_SHIFT = 0x10;
|
||||
const int DOM_VK_CONTROL = 0x11;
|
||||
const int DOM_VK_ALT = 0x12;
|
||||
const int DOM_VK_PAUSE = 0x13;
|
||||
const int DOM_VK_CAPS_LOCK = 0x14;
|
||||
const int DOM_VK_ESCAPE = 0x1B;
|
||||
const int DOM_VK_SPACE = 0x20;
|
||||
const int DOM_VK_PAGE_UP = 0x21;
|
||||
const int DOM_VK_PAGE_DOWN = 0x22;
|
||||
const int DOM_VK_END = 0x23;
|
||||
const int DOM_VK_HOME = 0x24;
|
||||
const int DOM_VK_LEFT = 0x25;
|
||||
const int DOM_VK_UP = 0x26;
|
||||
const int DOM_VK_RIGHT = 0x27;
|
||||
const int DOM_VK_DOWN = 0x28;
|
||||
const int DOM_VK_PRINTSCREEN = 0x2C;
|
||||
const int DOM_VK_INSERT = 0x2D;
|
||||
const int DOM_VK_DELETE = 0x2E;
|
||||
|
||||
// VK_0 - VK_9 match their ascii values
|
||||
const int VK_0 = 0x30;
|
||||
const int VK_1 = 0x31;
|
||||
const int VK_2 = 0x32;
|
||||
const int VK_3 = 0x33;
|
||||
const int VK_4 = 0x34;
|
||||
const int VK_5 = 0x35;
|
||||
const int VK_6 = 0x36;
|
||||
const int VK_7 = 0x37;
|
||||
const int VK_8 = 0x38;
|
||||
const int VK_9 = 0x39;
|
||||
// DOM_VK_0 - DOM_VK_9 match their ascii values
|
||||
const int DOM_VK_0 = 0x30;
|
||||
const int DOM_VK_1 = 0x31;
|
||||
const int DOM_VK_2 = 0x32;
|
||||
const int DOM_VK_3 = 0x33;
|
||||
const int DOM_VK_4 = 0x34;
|
||||
const int DOM_VK_5 = 0x35;
|
||||
const int DOM_VK_6 = 0x36;
|
||||
const int DOM_VK_7 = 0x37;
|
||||
const int DOM_VK_8 = 0x38;
|
||||
const int DOM_VK_9 = 0x39;
|
||||
|
||||
const int VK_SEMICOLON = 0x3B;
|
||||
const int VK_EQUALS = 0x3D;
|
||||
const int DOM_VK_SEMICOLON = 0x3B;
|
||||
const int DOM_VK_EQUALS = 0x3D;
|
||||
|
||||
// VK_A - VK_Z match their ascii values
|
||||
const int VK_A = 0x41;
|
||||
const int VK_B = 0x42;
|
||||
const int VK_C = 0x43;
|
||||
const int VK_D = 0x44;
|
||||
const int VK_E = 0x45;
|
||||
const int VK_F = 0x46;
|
||||
const int VK_G = 0x47;
|
||||
const int VK_H = 0x48;
|
||||
const int VK_I = 0x49;
|
||||
const int VK_J = 0x4A;
|
||||
const int VK_K = 0x4B;
|
||||
const int VK_L = 0x4C;
|
||||
const int VK_M = 0x4D;
|
||||
const int VK_N = 0x4E;
|
||||
const int VK_O = 0x4F;
|
||||
const int VK_P = 0x50;
|
||||
const int VK_Q = 0x51;
|
||||
const int VK_R = 0x52;
|
||||
const int VK_S = 0x53;
|
||||
const int VK_T = 0x54;
|
||||
const int VK_U = 0x55;
|
||||
const int VK_V = 0x56;
|
||||
const int VK_W = 0x57;
|
||||
const int VK_X = 0x58;
|
||||
const int VK_Y = 0x59;
|
||||
const int VK_Z = 0x5A;
|
||||
// DOM_VK_A - DOM_VK_Z match their ascii values
|
||||
const int DOM_VK_A = 0x41;
|
||||
const int DOM_VK_B = 0x42;
|
||||
const int DOM_VK_C = 0x43;
|
||||
const int DOM_VK_D = 0x44;
|
||||
const int DOM_VK_E = 0x45;
|
||||
const int DOM_VK_F = 0x46;
|
||||
const int DOM_VK_G = 0x47;
|
||||
const int DOM_VK_H = 0x48;
|
||||
const int DOM_VK_I = 0x49;
|
||||
const int DOM_VK_J = 0x4A;
|
||||
const int DOM_VK_K = 0x4B;
|
||||
const int DOM_VK_L = 0x4C;
|
||||
const int DOM_VK_M = 0x4D;
|
||||
const int DOM_VK_N = 0x4E;
|
||||
const int DOM_VK_O = 0x4F;
|
||||
const int DOM_VK_P = 0x50;
|
||||
const int DOM_VK_Q = 0x51;
|
||||
const int DOM_VK_R = 0x52;
|
||||
const int DOM_VK_S = 0x53;
|
||||
const int DOM_VK_T = 0x54;
|
||||
const int DOM_VK_U = 0x55;
|
||||
const int DOM_VK_V = 0x56;
|
||||
const int DOM_VK_W = 0x57;
|
||||
const int DOM_VK_X = 0x58;
|
||||
const int DOM_VK_Y = 0x59;
|
||||
const int DOM_VK_Z = 0x5A;
|
||||
|
||||
const int VK_NUMPAD0 = 0x60;
|
||||
const int VK_NUMPAD1 = 0x61;
|
||||
const int VK_NUMPAD2 = 0x62;
|
||||
const int VK_NUMPAD3 = 0x63;
|
||||
const int VK_NUMPAD4 = 0x64;
|
||||
const int VK_NUMPAD5 = 0x65;
|
||||
const int VK_NUMPAD6 = 0x66;
|
||||
const int VK_NUMPAD7 = 0x67;
|
||||
const int VK_NUMPAD8 = 0x68;
|
||||
const int VK_NUMPAD9 = 0x69;
|
||||
const int VK_MULTIPLY = 0x6A;
|
||||
const int VK_ADD = 0x6B;
|
||||
const int VK_SEPARATOR = 0x6C;
|
||||
const int VK_SUBTRACT = 0x6D;
|
||||
const int VK_DECIMAL = 0x6E;
|
||||
const int VK_DIVIDE = 0x6F;
|
||||
const int VK_F1 = 0x70;
|
||||
const int VK_F2 = 0x71;
|
||||
const int VK_F3 = 0x72;
|
||||
const int VK_F4 = 0x73;
|
||||
const int VK_F5 = 0x74;
|
||||
const int VK_F6 = 0x75;
|
||||
const int VK_F7 = 0x76;
|
||||
const int VK_F8 = 0x77;
|
||||
const int VK_F9 = 0x78;
|
||||
const int VK_F10 = 0x79;
|
||||
const int VK_F11 = 0x7A;
|
||||
const int VK_F12 = 0x7B;
|
||||
const int VK_F13 = 0x7C;
|
||||
const int VK_F14 = 0x7D;
|
||||
const int VK_F15 = 0x7E;
|
||||
const int VK_F16 = 0x7F;
|
||||
const int VK_F17 = 0x80;
|
||||
const int VK_F18 = 0x81;
|
||||
const int VK_F19 = 0x82;
|
||||
const int VK_F20 = 0x83;
|
||||
const int VK_F21 = 0x84;
|
||||
const int VK_F22 = 0x85;
|
||||
const int VK_F23 = 0x86;
|
||||
const int VK_F24 = 0x87;
|
||||
const int DOM_VK_NUMPAD0 = 0x60;
|
||||
const int DOM_VK_NUMPAD1 = 0x61;
|
||||
const int DOM_VK_NUMPAD2 = 0x62;
|
||||
const int DOM_VK_NUMPAD3 = 0x63;
|
||||
const int DOM_VK_NUMPAD4 = 0x64;
|
||||
const int DOM_VK_NUMPAD5 = 0x65;
|
||||
const int DOM_VK_NUMPAD6 = 0x66;
|
||||
const int DOM_VK_NUMPAD7 = 0x67;
|
||||
const int DOM_VK_NUMPAD8 = 0x68;
|
||||
const int DOM_VK_NUMPAD9 = 0x69;
|
||||
const int DOM_VK_MULTIPLY = 0x6A;
|
||||
const int DOM_VK_ADD = 0x6B;
|
||||
const int DOM_VK_SEPARATOR = 0x6C;
|
||||
const int DOM_VK_SUBTRACT = 0x6D;
|
||||
const int DOM_VK_DECIMAL = 0x6E;
|
||||
const int DOM_VK_DIVIDE = 0x6F;
|
||||
const int DOM_VK_F1 = 0x70;
|
||||
const int DOM_VK_F2 = 0x71;
|
||||
const int DOM_VK_F3 = 0x72;
|
||||
const int DOM_VK_F4 = 0x73;
|
||||
const int DOM_VK_F5 = 0x74;
|
||||
const int DOM_VK_F6 = 0x75;
|
||||
const int DOM_VK_F7 = 0x76;
|
||||
const int DOM_VK_F8 = 0x77;
|
||||
const int DOM_VK_F9 = 0x78;
|
||||
const int DOM_VK_F10 = 0x79;
|
||||
const int DOM_VK_F11 = 0x7A;
|
||||
const int DOM_VK_F12 = 0x7B;
|
||||
const int DOM_VK_F13 = 0x7C;
|
||||
const int DOM_VK_F14 = 0x7D;
|
||||
const int DOM_VK_F15 = 0x7E;
|
||||
const int DOM_VK_F16 = 0x7F;
|
||||
const int DOM_VK_F17 = 0x80;
|
||||
const int DOM_VK_F18 = 0x81;
|
||||
const int DOM_VK_F19 = 0x82;
|
||||
const int DOM_VK_F20 = 0x83;
|
||||
const int DOM_VK_F21 = 0x84;
|
||||
const int DOM_VK_F22 = 0x85;
|
||||
const int DOM_VK_F23 = 0x86;
|
||||
const int DOM_VK_F24 = 0x87;
|
||||
|
||||
const int VK_NUM_LOCK = 0x90;
|
||||
const int VK_SCROLL_LOCK = 0x91;
|
||||
const int DOM_VK_NUM_LOCK = 0x90;
|
||||
const int DOM_VK_SCROLL_LOCK = 0x91;
|
||||
|
||||
const int VK_COMMA = 0xBC;
|
||||
const int VK_PERIOD = 0xBE;
|
||||
const int VK_SLASH = 0xBF;
|
||||
const int VK_BACK_QUOTE = 0xC0;
|
||||
const int VK_OPEN_BRACKET = 0xDB;
|
||||
const int VK_BACK_SLASH = 0xDC;
|
||||
const int VK_CLOSE_BRACKET = 0xDD;
|
||||
const int VK_QUOTE = 0xDE;
|
||||
const int DOM_VK_COMMA = 0xBC;
|
||||
const int DOM_VK_PERIOD = 0xBE;
|
||||
const int DOM_VK_SLASH = 0xBF;
|
||||
const int DOM_VK_BACK_QUOTE = 0xC0;
|
||||
const int DOM_VK_OPEN_BRACKET = 0xDB;
|
||||
const int DOM_VK_BACK_SLASH = 0xDC;
|
||||
const int DOM_VK_CLOSE_BRACKET = 0xDD;
|
||||
const int DOM_VK_QUOTE = 0xDE;
|
||||
|
||||
readonly attribute int screenX;
|
||||
readonly attribute int screenY;
|
||||
@ -145,42 +145,42 @@
|
||||
/* IID: { 0xa6cf90c4, 0x15b3, 0x11d2, \
|
||||
{ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 } } */
|
||||
|
||||
const int EVENT_MOUSEDOWN = 0x00000001;
|
||||
const int EVENT_MOUSEUP = 0x00000002;
|
||||
const int EVENT_MOUSEOVER = 0x00000004;
|
||||
const int EVENT_MOUSEOUT = 0x00000008;
|
||||
const int EVENT_MOUSEMOVE = 0x00000010;
|
||||
const int EVENT_MOUSEDRAG = 0x00000020;
|
||||
const int EVENT_CLICK = 0x00000040;
|
||||
const int EVENT_DBLCLICK = 0x00000080;
|
||||
const int EVENT_KEYDOWN = 0x00000100;
|
||||
const int EVENT_KEYUP = 0x00000200;
|
||||
const int EVENT_KEYPRESS = 0x00000400;
|
||||
const int EVENT_DRAGDROP = 0x00000800;
|
||||
const int EVENT_FOCUS = 0x00001000;
|
||||
const int EVENT_BLUR = 0x00002000;
|
||||
const int EVENT_SELECT = 0x00004000;
|
||||
const int EVENT_CHANGE = 0x00008000;
|
||||
const int EVENT_RESET = 0x00010000;
|
||||
const int EVENT_SUBMIT = 0x00020000;
|
||||
const int EVENT_SCROLL = 0x00040000;
|
||||
const int EVENT_LOAD = 0x00080000;
|
||||
const int EVENT_UNLOAD = 0x00100000;
|
||||
const int EVENT_XFER_DONE = 0x00200000;
|
||||
const int EVENT_ABORT = 0x00400000;
|
||||
const int EVENT_ERROR = 0x00800000;
|
||||
const int EVENT_LOCATE = 0x01000000;
|
||||
const int EVENT_MOVE = 0x02000000;
|
||||
const int EVENT_RESIZE = 0x04000000;
|
||||
const int EVENT_FORWARD = 0x08000000;
|
||||
const int EVENT_HELP = 0x10000000;
|
||||
const int EVENT_BACK = 0x20000000;
|
||||
const int EVENT_TEXT = 0x40000000;
|
||||
const int MOUSEDOWN = 0x00000001;
|
||||
const int MOUSEUP = 0x00000002;
|
||||
const int MOUSEOVER = 0x00000004;
|
||||
const int MOUSEOUT = 0x00000008;
|
||||
const int MOUSEMOVE = 0x00000010;
|
||||
const int MOUSEDRAG = 0x00000020;
|
||||
const int CLICK = 0x00000040;
|
||||
const int DBLCLICK = 0x00000080;
|
||||
const int KEYDOWN = 0x00000100;
|
||||
const int KEYUP = 0x00000200;
|
||||
const int KEYPRESS = 0x00000400;
|
||||
const int DRAGDROP = 0x00000800;
|
||||
const int FOCUS = 0x00001000;
|
||||
const int BLUR = 0x00002000;
|
||||
const int SELECT = 0x00004000;
|
||||
const int CHANGE = 0x00008000;
|
||||
const int RESET = 0x00010000;
|
||||
const int SUBMIT = 0x00020000;
|
||||
const int SCROLL = 0x00040000;
|
||||
const int LOAD = 0x00080000;
|
||||
const int UNLOAD = 0x00100000;
|
||||
const int XFER_DONE = 0x00200000;
|
||||
const int ABORT = 0x00400000;
|
||||
const int ERROR = 0x00800000;
|
||||
const int LOCATE = 0x01000000;
|
||||
const int MOVE = 0x02000000;
|
||||
const int RESIZE = 0x04000000;
|
||||
const int FORWARD = 0x08000000;
|
||||
const int HELP = 0x10000000;
|
||||
const int BACK = 0x20000000;
|
||||
const int TEXT = 0x40000000;
|
||||
|
||||
const int EVENT_ALT_MASK = 0x00000001;
|
||||
const int EVENT_CONTROL_MASK = 0x00000002;
|
||||
const int EVENT_SHIFT_MASK = 0x00000004;
|
||||
const int EVENT_META_MASK = 0x00000008;
|
||||
const int ALT_MASK = 0x00000001;
|
||||
const int CONTROL_MASK = 0x00000002;
|
||||
const int SHIFT_MASK = 0x00000004;
|
||||
const int META_MASK = 0x00000008;
|
||||
|
||||
readonly attribute int layerX;
|
||||
readonly attribute int layerY;
|
||||
@ -189,4 +189,7 @@
|
||||
readonly attribute unsigned long which;
|
||||
readonly attribute Node rangeParent;
|
||||
readonly attribute int rangeOffset;
|
||||
|
||||
attribute boolean cancelBubble;
|
||||
|
||||
};
|
||||
|
@ -43,4 +43,8 @@
|
||||
void open(/* ... */);
|
||||
void write(/* ... */);
|
||||
void writeln(/* ... */);
|
||||
|
||||
void captureEvents(in long eventFlags);
|
||||
void releaseEvents(in long eventFlags);
|
||||
void routeEvent(in Event evt);
|
||||
};
|
||||
|
@ -101,7 +101,6 @@ static NS_DEFINE_IID(kIDOMDragListenerIID, NS_IDOMDRAGLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDOMPaintListenerIID, NS_IDOMPAINTLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIEventListenerManagerIID, NS_IEVENTLISTENERMANAGER_IID);
|
||||
static NS_DEFINE_IID(kIPrivateDOMEventIID, NS_IPRIVATEDOMEVENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMEventCapturerIID, NS_IDOMEVENTCAPTURER_IID);
|
||||
static NS_DEFINE_IID(kIDOMEventReceiverIID, NS_IDOMEVENTRECEIVER_IID);
|
||||
static NS_DEFINE_IID(kIDOMEventTargetIID, NS_IDOMEVENTTARGET_IID);
|
||||
static NS_DEFINE_IID(kIBrowserWindowIID, NS_IBROWSER_WINDOW_IID);
|
||||
@ -208,11 +207,6 @@ GlobalWindowImpl::QueryInterface(const nsIID& aIID,
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMEventCapturerIID)) {
|
||||
*aInstancePtrResult = (void*)(nsISupports*)(nsIDOMEventCapturer*)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMEventReceiverIID)) {
|
||||
*aInstancePtrResult = (void*)(nsISupports*)(nsIDOMEventReceiver*)this;
|
||||
AddRef();
|
||||
@ -1981,6 +1975,7 @@ GlobalWindowImpl::OpenInternal(JSContext *cx,
|
||||
JSString* str;
|
||||
char* options;
|
||||
*aReturn = nsnull;
|
||||
PRBool nameSpecified = PR_FALSE;
|
||||
|
||||
if (argc > 0) {
|
||||
JSString *mJSStrURL = JS_ValueToString(cx, argv[0]);
|
||||
@ -2023,14 +2018,12 @@ GlobalWindowImpl::OpenInternal(JSContext *cx,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
name.SetString(JS_GetStringChars(mJSStrName));
|
||||
nameSpecified = PR_TRUE;
|
||||
|
||||
if (NS_OK != CheckWindowName(cx, name)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
name.SetString("");
|
||||
}
|
||||
|
||||
options = nsnull;
|
||||
if (argc > 2) {
|
||||
@ -2057,7 +2050,9 @@ GlobalWindowImpl::OpenInternal(JSContext *cx,
|
||||
// Check for existing window of same name.
|
||||
windowIsNew = PR_FALSE;
|
||||
windowIsModal = PR_FALSE;
|
||||
webShellContainer->FindWebShellWithName(name.GetUnicode(), newOuterShell);
|
||||
if (nameSpecified) {
|
||||
webShellContainer->FindWebShellWithName(name.GetUnicode(), newOuterShell);
|
||||
}
|
||||
if (nsnull == newOuterShell) {
|
||||
windowIsNew = PR_TRUE;
|
||||
if (chromeFlags & NS_CHROME_MODAL) {
|
||||
@ -2089,7 +2084,12 @@ GlobalWindowImpl::OpenInternal(JSContext *cx,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
newOuterShell->SetName(name.GetUnicode());
|
||||
if (nameSpecified) {
|
||||
newOuterShell->SetName(name.GetUnicode());
|
||||
}
|
||||
else {
|
||||
newOuterShell->SetName(nsnull);
|
||||
}
|
||||
newOuterShell->LoadURL(mAbsURL.GetUnicode());
|
||||
SizeAndShowOpenedWebShell(newOuterShell, options, windowIsNew, aDialog);
|
||||
if (windowIsModal) {
|
||||
@ -2787,15 +2787,15 @@ GlobalWindowImpl::GetListenerManager(nsIEventListenerManager **aInstancePtrResul
|
||||
return mListenerManager->QueryInterface(kIEventListenerManagerIID, (void**) aInstancePtrResult);;
|
||||
}
|
||||
//This is gonna get ugly. Can't use NS_NewEventListenerManager because of a circular link problem.
|
||||
nsIDOMEventCapturer *mDoc;
|
||||
if (nsnull != mDocument && NS_OK == mDocument->QueryInterface(kIDOMEventCapturerIID, (void**)&mDoc)) {
|
||||
if (NS_OK == mDoc->GetNewListenerManager(aInstancePtrResult)) {
|
||||
nsIDOMEventReceiver *doc = nsnull;
|
||||
if (nsnull != mDocument && NS_OK == mDocument->QueryInterface(kIDOMEventReceiverIID, (void**)&doc)) {
|
||||
if (NS_OK == doc->GetNewListenerManager(aInstancePtrResult)) {
|
||||
mListenerManager = *aInstancePtrResult;
|
||||
NS_ADDREF(mListenerManager);
|
||||
NS_RELEASE(mDoc);
|
||||
NS_RELEASE(doc);
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IF_RELEASE(mDoc);
|
||||
NS_IF_RELEASE(doc);
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
@ -2918,20 +2918,20 @@ GlobalWindowImpl::RemoveEventListener(const nsString& aType, nsIDOMEventListener
|
||||
}
|
||||
|
||||
nsresult
|
||||
GlobalWindowImpl::CaptureEvent(const nsString& aType)
|
||||
GlobalWindowImpl::CaptureEvents(PRInt32 aEventFlags)
|
||||
{
|
||||
nsIEventListenerManager *mManager;
|
||||
nsIEventListenerManager *manager;
|
||||
|
||||
if (NS_OK == GetListenerManager(&mManager)) {
|
||||
if (NS_OK == GetListenerManager(&manager)) {
|
||||
//mManager->CaptureEvent(aListener);
|
||||
NS_RELEASE(mManager);
|
||||
NS_RELEASE(manager);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
GlobalWindowImpl::ReleaseEvent(const nsString& aType)
|
||||
GlobalWindowImpl::ReleaseEvents(PRInt32 aEventFlags)
|
||||
{
|
||||
if (nsnull != mListenerManager) {
|
||||
//mListenerManager->ReleaseEvent(aListener);
|
||||
@ -2940,6 +2940,25 @@ GlobalWindowImpl::ReleaseEvent(const nsString& aType)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
GlobalWindowImpl::RouteEvent(nsIDOMEvent* aEvt)
|
||||
{
|
||||
//XXX Not the best solution -joki
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
GlobalWindowImpl::EnableExternalCapture()
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
GlobalWindowImpl::DisableExternalCapture()
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
GlobalWindowImpl::GetPrincipal(nsIPrincipal **result)
|
||||
{
|
||||
|
@ -28,11 +28,11 @@
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMNavigator.h"
|
||||
#include "nsIDOMLocation.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIDOMNSLocation.h"
|
||||
#include "nsIDOMScreen.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsIJSScriptObject.h"
|
||||
#include "nsIDOMEventCapturer.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsFrameList.h"
|
||||
#include "nsIScriptGlobalObjectData.h"
|
||||
@ -64,7 +64,7 @@ class HistoryImpl;
|
||||
|
||||
// Global object for scripting
|
||||
class GlobalWindowImpl : public nsIScriptObjectOwner, public nsIScriptGlobalObject, public nsIDOMWindow,
|
||||
public nsIJSScriptObject, public nsIDOMEventCapturer, public nsIScriptGlobalObjectData
|
||||
public nsIJSScriptObject, public nsIScriptGlobalObjectData, public nsIDOMEventReceiver
|
||||
{
|
||||
public:
|
||||
GlobalWindowImpl();
|
||||
@ -169,15 +169,17 @@ public:
|
||||
NS_IMETHOD OpenDialog(JSContext *cx, jsval *argv, PRUint32 argc,
|
||||
nsIDOMWindow** aReturn);
|
||||
|
||||
NS_IMETHOD CaptureEvents(PRInt32 aEventFlags);
|
||||
NS_IMETHOD ReleaseEvents(PRInt32 aEventFlags);
|
||||
NS_IMETHOD RouteEvent(nsIDOMEvent* aEvt);
|
||||
NS_IMETHOD EnableExternalCapture();
|
||||
NS_IMETHOD DisableExternalCapture();
|
||||
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& anAnchorAlignment,
|
||||
const nsString& aPopupAlignment, nsIDOMWindow** outPopup);
|
||||
|
||||
// nsIDOMEventCapturer interface
|
||||
NS_IMETHOD CaptureEvent(const nsString& aType);
|
||||
NS_IMETHOD ReleaseEvent(const nsString& aType);
|
||||
|
||||
// nsIDOMEventReceiver interface
|
||||
NS_IMETHOD AddEventListenerByIID(nsIDOMEventListener *aListener, const nsIID& aIID);
|
||||
NS_IMETHOD RemoveEventListenerByIID(nsIDOMEventListener *aListener, const nsIID& aIID);
|
||||
|
@ -37,8 +37,8 @@
|
||||
#include "nsIDOMHistory.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIDOMWindowCollection.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMEventCapturer.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
|
||||
|
||||
@ -53,8 +53,8 @@ static NS_DEFINE_IID(kIScreenIID, NS_IDOMSCREEN_IID);
|
||||
static NS_DEFINE_IID(kIHistoryIID, NS_IDOMHISTORY_IID);
|
||||
static NS_DEFINE_IID(kIEventListenerIID, NS_IDOMEVENTLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIWindowCollectionIID, NS_IDOMWINDOWCOLLECTION_IID);
|
||||
static NS_DEFINE_IID(kIEventIID, NS_IDOMEVENT_IID);
|
||||
static NS_DEFINE_IID(kIEventTargetIID, NS_IDOMEVENTTARGET_IID);
|
||||
static NS_DEFINE_IID(kIEventCapturerIID, NS_IDOMEVENTCAPTURER_IID);
|
||||
static NS_DEFINE_IID(kIWindowIID, NS_IDOMWINDOW_IID);
|
||||
|
||||
NS_DEF_PTR(nsIDOMNavigator);
|
||||
@ -65,8 +65,8 @@ NS_DEF_PTR(nsIDOMScreen);
|
||||
NS_DEF_PTR(nsIDOMHistory);
|
||||
NS_DEF_PTR(nsIDOMEventListener);
|
||||
NS_DEF_PTR(nsIDOMWindowCollection);
|
||||
NS_DEF_PTR(nsIDOMEvent);
|
||||
NS_DEF_PTR(nsIDOMEventTarget);
|
||||
NS_DEF_PTR(nsIDOMEventCapturer);
|
||||
NS_DEF_PTR(nsIDOMWindow);
|
||||
|
||||
//
|
||||
@ -2065,6 +2065,249 @@ WindowSetInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method CaptureEvents
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
WindowCaptureEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsresult result = NS_OK;
|
||||
PRInt32 b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "window.captureevents",PR_FALSE , &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
if (argc < 1) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR);
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_NOT_NUMBER_ERR);
|
||||
}
|
||||
|
||||
result = nativeThis->CaptureEvents(b0);
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, result);
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method ReleaseEvents
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
WindowReleaseEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsresult result = NS_OK;
|
||||
PRInt32 b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "window.releaseevents",PR_FALSE , &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
if (argc < 1) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR);
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_NOT_NUMBER_ERR);
|
||||
}
|
||||
|
||||
result = nativeThis->ReleaseEvents(b0);
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, result);
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method RouteEvent
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
WindowRouteEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsresult result = NS_OK;
|
||||
nsIDOMEventPtr b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "window.routeevent",PR_FALSE , &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
if (argc < 1) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR);
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kIEventIID,
|
||||
"Event",
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
}
|
||||
|
||||
result = nativeThis->RouteEvent(b0);
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, result);
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method EnableExternalCapture
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
WindowEnableExternalCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsresult result = NS_OK;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "window.enableexternalcapture",PR_FALSE , &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
result = nativeThis->EnableExternalCapture();
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, result);
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method DisableExternalCapture
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
WindowDisableExternalCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsresult result = NS_OK;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "window.disableexternalcapture",PR_FALSE , &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
result = nativeThis->DisableExternalCapture();
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, result);
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method CreatePopup
|
||||
//
|
||||
@ -2231,114 +2474,6 @@ WindowOpenDialog(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method CaptureEvent
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
EventCapturerCaptureEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsIDOMEventCapturer *nativeThis = nsnull;
|
||||
nsresult result = NS_OK;
|
||||
if (NS_OK != privateThis->QueryInterface(kIEventCapturerIID, (void **)&nativeThis)) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR);
|
||||
}
|
||||
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "eventcapturer.captureevent",PR_FALSE , &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
if (argc < 1) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR);
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
result = nativeThis->CaptureEvent(b0);
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, result);
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method ReleaseEvent
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
EventCapturerReleaseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsIDOMEventCapturer *nativeThis = nsnull;
|
||||
nsresult result = NS_OK;
|
||||
if (NS_OK != privateThis->QueryInterface(kIEventCapturerIID, (void **)&nativeThis)) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR);
|
||||
}
|
||||
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "eventcapturer.releaseevent",PR_FALSE , &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
if (argc < 1) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR);
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
result = nativeThis->ReleaseEvent(b0);
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, result);
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method AddEventListener
|
||||
//
|
||||
@ -2554,11 +2689,14 @@ static JSFunctionSpec WindowMethods[] =
|
||||
{"clearInterval", WindowClearInterval, 1},
|
||||
{"setTimeout", WindowSetTimeout, 0},
|
||||
{"setInterval", WindowSetInterval, 0},
|
||||
{"captureEvents", WindowCaptureEvents, 1},
|
||||
{"releaseEvents", WindowReleaseEvents, 1},
|
||||
{"routeEvent", WindowRouteEvent, 1},
|
||||
{"enableExternalCapture", WindowEnableExternalCapture, 0},
|
||||
{"disableExternalCapture", WindowDisableExternalCapture, 0},
|
||||
{"createPopup", WindowCreatePopup, 7},
|
||||
{"open", WindowOpen, 0},
|
||||
{"openDialog", WindowOpenDialog, 0},
|
||||
{"captureEvent", EventCapturerCaptureEvent, 1},
|
||||
{"releaseEvent", EventCapturerReleaseEvent, 1},
|
||||
{"addEventListener", EventTargetAddEventListener, 3},
|
||||
{"removeEventListener", EventTargetRemoveEventListener, 3},
|
||||
{0}
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "nsIDOMComment.h"
|
||||
#include "nsIDOMDocumentFragment.h"
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsIDOMEventCapturer.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
|
||||
|
||||
@ -64,7 +63,6 @@ static NS_DEFINE_IID(kINSDocumentIID, NS_IDOMNSDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kICommentIID, NS_IDOMCOMMENT_IID);
|
||||
static NS_DEFINE_IID(kIDocumentFragmentIID, NS_IDOMDOCUMENTFRAGMENT_IID);
|
||||
static NS_DEFINE_IID(kIRangeIID, NS_IDOMRANGE_IID);
|
||||
static NS_DEFINE_IID(kIEventCapturerIID, NS_IDOMEVENTCAPTURER_IID);
|
||||
static NS_DEFINE_IID(kINodeListIID, NS_IDOMNODELIST_IID);
|
||||
|
||||
NS_DEF_PTR(nsIDOMElement);
|
||||
@ -81,7 +79,6 @@ NS_DEF_PTR(nsIDOMNSDocument);
|
||||
NS_DEF_PTR(nsIDOMComment);
|
||||
NS_DEF_PTR(nsIDOMDocumentFragment);
|
||||
NS_DEF_PTR(nsIDOMRange);
|
||||
NS_DEF_PTR(nsIDOMEventCapturer);
|
||||
NS_DEF_PTR(nsIDOMNodeList);
|
||||
|
||||
//
|
||||
@ -826,114 +823,6 @@ NSDocumentCreateRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method CaptureEvent
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
EventCapturerCaptureEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMDocument *privateThis = (nsIDOMDocument*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsIDOMEventCapturer *nativeThis = nsnull;
|
||||
nsresult result = NS_OK;
|
||||
if (NS_OK != privateThis->QueryInterface(kIEventCapturerIID, (void **)&nativeThis)) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR);
|
||||
}
|
||||
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "eventcapturer.captureevent",PR_FALSE , &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
if (argc < 1) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR);
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
result = nativeThis->CaptureEvent(b0);
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, result);
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method ReleaseEvent
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
EventCapturerReleaseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMDocument *privateThis = (nsIDOMDocument*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsIDOMEventCapturer *nativeThis = nsnull;
|
||||
nsresult result = NS_OK;
|
||||
if (NS_OK != privateThis->QueryInterface(kIEventCapturerIID, (void **)&nativeThis)) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR);
|
||||
}
|
||||
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "eventcapturer.releaseevent",PR_FALSE , &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
if (argc < 1) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR);
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
result = nativeThis->ReleaseEvent(b0);
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, result);
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
//
|
||||
// class for Document
|
||||
@ -981,8 +870,6 @@ static JSFunctionSpec DocumentMethods[] =
|
||||
{"getElementsByTagName", DocumentGetElementsByTagName, 1},
|
||||
{"createElementWithNameSpace", NSDocumentCreateElementWithNameSpace, 2},
|
||||
{"createRange", NSDocumentCreateRange, 0},
|
||||
{"captureEvent", EventCapturerCaptureEvent, 1},
|
||||
{"releaseEvent", EventCapturerReleaseEvent, 1},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
@ -67,7 +67,8 @@ enum UIEvent_slots {
|
||||
NSUIEVENT_PAGEY = -16,
|
||||
NSUIEVENT_WHICH = -17,
|
||||
NSUIEVENT_RANGEPARENT = -18,
|
||||
NSUIEVENT_RANGEOFFSET = -19
|
||||
NSUIEVENT_RANGEOFFSET = -19,
|
||||
NSUIEVENT_CANCELBUBBLE = -20
|
||||
};
|
||||
|
||||
/***********************************************************************/
|
||||
@ -490,6 +491,32 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NSUIEVENT_CANCELBUBBLE:
|
||||
{
|
||||
PRBool ok = PR_FALSE;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nsuievent.cancelbubble", PR_FALSE, &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
PRBool prop;
|
||||
nsIDOMNSUIEvent* b;
|
||||
if (NS_OK == a->QueryInterface(kINSUIEventIID, (void **)&b)) {
|
||||
nsresult result = NS_OK;
|
||||
result = b->GetCancelBubble(&prop);
|
||||
if(NS_SUCCEEDED(result)) {
|
||||
*vp = BOOLEAN_TO_JSVAL(prop);
|
||||
NS_RELEASE(b);
|
||||
}
|
||||
else {
|
||||
NS_RELEASE(b);
|
||||
return nsJSUtils::nsReportError(cx, result);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
|
||||
}
|
||||
@ -522,7 +549,30 @@ SetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
switch(JSVAL_TO_INT(id)) {
|
||||
case 0:
|
||||
case NSUIEVENT_CANCELBUBBLE:
|
||||
{
|
||||
PRBool ok = PR_FALSE;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nsuievent.cancelbubble", PR_TRUE, &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
PRBool prop;
|
||||
if (PR_FALSE == nsJSUtils::nsConvertJSValToBool(&prop, cx, *vp)) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_NOT_BOOLEAN_ERR);
|
||||
}
|
||||
|
||||
nsIDOMNSUIEvent *b;
|
||||
if (NS_OK == a->QueryInterface(kINSUIEventIID, (void **)&b)) {
|
||||
b->SetCancelBubble(prop);
|
||||
NS_RELEASE(b);
|
||||
}
|
||||
else {
|
||||
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
|
||||
}
|
||||
@ -607,6 +657,7 @@ static JSPropertySpec UIEventProperties[] =
|
||||
{"which", NSUIEVENT_WHICH, JSPROP_ENUMERATE | JSPROP_READONLY},
|
||||
{"rangeParent", NSUIEVENT_RANGEPARENT, JSPROP_ENUMERATE | JSPROP_READONLY},
|
||||
{"rangeOffset", NSUIEVENT_RANGEOFFSET, JSPROP_ENUMERATE | JSPROP_READONLY},
|
||||
{"cancelBubble", NSUIEVENT_CANCELBUBBLE, JSPROP_ENUMERATE},
|
||||
{0}
|
||||
};
|
||||
|
||||
@ -668,341 +719,341 @@ extern "C" NS_DOM nsresult NS_InitUIEventClass(nsIScriptContext *aContext, void
|
||||
if ((PR_TRUE == JS_LookupProperty(jscontext, global, "UIEvent", &vp)) &&
|
||||
JSVAL_IS_OBJECT(vp) &&
|
||||
((constructor = JSVAL_TO_OBJECT(vp)) != nsnull)) {
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_CANCEL);
|
||||
JS_SetProperty(jscontext, constructor, "VK_CANCEL", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_CANCEL);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_CANCEL", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_BACK);
|
||||
JS_SetProperty(jscontext, constructor, "VK_BACK", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_BACK);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_BACK", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_TAB);
|
||||
JS_SetProperty(jscontext, constructor, "VK_TAB", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_TAB);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_TAB", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_CLEAR);
|
||||
JS_SetProperty(jscontext, constructor, "VK_CLEAR", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_CLEAR);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_CLEAR", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_RETURN);
|
||||
JS_SetProperty(jscontext, constructor, "VK_RETURN", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_RETURN);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_RETURN", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_ENTER);
|
||||
JS_SetProperty(jscontext, constructor, "VK_ENTER", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_ENTER);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_ENTER", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_SHIFT);
|
||||
JS_SetProperty(jscontext, constructor, "VK_SHIFT", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_SHIFT);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_SHIFT", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_CONTROL);
|
||||
JS_SetProperty(jscontext, constructor, "VK_CONTROL", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_CONTROL);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_CONTROL", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_ALT);
|
||||
JS_SetProperty(jscontext, constructor, "VK_ALT", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_ALT);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_ALT", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_PAUSE);
|
||||
JS_SetProperty(jscontext, constructor, "VK_PAUSE", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_PAUSE);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_PAUSE", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_CAPS_LOCK);
|
||||
JS_SetProperty(jscontext, constructor, "VK_CAPS_LOCK", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_CAPS_LOCK);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_CAPS_LOCK", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_ESCAPE);
|
||||
JS_SetProperty(jscontext, constructor, "VK_ESCAPE", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_ESCAPE);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_ESCAPE", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_SPACE);
|
||||
JS_SetProperty(jscontext, constructor, "VK_SPACE", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_SPACE);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_SPACE", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_PAGE_UP);
|
||||
JS_SetProperty(jscontext, constructor, "VK_PAGE_UP", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_PAGE_UP);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_PAGE_UP", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_PAGE_DOWN);
|
||||
JS_SetProperty(jscontext, constructor, "VK_PAGE_DOWN", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_PAGE_DOWN);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_PAGE_DOWN", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_END);
|
||||
JS_SetProperty(jscontext, constructor, "VK_END", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_END);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_END", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_HOME);
|
||||
JS_SetProperty(jscontext, constructor, "VK_HOME", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_HOME);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_HOME", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_LEFT);
|
||||
JS_SetProperty(jscontext, constructor, "VK_LEFT", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_LEFT);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_LEFT", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_UP);
|
||||
JS_SetProperty(jscontext, constructor, "VK_UP", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_UP);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_UP", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_RIGHT);
|
||||
JS_SetProperty(jscontext, constructor, "VK_RIGHT", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_RIGHT);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_RIGHT", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_DOWN);
|
||||
JS_SetProperty(jscontext, constructor, "VK_DOWN", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_DOWN);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_DOWN", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_PRINTSCREEN);
|
||||
JS_SetProperty(jscontext, constructor, "VK_PRINTSCREEN", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_PRINTSCREEN);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_PRINTSCREEN", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_INSERT);
|
||||
JS_SetProperty(jscontext, constructor, "VK_INSERT", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_INSERT);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_INSERT", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_DELETE);
|
||||
JS_SetProperty(jscontext, constructor, "VK_DELETE", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_DELETE);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_DELETE", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_0);
|
||||
JS_SetProperty(jscontext, constructor, "VK_0", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_0);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_0", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_1);
|
||||
JS_SetProperty(jscontext, constructor, "VK_1", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_1);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_1", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_2);
|
||||
JS_SetProperty(jscontext, constructor, "VK_2", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_2);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_2", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_3);
|
||||
JS_SetProperty(jscontext, constructor, "VK_3", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_3);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_3", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_4);
|
||||
JS_SetProperty(jscontext, constructor, "VK_4", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_4);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_4", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_5);
|
||||
JS_SetProperty(jscontext, constructor, "VK_5", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_5);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_5", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_6);
|
||||
JS_SetProperty(jscontext, constructor, "VK_6", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_6);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_6", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_7);
|
||||
JS_SetProperty(jscontext, constructor, "VK_7", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_7);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_7", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_8);
|
||||
JS_SetProperty(jscontext, constructor, "VK_8", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_8);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_8", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_9);
|
||||
JS_SetProperty(jscontext, constructor, "VK_9", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_9);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_9", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_SEMICOLON);
|
||||
JS_SetProperty(jscontext, constructor, "VK_SEMICOLON", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_SEMICOLON);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_SEMICOLON", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_EQUALS);
|
||||
JS_SetProperty(jscontext, constructor, "VK_EQUALS", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_EQUALS);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_EQUALS", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_A);
|
||||
JS_SetProperty(jscontext, constructor, "VK_A", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_A);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_A", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_B);
|
||||
JS_SetProperty(jscontext, constructor, "VK_B", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_B);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_B", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_C);
|
||||
JS_SetProperty(jscontext, constructor, "VK_C", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_C);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_C", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_D);
|
||||
JS_SetProperty(jscontext, constructor, "VK_D", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_D);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_D", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_E);
|
||||
JS_SetProperty(jscontext, constructor, "VK_E", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_E);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_E", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_G);
|
||||
JS_SetProperty(jscontext, constructor, "VK_G", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_G);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_G", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_H);
|
||||
JS_SetProperty(jscontext, constructor, "VK_H", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_H);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_H", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_I);
|
||||
JS_SetProperty(jscontext, constructor, "VK_I", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_I);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_I", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_J);
|
||||
JS_SetProperty(jscontext, constructor, "VK_J", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_J);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_J", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_K);
|
||||
JS_SetProperty(jscontext, constructor, "VK_K", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_K);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_K", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_L);
|
||||
JS_SetProperty(jscontext, constructor, "VK_L", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_L);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_L", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_M);
|
||||
JS_SetProperty(jscontext, constructor, "VK_M", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_M);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_M", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_N);
|
||||
JS_SetProperty(jscontext, constructor, "VK_N", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_N);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_N", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_O);
|
||||
JS_SetProperty(jscontext, constructor, "VK_O", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_O);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_O", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_P);
|
||||
JS_SetProperty(jscontext, constructor, "VK_P", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_P);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_P", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_Q);
|
||||
JS_SetProperty(jscontext, constructor, "VK_Q", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_Q);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_Q", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_R);
|
||||
JS_SetProperty(jscontext, constructor, "VK_R", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_R);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_R", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_S);
|
||||
JS_SetProperty(jscontext, constructor, "VK_S", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_S);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_S", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_T);
|
||||
JS_SetProperty(jscontext, constructor, "VK_T", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_T);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_T", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_U);
|
||||
JS_SetProperty(jscontext, constructor, "VK_U", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_U);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_U", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_V);
|
||||
JS_SetProperty(jscontext, constructor, "VK_V", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_V);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_V", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_W);
|
||||
JS_SetProperty(jscontext, constructor, "VK_W", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_W);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_W", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_X);
|
||||
JS_SetProperty(jscontext, constructor, "VK_X", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_X);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_X", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_Y);
|
||||
JS_SetProperty(jscontext, constructor, "VK_Y", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_Y);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_Y", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_Z);
|
||||
JS_SetProperty(jscontext, constructor, "VK_Z", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_Z);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_Z", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_NUMPAD0);
|
||||
JS_SetProperty(jscontext, constructor, "VK_NUMPAD0", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_NUMPAD0);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_NUMPAD0", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_NUMPAD1);
|
||||
JS_SetProperty(jscontext, constructor, "VK_NUMPAD1", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_NUMPAD1);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_NUMPAD1", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_NUMPAD2);
|
||||
JS_SetProperty(jscontext, constructor, "VK_NUMPAD2", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_NUMPAD2);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_NUMPAD2", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_NUMPAD3);
|
||||
JS_SetProperty(jscontext, constructor, "VK_NUMPAD3", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_NUMPAD3);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_NUMPAD3", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_NUMPAD4);
|
||||
JS_SetProperty(jscontext, constructor, "VK_NUMPAD4", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_NUMPAD4);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_NUMPAD4", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_NUMPAD5);
|
||||
JS_SetProperty(jscontext, constructor, "VK_NUMPAD5", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_NUMPAD5);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_NUMPAD5", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_NUMPAD6);
|
||||
JS_SetProperty(jscontext, constructor, "VK_NUMPAD6", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_NUMPAD6);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_NUMPAD6", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_NUMPAD7);
|
||||
JS_SetProperty(jscontext, constructor, "VK_NUMPAD7", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_NUMPAD7);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_NUMPAD7", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_NUMPAD8);
|
||||
JS_SetProperty(jscontext, constructor, "VK_NUMPAD8", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_NUMPAD8);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_NUMPAD8", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_NUMPAD9);
|
||||
JS_SetProperty(jscontext, constructor, "VK_NUMPAD9", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_NUMPAD9);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_NUMPAD9", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_MULTIPLY);
|
||||
JS_SetProperty(jscontext, constructor, "VK_MULTIPLY", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_MULTIPLY);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_MULTIPLY", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_ADD);
|
||||
JS_SetProperty(jscontext, constructor, "VK_ADD", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_ADD);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_ADD", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_SEPARATOR);
|
||||
JS_SetProperty(jscontext, constructor, "VK_SEPARATOR", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_SEPARATOR);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_SEPARATOR", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_SUBTRACT);
|
||||
JS_SetProperty(jscontext, constructor, "VK_SUBTRACT", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_SUBTRACT);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_SUBTRACT", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_DECIMAL);
|
||||
JS_SetProperty(jscontext, constructor, "VK_DECIMAL", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_DECIMAL);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_DECIMAL", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_DIVIDE);
|
||||
JS_SetProperty(jscontext, constructor, "VK_DIVIDE", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_DIVIDE);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_DIVIDE", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F1);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F1", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F1);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F1", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F2);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F2", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F2);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F2", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F3);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F3", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F3);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F3", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F4);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F4", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F4);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F4", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F5);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F5", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F5);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F5", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F6);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F6", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F6);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F6", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F7);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F7", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F7);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F7", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F8);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F8", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F8);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F8", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F9);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F9", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F9);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F9", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F10);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F10", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F10);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F10", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F11);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F11", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F11);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F11", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F12);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F12", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F12);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F12", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F13);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F13", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F13);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F13", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F14);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F14", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F14);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F14", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F15);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F15", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F15);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F15", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F16);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F16", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F16);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F16", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F17);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F17", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F17);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F17", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F18);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F18", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F18);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F18", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F19);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F19", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F19);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F19", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F20);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F20", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F20);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F20", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F21);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F21", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F21);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F21", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F22);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F22", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F22);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F22", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F23);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F23", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F23);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F23", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_F24);
|
||||
JS_SetProperty(jscontext, constructor, "VK_F24", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_F24);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_F24", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_NUM_LOCK);
|
||||
JS_SetProperty(jscontext, constructor, "VK_NUM_LOCK", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_NUM_LOCK);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_NUM_LOCK", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_SCROLL_LOCK);
|
||||
JS_SetProperty(jscontext, constructor, "VK_SCROLL_LOCK", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_SCROLL_LOCK);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_SCROLL_LOCK", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_COMMA);
|
||||
JS_SetProperty(jscontext, constructor, "VK_COMMA", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_COMMA);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_COMMA", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_PERIOD);
|
||||
JS_SetProperty(jscontext, constructor, "VK_PERIOD", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_PERIOD);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_PERIOD", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_SLASH);
|
||||
JS_SetProperty(jscontext, constructor, "VK_SLASH", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_SLASH);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_SLASH", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_BACK_QUOTE);
|
||||
JS_SetProperty(jscontext, constructor, "VK_BACK_QUOTE", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_BACK_QUOTE);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_BACK_QUOTE", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_OPEN_BRACKET);
|
||||
JS_SetProperty(jscontext, constructor, "VK_OPEN_BRACKET", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_OPEN_BRACKET);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_OPEN_BRACKET", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_BACK_SLASH);
|
||||
JS_SetProperty(jscontext, constructor, "VK_BACK_SLASH", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_BACK_SLASH);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_BACK_SLASH", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_CLOSE_BRACKET);
|
||||
JS_SetProperty(jscontext, constructor, "VK_CLOSE_BRACKET", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_CLOSE_BRACKET);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_CLOSE_BRACKET", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::VK_QUOTE);
|
||||
JS_SetProperty(jscontext, constructor, "VK_QUOTE", &vp);
|
||||
vp = INT_TO_JSVAL(nsIDOMUIEvent::DOM_VK_QUOTE);
|
||||
JS_SetProperty(jscontext, constructor, "DOM_VK_QUOTE", &vp);
|
||||
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMHTMLDocument.h"
|
||||
#include "nsIDOMNSHTMLDocument.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMHTMLCollection.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
|
||||
@ -44,6 +45,7 @@ static NS_DEFINE_IID(kIElementIID, NS_IDOMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIHTMLElementIID, NS_IDOMHTMLELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IDOMHTMLDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kINSHTMLDocumentIID, NS_IDOMNSHTMLDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIEventIID, NS_IDOMEVENT_IID);
|
||||
static NS_DEFINE_IID(kIHTMLCollectionIID, NS_IDOMHTMLCOLLECTION_IID);
|
||||
static NS_DEFINE_IID(kINodeListIID, NS_IDOMNODELIST_IID);
|
||||
|
||||
@ -51,6 +53,7 @@ NS_DEF_PTR(nsIDOMElement);
|
||||
NS_DEF_PTR(nsIDOMHTMLElement);
|
||||
NS_DEF_PTR(nsIDOMHTMLDocument);
|
||||
NS_DEF_PTR(nsIDOMNSHTMLDocument);
|
||||
NS_DEF_PTR(nsIDOMEvent);
|
||||
NS_DEF_PTR(nsIDOMHTMLCollection);
|
||||
NS_DEF_PTR(nsIDOMNodeList);
|
||||
|
||||
@ -1203,6 +1206,178 @@ NSHTMLDocumentWriteln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method CaptureEvents
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
NSHTMLDocumentCaptureEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMHTMLDocument *privateThis = (nsIDOMHTMLDocument*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsIDOMNSHTMLDocument *nativeThis = nsnull;
|
||||
nsresult result = NS_OK;
|
||||
if (NS_OK != privateThis->QueryInterface(kINSHTMLDocumentIID, (void **)&nativeThis)) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR);
|
||||
}
|
||||
|
||||
PRInt32 b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.captureevents",PR_FALSE , &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
if (argc < 1) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR);
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_NOT_NUMBER_ERR);
|
||||
}
|
||||
|
||||
result = nativeThis->CaptureEvents(b0);
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, result);
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method ReleaseEvents
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
NSHTMLDocumentReleaseEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMHTMLDocument *privateThis = (nsIDOMHTMLDocument*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsIDOMNSHTMLDocument *nativeThis = nsnull;
|
||||
nsresult result = NS_OK;
|
||||
if (NS_OK != privateThis->QueryInterface(kINSHTMLDocumentIID, (void **)&nativeThis)) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR);
|
||||
}
|
||||
|
||||
PRInt32 b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.releaseevents",PR_FALSE , &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
if (argc < 1) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR);
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_NOT_NUMBER_ERR);
|
||||
}
|
||||
|
||||
result = nativeThis->ReleaseEvents(b0);
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, result);
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method RouteEvent
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
NSHTMLDocumentRouteEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMHTMLDocument *privateThis = (nsIDOMHTMLDocument*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsIDOMNSHTMLDocument *nativeThis = nsnull;
|
||||
nsresult result = NS_OK;
|
||||
if (NS_OK != privateThis->QueryInterface(kINSHTMLDocumentIID, (void **)&nativeThis)) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR);
|
||||
}
|
||||
|
||||
nsIDOMEventPtr b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.routeevent",PR_FALSE , &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
if (argc < 1) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR);
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kIEventIID,
|
||||
"Event",
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
}
|
||||
|
||||
result = nativeThis->RouteEvent(b0);
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, result);
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
//
|
||||
// class for HTMLDocument
|
||||
@ -1263,6 +1438,9 @@ static JSFunctionSpec HTMLDocumentMethods[] =
|
||||
{"open", NSHTMLDocumentOpen, 0},
|
||||
{"write", NSHTMLDocumentWrite, 0},
|
||||
{"writeln", NSHTMLDocumentWriteln, 0},
|
||||
{"captureEvents", NSHTMLDocumentCaptureEvents, 1},
|
||||
{"releaseEvents", NSHTMLDocumentReleaseEvents, 1},
|
||||
{"routeEvent", NSHTMLDocumentRouteEvent, 1},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
@ -89,7 +89,6 @@ static NS_DEFINE_IID(kIDOMNSDocumentIID, NS_IDOMNSDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
static NS_DEFINE_IID(kIDOMAttrIID, NS_IDOMATTR_IID);
|
||||
static NS_DEFINE_IID(kIScriptEventListenerIID, NS_ISCRIPTEVENTLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDOMEventCapturerIID, NS_IDOMEVENTCAPTURER_IID);
|
||||
static NS_DEFINE_IID(kIPrivateDOMEventIID, NS_IPRIVATEDOMEVENT_IID);
|
||||
static NS_DEFINE_IID(kIEventListenerManagerIID, NS_IEVENTLISTENERMANAGER_IID);
|
||||
static NS_DEFINE_IID(kIPostDataIID, NS_IPOSTDATA_IID);
|
||||
@ -770,12 +769,6 @@ nsresult nsDocument::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMEventCapturerIID)) {
|
||||
nsIDOMEventCapturer* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIDOMEventReceiverIID)) {
|
||||
nsIDOMEventReceiver* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
@ -2424,27 +2417,6 @@ nsresult nsDocument::RemoveEventListener(const nsString& aType, nsIDOMEventListe
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsresult nsDocument::CaptureEvent(const nsString& aType)
|
||||
{
|
||||
nsIEventListenerManager *mManager;
|
||||
|
||||
if (NS_OK == GetListenerManager(&mManager)) {
|
||||
//mManager->CaptureEvent(aListener);
|
||||
NS_RELEASE(mManager);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsresult nsDocument::ReleaseEvent(const nsString& aType)
|
||||
{
|
||||
if (nsnull != mListenerManager) {
|
||||
//mListenerManager->ReleaseEvent(aListener);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
PRBool nsDocument::AddProperty(JSContext *aContext, jsval aID, jsval *aVp)
|
||||
{
|
||||
return PR_TRUE;
|
||||
@ -2665,6 +2637,7 @@ void nsDocument::FinishConvertToXIF(nsXIFConverter& aConverter, nsIDOMNode* aNod
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::ToXIF(nsXIFConverter& aConverter, nsIDOMNode* aNode)
|
||||
{
|
||||
|
@ -24,10 +24,10 @@
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIDiskDocument.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIScriptContextOwner.h"
|
||||
#include "nsIDOMEventCapturer.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsXIFConverter.h"
|
||||
#include "nsIJSScriptObject.h"
|
||||
@ -107,9 +107,9 @@ class nsDocument : public nsIDocument,
|
||||
public nsIDOMNSDocument,
|
||||
public nsIDiskDocument,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventCapturer,
|
||||
public nsIJSScriptObject,
|
||||
public nsSupportsWeakReference
|
||||
public nsSupportsWeakReference,
|
||||
public nsIDOMEventReceiver
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -357,10 +357,6 @@ public:
|
||||
NS_IMETHOD AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn);
|
||||
NS_IMETHOD CloneNode(PRBool aDeep, nsIDOMNode** aReturn);
|
||||
|
||||
// nsIDOMEventCapturer interface
|
||||
NS_IMETHOD CaptureEvent(const nsString& aType);
|
||||
NS_IMETHOD ReleaseEvent(const nsString& aType);
|
||||
|
||||
// nsIDOMEventReceiver interface
|
||||
NS_IMETHOD AddEventListenerByIID(nsIDOMEventListener *aListener, const nsIID& aIID);
|
||||
NS_IMETHOD RemoveEventListenerByIID(nsIDOMEventListener *aListener, const nsIID& aIID);
|
||||
|
@ -417,7 +417,6 @@ NS_IMPL_ADDREF(nsRangeListIterator)
|
||||
|
||||
NS_IMPL_RELEASE(nsRangeListIterator)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsRangeListIterator::CurrentItem(nsIDOMRange **aItem)
|
||||
{
|
||||
@ -742,12 +741,12 @@ nsRangeList::HandleKeyEvent(nsGUIEvent *aGuiEvent)
|
||||
nsKeyEvent *keyEvent = (nsKeyEvent *)aGuiEvent; //this is ok. It really is a keyevent
|
||||
switch (keyEvent->keyCode)
|
||||
{
|
||||
case nsIDOMUIEvent::VK_LEFT :
|
||||
case nsIDOMUIEvent::VK_UP :
|
||||
case nsIDOMUIEvent::VK_DOWN :
|
||||
case nsIDOMUIEvent::VK_RIGHT :
|
||||
case nsIDOMUIEvent::VK_HOME :
|
||||
case nsIDOMUIEvent::VK_END :
|
||||
case nsIDOMUIEvent::DOM_VK_LEFT :
|
||||
case nsIDOMUIEvent::DOM_VK_UP :
|
||||
case nsIDOMUIEvent::DOM_VK_DOWN :
|
||||
case nsIDOMUIEvent::DOM_VK_RIGHT :
|
||||
case nsIDOMUIEvent::DOM_VK_HOME :
|
||||
case nsIDOMUIEvent::DOM_VK_END :
|
||||
break;
|
||||
default:
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -764,7 +763,7 @@ nsRangeList::HandleKeyEvent(nsGUIEvent *aGuiEvent)
|
||||
result = mDomSelections[SELECTION_NORMAL]->GetIsCollapsed(&isCollapsed);
|
||||
if (NS_FAILED(result))
|
||||
return result;
|
||||
if (keyEvent->keyCode == nsIDOMUIEvent::VK_UP || keyEvent->keyCode == nsIDOMUIEvent::VK_DOWN)
|
||||
if (keyEvent->keyCode == nsIDOMUIEvent::DOM_VK_UP || keyEvent->keyCode == nsIDOMUIEvent::DOM_VK_DOWN)
|
||||
{
|
||||
desiredX= FetchDesiredX();
|
||||
SetDesiredX(desiredX);
|
||||
@ -772,8 +771,8 @@ nsRangeList::HandleKeyEvent(nsGUIEvent *aGuiEvent)
|
||||
|
||||
if (!isCollapsed && !keyEvent->isShift) {
|
||||
switch (keyEvent->keyCode){
|
||||
case nsIDOMUIEvent::VK_LEFT :
|
||||
case nsIDOMUIEvent::VK_UP : {
|
||||
case nsIDOMUIEvent::DOM_VK_LEFT :
|
||||
case nsIDOMUIEvent::DOM_VK_UP : {
|
||||
if ((mDomSelections[SELECTION_NORMAL]->GetDirection() == eDirPrevious)) { //f,a
|
||||
offsetused = mDomSelections[SELECTION_NORMAL]->FetchFocusOffset();
|
||||
weakNodeUsed = mDomSelections[SELECTION_NORMAL]->FetchFocusNode();
|
||||
@ -785,8 +784,8 @@ nsRangeList::HandleKeyEvent(nsGUIEvent *aGuiEvent)
|
||||
result = mDomSelections[SELECTION_NORMAL]->Collapse(weakNodeUsed,offsetused);
|
||||
|
||||
} break;
|
||||
case nsIDOMUIEvent::VK_RIGHT :
|
||||
case nsIDOMUIEvent::VK_DOWN : {
|
||||
case nsIDOMUIEvent::DOM_VK_RIGHT :
|
||||
case nsIDOMUIEvent::DOM_VK_DOWN : {
|
||||
if ((mDomSelections[SELECTION_NORMAL]->GetDirection() == eDirPrevious)) { //f,a
|
||||
offsetused = mDomSelections[SELECTION_NORMAL]->FetchAnchorOffset();
|
||||
weakNodeUsed = mDomSelections[SELECTION_NORMAL]->FetchAnchorNode();
|
||||
@ -799,7 +798,7 @@ nsRangeList::HandleKeyEvent(nsGUIEvent *aGuiEvent)
|
||||
} break;
|
||||
|
||||
}
|
||||
if (keyEvent->keyCode == nsIDOMUIEvent::VK_UP || keyEvent->keyCode == nsIDOMUIEvent::VK_DOWN)
|
||||
if (keyEvent->keyCode == nsIDOMUIEvent::DOM_VK_UP || keyEvent->keyCode == nsIDOMUIEvent::DOM_VK_DOWN)
|
||||
SetDesiredX(desiredX);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -814,23 +813,23 @@ nsRangeList::HandleKeyEvent(nsGUIEvent *aGuiEvent)
|
||||
pos.SetData(mTracker, desiredX, amount, eDirPrevious, offsetused, PR_FALSE,PR_TRUE);
|
||||
mHint = HINTRIGHT;//stick to opposite of movement
|
||||
switch (keyEvent->keyCode){
|
||||
case nsIDOMUIEvent::VK_RIGHT :
|
||||
case nsIDOMUIEvent::DOM_VK_RIGHT :
|
||||
pos.mDirection = eDirNext;
|
||||
mHint = HINTLEFT;//stick to this line
|
||||
case nsIDOMUIEvent::VK_LEFT : //no break
|
||||
case nsIDOMUIEvent::DOM_VK_LEFT : //no break
|
||||
InvalidateDesiredX();
|
||||
break;
|
||||
case nsIDOMUIEvent::VK_DOWN :
|
||||
case nsIDOMUIEvent::DOM_VK_DOWN :
|
||||
pos.mDirection = eDirNext;//no break here
|
||||
mHint = HINTLEFT;//stick to this line
|
||||
case nsIDOMUIEvent::VK_UP :
|
||||
case nsIDOMUIEvent::DOM_VK_UP :
|
||||
pos.mAmount = eSelectLine;
|
||||
break;
|
||||
case nsIDOMUIEvent::VK_HOME :
|
||||
case nsIDOMUIEvent::DOM_VK_HOME :
|
||||
pos.mAmount = eSelectBeginLine;
|
||||
InvalidateDesiredX();
|
||||
break;
|
||||
case nsIDOMUIEvent::VK_END :
|
||||
case nsIDOMUIEvent::DOM_VK_END :
|
||||
pos.mAmount = eSelectEndLine;
|
||||
InvalidateDesiredX();
|
||||
mHint = HINTLEFT;//stick to this line
|
||||
|
@ -601,6 +601,30 @@ NS_METHOD nsDOMEvent::GetRangeOffset(PRInt32* aRangeOffset)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_METHOD nsDOMEvent::GetCancelBubble(PRBool* aCancelBubble)
|
||||
{
|
||||
if (mEvent->flags & NS_EVENT_FLAG_BUBBLE || mEvent->flags & NS_EVENT_FLAG_INIT) {
|
||||
*aCancelBubble = (mEvent->flags &= NS_EVENT_FLAG_STOP_DISPATCH) ? PR_TRUE : PR_FALSE;
|
||||
}
|
||||
else {
|
||||
*aCancelBubble = PR_FALSE;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsDOMEvent::SetCancelBubble(PRBool aCancelBubble)
|
||||
{
|
||||
if (mEvent->flags & NS_EVENT_FLAG_BUBBLE || mEvent->flags & NS_EVENT_FLAG_INIT) {
|
||||
if (aCancelBubble) {
|
||||
mEvent->flags |= NS_EVENT_FLAG_STOP_DISPATCH;
|
||||
}
|
||||
else {
|
||||
mEvent->flags &= ~NS_EVENT_FLAG_STOP_DISPATCH;
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
||||
{
|
||||
//XXX Write me!
|
||||
|
@ -128,6 +128,9 @@ public:
|
||||
|
||||
NS_IMETHOD GetRangeOffset(PRInt32* aRangeOffset);
|
||||
|
||||
NS_IMETHOD GetCancelBubble(PRBool* aCancelBubble);
|
||||
NS_IMETHOD SetCancelBubble(PRBool aCancelBubble);
|
||||
|
||||
// nsIPrivateDOMEvent interface
|
||||
NS_IMETHOD DuplicatePrivateData();
|
||||
NS_IMETHOD SetTarget(nsIDOMNode* aNode);
|
||||
|
@ -432,6 +432,16 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NS_VK_HOME:
|
||||
case NS_VK_END:
|
||||
if (!mCurrentFocus) {
|
||||
nsIScrollableView* sv = GetNearestScrollingView(aView);
|
||||
if (sv) {
|
||||
nsKeyEvent * keyEvent = (nsKeyEvent *)aEvent;
|
||||
sv->ScrollByWhole((keyEvent->keyCode != NS_VK_HOME) ? PR_TRUE : PR_FALSE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NS_VK_DOWN:
|
||||
case NS_VK_UP:
|
||||
if (!mCurrentFocus) {
|
||||
|
@ -78,6 +78,7 @@
|
||||
#include "nsGenericDOMNodeList.h"
|
||||
#include "nsICSSLoader.h"
|
||||
#include "nsIHTTPChannel.h"
|
||||
#include "nsIEventListenerManager.h"
|
||||
|
||||
#include "nsICharsetDetector.h"
|
||||
#include "nsICharsetDetectionAdaptor.h"
|
||||
@ -2215,6 +2216,36 @@ nsHTMLDocument::GetSelection(nsString& aReturn)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocument::CaptureEvents(PRInt32 aEventFlags)
|
||||
{
|
||||
nsIEventListenerManager *manager;
|
||||
|
||||
if (NS_OK == GetListenerManager(&manager)) {
|
||||
//mManager->CaptureEvent(aListener);
|
||||
NS_RELEASE(manager);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocument::ReleaseEvents(PRInt32 aEventFlags)
|
||||
{
|
||||
if (nsnull != mListenerManager) {
|
||||
//mListenerManager->ReleaseEvent(aListener);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocument::RouteEvent(nsIDOMEvent* aEvt)
|
||||
{
|
||||
//XXX Not the best solution -joki
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRIntn
|
||||
nsHTMLDocument::RemoveStrings(PLHashEntry *he, PRIntn i, void *arg)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user