OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/events/PointerEventFactory.h" | 5 #include "core/events/PointerEventFactory.h" |
6 | 6 |
7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
8 #include "platform/geometry/FloatSize.h" | 8 #include "platform/geometry/FloatSize.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 pointerEventInit.setView(view); | 259 pointerEventInit.setView(view); |
260 | 260 |
261 updateMousePointerEventInit(mouseEvent, view, &pointerEventInit); | 261 updateMousePointerEventInit(mouseEvent, view, &pointerEventInit); |
262 | 262 |
263 // Create coalesced events init structure only for pointermove. | 263 // Create coalesced events init structure only for pointermove. |
264 if (pointerEventName == EventTypeNames::pointermove) { | 264 if (pointerEventName == EventTypeNames::pointermove) { |
265 HeapVector<Member<PointerEvent>> coalescedPointerEvents; | 265 HeapVector<Member<PointerEvent>> coalescedPointerEvents; |
266 for (const auto& coalescedMouseEvent : coalescedMouseEvents) { | 266 for (const auto& coalescedMouseEvent : coalescedMouseEvents) { |
267 DCHECK_EQ(mouseEvent.id, coalescedMouseEvent.id); | 267 DCHECK_EQ(mouseEvent.id, coalescedMouseEvent.id); |
268 DCHECK_EQ(mouseEvent.pointerType, coalescedMouseEvent.pointerType); | 268 // TODO(crbug.com/684292): We need further investigation of why the |
| 269 // following DCHECK fails. |
| 270 // DCHECK_EQ(mouseEvent.pointerType, coalescedMouseEvent.pointerType); |
269 PointerEventInit coalescedEventInit = pointerEventInit; | 271 PointerEventInit coalescedEventInit = pointerEventInit; |
270 updateMousePointerEventInit(coalescedMouseEvent, view, | 272 updateMousePointerEventInit(coalescedMouseEvent, view, |
271 &coalescedEventInit); | 273 &coalescedEventInit); |
272 coalescedPointerEvents.push_back( | 274 coalescedPointerEvents.push_back( |
273 PointerEvent::create(pointerEventName, coalescedEventInit)); | 275 PointerEvent::create(pointerEventName, coalescedEventInit)); |
274 } | 276 } |
275 pointerEventInit.setCoalescedEvents(coalescedPointerEvents); | 277 pointerEventInit.setCoalescedEvents(coalescedPointerEvents); |
276 } | 278 } |
277 | 279 |
278 return PointerEvent::create(pointerEventName, pointerEventInit); | 280 return PointerEvent::create(pointerEventName, pointerEventInit); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 const WebPointerProperties& properties) const { | 517 const WebPointerProperties& properties) const { |
516 if (properties.pointerType == WebPointerProperties::PointerType::Mouse) | 518 if (properties.pointerType == WebPointerProperties::PointerType::Mouse) |
517 return PointerEventFactory::s_mouseId; | 519 return PointerEventFactory::s_mouseId; |
518 IncomingId id(properties.pointerType, properties.id); | 520 IncomingId id(properties.pointerType, properties.id); |
519 if (m_pointerIncomingIdMapping.contains(id)) | 521 if (m_pointerIncomingIdMapping.contains(id)) |
520 return m_pointerIncomingIdMapping.get(id); | 522 return m_pointerIncomingIdMapping.get(id); |
521 return PointerEventFactory::s_invalidId; | 523 return PointerEventFactory::s_invalidId; |
522 } | 524 } |
523 | 525 |
524 } // namespace blink | 526 } // namespace blink |
OLD | NEW |