зеркало из https://github.com/mozilla/pjs.git
Propagate trusted flag to synthesized events. b=265692 r=bzbarsky sr=jst a=asa
This commit is contained in:
Родитель
c4e35051b7
Коммит
642604a088
|
@ -1124,6 +1124,9 @@ void
|
||||||
nsEventStateManager::CreateClickHoldTimer(nsPresContext* inPresContext,
|
nsEventStateManager::CreateClickHoldTimer(nsPresContext* inPresContext,
|
||||||
nsGUIEvent* inMouseDownEvent)
|
nsGUIEvent* inMouseDownEvent)
|
||||||
{
|
{
|
||||||
|
if (!(inMouseDownEvent->internalAppFlags & NS_APP_EVENT_FLAG_TRUSTED))
|
||||||
|
return;
|
||||||
|
|
||||||
// just to be anal (er, safe)
|
// just to be anal (er, safe)
|
||||||
if (mClickHoldTimer) {
|
if (mClickHoldTimer) {
|
||||||
mClickHoldTimer->Cancel();
|
mClickHoldTimer->Cancel();
|
||||||
|
@ -1231,6 +1234,7 @@ nsEventStateManager::FireContextClick()
|
||||||
event.clickCount = 1;
|
event.clickCount = 1;
|
||||||
event.point = mEventPoint;
|
event.point = mEventPoint;
|
||||||
event.refPoint = mEventRefPoint;
|
event.refPoint = mEventRefPoint;
|
||||||
|
event.internalAppFlags |= NS_APP_EVENT_FLAG_TRUSTED;
|
||||||
|
|
||||||
// Dispatch to the DOM. We have to fake out the ESM and tell it that the
|
// Dispatch to the DOM. We have to fake out the ESM and tell it that the
|
||||||
// current target frame is actually where the mouseDown occurred, otherwise it
|
// current target frame is actually where the mouseDown occurred, otherwise it
|
||||||
|
@ -1481,6 +1485,8 @@ nsEventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
|
||||||
event.isControl = ((nsMouseEvent*)aEvent)->isControl;
|
event.isControl = ((nsMouseEvent*)aEvent)->isControl;
|
||||||
event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
|
event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
|
||||||
event.isMeta = ((nsMouseEvent*)aEvent)->isMeta;
|
event.isMeta = ((nsMouseEvent*)aEvent)->isMeta;
|
||||||
|
event.internalAppFlags |=
|
||||||
|
aEvent->internalAppFlags & NS_APP_EVENT_FLAG_TRUSTED;
|
||||||
|
|
||||||
// Dispatch to the DOM. We have to fake out the ESM and tell it that the
|
// Dispatch to the DOM. We have to fake out the ESM and tell it that the
|
||||||
// current target frame is actually where the mouseDown occurred, otherwise it
|
// current target frame is actually where the mouseDown occurred, otherwise it
|
||||||
|
@ -2508,6 +2514,8 @@ nsEventStateManager::DispatchMouseEvent(nsPresContext* aPresContext,
|
||||||
event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
|
event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
|
||||||
event.isMeta = ((nsMouseEvent*)aEvent)->isMeta;
|
event.isMeta = ((nsMouseEvent*)aEvent)->isMeta;
|
||||||
event.nativeMsg = ((nsMouseEvent*)aEvent)->nativeMsg;
|
event.nativeMsg = ((nsMouseEvent*)aEvent)->nativeMsg;
|
||||||
|
event.internalAppFlags |=
|
||||||
|
aEvent->internalAppFlags & NS_APP_EVENT_FLAG_TRUSTED;
|
||||||
|
|
||||||
mCurrentTargetContent = aTargetContent;
|
mCurrentTargetContent = aTargetContent;
|
||||||
mCurrentRelatedContent = aRelatedContent;
|
mCurrentRelatedContent = aRelatedContent;
|
||||||
|
@ -2563,6 +2571,8 @@ nsEventStateManager::MaybeDispatchMouseEventToIframe(
|
||||||
event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
|
event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
|
||||||
event.isMeta = ((nsMouseEvent*)aEvent)->isMeta;
|
event.isMeta = ((nsMouseEvent*)aEvent)->isMeta;
|
||||||
event.nativeMsg = ((nsMouseEvent*)aEvent)->nativeMsg;
|
event.nativeMsg = ((nsMouseEvent*)aEvent)->nativeMsg;
|
||||||
|
event.internalAppFlags |=
|
||||||
|
aEvent->internalAppFlags & NS_APP_EVENT_FLAG_TRUSTED;
|
||||||
|
|
||||||
parentShell->HandleDOMEventWithTarget(docContent, &event, &status);
|
parentShell->HandleDOMEventWithTarget(docContent, &event, &status);
|
||||||
}
|
}
|
||||||
|
@ -2715,6 +2725,8 @@ nsEventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
|
||||||
event.isControl = ((nsMouseEvent*)aEvent)->isControl;
|
event.isControl = ((nsMouseEvent*)aEvent)->isControl;
|
||||||
event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
|
event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
|
||||||
event.isMeta = ((nsMouseEvent*)aEvent)->isMeta;
|
event.isMeta = ((nsMouseEvent*)aEvent)->isMeta;
|
||||||
|
event.internalAppFlags |=
|
||||||
|
aEvent->internalAppFlags & NS_APP_EVENT_FLAG_TRUSTED;
|
||||||
|
|
||||||
//The frame has change but the content may not have. Check before dispatching to content
|
//The frame has change but the content may not have. Check before dispatching to content
|
||||||
mLastDragOverFrame->GetContentForEvent(aPresContext, aEvent, getter_AddRefs(lastContent));
|
mLastDragOverFrame->GetContentForEvent(aPresContext, aEvent, getter_AddRefs(lastContent));
|
||||||
|
@ -2748,6 +2760,8 @@ nsEventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
|
||||||
event.isControl = ((nsMouseEvent*)aEvent)->isControl;
|
event.isControl = ((nsMouseEvent*)aEvent)->isControl;
|
||||||
event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
|
event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
|
||||||
event.isMeta = ((nsMouseEvent*)aEvent)->isMeta;
|
event.isMeta = ((nsMouseEvent*)aEvent)->isMeta;
|
||||||
|
event.internalAppFlags |=
|
||||||
|
aEvent->internalAppFlags & NS_APP_EVENT_FLAG_TRUSTED;
|
||||||
|
|
||||||
mCurrentTargetContent = targetContent;
|
mCurrentTargetContent = targetContent;
|
||||||
mCurrentRelatedContent = lastContent;
|
mCurrentRelatedContent = lastContent;
|
||||||
|
@ -2789,6 +2803,8 @@ nsEventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
|
||||||
event.isControl = ((nsMouseEvent*)aEvent)->isControl;
|
event.isControl = ((nsMouseEvent*)aEvent)->isControl;
|
||||||
event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
|
event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
|
||||||
event.isMeta = ((nsMouseEvent*)aEvent)->isMeta;
|
event.isMeta = ((nsMouseEvent*)aEvent)->isMeta;
|
||||||
|
event.internalAppFlags |=
|
||||||
|
aEvent->internalAppFlags & NS_APP_EVENT_FLAG_TRUSTED;
|
||||||
|
|
||||||
// dispatch to content via DOM
|
// dispatch to content via DOM
|
||||||
nsCOMPtr<nsIContent> lastContent;
|
nsCOMPtr<nsIContent> lastContent;
|
||||||
|
@ -2946,6 +2962,8 @@ nsEventStateManager::CheckForAndDispatchClick(nsPresContext* aPresContext,
|
||||||
event2.isControl = aEvent->isControl;
|
event2.isControl = aEvent->isControl;
|
||||||
event2.isAlt = aEvent->isAlt;
|
event2.isAlt = aEvent->isAlt;
|
||||||
event2.isMeta = aEvent->isMeta;
|
event2.isMeta = aEvent->isMeta;
|
||||||
|
event2.internalAppFlags |=
|
||||||
|
aEvent->internalAppFlags & NS_APP_EVENT_FLAG_TRUSTED;
|
||||||
|
|
||||||
ret = presShell->HandleEventWithTarget(&event2, mCurrentTarget, mouseContent, flags, aStatus);
|
ret = presShell->HandleEventWithTarget(&event2, mCurrentTarget, mouseContent, flags, aStatus);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче