| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 , m_mousePositionIsUnknown(true) | 268 , m_mousePositionIsUnknown(true) |
| 269 , m_mouseDownTimestamp(0) | 269 , m_mouseDownTimestamp(0) |
| 270 , m_touchPressed(false) | 270 , m_touchPressed(false) |
| 271 , m_inPointerCanceledState(false) | 271 , m_inPointerCanceledState(false) |
| 272 , m_scrollGestureHandlingNode(nullptr) | 272 , m_scrollGestureHandlingNode(nullptr) |
| 273 , m_lastGestureScrollOverWidget(false) | 273 , m_lastGestureScrollOverWidget(false) |
| 274 , m_longTapShouldInvokeContextMenu(false) | 274 , m_longTapShouldInvokeContextMenu(false) |
| 275 , m_activeIntervalTimer(this, &EventHandler::activeIntervalTimerFired) | 275 , m_activeIntervalTimer(this, &EventHandler::activeIntervalTimerFired) |
| 276 , m_lastShowPressTimestamp(0) | 276 , m_lastShowPressTimestamp(0) |
| 277 , m_deltaConsumedForScrollSequence(false) | 277 , m_deltaConsumedForScrollSequence(false) |
| 278 , m_waitingForFirstTouchMove(false) |
| 278 { | 279 { |
| 279 } | 280 } |
| 280 | 281 |
| 281 EventHandler::~EventHandler() | 282 EventHandler::~EventHandler() |
| 282 { | 283 { |
| 283 ASSERT(!m_fakeMouseMoveEventTimer.isActive()); | 284 ASSERT(!m_fakeMouseMoveEventTimer.isActive()); |
| 284 } | 285 } |
| 285 | 286 |
| 286 DEFINE_TRACE(EventHandler) | 287 DEFINE_TRACE(EventHandler) |
| 287 { | 288 { |
| (...skipping 3359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3647 using EventTargetSet = HeapHashSet<Member<EventTarget>>; | 3648 using EventTargetSet = HeapHashSet<Member<EventTarget>>; |
| 3648 // Set of targets involved in m_touches. | 3649 // Set of targets involved in m_touches. |
| 3649 EventTargetSet m_targets; | 3650 EventTargetSet m_targets; |
| 3650 }; | 3651 }; |
| 3651 | 3652 |
| 3652 } // namespace | 3653 } // namespace |
| 3653 | 3654 |
| 3654 WebInputEventResult EventHandler::dispatchTouchEvents(const PlatformTouchEvent&
event, | 3655 WebInputEventResult EventHandler::dispatchTouchEvents(const PlatformTouchEvent&
event, |
| 3655 HeapVector<TouchInfo>& touchInfos, bool freshTouchEvents, bool allTouchRelea
sed) | 3656 HeapVector<TouchInfo>& touchInfos, bool freshTouchEvents, bool allTouchRelea
sed) |
| 3656 { | 3657 { |
| 3658 bool firstTouchMoveAfterTouchStart = false; |
| 3659 if (event.type() == PlatformEvent::TouchStart) { |
| 3660 m_waitingForFirstTouchMove = true; |
| 3661 } else if (event.type() == PlatformEvent::TouchMove) { |
| 3662 firstTouchMoveAfterTouchStart = m_waitingForFirstTouchMove; |
| 3663 m_waitingForFirstTouchMove = false; |
| 3664 } |
| 3665 |
| 3657 // Build up the lists to use for the 'touches', 'targetTouches' and | 3666 // Build up the lists to use for the 'touches', 'targetTouches' and |
| 3658 // 'changedTouches' attributes in the JS event. See | 3667 // 'changedTouches' attributes in the JS event. See |
| 3659 // http://www.w3.org/TR/touch-events/#touchevent-interface for how these | 3668 // http://www.w3.org/TR/touch-events/#touchevent-interface for how these |
| 3660 // lists fit together. | 3669 // lists fit together. |
| 3661 | 3670 |
| 3662 // Holds the complete set of touches on the screen. | 3671 // Holds the complete set of touches on the screen. |
| 3663 RawPtr<TouchList> touches = TouchList::create(); | 3672 RawPtr<TouchList> touches = TouchList::create(); |
| 3664 | 3673 |
| 3665 // A different view on the 'touches' list above, filtered and grouped by | 3674 // A different view on the 'touches' list above, filtered and grouped by |
| 3666 // event target. Used for the 'targetTouches' list in the JS event. | 3675 // event target. Used for the 'targetTouches' list in the JS event. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3731 for (unsigned state = 0; state != PlatformTouchPoint::TouchStateEnd; ++state
) { | 3740 for (unsigned state = 0; state != PlatformTouchPoint::TouchStateEnd; ++state
) { |
| 3732 if (!changedTouches[state].m_touches) | 3741 if (!changedTouches[state].m_touches) |
| 3733 continue; | 3742 continue; |
| 3734 | 3743 |
| 3735 const AtomicString& eventName(touchEventNameForTouchPointState(static_ca
st<PlatformTouchPoint::TouchState>(state))); | 3744 const AtomicString& eventName(touchEventNameForTouchPointState(static_ca
st<PlatformTouchPoint::TouchState>(state))); |
| 3736 for (const auto& eventTarget : changedTouches[state].m_targets) { | 3745 for (const auto& eventTarget : changedTouches[state].m_targets) { |
| 3737 EventTarget* touchEventTarget = eventTarget.get(); | 3746 EventTarget* touchEventTarget = eventTarget.get(); |
| 3738 RawPtr<TouchEvent> touchEvent = TouchEvent::create( | 3747 RawPtr<TouchEvent> touchEvent = TouchEvent::create( |
| 3739 touches.get(), touchesByTarget.get(touchEventTarget), changedTou
ches[state].m_touches.get(), | 3748 touches.get(), touchesByTarget.get(touchEventTarget), changedTou
ches[state].m_touches.get(), |
| 3740 eventName, touchEventTarget->toNode()->document().domWindow(), | 3749 eventName, touchEventTarget->toNode()->document().domWindow(), |
| 3741 event.getModifiers(), event.cancelable(), event.causesScrollingI
fUncanceled(), event.timestamp()); | 3750 event.getModifiers(), event.cancelable(), event.causesScrollingI
fUncanceled(), firstTouchMoveAfterTouchStart, event.timestamp()); |
| 3742 | 3751 |
| 3743 eventResult = mergeEventResult(eventResult, toWebInputEventResult(to
uchEventTarget->dispatchEvent(touchEvent.get()))); | 3752 eventResult = mergeEventResult(eventResult, toWebInputEventResult(to
uchEventTarget->dispatchEvent(touchEvent.get()))); |
| 3744 } | 3753 } |
| 3745 } | 3754 } |
| 3746 | 3755 |
| 3747 return eventResult; | 3756 return eventResult; |
| 3748 } | 3757 } |
| 3749 | 3758 |
| 3750 WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve
nt) | 3759 WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve
nt) |
| 3751 { | 3760 { |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4006 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() | 4015 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() |
| 4007 { | 4016 { |
| 4008 #if OS(MACOSX) | 4017 #if OS(MACOSX) |
| 4009 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); | 4018 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); |
| 4010 #else | 4019 #else |
| 4011 return PlatformEvent::AltKey; | 4020 return PlatformEvent::AltKey; |
| 4012 #endif | 4021 #endif |
| 4013 } | 4022 } |
| 4014 | 4023 |
| 4015 } // namespace blink | 4024 } // namespace blink |
| OLD | NEW |