зеркало из https://github.com/mozilla/pjs.git
Partially fix bug 28323 by changing the text field editor keypress listener to not add characters into the text field if the user has cancelled the event. r:jst
This commit is contained in:
Родитель
0067f48168
Коммит
dc08d4dbd9
|
@ -42,7 +42,7 @@
|
|||
#include "nsIPrivateCompositionEvent.h"
|
||||
#include "nsIEditorMailSupport.h"
|
||||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIDOMNSUIEvent.h"
|
||||
#include "nsIPref.h"
|
||||
#include "nsILookAndFeel.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
@ -158,12 +158,12 @@ nsTextEditorKeyListener::KeyPress(nsIDOMEvent* aKeyEvent)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent = do_QueryInterface(aKeyEvent);
|
||||
if(privateEvent)
|
||||
nsCOMPtr<nsIDOMNSUIEvent> nsUIEvent = do_QueryInterface(aKeyEvent);
|
||||
if(nsUIEvent)
|
||||
{
|
||||
PRBool dispatchStopped;
|
||||
privateEvent->IsDispatchStopped(&dispatchStopped);
|
||||
if(dispatchStopped)
|
||||
PRBool defaultPrevented;
|
||||
nsUIEvent->GetPreventDefault(&defaultPrevented);
|
||||
if(defaultPrevented)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include "nsIPrivateCompositionEvent.h"
|
||||
#include "nsIEditorMailSupport.h"
|
||||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIDOMNSUIEvent.h"
|
||||
#include "nsIPref.h"
|
||||
#include "nsILookAndFeel.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
@ -158,12 +158,12 @@ nsTextEditorKeyListener::KeyPress(nsIDOMEvent* aKeyEvent)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent = do_QueryInterface(aKeyEvent);
|
||||
if(privateEvent)
|
||||
nsCOMPtr<nsIDOMNSUIEvent> nsUIEvent = do_QueryInterface(aKeyEvent);
|
||||
if(nsUIEvent)
|
||||
{
|
||||
PRBool dispatchStopped;
|
||||
privateEvent->IsDispatchStopped(&dispatchStopped);
|
||||
if(dispatchStopped)
|
||||
PRBool defaultPrevented;
|
||||
nsUIEvent->GetPreventDefault(&defaultPrevented);
|
||||
if(defaultPrevented)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче