Bug 1204442 nsIDragService::FireDragEventAtSource() shouldn't be available from script because it takes a value of mozilla::EventMessage r=smaug, sr=smaug

This commit is contained in:
Masayuki Nakano 2015-09-15 00:18:29 +09:00
parent 4fb3553a93
commit 9dafcc57ad
2 changed files with 8 additions and 5 deletions

View File

@ -396,7 +396,7 @@ nsBaseDragService::EndDragSession(bool aDoneDrag)
}
NS_IMETHODIMP
nsBaseDragService::FireDragEventAtSource(uint32_t aMsg)
nsBaseDragService::FireDragEventAtSource(EventMessage aEventMessage)
{
if (mSourceNode && !mSuppressLevel) {
nsCOMPtr<nsIDocument> doc = do_QueryInterface(mSourceDocument);
@ -404,9 +404,9 @@ nsBaseDragService::FireDragEventAtSource(uint32_t aMsg)
nsCOMPtr<nsIPresShell> presShell = doc->GetShell();
if (presShell) {
nsEventStatus status = nsEventStatus_eIgnore;
WidgetDragEvent event(true, static_cast<EventMessage>(aMsg), nullptr);
WidgetDragEvent event(true, aEventMessage, nullptr);
event.inputSource = mInputSource;
if (aMsg == eDragEnd) {
if (aEventMessage == eDragEnd) {
event.refPoint.x = mEndDragPoint.x;
event.refPoint.y = mEndDragPoint.y;
event.userCancelled = mUserCancelled;

View File

@ -16,6 +16,8 @@ interface nsIDOMDataTransfer;
interface nsISelection;
%{C++
#include "mozilla/EventForwards.h"
namespace mozilla {
namespace dom {
class ContentParent;
@ -24,8 +26,9 @@ class ContentParent;
%}
[ptr] native ContentParentPtr(mozilla::dom::ContentParent);
native EventMessage(mozilla::EventMessage);
[scriptable, uuid(009d4489-4568-4896-9442-19717dd00f15), builtinclass]
[scriptable, uuid(ebd6b3a2-af16-43af-a698-3091a087dd62), builtinclass]
interface nsIDragService : nsISupports
{
const long DRAGDROP_ACTION_NONE = 0;
@ -114,7 +117,7 @@ interface nsIDragService : nsISupports
/**
* Fire a drag event at the source of the drag
*/
void fireDragEventAtSource ( in unsigned long aMsg );
[noscript] void fireDragEventAtSource(in EventMessage aEventMessage);
/**
* Increase/decrease dragging suppress level by one.