Bug 813445 part.10 Remove NS_EVENT_FLAG_DONT_FORWARD_CROSS_PROCESS and NS_EVENT_RETARGET_TO_NON_NATIVE_ANONYMOUS r=smaug

This commit is contained in:
Masayuki Nakano 2012-12-16 10:26:05 +09:00
parent 0c3d212d7e
commit 944e110e9a
5 changed files with 13 additions and 11 deletions

View File

@ -464,7 +464,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
bool retargeted = false;
if (aEvent->flags & NS_EVENT_RETARGET_TO_NON_NATIVE_ANONYMOUS) {
if (aEvent->mFlags.mRetargetToNonNativeAnonymous) {
nsCOMPtr<nsIContent> content = do_QueryInterface(target);
if (content && content->IsInNativeAnonymousSubtree()) {
nsCOMPtr<nsPIDOMEventTarget> newTarget =

View File

@ -1655,7 +1655,7 @@ nsEventStateManager::HandleCrossProcessEvent(nsEvent *aEvent,
nsIFrame* aTargetFrame,
nsEventStatus *aStatus) {
if (*aStatus == nsEventStatus_eConsumeNoDefault ||
aEvent->flags & NS_EVENT_FLAG_DONT_FORWARD_CROSS_PROCESS ||
aEvent->mFlags.mNoCrossProcessBoundaryForwarding ||
!CrossProcessSafeEvent(*aEvent)) {
return false;
}

View File

@ -6509,9 +6509,10 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsEventStatus* aStatus)
!AdjustContextMenuKeyEvent(me)) {
return NS_OK;
}
if (me->IsShift())
aEvent->flags |= NS_EVENT_FLAG_ONLY_CHROME_DISPATCH |
NS_EVENT_RETARGET_TO_NON_NATIVE_ANONYMOUS;
if (me->IsShift()) {
aEvent->flags |= NS_EVENT_FLAG_ONLY_CHROME_DISPATCH;
aEvent->mFlags.mRetargetToNonNativeAnonymous = true;
}
}
nsAutoHandlingUserInputStatePusher userInpStatePusher(isHandlingUserInput,

View File

@ -138,8 +138,7 @@ sendMouseEvent(uint32_t msg, uint64_t timeMs, int x, int y, bool forwardToChildr
if (msg != NS_MOUSE_MOVE)
event.clickCount = 1;
if (!forwardToChildren)
event.flags |= NS_EVENT_FLAG_DONT_FORWARD_CROSS_PROCESS;
event.mFlags.mNoCrossProcessBoundaryForwarding = !forwardToChildren;
nsWindow::DispatchInputEvent(event);
}

View File

@ -120,10 +120,6 @@ enum nsEventStructType {
#define NS_PRIV_EVENT_UNTRUSTED_PERMITTED 0x8000
#define NS_EVENT_RETARGET_TO_NON_NATIVE_ANONYMOUS 0x40000
#define NS_EVENT_FLAG_DONT_FORWARD_CROSS_PROCESS 0x100000
#define NS_EVENT_CAPTURE_MASK (~(NS_EVENT_FLAG_BUBBLE | NS_EVENT_FLAG_NO_CONTENT_DISPATCH))
#define NS_EVENT_BUBBLE_MASK (~(NS_EVENT_FLAG_CAPTURE | NS_EVENT_FLAG_NO_CONTENT_DISPATCH))
@ -540,6 +536,12 @@ public:
// If mExceptionHasBeenRisen is true, one of the event handlers has risen an
// exception.
bool mExceptionHasBeenRisen : 1;
// If mRetargetToNonNativeAnonymous is true and the target is in a non-native
// native anonymous subtree, the event target is set to originalTarget.
bool mRetargetToNonNativeAnonymous : 1;
// If mNoCrossProcessBoundaryForwarding is true, the event is not allowed to
// cross process boundary.
bool mNoCrossProcessBoundaryForwarding : 1;
// If the event is being handled in target phase, returns true.
bool InTargetPhase() const