* Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that * should would receive a `mouseEnter` or `mouseLeave` event. * * Does not invoke the callback on the nearest common ancestor because nothing * "entered" or "left" that element.
(from, to, fn, argFrom, argTo)
| 2597 | * "entered" or "left" that element. |
| 2598 | */ |
| 2599 | function traverseEnterLeave(from, to, fn, argFrom, argTo) { |
| 2600 | var common = from && to ? getLowestCommonAncestor(from, to) : null; |
| 2601 | var pathFrom = []; |
| 2602 | while (true) { |
| 2603 | if (!from) { |
| 2604 | break; |
| 2605 | } |
| 2606 | if (from === common) { |
| 2607 | break; |
| 2608 | } |
| 2609 | var alternate = from.alternate; |
| 2610 | if (alternate !== null && alternate === common) { |
| 2611 | break; |
| 2612 | } |
| 2613 | pathFrom.push(from); |
| 2614 | from = getParent(from); |
| 2615 | } |
| 2616 | var pathTo = []; |
| 2617 | while (true) { |
| 2618 | if (!to) { |
| 2619 | break; |
| 2620 | } |
| 2621 | if (to === common) { |
| 2622 | break; |
| 2623 | } |
| 2624 | var _alternate = to.alternate; |
| 2625 | if (_alternate !== null && _alternate === common) { |
| 2626 | break; |
| 2627 | } |
| 2628 | pathTo.push(to); |
| 2629 | to = getParent(to); |
| 2630 | } |
| 2631 | for (var i = 0; i < pathFrom.length; i++) { |
| 2632 | fn(pathFrom[i], 'bubbled', argFrom); |
| 2633 | } |
| 2634 | for (var _i = pathTo.length; _i-- > 0;) { |
| 2635 | fn(pathTo[_i], 'captured', argTo); |
| 2636 | } |
| 2637 | } |
| 2638 | |
| 2639 | /** |
| 2640 | * Some event types have a notion of different registration names for different |
no test coverage detected