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 // TODO(crbug.com/684292): We need further investigation of why the | 268 DCHECK_EQ(mouseEvent.pointerType, coalescedMouseEvent.pointerType); |
269 // following DCHECK fails. | |
270 // DCHECK_EQ(mouseEvent.pointerType, coalescedMouseEvent.pointerType); | |
271 PointerEventInit coalescedEventInit = pointerEventInit; | 269 PointerEventInit coalescedEventInit = pointerEventInit; |
272 updateMousePointerEventInit(coalescedMouseEvent, view, | 270 updateMousePointerEventInit(coalescedMouseEvent, view, |
273 &coalescedEventInit); | 271 &coalescedEventInit); |
274 coalescedPointerEvents.push_back( | 272 coalescedPointerEvents.push_back( |
275 PointerEvent::create(pointerEventName, coalescedEventInit)); | 273 PointerEvent::create(pointerEventName, coalescedEventInit)); |
276 } | 274 } |
277 pointerEventInit.setCoalescedEvents(coalescedPointerEvents); | 275 pointerEventInit.setCoalescedEvents(coalescedPointerEvents); |
278 } | 276 } |
279 | 277 |
280 return PointerEvent::create(pointerEventName, pointerEventInit); | 278 return PointerEvent::create(pointerEventName, pointerEventInit); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 const WebPointerProperties& properties) const { | 515 const WebPointerProperties& properties) const { |
518 if (properties.pointerType == WebPointerProperties::PointerType::Mouse) | 516 if (properties.pointerType == WebPointerProperties::PointerType::Mouse) |
519 return PointerEventFactory::s_mouseId; | 517 return PointerEventFactory::s_mouseId; |
520 IncomingId id(properties.pointerType, properties.id); | 518 IncomingId id(properties.pointerType, properties.id); |
521 if (m_pointerIncomingIdMapping.contains(id)) | 519 if (m_pointerIncomingIdMapping.contains(id)) |
522 return m_pointerIncomingIdMapping.get(id); | 520 return m_pointerIncomingIdMapping.get(id); |
523 return PointerEventFactory::s_invalidId; | 521 return PointerEventFactory::s_invalidId; |
524 } | 522 } |
525 | 523 |
526 } // namespace blink | 524 } // namespace blink |
OLD | NEW |