* 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)
| 2696 | * "entered" or "left" that element. |
| 2697 | */ |
| 2698 | function traverseEnterLeave(from, to, fn, argFrom, argTo) { |
| 2699 | var common = from && to ? getLowestCommonAncestor(from, to) : null; |
| 2700 | var pathFrom = []; |
| 2701 | while (true) { |
| 2702 | if (!from) { |
| 2703 | break; |
| 2704 | } |
| 2705 | if (from === common) { |
| 2706 | break; |
| 2707 | } |
| 2708 | var alternate = from.alternate; |
| 2709 | if (alternate !== null && alternate === common) { |
| 2710 | break; |
| 2711 | } |
| 2712 | pathFrom.push(from); |
| 2713 | from = getParent(from); |
| 2714 | } |
| 2715 | var pathTo = []; |
| 2716 | while (true) { |
| 2717 | if (!to) { |
| 2718 | break; |
| 2719 | } |
| 2720 | if (to === common) { |
| 2721 | break; |
| 2722 | } |
| 2723 | var _alternate = to.alternate; |
| 2724 | if (_alternate !== null && _alternate === common) { |
| 2725 | break; |
| 2726 | } |
| 2727 | pathTo.push(to); |
| 2728 | to = getParent(to); |
| 2729 | } |
| 2730 | for (var i = 0; i < pathFrom.length; i++) { |
| 2731 | fn(pathFrom[i], 'bubbled', argFrom); |
| 2732 | } |
| 2733 | for (var _i = pathTo.length; _i-- > 0;) { |
| 2734 | fn(pathTo[_i], 'captured', argTo); |
| 2735 | } |
| 2736 | } |
| 2737 | |
| 2738 | /** |
| 2739 | * Some event types have a notion of different registration names for different |
no test coverage detected