зеркало из https://github.com/mozilla/gecko-dev.git
Fixing bug 257523. Prevent Copy & Paste with generated DOM events. Patch by trev@gtchat.de, r=jst@mozilla.org, sr=dveditz@cruzio.com
This commit is contained in:
Родитель
1e7fadf591
Коммит
30a055a3ab
|
@ -98,6 +98,7 @@
|
|||
#include "nsGUIEvent.h"
|
||||
#include "nsIDOMEventGroup.h"
|
||||
#include "nsIDOM3EventTarget.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMNSUIEvent.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
|
||||
|
@ -374,12 +375,18 @@ static PRBool
|
|||
DOMEventToNativeKeyEvent(nsIDOMEvent *aDOMEvent,
|
||||
nsNativeKeyEvent *aNativeEvent)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNSUIEvent> nsevent = do_QueryInterface(aDOMEvent);
|
||||
nsCOMPtr<nsIDOMNSUIEvent> uievent = do_QueryInterface(aDOMEvent);
|
||||
PRBool defaultPrevented;
|
||||
nsevent->GetPreventDefault(&defaultPrevented);
|
||||
uievent->GetPreventDefault(&defaultPrevented);
|
||||
if (defaultPrevented)
|
||||
return PR_FALSE;
|
||||
|
||||
nsCOMPtr<nsIDOMNSEvent> nsevent = do_QueryInterface(aDOMEvent);
|
||||
PRBool trusted = PR_FALSE;
|
||||
nsevent->GetIsTrusted(&trusted);
|
||||
if (!trusted)
|
||||
return PR_FALSE;
|
||||
|
||||
nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aDOMEvent);
|
||||
|
||||
keyEvent->GetCharCode(&aNativeEvent->charCode);
|
||||
|
|
|
@ -98,6 +98,7 @@
|
|||
#include "nsGUIEvent.h"
|
||||
#include "nsIDOMEventGroup.h"
|
||||
#include "nsIDOM3EventTarget.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMNSUIEvent.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
|
||||
|
@ -374,12 +375,18 @@ static PRBool
|
|||
DOMEventToNativeKeyEvent(nsIDOMEvent *aDOMEvent,
|
||||
nsNativeKeyEvent *aNativeEvent)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNSUIEvent> nsevent = do_QueryInterface(aDOMEvent);
|
||||
nsCOMPtr<nsIDOMNSUIEvent> uievent = do_QueryInterface(aDOMEvent);
|
||||
PRBool defaultPrevented;
|
||||
nsevent->GetPreventDefault(&defaultPrevented);
|
||||
uievent->GetPreventDefault(&defaultPrevented);
|
||||
if (defaultPrevented)
|
||||
return PR_FALSE;
|
||||
|
||||
nsCOMPtr<nsIDOMNSEvent> nsevent = do_QueryInterface(aDOMEvent);
|
||||
PRBool trusted = PR_FALSE;
|
||||
nsevent->GetIsTrusted(&trusted);
|
||||
if (!trusted)
|
||||
return PR_FALSE;
|
||||
|
||||
nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aDOMEvent);
|
||||
|
||||
keyEvent->GetCharCode(&aNativeEvent->charCode);
|
||||
|
|
Загрузка…
Ссылка в новой задаче