зеркало из https://github.com/mozilla/pjs.git
Bug 663461 Part 1: Remove Add/RemoveEventListenerByIID from editor. r=smaug
This commit is contained in:
Родитель
6f8420a7cc
Коммит
b74f786049
|
@ -114,6 +114,14 @@ interface nsIDOMEventTarget : nsISupports
|
|||
{
|
||||
return AddEventListener(aType, aListener, aUseCapture, PR_FALSE, 1);
|
||||
}
|
||||
// non-virtual so it won't affect the vtable
|
||||
nsresult AddEventListener(const nsAString& aType,
|
||||
nsIDOMEventListener* aListener,
|
||||
PRBool aUseCapture,
|
||||
PRBool aWantsUntrusted)
|
||||
{
|
||||
return AddEventListener(aType, aListener, aUseCapture, aWantsUntrusted, 2);
|
||||
}
|
||||
%}
|
||||
|
||||
/**
|
||||
|
|
|
@ -331,11 +331,9 @@ nsresult
|
|||
nsEditor::CreateEventListeners()
|
||||
{
|
||||
// Don't create the handler twice
|
||||
if (mEventListener)
|
||||
return NS_OK;
|
||||
mEventListener = do_QueryInterface(
|
||||
static_cast<nsIDOMKeyListener*>(new nsEditorEventListener()));
|
||||
NS_ENSURE_TRUE(mEventListener, NS_ERROR_OUT_OF_MEMORY);
|
||||
if (!mEventListener) {
|
||||
mEventListener = new nsEditorEventListener();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -132,60 +132,71 @@ nsEditorEventListener::InstallToEditor()
|
|||
nsEventListenerManager* elmP = piTarget->GetListenerManager(PR_TRUE);
|
||||
NS_ENSURE_STATE(elmP);
|
||||
|
||||
nsCOMPtr<nsIDOMEventListener> listenerBase;
|
||||
CallQueryInterface(this, getter_AddRefs(listenerBase));
|
||||
|
||||
rv = elmP->AddEventListenerByType(listenerBase,
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("keypress"),
|
||||
NS_EVENT_FLAG_BUBBLE |
|
||||
NS_PRIV_EVENT_UNTRUSTED_PERMITTED |
|
||||
NS_EVENT_FLAG_SYSTEM_EVENT);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// See bug 455215, we cannot use the standard dragstart event yet
|
||||
rv = elmP->AddEventListenerByType(listenerBase,
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("draggesture"),
|
||||
NS_EVENT_FLAG_BUBBLE |
|
||||
NS_EVENT_FLAG_SYSTEM_EVENT);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = elmP->AddEventListenerByType(listenerBase,
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("dragenter"),
|
||||
NS_EVENT_FLAG_BUBBLE |
|
||||
NS_EVENT_FLAG_SYSTEM_EVENT);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = elmP->AddEventListenerByType(listenerBase,
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("dragover"),
|
||||
NS_EVENT_FLAG_BUBBLE |
|
||||
NS_EVENT_FLAG_SYSTEM_EVENT);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = elmP->AddEventListenerByType(listenerBase,
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("dragexit"),
|
||||
NS_EVENT_FLAG_BUBBLE |
|
||||
NS_EVENT_FLAG_SYSTEM_EVENT);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = elmP->AddEventListenerByType(listenerBase,
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("drop"),
|
||||
NS_EVENT_FLAG_BUBBLE |
|
||||
NS_EVENT_FLAG_SYSTEM_EVENT);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = elmP->AddEventListenerByIID(listenerBase,
|
||||
NS_GET_IID(nsIDOMMouseListener),
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("mousedown"),
|
||||
NS_EVENT_FLAG_CAPTURE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("mouseup"),
|
||||
NS_EVENT_FLAG_CAPTURE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("click"),
|
||||
NS_EVENT_FLAG_CAPTURE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Focus event doesn't bubble so adding the listener to capturing phase.
|
||||
// Make sure this works after bug 235441 gets fixed.
|
||||
rv = elmP->AddEventListenerByIID(listenerBase,
|
||||
NS_GET_IID(nsIDOMFocusListener),
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("blur"),
|
||||
NS_EVENT_FLAG_CAPTURE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = piTarget->AddEventListenerByIID(listenerBase,
|
||||
NS_GET_IID(nsIDOMTextListener));
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("focus"),
|
||||
NS_EVENT_FLAG_CAPTURE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = piTarget->AddEventListenerByIID(listenerBase,
|
||||
NS_GET_IID(nsIDOMCompositionListener));
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("text"),
|
||||
NS_EVENT_FLAG_BUBBLE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("compositionstart"),
|
||||
NS_EVENT_FLAG_BUBBLE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = elmP->AddEventListenerByType(this,
|
||||
NS_LITERAL_STRING("compositionend"),
|
||||
NS_EVENT_FLAG_BUBBLE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -215,47 +226,54 @@ nsEditorEventListener::UninstallFromEditor()
|
|||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEventListener> listenerBase;
|
||||
CallQueryInterface(this, getter_AddRefs(listenerBase));
|
||||
|
||||
elmP->RemoveEventListenerByType(listenerBase,
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("keypress"),
|
||||
NS_EVENT_FLAG_BUBBLE |
|
||||
NS_EVENT_FLAG_SYSTEM_EVENT);
|
||||
elmP->RemoveEventListenerByType(listenerBase,
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("draggesture"),
|
||||
NS_EVENT_FLAG_BUBBLE |
|
||||
NS_EVENT_FLAG_SYSTEM_EVENT);
|
||||
elmP->RemoveEventListenerByType(listenerBase,
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("dragenter"),
|
||||
NS_EVENT_FLAG_BUBBLE |
|
||||
NS_EVENT_FLAG_SYSTEM_EVENT);
|
||||
elmP->RemoveEventListenerByType(listenerBase,
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("dragover"),
|
||||
NS_EVENT_FLAG_BUBBLE |
|
||||
NS_EVENT_FLAG_SYSTEM_EVENT);
|
||||
elmP->RemoveEventListenerByType(listenerBase,
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("dragexit"),
|
||||
NS_EVENT_FLAG_BUBBLE |
|
||||
NS_EVENT_FLAG_SYSTEM_EVENT);
|
||||
elmP->RemoveEventListenerByType(listenerBase,
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("drop"),
|
||||
NS_EVENT_FLAG_BUBBLE |
|
||||
NS_EVENT_FLAG_SYSTEM_EVENT);
|
||||
|
||||
elmP->RemoveEventListenerByIID(listenerBase,
|
||||
NS_GET_IID(nsIDOMMouseListener),
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("mousedown"),
|
||||
NS_EVENT_FLAG_CAPTURE);
|
||||
|
||||
elmP->RemoveEventListenerByIID(listenerBase,
|
||||
NS_GET_IID(nsIDOMFocusListener),
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("mouseup"),
|
||||
NS_EVENT_FLAG_CAPTURE);
|
||||
|
||||
piTarget->RemoveEventListenerByIID(listenerBase,
|
||||
NS_GET_IID(nsIDOMTextListener));
|
||||
|
||||
piTarget->RemoveEventListenerByIID(listenerBase,
|
||||
NS_GET_IID(nsIDOMCompositionListener));
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("click"),
|
||||
NS_EVENT_FLAG_CAPTURE);
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("blur"),
|
||||
NS_EVENT_FLAG_CAPTURE);
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("focus"),
|
||||
NS_EVENT_FLAG_CAPTURE);
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("text"),
|
||||
NS_EVENT_FLAG_BUBBLE);
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("compositionstart"),
|
||||
NS_EVENT_FLAG_BUBBLE);
|
||||
elmP->RemoveEventListenerByType(this,
|
||||
NS_LITERAL_STRING("compositionend"),
|
||||
NS_EVENT_FLAG_BUBBLE);
|
||||
}
|
||||
|
||||
already_AddRefed<nsIPresShell>
|
||||
|
@ -270,18 +288,7 @@ nsEditorEventListener::GetPresShell()
|
|||
* nsISupports implementation
|
||||
*/
|
||||
|
||||
NS_IMPL_ADDREF(nsEditorEventListener)
|
||||
NS_IMPL_RELEASE(nsEditorEventListener)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsEditorEventListener)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMKeyListener)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMTextListener)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMCompositionListener)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMMouseListener)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMFocusListener)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMKeyListener)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMKeyListener)
|
||||
NS_INTERFACE_MAP_END
|
||||
NS_IMPL_ISUPPORTS1(nsEditorEventListener, nsIDOMEventListener)
|
||||
|
||||
/**
|
||||
* nsIDOMEventListener implementation
|
||||
|
@ -292,10 +299,11 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent)
|
|||
{
|
||||
NS_ENSURE_TRUE(mEditor, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
|
||||
if (dragEvent) {
|
||||
nsAutoString eventType;
|
||||
aEvent->GetType(eventType);
|
||||
|
||||
nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
|
||||
if (dragEvent) {
|
||||
if (eventType.EqualsLiteral("draggesture"))
|
||||
return DragGesture(dragEvent);
|
||||
if (eventType.EqualsLiteral("dragenter"))
|
||||
|
@ -307,26 +315,26 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent)
|
|||
if (eventType.EqualsLiteral("drop"))
|
||||
return Drop(dragEvent);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* nsIDOMKeyListener implementation
|
||||
*/
|
||||
if (eventType.EqualsLiteral("keypress"))
|
||||
return KeyPress(aEvent);
|
||||
if (eventType.EqualsLiteral("mousedown"))
|
||||
return MouseDown(aEvent);
|
||||
if (eventType.EqualsLiteral("mouseup"))
|
||||
return MouseUp(aEvent);
|
||||
if (eventType.EqualsLiteral("click"))
|
||||
return MouseClick(aEvent);
|
||||
if (eventType.EqualsLiteral("focus"))
|
||||
return Focus(aEvent);
|
||||
if (eventType.EqualsLiteral("blur"))
|
||||
return Blur(aEvent);
|
||||
if (eventType.EqualsLiteral("text"))
|
||||
return HandleText(aEvent);
|
||||
if (eventType.EqualsLiteral("compositionstart"))
|
||||
return HandleStartComposition(aEvent);
|
||||
if (eventType.EqualsLiteral("compositionend"))
|
||||
return HandleEndComposition(aEvent);
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorEventListener::KeyDown(nsIDOMEvent* aKeyEvent)
|
||||
{
|
||||
// WARNING: If you change this method, you comment out next line.
|
||||
// NS_ENSURE_TRUE(mEditor, NS_ERROR_NOT_AVAILABLE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorEventListener::KeyUp(nsIDOMEvent* aKeyEvent)
|
||||
{
|
||||
// WARNING: If you change this method, you comment out next line.
|
||||
// NS_ENSURE_TRUE(mEditor, NS_ERROR_NOT_AVAILABLE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -367,10 +375,6 @@ nsEditorEventListener::KeyPress(nsIDOMEvent* aKeyEvent)
|
|||
return mEditor->HandleKeyPressEvent(keyEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
* nsIDOMMouseListener implementation
|
||||
*/
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorEventListener::MouseClick(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
|
@ -462,42 +466,6 @@ nsEditorEventListener::MouseDown(nsIDOMEvent* aMouseEvent)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorEventListener::MouseUp(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
// WARNING: If you change this method, you comment out next line.
|
||||
// NS_ENSURE_TRUE(mEditor, NS_ERROR_NOT_AVAILABLE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorEventListener::MouseDblClick(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
// WARNING: If you change this method, you comment out next line.
|
||||
// NS_ENSURE_TRUE(mEditor, NS_ERROR_NOT_AVAILABLE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorEventListener::MouseOver(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
// WARNING: If you change this method, you comment out next line.
|
||||
// NS_ENSURE_TRUE(mEditor, NS_ERROR_NOT_AVAILABLE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorEventListener::MouseOut(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
// WARNING: If you change this method, you comment out next line.
|
||||
// NS_ENSURE_TRUE(mEditor, NS_ERROR_NOT_AVAILABLE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* nsIDOMTextListener implementation
|
||||
*/
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorEventListener::HandleText(nsIDOMEvent* aTextEvent)
|
||||
{
|
||||
|
@ -780,10 +748,6 @@ nsEditorEventListener::CanDrop(nsIDOMDragEvent* aEvent)
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* nsIDOMCompositionListener implementation
|
||||
*/
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorEventListener::HandleStartComposition(nsIDOMEvent* aCompositionEvent)
|
||||
{
|
||||
|
@ -809,10 +773,6 @@ nsEditorEventListener::HandleEndComposition(nsIDOMEvent* aCompositionEvent)
|
|||
return mEditor->EndIMEComposition();
|
||||
}
|
||||
|
||||
/**
|
||||
* nsIDOMFocusListener implementation
|
||||
*/
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorEventListener::Focus(nsIDOMEvent* aEvent)
|
||||
{
|
||||
|
|
|
@ -42,22 +42,19 @@
|
|||
#include "nsCOMPtr.h"
|
||||
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMKeyListener.h"
|
||||
#include "nsIDOMMouseListener.h"
|
||||
#include "nsIDOMTextListener.h"
|
||||
#include "nsIDOMCompositionListener.h"
|
||||
#include "nsIDOMFocusListener.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
|
||||
#include "nsCaret.h"
|
||||
|
||||
// X.h defines KeyPress
|
||||
#ifdef KeyPress
|
||||
#undef KeyPress
|
||||
#endif
|
||||
|
||||
class nsEditor;
|
||||
class nsIDOMDragEvent;
|
||||
|
||||
class nsEditorEventListener : public nsIDOMKeyListener,
|
||||
public nsIDOMTextListener,
|
||||
public nsIDOMCompositionListener,
|
||||
public nsIDOMMouseListener,
|
||||
public nsIDOMFocusListener
|
||||
class nsEditorEventListener : public nsIDOMEventListener
|
||||
{
|
||||
public:
|
||||
nsEditorEventListener();
|
||||
|
@ -70,27 +67,13 @@ public:
|
|||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDOMEVENTLISTENER
|
||||
|
||||
// nsIDOMKeyListener
|
||||
NS_IMETHOD KeyDown(nsIDOMEvent* aKeyEvent);
|
||||
NS_IMETHOD KeyUp(nsIDOMEvent* aKeyEvent);
|
||||
NS_IMETHOD KeyPress(nsIDOMEvent* aKeyEvent);
|
||||
|
||||
// nsIDOMTextListener
|
||||
NS_IMETHOD HandleText(nsIDOMEvent* aTextEvent);
|
||||
|
||||
// nsIDOMCompositionListener
|
||||
NS_IMETHOD HandleStartComposition(nsIDOMEvent* aCompositionEvent);
|
||||
NS_IMETHOD HandleEndComposition(nsIDOMEvent* aCompositionEvent);
|
||||
|
||||
// nsIDOMMouseListener
|
||||
NS_IMETHOD MouseDown(nsIDOMEvent* aMouseEvent);
|
||||
NS_IMETHOD MouseUp(nsIDOMEvent* aMouseEvent);
|
||||
NS_IMETHOD MouseUp(nsIDOMEvent* aMouseEvent) { return NS_OK; }
|
||||
NS_IMETHOD MouseClick(nsIDOMEvent* aMouseEvent);
|
||||
NS_IMETHOD MouseDblClick(nsIDOMEvent* aMouseEvent);
|
||||
NS_IMETHOD MouseOver(nsIDOMEvent* aMouseEvent);
|
||||
NS_IMETHOD MouseOut(nsIDOMEvent* aMouseEvent);
|
||||
|
||||
// nsIDOMFocusListener
|
||||
NS_IMETHOD Focus(nsIDOMEvent* aEvent);
|
||||
NS_IMETHOD Blur(nsIDOMEvent* aEvent);
|
||||
|
||||
|
|
|
@ -414,8 +414,9 @@ nsHTMLEditor::GrabberClicked()
|
|||
nsCOMPtr<nsIDOMEventTarget> piTarget = GetDOMEventTarget();
|
||||
NS_ENSURE_TRUE(piTarget, NS_ERROR_FAILURE);
|
||||
|
||||
res = piTarget->AddEventListenerByIID(mMouseMotionListenerP,
|
||||
NS_GET_IID(nsIDOMMouseMotionListener));
|
||||
res = piTarget->AddEventListener(NS_LITERAL_STRING("mousemove"),
|
||||
mMouseMotionListenerP,
|
||||
PR_FALSE, PR_FALSE);
|
||||
NS_ASSERTION(NS_SUCCEEDED(res),
|
||||
"failed to register mouse motion listener");
|
||||
}
|
||||
|
@ -447,8 +448,9 @@ nsHTMLEditor::EndMoving()
|
|||
#ifdef DEBUG
|
||||
nsresult res =
|
||||
#endif
|
||||
piTarget->RemoveEventListenerByIID(mMouseMotionListenerP,
|
||||
NS_GET_IID(nsIDOMMouseMotionListener));
|
||||
piTarget->RemoveEventListener(NS_LITERAL_STRING("mousemove"),
|
||||
mMouseMotionListenerP,
|
||||
PR_FALSE);
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "failed to remove mouse motion listener");
|
||||
}
|
||||
mMouseMotionListenerP = nsnull;
|
||||
|
|
|
@ -443,11 +443,9 @@ nsresult
|
|||
nsHTMLEditor::CreateEventListeners()
|
||||
{
|
||||
// Don't create the handler twice
|
||||
if (mEventListener)
|
||||
return NS_OK;
|
||||
mEventListener = do_QueryInterface(
|
||||
static_cast<nsIDOMKeyListener*>(new nsHTMLEditorEventListener()));
|
||||
NS_ENSURE_TRUE(mEventListener, NS_ERROR_OUT_OF_MEMORY);
|
||||
if (!mEventListener) {
|
||||
mEventListener = new nsHTMLEditorEventListener();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -486,11 +484,10 @@ nsHTMLEditor::RemoveEventListeners()
|
|||
|
||||
if (mMouseMotionListenerP)
|
||||
{
|
||||
// mMouseMotionListenerP might be registerd either by IID or
|
||||
// name, unregister by both.
|
||||
target->RemoveEventListenerByIID(mMouseMotionListenerP,
|
||||
NS_GET_IID(nsIDOMMouseMotionListener));
|
||||
|
||||
// mMouseMotionListenerP might be registerd either as bubbling or
|
||||
// capturing, unregister by both.
|
||||
target->RemoveEventListener(NS_LITERAL_STRING("mousemove"),
|
||||
mMouseMotionListenerP, PR_FALSE);
|
||||
target->RemoveEventListener(NS_LITERAL_STRING("mousemove"),
|
||||
mMouseMotionListenerP, PR_TRUE);
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ ResizerSelectionListener::NotifySelectionChanged(nsIDOMDocument *, nsISelection
|
|||
// ResizerMouseMotionListener
|
||||
// ==================================================================
|
||||
|
||||
NS_IMPL_ISUPPORTS2(ResizerMouseMotionListener, nsIDOMEventListener, nsIDOMMouseMotionListener)
|
||||
NS_IMPL_ISUPPORTS1(ResizerMouseMotionListener, nsIDOMEventListener)
|
||||
|
||||
ResizerMouseMotionListener::ResizerMouseMotionListener(nsIHTMLEditor * aEditor)
|
||||
{
|
||||
|
@ -141,9 +141,8 @@ ResizerMouseMotionListener::~ResizerMouseMotionListener()
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
ResizerMouseMotionListener::MouseMove(nsIDOMEvent* aMouseEvent)
|
||||
ResizerMouseMotionListener::HandleEvent(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
nsCOMPtr<nsIDOMMouseEvent> mouseEvent ( do_QueryInterface(aMouseEvent) );
|
||||
if (!mouseEvent) {
|
||||
|
@ -162,18 +161,6 @@ ResizerMouseMotionListener::MouseMove(nsIDOMEvent* aMouseEvent)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ResizerMouseMotionListener::HandleEvent(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ResizerMouseMotionListener::DragMove(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// ==================================================================
|
||||
// nsHTMLEditor
|
||||
// ==================================================================
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsISelectionListener.h"
|
||||
#include "nsIDOMMouseMotionListener.h"
|
||||
|
||||
#define kTopLeft NS_LITERAL_STRING("nw")
|
||||
#define kTop NS_LITERAL_STRING("n")
|
||||
|
@ -90,7 +89,7 @@ protected:
|
|||
// ResizerMouseMotionListener
|
||||
// ==================================================================
|
||||
|
||||
class ResizerMouseMotionListener: public nsIDOMMouseMotionListener
|
||||
class ResizerMouseMotionListener : public nsIDOMEventListener
|
||||
{
|
||||
public:
|
||||
ResizerMouseMotionListener(nsIHTMLEditor * aEditor);
|
||||
|
@ -102,9 +101,6 @@ public:
|
|||
|
||||
NS_DECL_NSIDOMEVENTLISTENER
|
||||
|
||||
NS_IMETHOD MouseMove(nsIDOMEvent* aMouseEvent);
|
||||
NS_IMETHOD DragMove(nsIDOMEvent* aMouseEvent);
|
||||
|
||||
protected:
|
||||
nsWeakPtr mEditor;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче