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

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

Issue 2889733002: Set the target lazily for the coalesced events (Closed)
Patch Set: Add missing override Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/events/PointerEvent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/events/PointerEvent.cpp
diff --git a/third_party/WebKit/Source/core/events/PointerEvent.cpp b/third_party/WebKit/Source/core/events/PointerEvent.cpp
index 0659c5019a68069c66a0b50679257837a7093eb2..42d4a76d83d94d1b0350d69ca07bd727f556af22 100644
--- a/third_party/WebKit/Source/core/events/PointerEvent.cpp
+++ b/third_party/WebKit/Source/core/events/PointerEvent.cpp
@@ -21,7 +21,8 @@ PointerEvent::PointerEvent(const AtomicString& type,
tilt_y_(0),
tangential_pressure_(0),
twist_(0),
- is_primary_(false) {
+ is_primary_(false),
+ coalesced_events_targets_dirty_(false) {
if (initializer.hasPointerId())
pointer_id_ = initializer.pointerId();
if (initializer.hasWidth())
@@ -60,7 +61,17 @@ EventDispatchMediator* PointerEvent::CreateMediator() {
return PointerEventDispatchMediator::Create(this);
}
-HeapVector<Member<PointerEvent>> PointerEvent::getCoalescedEvents() const {
+void PointerEvent::ReceivedTarget() {
+ coalesced_events_targets_dirty_ = true;
+ MouseEvent::ReceivedTarget();
+}
+
+HeapVector<Member<PointerEvent>> PointerEvent::getCoalescedEvents() {
+ if (coalesced_events_targets_dirty_) {
+ for (auto coalesced_event : coalesced_events_)
+ coalesced_event->SetTarget(target());
+ coalesced_events_targets_dirty_ = false;
+ }
return coalesced_events_;
}
« no previous file with comments | « third_party/WebKit/Source/core/events/PointerEvent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698