* Helper to find the previous element that is a fragment * anchor. This is necessary because a destroyed frag's * element could still be lingering in the DOM before its * leaving transition finishes, but its inserted flag * should have been set to false so we can skip them. * * If
(frag, anchor, id)
| 4530 | */ |
| 4531 | |
| 4532 | function findPrevFrag(frag, anchor, id) { |
| 4533 | var el = frag.node.previousSibling; |
| 4534 | /* istanbul ignore if */ |
| 4535 | if (!el) return; |
| 4536 | frag = el.__v_frag; |
| 4537 | while ((!frag || frag.forId !== id || !frag.inserted) && el !== anchor) { |
| 4538 | el = el.previousSibling; |
| 4539 | /* istanbul ignore if */ |
| 4540 | if (!el) return; |
| 4541 | frag = el.__v_frag; |
| 4542 | } |
| 4543 | return frag; |
| 4544 | } |
| 4545 | |
| 4546 | /** |
| 4547 | * Find a vm from a fragment. |