| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 pointerEventInit.setView(view); | 262 pointerEventInit.setView(view); |
| 263 | 263 |
| 264 updateMousePointerEventInit(mouseEvent, view, &pointerEventInit); | 264 updateMousePointerEventInit(mouseEvent, view, &pointerEventInit); |
| 265 | 265 |
| 266 // Create coalesced events init structure only for pointermove. | 266 // Create coalesced events init structure only for pointermove. |
| 267 if (pointerEventName == EventTypeNames::pointermove) { | 267 if (pointerEventName == EventTypeNames::pointermove) { |
| 268 HeapVector<Member<PointerEvent>> coalescedPointerEvents; | 268 HeapVector<Member<PointerEvent>> coalescedPointerEvents; |
| 269 for (const auto& coalescedMouseEvent : coalescedMouseEvents) { | 269 for (const auto& coalescedMouseEvent : coalescedMouseEvents) { |
| 270 DCHECK_EQ(mouseEvent.pointerProperties().id, | 270 DCHECK_EQ(mouseEvent.pointerProperties().id, |
| 271 coalescedMouseEvent.pointerProperties().id); | 271 coalescedMouseEvent.pointerProperties().id); |
| 272 DCHECK_EQ(mouseEvent.pointerProperties().pointerType, | 272 // TODO(crbug.com/684292): We need further investigation of why the |
| 273 coalescedMouseEvent.pointerProperties().pointerType); | 273 // following DCHECK fails. |
| 274 // DCHECK_EQ(mouseEvent.pointerProperties().pointerType, |
| 275 // coalescedMouseEvent.pointerProperties().pointerType); |
| 274 PointerEventInit coalescedEventInit = pointerEventInit; | 276 PointerEventInit coalescedEventInit = pointerEventInit; |
| 275 updateMousePointerEventInit(coalescedMouseEvent, view, | 277 updateMousePointerEventInit(coalescedMouseEvent, view, |
| 276 &coalescedEventInit); | 278 &coalescedEventInit); |
| 277 coalescedPointerEvents.push_back( | 279 coalescedPointerEvents.push_back( |
| 278 PointerEvent::create(pointerEventName, coalescedEventInit)); | 280 PointerEvent::create(pointerEventName, coalescedEventInit)); |
| 279 } | 281 } |
| 280 pointerEventInit.setCoalescedEvents(coalescedPointerEvents); | 282 pointerEventInit.setCoalescedEvents(coalescedPointerEvents); |
| 281 } | 283 } |
| 282 | 284 |
| 283 return PointerEvent::create(pointerEventName, pointerEventInit); | 285 return PointerEvent::create(pointerEventName, pointerEventInit); |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 const WebPointerProperties& properties) const { | 523 const WebPointerProperties& properties) const { |
| 522 if (properties.pointerType == WebPointerProperties::PointerType::Mouse) | 524 if (properties.pointerType == WebPointerProperties::PointerType::Mouse) |
| 523 return PointerEventFactory::s_mouseId; | 525 return PointerEventFactory::s_mouseId; |
| 524 IncomingId id(properties.pointerType, properties.id); | 526 IncomingId id(properties.pointerType, properties.id); |
| 525 if (m_pointerIncomingIdMapping.contains(id)) | 527 if (m_pointerIncomingIdMapping.contains(id)) |
| 526 return m_pointerIncomingIdMapping.get(id); | 528 return m_pointerIncomingIdMapping.get(id); |
| 527 return PointerEventFactory::s_invalidId; | 529 return PointerEventFactory::s_invalidId; |
| 528 } | 530 } |
| 529 | 531 |
| 530 } // namespace blink | 532 } // namespace blink |
| OLD | NEW |