Bug 813445 part.12 Remove NS_EVENT_FLAG_ONLY_CHROME_DISPATCH and nsEvent::flags r=smaug

This commit is contained in:
Masayuki Nakano 2012-12-16 10:26:05 +09:00
parent 3ea9434de3
commit ebad00b4b8
8 changed files with 10 additions and 21 deletions

View File

@ -245,7 +245,7 @@ nsPluginCrashedEvent::Run()
event->InitEvent(NS_LITERAL_STRING("PluginCrashed"), true, true);
event->SetTrusted(true);
event->GetInternalNSEvent()->flags |= NS_EVENT_FLAG_ONLY_CHROME_DISPATCH;
event->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
nsCOMPtr<nsIWritableVariant> variant;

View File

@ -780,7 +780,6 @@ nsDOMEvent::DuplicatePrivateData()
newEvent->target = mEvent->target;
newEvent->currentTarget = mEvent->currentTarget;
newEvent->originalTarget = mEvent->originalTarget;
newEvent->flags = mEvent->flags;
newEvent->mFlags = mEvent->mFlags;
newEvent->time = mEvent->time;
newEvent->refPoint = mEvent->refPoint;

View File

@ -477,7 +477,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
}
}
if (aEvent->flags & NS_EVENT_FLAG_ONLY_CHROME_DISPATCH) {
if (aEvent->mFlags.mOnlyChromeDispatch) {
nsCOMPtr<nsINode> node = do_QueryInterface(aTarget);
if (!node) {
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(aTarget);

View File

@ -9096,7 +9096,7 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic,
if (fireMozStorageChanged) {
nsEvent *internalEvent = event->GetInternalNSEvent();
internalEvent->flags |= NS_EVENT_FLAG_ONLY_CHROME_DISPATCH;
internalEvent->mFlags.mOnlyChromeDispatch = true;
}
if (IsFrozen()) {

View File

@ -6387,7 +6387,7 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsEventStatus* aStatus)
// handler from stopping all loads in the document, which
// would cause <video> loads to stop.
aEvent->mFlags.mDefaultPrevented = true;
aEvent->flags |= NS_EVENT_FLAG_ONLY_CHROME_DISPATCH;
aEvent->mFlags.mOnlyChromeDispatch = true;
if (aEvent->message == NS_KEY_UP) {
// ESC key released while in DOM full-screen mode.
@ -6493,7 +6493,7 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsEventStatus* aStatus)
bool onlyChromeDrop = false;
session->GetOnlyChromeDrop(&onlyChromeDrop);
if (onlyChromeDrop) {
aEvent->flags |= NS_EVENT_FLAG_ONLY_CHROME_DISPATCH;
aEvent->mFlags.mOnlyChromeDispatch = true;
}
}
break;
@ -6510,7 +6510,7 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsEventStatus* aStatus)
return NS_OK;
}
if (me->IsShift()) {
aEvent->flags |= NS_EVENT_FLAG_ONLY_CHROME_DISPATCH;
aEvent->mFlags.mOnlyChromeDispatch = true;
aEvent->mFlags.mRetargetToNonNativeAnonymous = true;
}
}
@ -6586,7 +6586,7 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsEventStatus* aStatus)
(last &&
nsContentUtils::ContentIsDescendantOf(last,
possibleFormElement))) {
aEvent->flags |= NS_EVENT_FLAG_ONLY_CHROME_DISPATCH;
aEvent->mFlags.mOnlyChromeDispatch = true;
}
}
}

View File

@ -114,10 +114,6 @@ enum nsEventStructType {
#define NS_PRIV_EVENT_FLAG_SCRIPT 0x0080
#define NS_EVENT_FLAG_NO_CONTENT_DISPATCH 0x0100
#define NS_EVENT_FLAG_SYSTEM_EVENT 0x0200
// Use this flag if the event should be dispatched only to chrome.
#define NS_EVENT_FLAG_ONLY_CHROME_DISPATCH 0x2000
#define NS_PRIV_EVENT_UNTRUSTED_PERMITTED 0x8000
#define NS_EVENT_CAPTURE_MASK (~(NS_EVENT_FLAG_BUBBLE | NS_EVENT_FLAG_NO_CONTENT_DISPATCH))
@ -550,6 +546,8 @@ public:
// can handle the event if they add event listeners to the window or the
// document.
bool mNoContentDispatch : 1;
// If mOnlyChromeDispatch is true, the event is dispatched to only chrome.
bool mOnlyChromeDispatch : 1;
// If the event is being handled in target phase, returns true.
bool InTargetPhase() const
@ -605,7 +603,6 @@ protected:
refPoint(0, 0),
lastRefPoint(0, 0),
time(0),
flags(NS_EVENT_FLAG_NONE),
userType(0)
{
MOZ_COUNT_CTOR(nsEvent);
@ -626,7 +623,6 @@ public:
refPoint(0, 0),
lastRefPoint(0, 0),
time(0),
flags(NS_EVENT_FLAG_NONE),
userType(0)
{
MOZ_COUNT_CTOR(nsEvent);
@ -658,10 +654,6 @@ public:
// Elapsed time, in milliseconds, from a platform-specific zero time
// to the time the message was created
uint64_t time;
// Flags to hold event flow stage and capture/bubble cancellation
// status. This is used also to indicate whether the event is trusted.
uint32_t flags;
// See EventFlags definition for the detail.
mozilla::widget::EventFlags mFlags;

View File

@ -41,7 +41,6 @@ struct ParamTraits<nsEvent>
WriteParam(aMsg, aParam.message);
WriteParam(aMsg, aParam.refPoint);
WriteParam(aMsg, aParam.time);
WriteParam(aMsg, aParam.flags);
WriteParam(aMsg, aParam.mFlags);
}
@ -52,7 +51,6 @@ struct ParamTraits<nsEvent>
ReadParam(aMsg, aIter, &aResult->message) &&
ReadParam(aMsg, aIter, &aResult->refPoint) &&
ReadParam(aMsg, aIter, &aResult->time) &&
ReadParam(aMsg, aIter, &aResult->flags) &&
ReadParam(aMsg, aIter, &aResult->mFlags);
aResult->eventStructType = static_cast<nsEventStructType>(eventStructType);
return ret;

View File

@ -3914,7 +3914,7 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam,
}
else if (aEventType == NS_MOUSE_MOZHITTEST)
{
event.flags |= NS_EVENT_FLAG_ONLY_CHROME_DISPATCH;
event.mFlags.mOnlyChromeDispatch = true;
}
event.clickCount = sLastClickCount;