Bug 930843 part.2 NS_UI_ACTIVATE event should be trusted event even if it's caused by an untrusted event r=smaug

This commit is contained in:
Masayuki Nakano
2015-08-22 13:02:39 +09:00
parent 084590ae89
commit fd48b69d14
5 changed files with 36 additions and 14 deletions

View File

@@ -3629,10 +3629,9 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (mouseEvent && mouseEvent->IsLeftClickEvent() &&
!ShouldPreventDOMActivateDispatch(aVisitor.mEvent->originalTarget)) {
// XXX Activating actually occurs even if it's caused by untrusted event.
// Therefore, shouldn't this be always trusted event?
InternalUIEvent actEvent(aVisitor.mEvent->mFlags.mIsTrusted,
NS_UI_ACTIVATE);
// DOMActive event should be trusted since the activation is actually
// occurred even if the cause is an untrusted click event.
InternalUIEvent actEvent(true, NS_UI_ACTIVATE, mouseEvent);
actEvent.detail = 1;
nsCOMPtr<nsIPresShell> shell = aVisitor.mPresContext->GetPresShell();