Bug 1315862 Part1: Stop dispatching pointer events in the system group. r=masayuki,smaug

MozReview-Commit-ID: 8Xqp3bxlRFt

--HG--
extra : rebase_source : 25afbefb19e5ae613e9e493ea2f275a36004d523
This commit is contained in:
Stone Shih 2016-11-11 18:02:37 +08:00
Родитель e8a2815ded
Коммит 5d6aec8c60
3 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -407,7 +407,8 @@ EventTargetChainItem::HandleEventTargetChain(
}
aVisitor.mEvent->mFlags.mInBubblingPhase = false;
if (!aVisitor.mEvent->mFlags.mInSystemGroup) {
if (!aVisitor.mEvent->mFlags.mInSystemGroup &&
aVisitor.mEvent->IsAllowedToDispatchInSystemGroup()) {
// Dispatch to the system event group. Make sure to clear the
// STOP_DISPATCH flag since this resets for each event group.
aVisitor.mEvent->mFlags.mPropagationStopped = false;

Просмотреть файл

@ -553,6 +553,10 @@ public:
* Whether the event should cause a DOM event.
*/
bool IsAllowedToDispatchDOMEvent() const;
/**
* Whether the event should be dispatched in system group.
*/
bool IsAllowedToDispatchInSystemGroup() const;
/**
* Initialize mComposed
*/

Просмотреть файл

@ -416,6 +416,15 @@ WidgetEvent::IsAllowedToDispatchDOMEvent() const
}
}
bool
WidgetEvent::IsAllowedToDispatchInSystemGroup() const
{
// We don't expect to implement default behaviors with pointer events because
// if we do, prevent default on mouse events can't prevent default behaviors
// anymore.
return mClass != ePointerEventClass;
}
/******************************************************************************
* mozilla::WidgetInputEvent
******************************************************************************/