| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 adjustedTouches.append(&touchEventContext->touches()); | 306 adjustedTouches.append(&touchEventContext->touches()); |
| 307 adjustedTargetTouches.append(&touchEventContext->targetTouches()); | 307 adjustedTargetTouches.append(&touchEventContext->targetTouches()); |
| 308 adjustedChangedTouches.append(&touchEventContext->changedTouches()); | 308 adjustedChangedTouches.append(&touchEventContext->changedTouches()); |
| 309 treeScopes.append(&m_treeScopeEventContexts[i]->treeScope()); | 309 treeScopes.append(&m_treeScopeEventContexts[i]->treeScope()); |
| 310 } | 310 } |
| 311 | 311 |
| 312 adjustTouchList(node, touchEvent.touches(), adjustedTouches, treeScopes); | 312 adjustTouchList(node, touchEvent.touches(), adjustedTouches, treeScopes); |
| 313 adjustTouchList(node, touchEvent.targetTouches(), adjustedTargetTouches, tre
eScopes); | 313 adjustTouchList(node, touchEvent.targetTouches(), adjustedTargetTouches, tre
eScopes); |
| 314 adjustTouchList(node, touchEvent.changedTouches(), adjustedChangedTouches, t
reeScopes); | 314 adjustTouchList(node, touchEvent.changedTouches(), adjustedChangedTouches, t
reeScopes); |
| 315 | 315 |
| 316 #ifndef NDEBUG | 316 #if ENABLE(ASSERT) |
| 317 for (size_t i = 0; i < m_treeScopeEventContexts.size(); ++i) { | 317 for (size_t i = 0; i < m_treeScopeEventContexts.size(); ++i) { |
| 318 TreeScope& treeScope = m_treeScopeEventContexts[i]->treeScope(); | 318 TreeScope& treeScope = m_treeScopeEventContexts[i]->treeScope(); |
| 319 TouchEventContext* touchEventContext = m_treeScopeEventContexts[i]->touc
hEventContext(); | 319 TouchEventContext* touchEventContext = m_treeScopeEventContexts[i]->touc
hEventContext(); |
| 320 checkReachability(treeScope, touchEventContext->touches()); | 320 checkReachability(treeScope, touchEventContext->touches()); |
| 321 checkReachability(treeScope, touchEventContext->targetTouches()); | 321 checkReachability(treeScope, touchEventContext->targetTouches()); |
| 322 checkReachability(treeScope, touchEventContext->changedTouches()); | 322 checkReachability(treeScope, touchEventContext->changedTouches()); |
| 323 } | 323 } |
| 324 #endif | 324 #endif |
| 325 } | 325 } |
| 326 | 326 |
| 327 void EventPath::adjustTouchList(const Node* node, const TouchList* touchList, Wi
llBeHeapVector<RawPtrWillBeMember<TouchList> > adjustedTouchList, const WillBeHe
apVector<RawPtrWillBeMember<TreeScope> >& treeScopes) | 327 void EventPath::adjustTouchList(const Node* node, const TouchList* touchList, Wi
llBeHeapVector<RawPtrWillBeMember<TouchList> > adjustedTouchList, const WillBeHe
apVector<RawPtrWillBeMember<TreeScope> >& treeScopes) |
| 328 { | 328 { |
| 329 if (!touchList) | 329 if (!touchList) |
| 330 return; | 330 return; |
| 331 for (size_t i = 0; i < touchList->length(); ++i) { | 331 for (size_t i = 0; i < touchList->length(); ++i) { |
| 332 const Touch& touch = *touchList->item(i); | 332 const Touch& touch = *touchList->item(i); |
| 333 RelatedTargetMap relatedNodeMap; | 333 RelatedTargetMap relatedNodeMap; |
| 334 buildRelatedNodeMap(touch.target()->toNode(), relatedNodeMap); | 334 buildRelatedNodeMap(touch.target()->toNode(), relatedNodeMap); |
| 335 for (size_t j = 0; j < treeScopes.size(); ++j) { | 335 for (size_t j = 0; j < treeScopes.size(); ++j) { |
| 336 adjustedTouchList[j]->append(touch.cloneWithNewTarget(findRelatedNod
e(treeScopes[j], relatedNodeMap))); | 336 adjustedTouchList[j]->append(touch.cloneWithNewTarget(findRelatedNod
e(treeScopes[j], relatedNodeMap))); |
| 337 } | 337 } |
| 338 } | 338 } |
| 339 } | 339 } |
| 340 | 340 |
| 341 #ifndef NDEBUG | 341 #if ENABLE(ASSERT) |
| 342 void EventPath::checkReachability(TreeScope& treeScope, TouchList& touchList) | 342 void EventPath::checkReachability(TreeScope& treeScope, TouchList& touchList) |
| 343 { | 343 { |
| 344 for (size_t i = 0; i < touchList.length(); ++i) | 344 for (size_t i = 0; i < touchList.length(); ++i) |
| 345 ASSERT(touchList.item(i)->target()->toNode()->treeScope().isInclusiveOld
erSiblingShadowRootOrAncestorTreeScopeOf(treeScope)); | 345 ASSERT(touchList.item(i)->target()->toNode()->treeScope().isInclusiveOld
erSiblingShadowRootOrAncestorTreeScopeOf(treeScope)); |
| 346 } | 346 } |
| 347 #endif | 347 #endif |
| 348 | 348 |
| 349 void EventPath::trace(Visitor* visitor) | 349 void EventPath::trace(Visitor* visitor) |
| 350 { | 350 { |
| 351 visitor->trace(m_nodeEventContexts); | 351 visitor->trace(m_nodeEventContexts); |
| 352 visitor->trace(m_node); | 352 visitor->trace(m_node); |
| 353 visitor->trace(m_event); | 353 visitor->trace(m_event); |
| 354 visitor->trace(m_treeScopeEventContexts); | 354 visitor->trace(m_treeScopeEventContexts); |
| 355 } | 355 } |
| 356 | 356 |
| 357 } // namespace | 357 } // namespace |
| OLD | NEW |