void EventPath::adjustForTouchEvent(TouchEvent& touchEvent) { WillBeHeapVector<RawPtrWillBeMember<TouchList>> adjustedTouches; WillBeHeapVector<RawPtrWillBeMember<TouchList>> adjustedTargetTouches; WillBeHeapVector<RawPtrWillBeMember<TouchList>> adjustedChangedTouches; WillBeHeapVector<RawPtrWillBeMember<TreeScope>> treeScopes; for (const auto& treeScopeEventContext : m_treeScopeEventContexts) { TouchEventContext* touchEventContext = treeScopeEventContext->ensureTouchEventContext(); adjustedTouches.append(&touchEventContext->touches()); adjustedTargetTouches.append(&touchEventContext->targetTouches()); adjustedChangedTouches.append(&touchEventContext->changedTouches()); treeScopes.append(&treeScopeEventContext->treeScope()); } adjustTouchList(touchEvent.touches(), adjustedTouches, treeScopes); adjustTouchList(touchEvent.targetTouches(), adjustedTargetTouches, treeScopes); adjustTouchList(touchEvent.changedTouches(), adjustedChangedTouches, treeScopes); #if ENABLE(ASSERT) for (const auto& treeScopeEventContext : m_treeScopeEventContexts) { TreeScope& treeScope = treeScopeEventContext->treeScope(); TouchEventContext* touchEventContext = treeScopeEventContext->touchEventContext(); checkReachability(treeScope, touchEventContext->touches()); checkReachability(treeScope, touchEventContext->targetTouches()); checkReachability(treeScope, touchEventContext->changedTouches()); } #endif }
void EventPath::adjustForTouchEvent(Node* node, TouchEvent& touchEvent) { WillBeHeapVector<RawPtrWillBeMember<TouchList> > adjustedTouches; WillBeHeapVector<RawPtrWillBeMember<TouchList> > adjustedTargetTouches; WillBeHeapVector<RawPtrWillBeMember<TouchList> > adjustedChangedTouches; Vector<TreeScope*> treeScopes; for (size_t i = 0; i < m_treeScopeEventContexts.size(); ++i) { TouchEventContext* touchEventContext = m_treeScopeEventContexts[i]->ensureTouchEventContext(); adjustedTouches.append(&touchEventContext->touches()); adjustedTargetTouches.append(&touchEventContext->targetTouches()); adjustedChangedTouches.append(&touchEventContext->changedTouches()); treeScopes.append(&m_treeScopeEventContexts[i]->treeScope()); } adjustTouchList(node, touchEvent.touches(), adjustedTouches, treeScopes); adjustTouchList(node, touchEvent.targetTouches(), adjustedTargetTouches, treeScopes); adjustTouchList(node, touchEvent.changedTouches(), adjustedChangedTouches, treeScopes); #ifndef NDEBUG for (size_t i = 0; i < m_treeScopeEventContexts.size(); ++i) { TreeScope& treeScope = m_treeScopeEventContexts[i]->treeScope(); TouchEventContext* touchEventContext = m_treeScopeEventContexts[i]->touchEventContext(); checkReachability(treeScope, touchEventContext->touches()); checkReachability(treeScope, touchEventContext->targetTouches()); checkReachability(treeScope, touchEventContext->changedTouches()); } #endif }
void EventRetargeter::adjustForTouchEvent(Node* node, const TouchEvent& touchEvent, EventPath& eventPath) { size_t eventPathSize = eventPath.size(); EventPathTouchLists eventPathTouches(eventPathSize); EventPathTouchLists eventPathTargetTouches(eventPathSize); EventPathTouchLists eventPathChangedTouches(eventPathSize); for (size_t i = 0; i < eventPathSize; ++i) { ASSERT(eventPath[i]->isTouchEventContext()); TouchEventContext* touchEventContext = toTouchEventContext(eventPath[i].get()); eventPathTouches[i] = touchEventContext->touches(); eventPathTargetTouches[i] = touchEventContext->targetTouches(); eventPathChangedTouches[i] = touchEventContext->changedTouches(); } adjustTouchList(node, touchEvent.touches(), eventPath, eventPathTouches); adjustTouchList(node, touchEvent.targetTouches(), eventPath, eventPathTargetTouches); adjustTouchList(node, touchEvent.changedTouches(), eventPath, eventPathChangedTouches); }
void EventRetargeter::adjustForTouchEvent(Node* node, TouchEvent& touchEvent) { EventPath& eventPath = touchEvent.eventPath(); size_t eventPathSize = eventPath.size(); EventPathTouchLists eventPathTouches(eventPathSize); EventPathTouchLists eventPathTargetTouches(eventPathSize); EventPathTouchLists eventPathChangedTouches(eventPathSize); for (size_t i = 0; i < eventPathSize; ++i) { ASSERT(eventPath[i].isTouchEventContext()); TouchEventContext& touchEventContext = toTouchEventContext(eventPath[i]); eventPathTouches[i] = touchEventContext.touches(); eventPathTargetTouches[i] = touchEventContext.targetTouches(); eventPathChangedTouches[i] = touchEventContext.changedTouches(); } adjustTouchList(node, touchEvent.touches(), eventPath, eventPathTouches); adjustTouchList(node, touchEvent.targetTouches(), eventPath, eventPathTargetTouches); adjustTouchList(node, touchEvent.changedTouches(), eventPath, eventPathChangedTouches); }