mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 716822 - Move attributes and methods on nsIDOMNSEvent to nsIDOMEvent; r=smaug
This commit is contained in:
parent
d6a7a66fb7
commit
b927c10310
@ -26,21 +26,11 @@
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
#include "nsIAccessibleRelation.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDocShellTreeNode.h"
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsIDOMHTMLImageElement.h"
|
||||
#include "nsIDOMHTMLInputElement.h"
|
||||
#include "nsIDOMHTMLSelectElement.h"
|
||||
#include "nsIDOMDataContainerEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMXULMultSelectCntrlEl.h"
|
||||
#include "nsIDOMXULPopupElement.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsEventListenerManager.h"
|
||||
#include "nsIFrame.h"
|
||||
@ -262,9 +252,9 @@ RootAccessible::DocumentActivated(DocAccessible* aDocument)
|
||||
NS_IMETHODIMP
|
||||
RootAccessible::HandleEvent(nsIDOMEvent* aDOMEvent)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNSEvent> DOMNSEvent(do_QueryInterface(aDOMEvent));
|
||||
MOZ_ASSERT(aDOMEvent);
|
||||
nsCOMPtr<nsIDOMEventTarget> DOMEventTarget;
|
||||
DOMNSEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
|
||||
aDOMEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
|
||||
nsCOMPtr<nsINode> origTargetNode(do_QueryInterface(DOMEventTarget));
|
||||
if (!origTargetNode)
|
||||
return NS_OK;
|
||||
@ -299,9 +289,9 @@ RootAccessible::HandleEvent(nsIDOMEvent* aDOMEvent)
|
||||
void
|
||||
RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNSEvent> DOMNSEvent(do_QueryInterface(aDOMEvent));
|
||||
MOZ_ASSERT(aDOMEvent);
|
||||
nsCOMPtr<nsIDOMEventTarget> DOMEventTarget;
|
||||
DOMNSEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
|
||||
aDOMEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
|
||||
nsCOMPtr<nsINode> origTargetNode(do_QueryInterface(DOMEventTarget));
|
||||
|
||||
nsAutoString eventType;
|
||||
|
@ -67,13 +67,13 @@ function test_gestureListener(evt)
|
||||
is(evt.delta, test_expectedDelta,
|
||||
"evt.delta (" + evt.delta + ") does not match expected value");
|
||||
|
||||
is(evt.shiftKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.SHIFT_MASK) != 0,
|
||||
is(evt.shiftKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.SHIFT_MASK) != 0,
|
||||
"evt.shiftKey did not match expected value");
|
||||
is(evt.ctrlKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.CONTROL_MASK) != 0,
|
||||
is(evt.ctrlKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.CONTROL_MASK) != 0,
|
||||
"evt.ctrlKey did not match expected value");
|
||||
is(evt.altKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.ALT_MASK) != 0,
|
||||
is(evt.altKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.ALT_MASK) != 0,
|
||||
"evt.altKey did not match expected value");
|
||||
is(evt.metaKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.META_MASK) != 0,
|
||||
is(evt.metaKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.META_MASK) != 0,
|
||||
"evt.metaKey did not match expected value");
|
||||
|
||||
if (evt.type == "MozTapGesture") {
|
||||
@ -158,19 +158,19 @@ function test_TestEventListeners()
|
||||
e("MozEdgeUIGesture", 0, 0, 0);
|
||||
|
||||
// event.shiftKey
|
||||
let modifier = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
|
||||
let modifier = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
|
||||
e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
|
||||
|
||||
// event.metaKey
|
||||
modifier = Components.interfaces.nsIDOMNSEvent.META_MASK;
|
||||
modifier = Components.interfaces.nsIDOMEvent.META_MASK;
|
||||
e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
|
||||
|
||||
// event.altKey
|
||||
modifier = Components.interfaces.nsIDOMNSEvent.ALT_MASK;
|
||||
modifier = Components.interfaces.nsIDOMEvent.ALT_MASK;
|
||||
e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
|
||||
|
||||
// event.ctrlKey
|
||||
modifier = Components.interfaces.nsIDOMNSEvent.CONTROL_MASK;
|
||||
modifier = Components.interfaces.nsIDOMEvent.CONTROL_MASK;
|
||||
e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMDragEvent.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
|
@ -88,7 +88,6 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
|
||||
#include "nsContentErrors.h"
|
||||
#include "nsUnicharUtilCIID.h"
|
||||
#include "nsINativeKeyBindings.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsXULPopupManager.h"
|
||||
#include "nsIPermissionManager.h"
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
@ -4689,14 +4688,13 @@ nsContentUtils::DOMEventToNativeKeyEvent(nsIDOMKeyEvent* aKeyEvent,
|
||||
nsNativeKeyEvent* aNativeEvent,
|
||||
bool aGetCharCode)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNSEvent> nsevent = do_QueryInterface(aKeyEvent);
|
||||
bool defaultPrevented;
|
||||
nsevent->GetPreventDefault(&defaultPrevented);
|
||||
aKeyEvent->GetPreventDefault(&defaultPrevented);
|
||||
if (defaultPrevented)
|
||||
return false;
|
||||
|
||||
bool trusted = false;
|
||||
nsevent->GetIsTrusted(&trusted);
|
||||
aKeyEvent->GetIsTrusted(&trusted);
|
||||
if (!trusted)
|
||||
return false;
|
||||
|
||||
|
@ -4009,7 +4009,6 @@ DOMCI_DATA(XMLHttpProgressEvent, nsXMLHttpProgressEvent)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsXMLHttpProgressEvent)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMProgressEvent)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEvent, nsIDOMProgressEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMProgressEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMLSProgressEvent)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(XMLHttpProgressEvent)
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsIJSNativeInitializer.h"
|
||||
#include "nsIDOMLSProgressEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsDOMProgressEvent.h"
|
||||
#include "nsDOMEventTargetHelper.h"
|
||||
@ -35,12 +34,12 @@
|
||||
#include "nsDOMBlobBuilder.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "mozilla/dom/XMLHttpRequestBinding.h"
|
||||
#include "mozilla/dom/XMLHttpRequestUploadBinding.h"
|
||||
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "mozilla/dom/TypedArray.h"
|
||||
#include "mozilla/dom/XMLHttpRequestBinding.h"
|
||||
#include "mozilla/dom/XMLHttpRequestUploadBinding.h"
|
||||
|
||||
class nsILoadGroup;
|
||||
class AsyncVerifyRedirectCallbackForwarder;
|
||||
@ -710,8 +709,7 @@ protected:
|
||||
// helper class to expose a progress DOM Event
|
||||
|
||||
class nsXMLHttpProgressEvent : public nsIDOMProgressEvent,
|
||||
public nsIDOMLSProgressEvent,
|
||||
public nsIDOMNSEvent
|
||||
public nsIDOMLSProgressEvent
|
||||
{
|
||||
public:
|
||||
nsXMLHttpProgressEvent(nsIDOMProgressEvent* aInner,
|
||||
@ -721,9 +719,8 @@ public:
|
||||
virtual ~nsXMLHttpProgressEvent();
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXMLHttpProgressEvent, nsIDOMNSEvent)
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXMLHttpProgressEvent, nsIDOMProgressEvent)
|
||||
NS_FORWARD_NSIDOMEVENT(mInner->)
|
||||
NS_FORWARD_NSIDOMNSEVENT(mInner->)
|
||||
NS_FORWARD_NSIDOMPROGRESSEVENT(mInner->)
|
||||
NS_DECL_NSIDOMLSPROGRESSEVENT
|
||||
|
||||
|
@ -175,7 +175,6 @@ DOMCI_DATA(Event, nsDOMEvent)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMEvent)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIJSNativeInitializer)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Event)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define nsDOMEvent_h__
|
||||
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
@ -24,7 +23,6 @@ struct JSContext;
|
||||
struct JSObject;
|
||||
|
||||
class nsDOMEvent : public nsIDOMEvent,
|
||||
public nsIDOMNSEvent,
|
||||
public nsIJSNativeInitializer
|
||||
{
|
||||
public:
|
||||
@ -191,9 +189,6 @@ public:
|
||||
// nsIDOMEvent Interface
|
||||
NS_DECL_NSIDOMEVENT
|
||||
|
||||
// nsIDOMNSEvent Interface
|
||||
NS_DECL_NSIDOMNSEVENT
|
||||
|
||||
// nsIJSNativeInitializer
|
||||
NS_IMETHOD Initialize(nsISupports* aOwner, JSContext* aCx, JSObject* aObj,
|
||||
PRUint32 aArgc, jsval* aArgv);
|
||||
@ -251,6 +246,12 @@ protected:
|
||||
NS_IMETHOD InitEvent(const nsAString & eventTypeArg, bool canBubbleArg, bool cancelableArg) { return _to InitEvent(eventTypeArg, canBubbleArg, cancelableArg); } \
|
||||
NS_IMETHOD GetDefaultPrevented(bool *aDefaultPrevented) { return _to GetDefaultPrevented(aDefaultPrevented); } \
|
||||
NS_IMETHOD StopImmediatePropagation(void) { return _to StopImmediatePropagation(); } \
|
||||
NS_IMETHOD GetOriginalTarget(nsIDOMEventTarget** aOriginalTarget) { return _to GetOriginalTarget(aOriginalTarget); } \
|
||||
NS_IMETHOD GetExplicitOriginalTarget(nsIDOMEventTarget** aExplicitOriginalTarget) { return _to GetExplicitOriginalTarget(aExplicitOriginalTarget); } \
|
||||
NS_IMETHOD PreventBubble() { return _to PreventBubble(); } \
|
||||
NS_IMETHOD PreventCapture() { return _to PreventCapture(); } \
|
||||
NS_IMETHOD GetPreventDefault(bool* aRetval) { return _to GetPreventDefault(aRetval); } \
|
||||
NS_IMETHOD GetIsTrusted(bool* aIsTrusted) { return _to GetIsTrusted(aIsTrusted); } \
|
||||
NS_IMETHOD SetTarget(nsIDOMEventTarget *aTarget) { return _to SetTarget(aTarget); } \
|
||||
NS_IMETHOD_(bool) IsDispatchStopped(void) { return _to IsDispatchStopped(); } \
|
||||
NS_IMETHOD_(nsEvent *) GetInternalNSEvent(void) { return _to GetInternalNSEvent(); } \
|
||||
|
@ -29,8 +29,6 @@ public:
|
||||
NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType);
|
||||
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter);
|
||||
|
||||
NS_FORWARD_NSIDOMNSEVENT(nsDOMEvent::)
|
||||
|
||||
virtual nsresult InitFromCtor(const nsAString& aType,
|
||||
JSContext* aCx, jsval* aVal);
|
||||
|
||||
|
@ -545,7 +545,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Make sure that nsIDOMEvent::target and nsIDOMNSEvent::originalTarget
|
||||
// Make sure that nsIDOMEvent::target and nsIDOMEvent::originalTarget
|
||||
// point to the last item in the chain.
|
||||
if (!aEvent->target) {
|
||||
// Note, CurrentTarget() points always to the object returned by
|
||||
@ -682,10 +682,8 @@ nsEventDispatcher::DispatchDOMEvent(nsISupports* aTarget,
|
||||
if (innerEvent->flags & NS_EVENT_DISPATCHED) {
|
||||
innerEvent->target = nullptr;
|
||||
innerEvent->originalTarget = nullptr;
|
||||
}
|
||||
else {
|
||||
nsCOMPtr<nsIDOMNSEvent> nsevent(do_QueryInterface(aDOMEvent));
|
||||
nsevent->GetIsTrusted(&dontResetTrusted);
|
||||
} else {
|
||||
aDOMEvent->GetIsTrusted(&dontResetTrusted);
|
||||
}
|
||||
|
||||
if (!dontResetTrusted) {
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "nsDOMEvent.h"
|
||||
#include "nsEventListenerManager.h"
|
||||
#include "nsCaret.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsITextControlFrame.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsIFrame.h"
|
||||
@ -202,8 +201,7 @@ nsIMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
|
||||
NS_ENSURE_TRUE(widget, );
|
||||
|
||||
bool isTrusted;
|
||||
nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aMouseEvent);
|
||||
nsresult rv = NSEvent->GetIsTrusted(&isTrusted);
|
||||
nsresult rv = aMouseEvent->GetIsTrusted(&isTrusted);
|
||||
NS_ENSURE_SUCCESS(rv, );
|
||||
if (!isTrusted) {
|
||||
return; // ignore untrusted event.
|
||||
|
@ -84,8 +84,9 @@ MOCHITEST_FILES = \
|
||||
test_bug741666.html \
|
||||
test_dom_keyboard_event.html \
|
||||
test_dom_mouse_event.html \
|
||||
test_bug742376.html \
|
||||
test_bug603008.html \
|
||||
test_bug716822.html \
|
||||
test_bug742376.html \
|
||||
$(NULL)
|
||||
|
||||
#bug 585630
|
||||
|
@ -53,7 +53,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=238987
|
||||
shouldStop = true;
|
||||
}
|
||||
} else if (e.target.id == "end") {
|
||||
modifier = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
|
||||
modifier = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
|
||||
} else if (modifier) {
|
||||
var expected = backwardFocusArray.pop();
|
||||
ok(expected == e.target.id,
|
||||
|
@ -19,8 +19,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
|
||||
|
||||
/** Test for Bug 409604 **/
|
||||
|
||||
var modifier = Components.interfaces.nsIDOMNSEvent.ALT_MASK |
|
||||
Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
|
||||
var modifier = Components.interfaces.nsIDOMEvent.ALT_MASK |
|
||||
Components.interfaces.nsIDOMEvent.SHIFT_MASK;
|
||||
var expectedFocus = "a,c,d,e,f,g,h,i,j,k,l,m,n,p,x,y";
|
||||
// XXX the "map" test is causing trouble, see bug 433089
|
||||
var focusArray = expectedFocus.split(",");
|
||||
|
@ -81,7 +81,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=617528
|
||||
browser.removeEventListener("contextmenu", onContextMenu1, false);
|
||||
|
||||
browser.addEventListener("contextmenu", onContextMenu2, false);
|
||||
var shiftMask = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
|
||||
var shiftMask = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
|
||||
wu.sendMouseEvent("contextmenu", left, top, 2, 1, shiftMask);
|
||||
browser.removeEventListener("contextmenu", onContextMenu2, false);
|
||||
|
||||
|
28
content/events/test/test_bug716822.html
Normal file
28
content/events/test/test_bug716822.html
Normal file
@ -0,0 +1,28 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=716822
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 716822</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=716822">Mozilla Bug 716822</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
/** Test for Bug 716822 **/
|
||||
for (var p in window.NSEvent) {
|
||||
ok(p in window.Event, p + " should be in Event.");
|
||||
is(window.NSEvent[p], window.Event[p], "Value of " + p);
|
||||
}
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -58,7 +58,6 @@
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsEventStateManager.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsDOMCSSDeclaration.h"
|
||||
#include "nsITextControlFrame.h"
|
||||
#include "nsIForm.h"
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIFormControlFrame.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include "nsPresState.h"
|
||||
#include "nsLayoutErrors.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIDOMHTMLCollection.h"
|
||||
#include "nsLinebreakConverter.h" //to strip out carriage returns
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "nsIDOMKeyEvent.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
@ -86,10 +85,8 @@ nsXBLKeyEventHandler::ExecuteMatchedHandlers(nsIDOMKeyEvent* aKeyEvent,
|
||||
PRUint32 aCharCode,
|
||||
bool aIgnoreShiftKey)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
|
||||
bool trustedEvent = false;
|
||||
if (domNSEvent)
|
||||
domNSEvent->GetIsTrusted(&trustedEvent);
|
||||
aKeyEvent->GetIsTrusted(&trustedEvent);
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> target;
|
||||
aKeyEvent->GetCurrentTarget(getter_AddRefs(target));
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "nsEventListenerManager.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsPIWindowRoot.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
@ -210,11 +209,8 @@ nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventTarget* aTarget,
|
||||
// XUL handlers and commands shouldn't be triggered by non-trusted
|
||||
// events.
|
||||
if (isXULKey || isXBLCommand) {
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aEvent);
|
||||
bool trustedEvent = false;
|
||||
if (domNSEvent) {
|
||||
domNSEvent->GetIsTrusted(&trustedEvent);
|
||||
}
|
||||
aEvent->GetIsTrusted(&trustedEvent);
|
||||
|
||||
if (!trustedEvent)
|
||||
return NS_OK;
|
||||
@ -360,21 +356,18 @@ nsXBLPrototypeHandler::DispatchXBLCommand(nsIDOMEventTarget* aTarget, nsIDOMEven
|
||||
// This is a special-case optimization to make command handling fast.
|
||||
// It isn't really a part of XBL, but it helps speed things up.
|
||||
|
||||
if (aEvent) {
|
||||
// See if preventDefault has been set. If so, don't execute.
|
||||
bool preventDefault = false;
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aEvent);
|
||||
if (domNSEvent) {
|
||||
domNSEvent->GetPreventDefault(&preventDefault);
|
||||
aEvent->GetPreventDefault(&preventDefault);
|
||||
if (preventDefault) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (preventDefault)
|
||||
return NS_OK;
|
||||
|
||||
if (aEvent) {
|
||||
bool dispatchStopped = aEvent->IsDispatchStopped();
|
||||
if (dispatchStopped)
|
||||
if (dispatchStopped) {
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// Instead of executing JS, let's get the controller for the bound
|
||||
// element and call doCommand on it.
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "nsIAtom.h"
|
||||
#include "nsIDOMKeyEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsXBLService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsGkAtoms.h"
|
||||
@ -280,17 +279,14 @@ DoCommandCallback(const char *aCommand, void *aData)
|
||||
nsresult
|
||||
nsXBLWindowKeyHandler::WalkHandlers(nsIDOMKeyEvent* aKeyEvent, nsIAtom* aEventType)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
|
||||
bool prevent;
|
||||
domNSEvent->GetPreventDefault(&prevent);
|
||||
aKeyEvent->GetPreventDefault(&prevent);
|
||||
if (prevent)
|
||||
return NS_OK;
|
||||
|
||||
bool trustedEvent = false;
|
||||
if (domNSEvent) {
|
||||
// Don't process the event if it was not dispatched from a trusted source
|
||||
domNSEvent->GetIsTrusted(&trustedEvent);
|
||||
}
|
||||
aKeyEvent->GetIsTrusted(&trustedEvent);
|
||||
|
||||
if (!trustedEvent)
|
||||
return NS_OK;
|
||||
@ -303,7 +299,7 @@ nsXBLWindowKeyHandler::WalkHandlers(nsIDOMKeyEvent* aKeyEvent, nsIAtom* aEventTy
|
||||
if (!el) {
|
||||
if (mUserHandler) {
|
||||
WalkHandlersInternal(aKeyEvent, aEventType, mUserHandler);
|
||||
domNSEvent->GetPreventDefault(&prevent);
|
||||
aKeyEvent->GetPreventDefault(&prevent);
|
||||
if (prevent)
|
||||
return NS_OK; // Handled by the user bindings. Our work here is done.
|
||||
}
|
||||
|
@ -99,7 +99,6 @@
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "mozAutoDocUpdate.h"
|
||||
#include "nsIDOMXULCommandEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsCCUncollectableMarker.h"
|
||||
|
||||
namespace css = mozilla::css;
|
||||
@ -1136,19 +1135,18 @@ nsXULElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
// pointed to by the command attribute. The new event's
|
||||
// sourceEvent will be the original command event that we're
|
||||
// handling.
|
||||
nsCOMPtr<nsIDOMNSEvent> nsevent =
|
||||
do_QueryInterface(aVisitor.mDOMEvent);
|
||||
while (nsevent) {
|
||||
nsCOMPtr<nsIDOMEvent> domEvent = aVisitor.mDOMEvent;
|
||||
while (domEvent) {
|
||||
nsCOMPtr<nsIDOMEventTarget> oTarget;
|
||||
nsevent->GetOriginalTarget(getter_AddRefs(oTarget));
|
||||
domEvent->GetOriginalTarget(getter_AddRefs(oTarget));
|
||||
NS_ENSURE_STATE(!SameCOMIdentity(oTarget, commandContent));
|
||||
nsCOMPtr<nsIDOMEvent> tmp;
|
||||
nsCOMPtr<nsIDOMXULCommandEvent> commandEvent =
|
||||
do_QueryInterface(nsevent);
|
||||
do_QueryInterface(domEvent);
|
||||
if (commandEvent) {
|
||||
commandEvent->GetSourceEvent(getter_AddRefs(tmp));
|
||||
commandEvent->GetSourceEvent(getter_AddRefs(domEvent));
|
||||
} else {
|
||||
domEvent = NULL;
|
||||
}
|
||||
nsevent = do_QueryInterface(tmp);
|
||||
}
|
||||
|
||||
nsInputEvent* orig =
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "nsIDOMXULDocument.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
@ -93,12 +92,6 @@ nsXULPopupListener::HandleEvent(nsIDOMEvent* aEvent)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// check if someone has attempted to prevent this action.
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(mouseEvent);
|
||||
if (!domNSEvent) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Get the node that was clicked on.
|
||||
nsCOMPtr<nsIDOMEventTarget> target;
|
||||
mouseEvent->GetTarget(getter_AddRefs(target));
|
||||
@ -123,7 +116,7 @@ nsXULPopupListener::HandleEvent(nsIDOMEvent* aEvent)
|
||||
}
|
||||
|
||||
bool preventDefault;
|
||||
domNSEvent->GetPreventDefault(&preventDefault);
|
||||
mouseEvent->GetPreventDefault(&preventDefault);
|
||||
if (preventDefault && targetNode && mIsContext) {
|
||||
// Someone called preventDefault on a context menu.
|
||||
// Let's make sure they are allowed to do so.
|
||||
@ -173,8 +166,6 @@ nsXULPopupListener::HandleEvent(nsIDOMEvent* aEvent)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMNSEvent> nsevent = do_QueryInterface(aEvent);
|
||||
|
||||
if (mIsContext) {
|
||||
#ifndef NS_CONTEXT_MENU_IS_MOUSEUP
|
||||
// If the context menu launches on mousedown,
|
||||
|
@ -64,7 +64,6 @@
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMXMLDocument.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMKeyEvent.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsContentUtils.h"
|
||||
@ -2375,7 +2374,6 @@ nsDOMClassInfo::RegisterExternalClasses()
|
||||
|
||||
#define DOM_CLASSINFO_EVENT_MAP_ENTRIES \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEvent) \
|
||||
|
||||
#define DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMUIEvent) \
|
||||
@ -6396,14 +6394,6 @@ nsDOMConstructor::ResolveInterfaceConstants(JSContext *cx, JSObject *obj)
|
||||
nsresult rv = DefineInterfaceConstants(cx, obj, class_iid);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Special case for |Event|, Event needs constants from NSEvent
|
||||
// too for backwards compatibility.
|
||||
if (class_iid->Equals(NS_GET_IID(nsIDOMEvent))) {
|
||||
rv = DefineInterfaceConstants(cx, obj,
|
||||
&NS_GET_IID(nsIDOMNSEvent));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// Special case for |IDBKeyRange| which gets funny "static" functions.
|
||||
if (class_iid->Equals(NS_GET_IID(nsIIDBKeyRange)) &&
|
||||
!indexedDB::IDBKeyRange::DefineConstructors(cx, obj)) {
|
||||
@ -6548,14 +6538,6 @@ ResolvePrototype(nsIXPConnect *aXPConnect, nsGlobalWindow *aWin, JSContext *cx,
|
||||
rv = DefineInterfaceConstants(cx, class_obj, primary_iid);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Special case for |Event|, Event needs constants from NSEvent
|
||||
// too for backwards compatibility.
|
||||
if (primary_iid->Equals(NS_GET_IID(nsIDOMEvent))) {
|
||||
rv = DefineInterfaceConstants(cx, class_obj,
|
||||
&NS_GET_IID(nsIDOMNSEvent));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// Special case for |IDBKeyRange| which gets funny "static" functions.
|
||||
if (primary_iid->Equals(NS_GET_IID(nsIIDBKeyRange)) &&
|
||||
!indexedDB::IDBKeyRange::DefineConstructors(cx, class_obj)) {
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "nsPresContext.h"
|
||||
#include "nsDOMClassInfoID.h"
|
||||
#include "nsDOMError.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsDOMWindowUtils.h"
|
||||
#include "nsQueryContentEventResult.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
interface nsIDOMBluetoothDevice;
|
||||
|
||||
[scriptable, builtinclass, uuid(49294da3-b698-4a7f-aca2-3f9bc44c7625)]
|
||||
[scriptable, builtinclass, uuid(819b4683-23a9-4af9-96b9-2c40a14ecb0b)]
|
||||
interface nsIDOMBluetoothDeviceEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute nsIDOMBluetoothDevice device;
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(2604ce78-abaa-4af4-b456-daa4c6386a11)]
|
||||
[scriptable, builtinclass, uuid(5927bb1f-e8eb-4b40-ae20-cd02f34412ce)]
|
||||
interface nsIDOMBluetoothPropertyEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute DOMString property;
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(4eea27c9-a831-40ce-8dbd-e97df9f11b8f)]
|
||||
[scriptable, builtinclass, uuid(bb9797ae-6959-47cb-893e-73d3a7018d6d)]
|
||||
interface nsIIDBVersionChangeEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute unsigned long long oldVersion;
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
interface mozIDOMApplication;
|
||||
|
||||
[scriptable, builtinclass, uuid(8f2bfba8-f10e-4f63-a5e0-7a7056e1dbe6)]
|
||||
[scriptable, builtinclass, uuid(dae640fb-0a14-42d8-88d3-541c6f077820)]
|
||||
interface nsIDOMMozApplicationEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute mozIDOMApplication application;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(6ed26570-b640-11e1-afa6-0800200c9a66)]
|
||||
[scriptable, builtinclass, uuid(b05dd60a-bfb8-4428-982e-c7f20e77b673)]
|
||||
interface nsIDOMMozContactChangeEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute DOMString contactID;
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "domstubs.idl"
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, uuid(468304d6-aab6-4e1e-8ab2-569d9e703431), builtinclass]
|
||||
[scriptable, uuid(49bdda6f-430a-4cf8-b535-b97b5b1ed575), builtinclass]
|
||||
interface nsIDOMDeviceStorageChangeEvent : nsIDOMEvent
|
||||
{
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
* http://dev.w3.org/csswg/css3-animations/#animation-events-
|
||||
*/
|
||||
|
||||
[scriptable, builtinclass, uuid(861e0be7-695a-4627-919f-13bccb9eb115)]
|
||||
[scriptable, builtinclass, uuid(ecb06edb-8e90-43ce-8f4b-3d1021222e3a)]
|
||||
interface nsIDOMAnimationEvent : nsIDOMEvent {
|
||||
readonly attribute DOMString animationName;
|
||||
readonly attribute float elapsedTime;
|
||||
|
@ -15,7 +15,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
[scriptable, builtinclass, uuid(f2aafd86-e3e3-461f-96c4-8ad3b5f10e6a)]
|
||||
[scriptable, builtinclass, uuid(e5c281d9-ce73-4f95-bc4d-e00d537b63cb)]
|
||||
interface nsIDOMBeforeUnloadEvent : nsIDOMEvent
|
||||
{
|
||||
/**
|
||||
|
@ -12,7 +12,7 @@
|
||||
* For more information on this interface, please see
|
||||
* http://dev.w3.org/html5/websockets/#closeevent
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(0e3f4687-921c-4141-9615-0fca9e3b02f4)]
|
||||
[scriptable, builtinclass, uuid(028a92e8-54ab-42ba-938a-9118d339164f)]
|
||||
interface nsIDOMCloseEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute boolean wasClean;
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(588d57f8-e8b0-4abc-b94f-5ba8628b024a)]
|
||||
[scriptable, builtinclass, uuid(e2516013-4552-4638-b47b-9f0c24609e02)]
|
||||
interface nsIDOMCommandEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute DOMString command;
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "nsIDOMUIEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(681563fa-7b3a-4d1d-a6a4-8f06287560fa)]
|
||||
[scriptable, builtinclass, uuid(858d898a-33a8-4c0b-a9ff-fa9a81a5ce09)]
|
||||
interface nsIDOMCompositionEvent : nsIDOMUIEvent
|
||||
{
|
||||
readonly attribute DOMString data;
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "nsIDOMEvent.idl"
|
||||
interface nsIVariant;
|
||||
|
||||
[scriptable, builtinclass, uuid(90277f74-1383-4da8-8748-c7abd420cf06)]
|
||||
[scriptable, builtinclass, uuid(86e1b9ee-8080-4217-b3fa-025556d83597)]
|
||||
interface nsIDOMCustomEvent : nsIDOMEvent
|
||||
{
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "nsIDOMEvent.idl"
|
||||
#include "nsIVariant.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(2bad4fcf-a56c-447f-bf51-fa39efaac1fc)]
|
||||
[scriptable, builtinclass, uuid(8d70345a-144d-48d8-a64d-7a61a15b453c)]
|
||||
interface nsIDOMDataContainerEvent : nsIDOMEvent
|
||||
{
|
||||
/**
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(4d37e578-9469-4067-8de3-34e6f01f11f3)]
|
||||
[scriptable, builtinclass, uuid(9cc7684c-a239-428c-b4f1-34c510c98a1c)]
|
||||
interface nsIDOMDeviceLightEvent : nsIDOMEvent
|
||||
{
|
||||
[noscript] void initDeviceLightEvent(in DOMString eventTypeArg,
|
||||
|
@ -21,7 +21,7 @@ interface nsIDOMDeviceRotationRate : nsISupports
|
||||
};
|
||||
|
||||
|
||||
[scriptable, builtinclass, uuid(cdf9bfef-dd71-4780-889b-edb4780d00da)]
|
||||
[scriptable, builtinclass, uuid(1b3d39f2-8f8b-454f-83ad-acbdd32fa2c3)]
|
||||
interface nsIDOMDeviceMotionEvent : nsIDOMEvent
|
||||
{
|
||||
void initDeviceMotionEvent(in DOMString eventTypeArg,
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(a2d63af8-966a-443f-ac78-082b06d2878f)]
|
||||
[scriptable, builtinclass, uuid(8e37040a-dbbb-41d8-a019-eb687e5e8ec7)]
|
||||
interface nsIDOMDeviceOrientationEvent : nsIDOMEvent
|
||||
{
|
||||
void initDeviceOrientationEvent(in DOMString eventTypeArg,
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(de5ac415-5ae9-44ce-ab48-a533cbbef37c)]
|
||||
[scriptable, builtinclass, uuid(c33bec2d-5a0b-44ae-b035-d74cd519ec16)]
|
||||
interface nsIDOMDeviceProximityEvent : nsIDOMEvent
|
||||
{
|
||||
[noscript] void initDeviceProximityEvent(in DOMString eventTypeArg,
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
interface nsIDOMDataTransfer;
|
||||
|
||||
[scriptable, builtinclass, uuid(25e7df11-dbfe-4b9e-bd75-35090d913865)]
|
||||
[scriptable, builtinclass, uuid(2b3b587d-6426-415f-a6f0-4f86eaa562f1)]
|
||||
interface nsIDOMDragEvent : nsIDOMMouseEvent
|
||||
{
|
||||
readonly attribute nsIDOMDataTransfer dataTransfer;
|
||||
|
@ -11,6 +11,10 @@ interface nsIDOMEventTarget;
|
||||
[ptr] native IPCMessagePtr(IPC::Message);
|
||||
[ptr] native ConstIPCMessagePtr(const IPC::Message);
|
||||
%{C++
|
||||
#ifdef ERROR
|
||||
#undef ERROR
|
||||
#endif
|
||||
|
||||
class nsEvent;
|
||||
class nsCommandEvent;
|
||||
class nsPresContext;
|
||||
@ -29,7 +33,7 @@ class Message;
|
||||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||
*/
|
||||
|
||||
[scriptable, builtinclass, uuid(a7dc0284-5832-4034-a8a5-d860ce0f21d3)]
|
||||
[scriptable, builtinclass, uuid(270c945b-8a65-4170-bc0b-4ec1443cd39f)]
|
||||
interface nsIDOMEvent : nsISupports
|
||||
{
|
||||
// PhaseType
|
||||
@ -165,6 +169,75 @@ interface nsIDOMEvent : nsISupports
|
||||
*/
|
||||
void stopImmediatePropagation();
|
||||
|
||||
const long MOUSEDOWN = 0x00000001;
|
||||
const long MOUSEUP = 0x00000002;
|
||||
const long MOUSEOVER = 0x00000004;
|
||||
const long MOUSEOUT = 0x00000008;
|
||||
const long MOUSEMOVE = 0x00000010;
|
||||
const long MOUSEDRAG = 0x00000020;
|
||||
const long CLICK = 0x00000040;
|
||||
const long DBLCLICK = 0x00000080;
|
||||
const long KEYDOWN = 0x00000100;
|
||||
const long KEYUP = 0x00000200;
|
||||
const long KEYPRESS = 0x00000400;
|
||||
const long DRAGDROP = 0x00000800;
|
||||
const long FOCUS = 0x00001000;
|
||||
const long BLUR = 0x00002000;
|
||||
const long SELECT = 0x00004000;
|
||||
const long CHANGE = 0x00008000;
|
||||
const long RESET = 0x00010000;
|
||||
const long SUBMIT = 0x00020000;
|
||||
const long SCROLL = 0x00040000;
|
||||
const long LOAD = 0x00080000;
|
||||
const long UNLOAD = 0x00100000;
|
||||
const long XFER_DONE = 0x00200000;
|
||||
const long ABORT = 0x00400000;
|
||||
const long ERROR = 0x00800000;
|
||||
const long LOCATE = 0x01000000;
|
||||
const long MOVE = 0x02000000;
|
||||
const long RESIZE = 0x04000000;
|
||||
const long FORWARD = 0x08000000;
|
||||
const long HELP = 0x10000000;
|
||||
const long BACK = 0x20000000;
|
||||
const long TEXT = 0x40000000;
|
||||
|
||||
const long ALT_MASK = 0x00000001;
|
||||
const long CONTROL_MASK = 0x00000002;
|
||||
const long SHIFT_MASK = 0x00000004;
|
||||
const long META_MASK = 0x00000008;
|
||||
|
||||
/** The original target of the event, before any retargetings. */
|
||||
readonly attribute nsIDOMEventTarget originalTarget;
|
||||
/**
|
||||
* The explicit original target of the event. If the event was retargeted
|
||||
* for some reason other than an anonymous boundary crossing, this will be set
|
||||
* to the target before the retargeting occurs. For example, mouse events
|
||||
* are retargeted to their parent node when they happen over text nodes (bug
|
||||
* 185889), and in that case .target will show the parent and
|
||||
* .explicitOriginalTarget will show the text node.
|
||||
* .explicitOriginalTarget differs from .originalTarget in that it will never
|
||||
* contain anonymous content.
|
||||
*/
|
||||
readonly attribute nsIDOMEventTarget explicitOriginalTarget;
|
||||
|
||||
/**
|
||||
* @deprecated Use nsIDOMEvent::stopPropagation.
|
||||
*/
|
||||
void preventBubble();
|
||||
|
||||
/**
|
||||
* @deprecated Use nsIDOMEvent::stopPropagation.
|
||||
*/
|
||||
void preventCapture();
|
||||
|
||||
/**
|
||||
* @deprecated Use nsIDOMEvent::defaultPrevented.
|
||||
* To be removed in bug 691151.
|
||||
*/
|
||||
boolean getPreventDefault();
|
||||
|
||||
readonly attribute boolean isTrusted;
|
||||
|
||||
[noscript] void duplicatePrivateData();
|
||||
[noscript] void setTarget(in nsIDOMEventTarget aTarget);
|
||||
[notxpcom] boolean IsDispatchStopped();
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(83a9bc2d-d82d-45cc-8f11-4c919519f6e0)]
|
||||
[scriptable, builtinclass, uuid(bf5ce408-971a-4e74-bc57-178f0f8781f3)]
|
||||
interface nsIDOMHashChangeEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute DOMString oldURL;
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "nsIDOMUIEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(c43c4852-5bb6-409f-82cd-4f5e842b7208)]
|
||||
[scriptable, builtinclass, uuid(5d116380-8432-48cb-a717-200f04c39d2f)]
|
||||
interface nsIDOMKeyEvent : nsIDOMUIEvent
|
||||
{
|
||||
const unsigned long DOM_VK_CANCEL = 0x03;
|
||||
|
@ -12,7 +12,7 @@
|
||||
* For more information on this interface, please see
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/#messageevent
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(de8ce1da-220b-4a09-bce7-5c65a80f33c3)]
|
||||
[scriptable, builtinclass, uuid(ba747c2b-ec12-4e0d-8de4-d749a6b572e6)]
|
||||
interface nsIDOMMessageEvent : nsIDOMEvent
|
||||
{
|
||||
/**
|
||||
|
@ -13,7 +13,7 @@
|
||||
* http://www.w3.org/TR/DOM-Level-2-Events/
|
||||
*/
|
||||
|
||||
[scriptable, builtinclass, uuid(6f4bc64b-1aac-4251-82d3-fd2dc76654a0)]
|
||||
[scriptable, builtinclass, uuid(796c3436-5f89-4145-be3a-49808c09fdc6)]
|
||||
interface nsIDOMMouseEvent : nsIDOMUIEvent
|
||||
{
|
||||
readonly attribute long screenX;
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "nsIDOMMouseEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(44281a27-b48f-47bc-96c9-966f1cab6ae0)]
|
||||
[scriptable, builtinclass, uuid(bd3ab39d-eca0-4e2f-889d-4641a2e5d87d)]
|
||||
interface nsIDOMMouseScrollEvent : nsIDOMMouseEvent
|
||||
{
|
||||
const long HORIZONTAL_AXIS = 1;
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "nsIDOMMouseEvent.idl"
|
||||
|
||||
|
||||
[scriptable, builtinclass, uuid(045b4fd3-c15d-4c76-9d28-9df6f870525a)]
|
||||
[scriptable, builtinclass, uuid(58795094-bb6c-488e-af4d-ea029b07869a)]
|
||||
interface nsIDOMMozTouchEvent : nsIDOMMouseEvent
|
||||
{
|
||||
readonly attribute unsigned long streamId;
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(f5afec28-e7c0-4c1b-9cf4-8f3a5f0634d5)]
|
||||
[scriptable, builtinclass, uuid(85e7c0c0-4dbd-40f4-9f58-8050071dcaae)]
|
||||
interface nsIDOMMutationEvent : nsIDOMEvent
|
||||
{
|
||||
const unsigned short MODIFICATION = 1;
|
||||
|
@ -11,7 +11,7 @@
|
||||
#endif
|
||||
%}
|
||||
|
||||
[scriptable, uuid(07F905C1-9170-4103-86CA-766374DA149A)]
|
||||
[scriptable, uuid(2580b4a2-6d85-4ca6-9be2-98f3406ad296)]
|
||||
interface nsIDOMNSEvent : nsISupports
|
||||
{
|
||||
const long MOUSEDOWN = 0x00000001;
|
||||
@ -50,32 +50,4 @@ interface nsIDOMNSEvent : nsISupports
|
||||
const long CONTROL_MASK = 0x00000002;
|
||||
const long SHIFT_MASK = 0x00000004;
|
||||
const long META_MASK = 0x00000008;
|
||||
|
||||
/** The original target of the event, before any retargetings. */
|
||||
readonly attribute nsIDOMEventTarget originalTarget;
|
||||
/**
|
||||
* The explicit original target of the event. If the event was retargeted
|
||||
* for some reason other than an anonymous boundary crossing, this will be set
|
||||
* to the target before the retargeting occurs. For example, mouse events
|
||||
* are retargeted to their parent node when they happen over text nodes (bug
|
||||
* 185889), and in that case .target will show the parent and
|
||||
* .explicitOriginalTarget will show the text node.
|
||||
* .explicitOriginalTarget differs from .originalTarget in that it will never
|
||||
* contain anonymous content.
|
||||
*/
|
||||
readonly attribute nsIDOMEventTarget explicitOriginalTarget;
|
||||
|
||||
/**
|
||||
* @deprecated Use nsIDOMEvent::stopPropagation.
|
||||
*/
|
||||
void preventBubble();
|
||||
|
||||
/**
|
||||
* @deprecated Use nsIDOMEvent::stopPropagation.
|
||||
*/
|
||||
void preventCapture();
|
||||
|
||||
boolean getPreventDefault();
|
||||
|
||||
readonly attribute boolean isTrusted;
|
||||
};
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "nsIDOMEvent.idl"
|
||||
#include "nsIVariant.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(8e69e120-5dfc-4327-99e3-003a905a1504)]
|
||||
[scriptable, builtinclass, uuid(34139b4f-ac78-4372-98d3-12d6dcf478ef)]
|
||||
interface nsIDOMNotifyAudioAvailableEvent : nsIDOMEvent
|
||||
{
|
||||
[implicit_jscontext]
|
||||
|
@ -12,7 +12,7 @@ interface nsIDOMPaintRequestList;
|
||||
* event, which fires at a window when painting has happened in
|
||||
* that window.
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(de7dc0df-8914-4598-8b2a-8c222f4d52d5)]
|
||||
[scriptable, builtinclass, uuid(a61dc375-6631-4404-8205-b551afe826c3)]
|
||||
interface nsIDOMNotifyPaintEvent : nsIDOMEvent
|
||||
{
|
||||
/**
|
||||
|
@ -11,7 +11,7 @@
|
||||
* load/unload and saving/restoring a document from session history.
|
||||
*/
|
||||
|
||||
[scriptable, builtinclass, uuid(06910e55-a9fc-4194-bd6e-57a302a7ea2d)]
|
||||
[scriptable, builtinclass, uuid(9f3ffe42-bbd2-428d-97f1-6c158c6eb2f9)]
|
||||
interface nsIDOMPageTransitionEvent : nsIDOMEvent
|
||||
{
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
interface nsIVariant;
|
||||
|
||||
[scriptable, builtinclass, uuid(f7cfe6a2-da6f-4894-affe-e03b39251767)]
|
||||
[scriptable, builtinclass, uuid(17ab1333-6fc7-46f9-8513-a82dc6548642)]
|
||||
interface nsIDOMPopStateEvent : nsIDOMEvent
|
||||
{
|
||||
/**
|
||||
|
@ -12,7 +12,7 @@ interface nsIURI;
|
||||
* posted when a popup window is blocked.
|
||||
*/
|
||||
|
||||
[scriptable, builtinclass, uuid(f3a2bae2-291d-43eb-b7f0-bc1b69a890fe)]
|
||||
[scriptable, builtinclass, uuid(4eec5417-1687-46ef-9e41-e0a6fbb18927)]
|
||||
interface nsIDOMPopupBlockedEvent : nsIDOMEvent
|
||||
{
|
||||
/**
|
||||
|
@ -13,7 +13,7 @@
|
||||
* the specification is complete and is compatible with the WebKit ProgressEvent.
|
||||
*/
|
||||
|
||||
[scriptable, builtinclass, uuid(1b1842f0-b586-4990-9f6a-057e92483a4b)]
|
||||
[scriptable, builtinclass, uuid(c5b7ec31-b846-4a9f-b81e-859e76a74f6b)]
|
||||
interface nsIDOMProgressEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute boolean lengthComputable;
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "nsIDOMUIEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(b1febd2a-fc87-40cd-832d-772a74e0d261)]
|
||||
[scriptable, builtinclass, uuid(d38655dd-3be4-4c91-a3b1-0818d396ddf0)]
|
||||
interface nsIDOMScrollAreaEvent : nsIDOMUIEvent
|
||||
{
|
||||
// Scroll area client rect
|
||||
|
@ -69,7 +69,7 @@
|
||||
* consuming events.
|
||||
*/
|
||||
|
||||
[scriptable, builtinclass, uuid(5e2a88ce-5032-4758-8578-37c6d7f87d7b)]
|
||||
[scriptable, builtinclass, uuid(0748e618-6612-45d7-8d34-1f56d546e04a)]
|
||||
interface nsIDOMSimpleGestureEvent : nsIDOMMouseEvent
|
||||
{
|
||||
/* Swipe direction constants */
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(788edd11-0d81-4b2b-aaaa-f7d38246b0de)]
|
||||
[scriptable, builtinclass, uuid(88ae203d-12b8-4a85-a69f-6f83a8b5c226)]
|
||||
interface nsIDOMSmartCardEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute DOMString tokenName;
|
||||
|
@ -45,7 +45,7 @@ interface nsIDOMTouchList : nsISupports {
|
||||
nsIDOMTouch identifiedTouch(in long identifier);
|
||||
};
|
||||
|
||||
[scriptable, builtinclass, uuid(57809468-7c03-4e8a-b080-4e30f157db21)]
|
||||
[scriptable, builtinclass, uuid(dfaac0c6-9c4a-4a95-8872-1d58f19d5768)]
|
||||
interface nsIDOMTouchEvent : nsIDOMUIEvent {
|
||||
readonly attribute nsIDOMTouchList touches;
|
||||
readonly attribute nsIDOMTouchList targetTouches;
|
||||
|
@ -11,7 +11,7 @@
|
||||
* http://dev.w3.org/csswg/css3-transitions/#transition-events-
|
||||
*/
|
||||
|
||||
[scriptable, builtinclass, uuid(208c038e-dbed-42a1-9974-da204e6672f8)]
|
||||
[scriptable, builtinclass, uuid(dd6b6318-a69b-4daf-99ad-617876782dfd)]
|
||||
interface nsIDOMTransitionEvent : nsIDOMEvent {
|
||||
readonly attribute DOMString propertyName;
|
||||
readonly attribute float elapsedTime;
|
||||
|
@ -13,7 +13,7 @@
|
||||
* http://www.w3.org/TR/DOM-Level-2-Events/
|
||||
*/
|
||||
|
||||
[scriptable, builtinclass, uuid(6e6f00c2-29d9-452c-b804-5abb2dc429f3)]
|
||||
[scriptable, builtinclass, uuid(415453e6-132a-4902-9a99-cc480f0311b6)]
|
||||
interface nsIDOMUIEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute nsIDOMWindow view;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(caf39525-b0f9-46d1-91d2-59f31dd6e206)]
|
||||
[scriptable, builtinclass, uuid(ae59b379-1c58-4baa-bef4-21fca57fc4c2)]
|
||||
interface nsIDOMUserProximityEvent : nsIDOMEvent
|
||||
{
|
||||
[noscript] void initUserProximityEvent(in DOMString eventTypeArg,
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
interface nsIDOMLSInput;
|
||||
|
||||
[scriptable, builtinclass, uuid(068ddb48-1093-4973-800a-7f475f89b788)]
|
||||
[scriptable, builtinclass, uuid(522fb528-f550-4e0c-8745-f784bba7cfbe)]
|
||||
interface nsIDOMLSProgressEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute nsIDOMLSInput input;
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "nsIDOMEvent.idl"
|
||||
interface nsIVariant;
|
||||
|
||||
[scriptable, builtinclass, uuid(5e304193-af49-4546-8329-bf7c9159ed98)]
|
||||
[scriptable, builtinclass, uuid(109d5b5c-48b2-4d10-a881-72dcf4c27969)]
|
||||
interface nsIDOMMozSettingsEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute DOMString settingName;
|
||||
|
@ -13,7 +13,7 @@
|
||||
* http://www.w3.org/TR/SVG/animate.html#InterfaceTimeEvent
|
||||
*/
|
||||
|
||||
[scriptable, builtinclass, uuid(988c5b1d-55fc-49a3-87a4-7aa588ee7ed3)]
|
||||
[scriptable, builtinclass, uuid(a7ddd388-5fdf-4af8-b3ee-7e1baa636b66)]
|
||||
interface nsIDOMTimeEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute long detail;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
interface nsIDOMStorage;
|
||||
|
||||
[scriptable, builtinclass, uuid(acb10e76-860f-4a49-8083-661a152ae1b2)]
|
||||
[scriptable, builtinclass, uuid(0929c378-2ad6-4fde-a0db-8cd61bbb080c)]
|
||||
interface nsIDOMStorageEvent : nsIDOMEvent
|
||||
{
|
||||
/**
|
||||
|
@ -10,7 +10,7 @@
|
||||
* http://www.w3.org/TR/SVG11/script.html#InterfaceSVGEvent
|
||||
*/
|
||||
|
||||
[scriptable, builtinclass, uuid(850f465e-1bb9-4cbd-a973-c1283ec70422)]
|
||||
[scriptable, builtinclass, uuid(85c1aba6-6ab1-4b7d-b200-2c8ef39267ad)]
|
||||
interface nsIDOMSVGEvent : nsIDOMEvent
|
||||
{
|
||||
};
|
||||
|
@ -13,7 +13,7 @@
|
||||
interface nsIDOMSVGRect;
|
||||
interface nsIDOMSVGPoint;
|
||||
|
||||
[scriptable, builtinclass, uuid(8bd39d5a-6a01-4bcf-bb9b-02653ed6d794)]
|
||||
[scriptable, builtinclass, uuid(77a0b46e-54cf-4e6e-a962-a2f52389da34)]
|
||||
interface nsIDOMSVGZoomEvent : nsIDOMUIEvent
|
||||
{
|
||||
readonly attribute nsIDOMSVGRect zoomRectScreen;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include "nsIDOMUIEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(b7b54fe0-9983-49bc-bb79-1d8ffcb2260c)]
|
||||
[scriptable, builtinclass, uuid(bb7f2758-9a71-4701-984f-eb66f08c4356)]
|
||||
interface nsIDOMXULCommandEvent : nsIDOMUIEvent
|
||||
{
|
||||
/**
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(7a6723d3-2165-4aa6-a4a3-697e7b7af673)]
|
||||
[scriptable, builtinclass, uuid(1b8ea6e4-8142-4aba-b174-4d580b5bc294)]
|
||||
interface nsIDOMUSSDReceivedEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute DOMString message;
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
interface nsIDOMMozSmsMessage;
|
||||
|
||||
[scriptable, builtinclass, uuid(6db4d0d3-6708-47e8-be0f-06e4cdc0b062)]
|
||||
[scriptable, builtinclass, uuid(3bde920e-6552-479c-919a-d66589a85a28)]
|
||||
interface nsIDOMMozSmsEvent : nsIDOMEvent
|
||||
{
|
||||
[binaryname(MessageMoz)]
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
interface nsIDOMTelephonyCall;
|
||||
|
||||
[scriptable, builtinclass, uuid(afd4b154-e8ca-46d0-8d1f-eef9b5ffe23f)]
|
||||
[scriptable, builtinclass, uuid(d836f0e6-7305-4fdd-966e-ee261fa44001)]
|
||||
interface nsIDOMCallEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute nsIDOMTelephonyCall call;
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
interface nsIDOMMozVoicemailStatus;
|
||||
|
||||
[scriptable, builtinclass, uuid(4642f196-1a30-4a9b-986f-7f1574d5cee1)]
|
||||
[scriptable, builtinclass, uuid(b2208967-2231-45e4-9a40-57b97908adf8)]
|
||||
interface nsIDOMMozVoicemailEvent : nsIDOMEvent
|
||||
{
|
||||
/**
|
||||
|
@ -120,7 +120,7 @@ interface nsIDOMWifiManager : nsISupports
|
||||
attribute nsIDOMEventListener ondisabled;
|
||||
};
|
||||
|
||||
[scriptable, builtinclass, uuid(ba1dab70-b70d-11e1-afa6-0800200c9a66)]
|
||||
[scriptable, builtinclass, uuid(f3ef70b0-b2d3-4eb5-8ea4-008f8d330cd6)]
|
||||
interface nsIDOMMozWifiStatusChangeEvent : nsIDOMEvent
|
||||
{
|
||||
/**
|
||||
@ -142,7 +142,7 @@ interface nsIDOMMozWifiStatusChangeEvent : nsIDOMEvent
|
||||
in DOMString status);
|
||||
};
|
||||
|
||||
[scriptable, builtinclass, uuid(b383e950-b70d-11e1-afa6-0800200c9a66)]
|
||||
[scriptable, builtinclass, uuid(34994296-d694-4aed-953d-fc25ee25c050)]
|
||||
interface nsIDOMMozWifiConnectionInfoEvent : nsIDOMEvent
|
||||
{
|
||||
/**
|
||||
|
@ -62,7 +62,6 @@
|
||||
#include "nsIDOMHTMLElement.h" // for nsIDOMHTMLElement
|
||||
#include "nsIDOMKeyEvent.h" // for nsIDOMKeyEvent, etc
|
||||
#include "nsIDOMMouseEvent.h" // for nsIDOMMouseEvent
|
||||
#include "nsIDOMNSEvent.h" // for nsIDOMNSEvent
|
||||
#include "nsIDOMNamedNodeMap.h" // for nsIDOMNamedNodeMap
|
||||
#include "nsIDOMNode.h" // for nsIDOMNode, etc
|
||||
#include "nsIDOMNodeList.h" // for nsIDOMNodeList
|
||||
@ -5334,8 +5333,7 @@ bool
|
||||
nsEditor::IsAcceptableInputEvent(nsIDOMEvent* aEvent)
|
||||
{
|
||||
// If the event is trusted, the event should always cause input.
|
||||
nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aEvent);
|
||||
NS_ENSURE_TRUE(NSEvent, false);
|
||||
NS_ENSURE_TRUE(aEvent, false);
|
||||
|
||||
// If this is mouse event but this editor doesn't have focus, we shouldn't
|
||||
// handle it.
|
||||
@ -5348,7 +5346,7 @@ nsEditor::IsAcceptableInputEvent(nsIDOMEvent* aEvent)
|
||||
}
|
||||
|
||||
bool isTrusted;
|
||||
nsresult rv = NSEvent->GetIsTrusted(&isTrusted);
|
||||
nsresult rv = aEvent->GetIsTrusted(&isTrusted);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
if (isTrusted) {
|
||||
return true;
|
||||
@ -5390,7 +5388,7 @@ nsEditor::SetSuppressDispatchingInputEvent(bool aSuppress)
|
||||
}
|
||||
|
||||
nsEditor::HandlingTrustedAction::HandlingTrustedAction(nsEditor* aSelf,
|
||||
nsIDOMNSEvent* aEvent)
|
||||
nsIDOMEvent* aEvent)
|
||||
{
|
||||
MOZ_ASSERT(aEvent);
|
||||
|
||||
|
@ -49,7 +49,6 @@ class nsIDOMEvent;
|
||||
class nsIDOMEventListener;
|
||||
class nsIDOMEventTarget;
|
||||
class nsIDOMKeyEvent;
|
||||
class nsIDOMNSEvent;
|
||||
class nsIDOMNode;
|
||||
class nsIDOMRange;
|
||||
class nsIDocument;
|
||||
@ -798,7 +797,7 @@ public:
|
||||
Init(aSelf, aIsTrusted);
|
||||
}
|
||||
|
||||
HandlingTrustedAction(nsEditor* aSelf, nsIDOMNSEvent* aEvent);
|
||||
HandlingTrustedAction(nsEditor* aSelf, nsIDOMEvent* aEvent);
|
||||
|
||||
~HandlingTrustedAction()
|
||||
{
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "nsIDOMEventTarget.h" // for nsIDOMEventTarget
|
||||
#include "nsIDOMKeyEvent.h" // for nsIDOMKeyEvent
|
||||
#include "nsIDOMMouseEvent.h" // for nsIDOMMouseEvent
|
||||
#include "nsIDOMNSEvent.h" // for nsIDOMNSEvent
|
||||
#include "nsIDOMNode.h" // for nsIDOMNode
|
||||
#include "nsIDOMRange.h" // for nsIDOMRange
|
||||
#include "nsIDocument.h" // for nsIDocument
|
||||
@ -453,8 +452,7 @@ nsEditorEventListener::KeyPress(nsIDOMEvent* aKeyEvent)
|
||||
}
|
||||
|
||||
// Transfer the event's trusted-ness to our editor
|
||||
nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aKeyEvent);
|
||||
nsEditor::HandlingTrustedAction operation(mEditor, NSEvent);
|
||||
nsEditor::HandlingTrustedAction operation(mEditor, aKeyEvent);
|
||||
|
||||
// DOM event handling happens in two passes, the client pass and the system
|
||||
// pass. We do all of our processing in the system pass, to allow client
|
||||
@ -608,8 +606,7 @@ nsEditorEventListener::HandleText(nsIDOMEvent* aTextEvent)
|
||||
}
|
||||
|
||||
// Transfer the event's trusted-ness to our editor
|
||||
nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aTextEvent);
|
||||
nsEditor::HandlingTrustedAction operation(mEditor, NSEvent);
|
||||
nsEditor::HandlingTrustedAction operation(mEditor, aTextEvent);
|
||||
|
||||
return mEditor->UpdateIMEComposition(composedText, textRangeList);
|
||||
}
|
||||
@ -850,8 +847,7 @@ nsEditorEventListener::HandleEndComposition(nsIDOMEvent* aCompositionEvent)
|
||||
}
|
||||
|
||||
// Transfer the event's trusted-ness to our editor
|
||||
nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aCompositionEvent);
|
||||
nsEditor::HandlingTrustedAction operation(mEditor, NSEvent);
|
||||
nsEditor::HandlingTrustedAction operation(mEditor, aCompositionEvent);
|
||||
|
||||
mEditor->EndIMEComposition();
|
||||
}
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsIEditor.h"
|
||||
@ -104,8 +103,7 @@ nsHTMLEditorEventListener::MouseDown(nsIDOMEvent* aMouseEvent)
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> target;
|
||||
nsCOMPtr<nsIDOMNSEvent> internalEvent = do_QueryInterface(aMouseEvent);
|
||||
res = internalEvent->GetExplicitOriginalTarget(getter_AddRefs(target));
|
||||
res = aMouseEvent->GetExplicitOriginalTarget(getter_AddRefs(target));
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
NS_ENSURE_TRUE(target, NS_ERROR_NULL_POINTER);
|
||||
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(target);
|
||||
|
@ -36,8 +36,6 @@
|
||||
#include "nsIDOMSVGTitleElement.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMNamedNodeMap.h"
|
||||
#include "nsIFormControl.h"
|
||||
#include "nsIDOMHTMLInputElement.h"
|
||||
#include "nsIDOMHTMLTextAreaElement.h"
|
||||
@ -899,11 +897,9 @@ nsDocShellTreeOwner::HandleEvent(nsIDOMEvent* aEvent)
|
||||
nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
|
||||
NS_ENSURE_TRUE(dragEvent, NS_ERROR_INVALID_ARG);
|
||||
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aEvent);
|
||||
if (domNSEvent) {
|
||||
bool defaultPrevented;
|
||||
domNSEvent->GetPreventDefault(&defaultPrevented);
|
||||
if (defaultPrevented)
|
||||
aEvent->GetPreventDefault(&defaultPrevented);
|
||||
if (defaultPrevented) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1647,16 +1643,11 @@ ChromeContextMenuListener::HandleEvent(nsIDOMEvent* aMouseEvent)
|
||||
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
|
||||
NS_ENSURE_TRUE(mouseEvent, NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aMouseEvent);
|
||||
|
||||
if (domNSEvent) {
|
||||
bool isDefaultPrevented = false;
|
||||
domNSEvent->GetPreventDefault(&isDefaultPrevented);
|
||||
|
||||
aMouseEvent->GetPreventDefault(&isDefaultPrevented);
|
||||
if (isDefaultPrevented) {
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> targetNode;
|
||||
nsresult res = aMouseEvent->GetTarget(getter_AddRefs(targetNode));
|
||||
@ -1679,8 +1670,6 @@ ChromeContextMenuListener::HandleEvent(nsIDOMEvent* aMouseEvent)
|
||||
nsCOMPtr<nsIContextMenuInfo> menuInfo;
|
||||
if (menuListener2) {
|
||||
menuInfoImpl = new nsContextMenuInfo;
|
||||
if (!menuInfoImpl)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
menuInfo = menuInfoImpl;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "nsIDOMCompositionListener.h"
|
||||
#include "nsIDOMTextListener.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIView.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIViewManager.h"
|
||||
@ -114,13 +113,12 @@ nsWidgetUtils::Init()
|
||||
nsresult
|
||||
nsWidgetUtils::UpdateFromEvent(nsIDOMEvent *aDOMEvent)
|
||||
{
|
||||
nsCOMPtr <nsIDOMMouseEvent> mouseEvent;
|
||||
mouseEvent = do_QueryInterface(aDOMEvent);
|
||||
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aDOMEvent);
|
||||
if (!mouseEvent)
|
||||
return NS_OK;
|
||||
|
||||
((nsIDOMMouseEvent*)mouseEvent)->GetScreenX(&g_lastX);
|
||||
((nsIDOMMouseEvent*)mouseEvent)->GetScreenY(&g_lastY);
|
||||
mouseEvent->GetScreenX(&g_lastX);
|
||||
mouseEvent->GetScreenY(&g_lastY);
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> mWindow;
|
||||
nsCOMPtr<nsIDOMNode> mNode;
|
||||
@ -129,10 +127,8 @@ nsWidgetUtils::UpdateFromEvent(nsIDOMEvent *aDOMEvent)
|
||||
PRUint32 type = 0;
|
||||
bool isXul = false;
|
||||
{
|
||||
nsCOMPtr <nsIDOMNSEvent> aEvent = do_QueryInterface(aDOMEvent);
|
||||
nsCOMPtr<nsIDOMEventTarget> eventOrigTarget;
|
||||
if (aEvent)
|
||||
aEvent->GetOriginalTarget(getter_AddRefs(eventOrigTarget));
|
||||
aDOMEvent->GetOriginalTarget(getter_AddRefs(eventOrigTarget));
|
||||
if (eventOrigTarget)
|
||||
mOrigNode = do_QueryInterface(eventOrigTarget);
|
||||
isXul = IsXULNode(mOrigNode, &type);
|
||||
|
@ -176,8 +176,6 @@ members = [
|
||||
'nsIDOMProgressEvent.loaded',
|
||||
'nsIDOMProgressEvent.total',
|
||||
#XXX Can't quickstub initProgressEvent because it has long long parameters.
|
||||
'nsIDOMNSEvent.originalTarget',
|
||||
'nsIDOMNSEvent.getPreventDefault',
|
||||
'nsIDOMUIEvent.which',
|
||||
'nsIDOMUIEvent.rangeParent',
|
||||
'nsIDOMUIEvent.rangeOffset',
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "nsContentCreatorFunctions.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsEventListenerManager.h"
|
||||
#ifdef ACCESSIBILITY
|
||||
#include "nsAccessibilityService.h"
|
||||
@ -275,10 +274,9 @@ bool ShouldProcessMouseClick(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
// only allow the left button
|
||||
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aMouseEvent);
|
||||
NS_ENSURE_TRUE(mouseEvent && domNSEvent, false);
|
||||
NS_ENSURE_TRUE(mouseEvent, false);
|
||||
bool defaultPrevented = false;
|
||||
domNSEvent->GetPreventDefault(&defaultPrevented);
|
||||
aMouseEvent->GetPreventDefault(&defaultPrevented);
|
||||
if (defaultPrevented) {
|
||||
return false;
|
||||
}
|
||||
@ -403,10 +401,8 @@ nsFileControlFrame::BrowseMouseListener::HandleEvent(nsIDOMEvent* aEvent)
|
||||
return input ? input->FireAsyncClickHandler() : NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aEvent);
|
||||
NS_ENSURE_STATE(domNSEvent);
|
||||
bool defaultPrevented = false;
|
||||
domNSEvent->GetPreventDefault(&defaultPrevented);
|
||||
aEvent->GetPreventDefault(&defaultPrevented);
|
||||
if (defaultPrevented) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsFontMetrics.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsINodeInfo.h"
|
||||
|
@ -51,7 +51,6 @@
|
||||
#include "nsIStyleRule.h"//observe documents to send onchangenotifications
|
||||
#include "nsIDOMEventListener.h"//observe documents to send onchangenotifications
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
|
||||
#include "nsIDOMCharacterData.h" //for selection setting helper func
|
||||
#include "nsIDOMNodeList.h" //for selection setting helper func
|
||||
|
@ -43,7 +43,7 @@ addLoadEvent(function test() {
|
||||
.getInterface(CI.nsIDOMWindowUtils),
|
||||
sec = netscape.security,
|
||||
eSelect = $("eSelect"),
|
||||
IDOMNSEvent = CI.nsIDOMNSEvent,
|
||||
IDOMEvent = CI.nsIDOMEvent,
|
||||
IDOMKeyEvent = CI.nsIDOMKeyEvent,
|
||||
timeout = 0 // Choose a larger value like 500 ms if you want to see what's happening.
|
||||
|
||||
@ -105,10 +105,10 @@ addLoadEvent(function test() {
|
||||
is(eSelect.value, "2", "SELECT value should be 2 after pressing Down.")
|
||||
|
||||
// Test ALT-Down.
|
||||
testKey(IDOMKeyEvent.DOM_VK_DOWN, IDOMNSEvent.ALT_MASK, "ALT-Down", nextKey1)
|
||||
testKey(IDOMKeyEvent.DOM_VK_DOWN, IDOMEvent.ALT_MASK, "ALT-Down", nextKey1)
|
||||
function nextKey1() {
|
||||
// Test ALT-Up.
|
||||
testKey(IDOMKeyEvent.DOM_VK_UP, IDOMNSEvent.ALT_MASK, "ALT-Up", nextKey2)
|
||||
testKey(IDOMKeyEvent.DOM_VK_UP, IDOMEvent.ALT_MASK, "ALT-Up", nextKey2)
|
||||
}
|
||||
function nextKey2() {
|
||||
// Test the F4 key on OS/2 and Windows.
|
||||
|
@ -45,7 +45,6 @@
|
||||
#include "nsIDOMHTMLAppletElement.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsIDOMRange.h"
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMKeyEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsPresContext.h"
|
||||
@ -139,9 +139,8 @@ NS_IMETHODIMP
|
||||
nsPrintPreviewListener::HandleEvent(nsIDOMEvent* aEvent)
|
||||
{
|
||||
nsCOMPtr<nsIDOMEventTarget> target;
|
||||
nsCOMPtr<nsIDOMNSEvent> nsEvent = do_QueryInterface(aEvent);
|
||||
if (nsEvent)
|
||||
nsEvent->GetOriginalTarget(getter_AddRefs(target));
|
||||
if (aEvent)
|
||||
aEvent->GetOriginalTarget(getter_AddRefs(target));
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(target));
|
||||
if (content && !content->IsXUL()) {
|
||||
eEventAction action = ::GetActionForEvent(aEvent);
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "nsMenuBarListener.h"
|
||||
#include "nsMenuBarFrame.h"
|
||||
#include "nsMenuPopupFrame.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsGUIEvent.h"
|
||||
|
||||
// Drag & Drop, Clipboard
|
||||
@ -117,15 +117,12 @@ nsMenuBarListener::KeyUp(nsIDOMEvent* aKeyEvent)
|
||||
InitAccessKey();
|
||||
|
||||
//handlers shouldn't be triggered by non-trusted events.
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
|
||||
bool trustedEvent = false;
|
||||
aKeyEvent->GetIsTrusted(&trustedEvent);
|
||||
|
||||
if (domNSEvent) {
|
||||
domNSEvent->GetIsTrusted(&trustedEvent);
|
||||
}
|
||||
|
||||
if (!trustedEvent)
|
||||
if (!trustedEvent) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (mAccessKey && mAccessKeyFocuses)
|
||||
{
|
||||
@ -167,10 +164,9 @@ nsresult
|
||||
nsMenuBarListener::KeyPress(nsIDOMEvent* aKeyEvent)
|
||||
{
|
||||
// if event has already been handled, bail
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
|
||||
if (domNSEvent) {
|
||||
if (aKeyEvent) {
|
||||
bool eventHandled = false;
|
||||
domNSEvent->GetPreventDefault(&eventHandled);
|
||||
aKeyEvent->GetPreventDefault(&eventHandled);
|
||||
if (eventHandled) {
|
||||
return NS_OK; // don't consume event
|
||||
}
|
||||
@ -178,8 +174,8 @@ nsMenuBarListener::KeyPress(nsIDOMEvent* aKeyEvent)
|
||||
|
||||
//handlers shouldn't be triggered by non-trusted events.
|
||||
bool trustedEvent = false;
|
||||
if (domNSEvent) {
|
||||
domNSEvent->GetIsTrusted(&trustedEvent);
|
||||
if (aKeyEvent) {
|
||||
aKeyEvent->GetIsTrusted(&trustedEvent);
|
||||
}
|
||||
|
||||
if (!trustedEvent)
|
||||
@ -192,7 +188,7 @@ nsMenuBarListener::KeyPress(nsIDOMEvent* aKeyEvent)
|
||||
if (mAccessKey)
|
||||
{
|
||||
bool preventDefault;
|
||||
domNSEvent->GetPreventDefault(&preventDefault);
|
||||
aKeyEvent->GetPreventDefault(&preventDefault);
|
||||
if (!preventDefault) {
|
||||
nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aKeyEvent);
|
||||
PRUint32 keyCode, charCode;
|
||||
@ -307,11 +303,9 @@ nsMenuBarListener::KeyDown(nsIDOMEvent* aKeyEvent)
|
||||
InitAccessKey();
|
||||
|
||||
//handlers shouldn't be triggered by non-trusted events.
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
|
||||
bool trustedEvent = false;
|
||||
|
||||
if (domNSEvent) {
|
||||
domNSEvent->GetIsTrusted(&trustedEvent);
|
||||
if (aKeyEvent) {
|
||||
aKeyEvent->GetIsTrusted(&trustedEvent);
|
||||
}
|
||||
|
||||
if (!trustedEvent)
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "nsBoxObject.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsMenuBarFrame.h"
|
||||
#include "nsMenuBarListener.h"
|
||||
#include "nsMenuFrame.h"
|
||||
@ -87,12 +86,8 @@ NS_IMETHODIMP nsMenuBoxObject::HandleKeyPress(nsIDOMKeyEvent* aKeyEvent, bool* a
|
||||
return NS_OK;
|
||||
|
||||
// if event has already been handled, bail
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
|
||||
if (!domNSEvent)
|
||||
return NS_OK;
|
||||
|
||||
bool eventHandled = false;
|
||||
domNSEvent->GetPreventDefault(&eventHandled);
|
||||
aKeyEvent->GetPreventDefault(&eventHandled);
|
||||
if (eventHandled)
|
||||
return NS_OK;
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "nsMenuBarListener.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMXULElement.h"
|
||||
#include "nsIXULDocument.h"
|
||||
#include "nsIXULTemplateBuilder.h"
|
||||
@ -2110,11 +2110,9 @@ nsXULPopupManager::KeyPress(nsIDOMKeyEvent* aKeyEvent)
|
||||
return NS_OK;
|
||||
|
||||
//handlers shouldn't be triggered by non-trusted events.
|
||||
nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
|
||||
bool trustedEvent = false;
|
||||
|
||||
if (domNSEvent) {
|
||||
domNSEvent->GetIsTrusted(&trustedEvent);
|
||||
if (aKeyEvent) {
|
||||
aKeyEvent->GetIsTrusted(&trustedEvent);
|
||||
}
|
||||
|
||||
if (!trustedEvent)
|
||||
|
@ -179,10 +179,10 @@ let Util = {
|
||||
},
|
||||
|
||||
modifierMaskFromEvent: function modifierMaskFromEvent(aEvent) {
|
||||
return (aEvent.altKey ? Ci.nsIDOMNSEvent.ALT_MASK : 0) |
|
||||
(aEvent.ctrlKey ? Ci.nsIDOMNSEvent.CONTROL_MASK : 0) |
|
||||
(aEvent.shiftKey ? Ci.nsIDOMNSEvent.SHIFT_MASK : 0) |
|
||||
(aEvent.metaKey ? Ci.nsIDOMNSEvent.META_MASK : 0);
|
||||
return (aEvent.altKey ? Ci.nsIDOMEvent.ALT_MASK : 0) |
|
||||
(aEvent.ctrlKey ? Ci.nsIDOMEvent.CONTROL_MASK : 0) |
|
||||
(aEvent.shiftKey ? Ci.nsIDOMEvent.SHIFT_MASK : 0) |
|
||||
(aEvent.metaKey ? Ci.nsIDOMEvent.META_MASK : 0);
|
||||
},
|
||||
|
||||
get displayDPI() {
|
||||
|
@ -494,7 +494,7 @@ let Content = {
|
||||
case "Browser:MouseClick": {
|
||||
this.formAssistant.focusSync = true;
|
||||
let element = elementFromPoint(x, y);
|
||||
if (modifiers == Ci.nsIDOMNSEvent.CONTROL_MASK) {
|
||||
if (modifiers == Ci.nsIDOMEvent.CONTROL_MASK) {
|
||||
let uri = Util.getHrefForElement(element);
|
||||
if (uri)
|
||||
sendAsyncMessage("Browser:OpenURI", { uri: uri,
|
||||
@ -1518,8 +1518,8 @@ var SelectionHandler = {
|
||||
// Keep the cache in "client" coordinates, but translate for the mouse event
|
||||
this.cache.end = { x: json.x, y: json.y };
|
||||
let end = { x: this.cache.end.x - scrollOffset.x, y: this.cache.end.y - scrollOffset.y };
|
||||
utils.sendMouseEventToWindow("mousedown", end.x, end.y, 0, 1, Ci.nsIDOMNSEvent.SHIFT_MASK, true);
|
||||
utils.sendMouseEventToWindow("mouseup", end.x, end.y, 0, 1, Ci.nsIDOMNSEvent.SHIFT_MASK, true);
|
||||
utils.sendMouseEventToWindow("mousedown", end.x, end.y, 0, 1, Ci.nsIDOMEvent.SHIFT_MASK, true);
|
||||
utils.sendMouseEventToWindow("mouseup", end.x, end.y, 0, 1, Ci.nsIDOMEvent.SHIFT_MASK, true);
|
||||
} else {
|
||||
// Keep the cache in "client" coordinates, but translate for the mouse event
|
||||
this.cache.start = { x: json.x, y: json.y };
|
||||
@ -1529,8 +1529,8 @@ var SelectionHandler = {
|
||||
utils.sendMouseEventToWindow("mousedown", start.x, start.y, 0, 0, 0, true);
|
||||
utils.sendMouseEventToWindow("mouseup", start.x, start.y, 0, 0, 0, true);
|
||||
|
||||
utils.sendMouseEventToWindow("mousedown", end.x, end.y, 0, 1, Ci.nsIDOMNSEvent.SHIFT_MASK, true);
|
||||
utils.sendMouseEventToWindow("mouseup", end.x, end.y, 0, 1, Ci.nsIDOMNSEvent.SHIFT_MASK, true);
|
||||
utils.sendMouseEventToWindow("mousedown", end.x, end.y, 0, 1, Ci.nsIDOMEvent.SHIFT_MASK, true);
|
||||
utils.sendMouseEventToWindow("mouseup", end.x, end.y, 0, 1, Ci.nsIDOMEvent.SHIFT_MASK, true);
|
||||
}
|
||||
|
||||
// Cache the selected text since the selection might be gone by the time we get the "end" message
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include "nsSmartCardEvent.h"
|
||||
#include "nsIDOMSmartCardEvent.h"
|
||||
#include "nsIDOMClassInfo.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsXPCOM.h"
|
||||
|
||||
@ -23,7 +22,6 @@ nsSmartCardEvent::~nsSmartCardEvent()
|
||||
NS_INTERFACE_MAP_BEGIN(nsSmartCardEvent)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMSmartCardEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSmartCardEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMEvent)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SmartCardEvent)
|
||||
NS_INTERFACE_MAP_END
|
||||
@ -36,14 +34,8 @@ NS_IMPL_RELEASE(nsSmartCardEvent)
|
||||
//
|
||||
NS_IMETHODIMP nsSmartCardEvent::Init(nsIDOMEvent * aInner)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
NS_ASSERTION(aInner, "SmartCardEvent initialized with a null Event");
|
||||
mInner = aInner;
|
||||
mNSEvent = do_QueryInterface(mInner, &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
return mInner->SetTrusted(true);
|
||||
}
|
||||
|
||||
@ -54,6 +46,7 @@ NS_IMETHODIMP nsSmartCardEvent::GetTokenName(nsAString &aTokenName)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// nsIDOMEvent maps
|
||||
NS_IMETHODIMP nsSmartCardEvent::DuplicatePrivateData(void)
|
||||
{
|
||||
NS_ASSERTION(mInner, "SmartCardEvent called without Init");
|
||||
@ -99,45 +92,43 @@ nsSmartCardEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
|
||||
return mInner->Deserialize(aMsg, aIter);
|
||||
}
|
||||
|
||||
// IDOMNSEvent maps
|
||||
NS_IMETHODIMP nsSmartCardEvent::GetOriginalTarget(nsIDOMEventTarget * *aOriginalTarget)
|
||||
{
|
||||
NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
|
||||
return mNSEvent->GetOriginalTarget(aOriginalTarget);
|
||||
NS_ASSERTION(mInner, "SmartCardEvent called without Init");
|
||||
return mInner->GetOriginalTarget(aOriginalTarget);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSmartCardEvent::GetExplicitOriginalTarget(nsIDOMEventTarget * *aTarget)
|
||||
{
|
||||
NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
|
||||
return mNSEvent->GetExplicitOriginalTarget(aTarget);
|
||||
NS_ASSERTION(mInner, "SmartCardEvent called without Init");
|
||||
return mInner->GetExplicitOriginalTarget(aTarget);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSmartCardEvent::PreventBubble(void)
|
||||
{
|
||||
NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
|
||||
return mNSEvent->PreventBubble();
|
||||
NS_ASSERTION(mInner, "SmartCardEvent called without Init");
|
||||
return mInner->PreventBubble();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSmartCardEvent::PreventCapture(void)
|
||||
{
|
||||
NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
|
||||
return mNSEvent->PreventCapture();
|
||||
NS_ASSERTION(mInner, "SmartCardEvent called without Init");
|
||||
return mInner->PreventCapture();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSmartCardEvent::GetIsTrusted(bool *aIsTrusted)
|
||||
{
|
||||
NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
|
||||
return mNSEvent->GetIsTrusted(aIsTrusted);
|
||||
NS_ASSERTION(mInner, "SmartCardEvent called without Init");
|
||||
return mInner->GetIsTrusted(aIsTrusted);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSmartCardEvent::GetPreventDefault(bool* aReturn)
|
||||
{
|
||||
NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
|
||||
return mNSEvent->GetPreventDefault(aReturn);
|
||||
NS_ASSERTION(mInner, "SmartCardEvent called without Init");
|
||||
return mInner->GetPreventDefault(aReturn);
|
||||
}
|
||||
|
||||
// IDOMEvent maps
|
||||
NS_IMETHODIMP nsSmartCardEvent::GetType(nsAString & aType)
|
||||
{
|
||||
NS_ASSERTION(mInner, "SmartCardEvent called without Init");
|
||||
|
@ -7,14 +7,12 @@
|
||||
|
||||
#include "nsIDOMSmartCardEvent.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsString.h"
|
||||
#include "nsXPCOM.h"
|
||||
|
||||
// Expose SmartCard Specific paramenters to smart card events.
|
||||
class nsSmartCardEvent : public nsIDOMSmartCardEvent,
|
||||
public nsIDOMNSEvent
|
||||
class nsSmartCardEvent : public nsIDOMSmartCardEvent
|
||||
{
|
||||
public:
|
||||
nsSmartCardEvent(const nsAString &aTokenName);
|
||||
@ -22,13 +20,11 @@ public:
|
||||
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDOMSMARTCARDEVENT
|
||||
NS_DECL_NSIDOMNSEVENT
|
||||
NS_DECL_NSIDOMEVENT
|
||||
NS_DECL_NSIDOMSMARTCARDEVENT
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIDOMEvent> mInner;
|
||||
nsCOMPtr<nsIDOMNSEvent> mNSEvent;
|
||||
nsString mTokenName;
|
||||
};
|
||||
|
||||
|
@ -84,7 +84,7 @@ commonInit();
|
||||
|
||||
var uname = $_(1, "uname");
|
||||
var pword = $_(1, "pword");
|
||||
const shiftModifier = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
|
||||
const shiftModifier = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
|
||||
|
||||
// Get the pwmgr service
|
||||
var pwmgr = SpecialPowers.wrap(Components)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user