Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Unified Diff: third_party/WebKit/Source/core/events/PointerEventFactory.cpp

Issue 2772443006: Set trusted flag of coalesced events at creation (Closed)
Patch Set: Skip the touch test on Mac Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/events/PointerEventFactory.cpp
diff --git a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
index d38bd6f030f413255ad225d63203a4869da13a4f..ffec4a3fcc0986e7973f09cd5ab4cd6f22cac4c4 100644
--- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
+++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
@@ -279,10 +279,19 @@ PointerEvent* PointerEventFactory::create(
DCHECK_EQ(mouseEvent.pointerType, coalescedMouseEvent.pointerType);
PointerEventInit coalescedEventInit = pointerEventInit;
+ coalescedEventInit.setCancelable(false);
+ coalescedEventInit.setBubbles(false);
updateMousePointerEventInit(coalescedMouseEvent, view,
&coalescedEventInit);
- coalescedPointerEvents.push_back(
- PointerEvent::create(pointerEventName, coalescedEventInit));
+ PointerEvent* event =
+ PointerEvent::create(pointerEventName, coalescedEventInit);
+ // Set the trusted flag for the coalesced events at the creation time
+ // as oppose to the normal events which is done at the dispatch time. This
+ // is because we don't want to go over all the coalesced events at every
+ // dispatch and add the implementation complexity while it has no sensible
+ // usecase at this time.
+ event->setTrusted(true);
+ coalescedPointerEvents.push_back(event);
}
pointerEventInit.setCoalescedEvents(coalescedPointerEvents);
}
@@ -330,10 +339,18 @@ PointerEvent* PointerEventFactory::create(
DCHECK_EQ(touchPoint.id, coalescedTouchPoint.id);
DCHECK_EQ(touchPoint.pointerType, coalescedTouchPoint.pointerType);
PointerEventInit coalescedEventInit = pointerEventInit;
+ coalescedEventInit.setCancelable(false);
+ coalescedEventInit.setBubbles(false);
updateTouchPointerEventInit(coalescedTouchPoint, targetFrame,
&coalescedEventInit);
- coalescedPointerEvents.push_back(
- PointerEvent::create(type, coalescedEventInit));
+ PointerEvent* event = PointerEvent::create(type, coalescedEventInit);
+ // Set the trusted flag for the coalesced events at the creation time
+ // as oppose to the normal events which is done at the dispatch time. This
+ // is because we don't want to go over all the coalesced events at every
+ // dispatch and add the implementation complexity while it has no sensible
+ // usecase at this time.
+ event->setTrusted(true);
+ coalescedPointerEvents.push_back(event);
}
pointerEventInit.setCoalescedEvents(coalescedPointerEvents);
}

Powered by Google App Engine
This is Rietveld 408576698