* Regular creation mode: an anchor is created and * assigned to the `lContainer[NATIVE]` slot.
( lContainer: LContainer, hostLView: LView, hostTNode: TNode, slotValue: any, )
| 720 | * assigned to the `lContainer[NATIVE]` slot. |
| 721 | */ |
| 722 | function createAnchorNode( |
| 723 | lContainer: LContainer, |
| 724 | hostLView: LView, |
| 725 | hostTNode: TNode, |
| 726 | slotValue: any, |
| 727 | ) { |
| 728 | // We already have a native element (anchor) set, return. |
| 729 | if (lContainer[NATIVE]) return; |
| 730 | |
| 731 | let commentNode: RComment; |
| 732 | // If the host is an element container, the native host element is guaranteed to be a |
| 733 | // comment and we can reuse that comment as anchor element for the new LContainer. |
| 734 | // The comment node in question is already part of the DOM structure so we don't need to append |
| 735 | // it again. |
| 736 | if (hostTNode.type & TNodeType.ElementContainer) { |
| 737 | commentNode = unwrapRNode(slotValue) as RComment; |
| 738 | } else { |
| 739 | commentNode = insertAnchorNode(hostLView, hostTNode); |
| 740 | } |
| 741 | lContainer[NATIVE] = commentNode; |
| 742 | } |
| 743 | |
| 744 | /** |
| 745 | * Hydration logic that looks up all dehydrated views in this container |
no test coverage detected
searching dependent graphs…