Chromium Code Reviews| 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 7900cf790b6d9a49dd6c4abc76f3439811ce9514..8271c17c3c1e74b2c7c68bce0f96489f14e1e84c 100644 |
| --- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp |
| +++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp |
| @@ -219,8 +219,6 @@ PointerEvent* PointerEventFactory::create( |
| AtomicString pointerEventName = |
| pointerEventNameForMouseEventName(mouseEventName); |
| - DCHECK(pointerEventName == EventTypeNames::pointermove || |
| - coalescedMouseEvents.isEmpty()); |
| unsigned buttons = |
| MouseEvent::platformModifiersToButtons(mouseEvent.getModifiers()); |
| @@ -259,19 +257,22 @@ PointerEvent* PointerEventFactory::create( |
| updateMousePointerEventInit(mouseEvent, view, &pointerEventInit); |
| - // Created coalesced events init structure |
| - HeapVector<Member<PointerEvent>> coalescedPointerEvents; |
| - for (const auto& coalescedMouseEvent : coalescedMouseEvents) { |
| - DCHECK_EQ(mouseEvent.pointerProperties().id, |
| - coalescedMouseEvent.pointerProperties().id); |
| - DCHECK_EQ(mouseEvent.pointerProperties().pointerType, |
| - coalescedMouseEvent.pointerProperties().pointerType); |
| - PointerEventInit coalescedEventInit = pointerEventInit; |
| - updateMousePointerEventInit(coalescedMouseEvent, view, &coalescedEventInit); |
| - coalescedPointerEvents.push_back( |
| - PointerEvent::create(pointerEventName, coalescedEventInit)); |
| + // Create coalesced events init structure only for pointermove. |
| + if (pointerEventName == EventTypeNames::pointermove) { |
| + HeapVector<Member<PointerEvent>> coalescedPointerEvents; |
| + for (const auto& coalescedMouseEvent : coalescedMouseEvents) { |
| + DCHECK_EQ(mouseEvent.pointerProperties().id, |
| + coalescedMouseEvent.pointerProperties().id); |
| + DCHECK_EQ(mouseEvent.pointerProperties().pointerType, |
|
foolip
2017/01/24 04:56:26
Filed https://bugs.chromium.org/p/chromium/issues/
|
| + coalescedMouseEvent.pointerProperties().pointerType); |
| + PointerEventInit coalescedEventInit = pointerEventInit; |
| + updateMousePointerEventInit(coalescedMouseEvent, view, |
| + &coalescedEventInit); |
| + coalescedPointerEvents.push_back( |
| + PointerEvent::create(pointerEventName, coalescedEventInit)); |
| + } |
| + pointerEventInit.setCoalescedEvents(coalescedPointerEvents); |
| } |
| - pointerEventInit.setCoalescedEvents(coalescedPointerEvents); |
| return PointerEvent::create(pointerEventName, pointerEventInit); |
| } |
| @@ -286,8 +287,6 @@ PointerEvent* PointerEventFactory::create( |
| const AtomicString& type = |
| pointerEventNameForTouchPointState(touchPoint.state()); |
| - DCHECK(type == EventTypeNames::pointermove || coalescedPoints.isEmpty()); |
| - |
| bool pointerReleasedOrCancelled = |
| pointState == PlatformTouchPoint::TouchReleased || |
| pointState == PlatformTouchPoint::TouchCancelled; |
| @@ -310,21 +309,22 @@ PointerEvent* PointerEventFactory::create( |
| setEventSpecificFields(pointerEventInit, type); |
| - // Created coalesced events init structure |
| - HeapVector<Member<PointerEvent>> coalescedPointerEvents; |
| - for (const auto& coalescedTouchPoint : coalescedPoints) { |
| - DCHECK_EQ(touchPoint.state(), coalescedTouchPoint.state()); |
| - DCHECK_EQ(touchPoint.pointerProperties().id, |
| - coalescedTouchPoint.pointerProperties().id); |
| - DCHECK_EQ(touchPoint.pointerProperties().pointerType, |
| - coalescedTouchPoint.pointerProperties().pointerType); |
| - PointerEventInit coalescedEventInit = pointerEventInit; |
| - updateTouchPointerEventInit(coalescedTouchPoint, targetFrame, |
| - &coalescedEventInit); |
| - coalescedPointerEvents.push_back( |
| - PointerEvent::create(type, coalescedEventInit)); |
| + if (type == EventTypeNames::pointermove) { |
| + HeapVector<Member<PointerEvent>> coalescedPointerEvents; |
| + for (const auto& coalescedTouchPoint : coalescedPoints) { |
| + DCHECK_EQ(touchPoint.state(), coalescedTouchPoint.state()); |
| + DCHECK_EQ(touchPoint.pointerProperties().id, |
| + coalescedTouchPoint.pointerProperties().id); |
| + DCHECK_EQ(touchPoint.pointerProperties().pointerType, |
| + coalescedTouchPoint.pointerProperties().pointerType); |
| + PointerEventInit coalescedEventInit = pointerEventInit; |
| + updateTouchPointerEventInit(coalescedTouchPoint, targetFrame, |
| + &coalescedEventInit); |
| + coalescedPointerEvents.push_back( |
| + PointerEvent::create(type, coalescedEventInit)); |
| + } |
| + pointerEventInit.setCoalescedEvents(coalescedPointerEvents); |
| } |
| - pointerEventInit.setCoalescedEvents(coalescedPointerEvents); |
| return PointerEvent::create(type, pointerEventInit); |
| } |