* Regular creation mode: an anchor is created and * assigned to the `lContainer[NATIVE]` slot.
( lContainer: LContainer, hostLView: LView, hostTNode: TNode, slotValue: any, )
| 766 | * assigned to the `lContainer[NATIVE]` slot. |
| 767 | */ |
| 768 | function createAnchorNode( |
| 769 | lContainer: LContainer, |
| 770 | hostLView: LView, |
| 771 | hostTNode: TNode, |
| 772 | slotValue: any, |
| 773 | ) { |
| 774 | // We already have a native element (anchor) set, return. |
| 775 | if (lContainer[NATIVE]) return; |
| 776 | |
| 777 | let commentNode: RComment; |
| 778 | // If the host is an element container, the native host element is guaranteed to be a |
| 779 | // comment and we can reuse that comment as anchor element for the new LContainer. |
| 780 | // The comment node in question is already part of the DOM structure so we don't need to append |
| 781 | // it again. |
| 782 | if (hostTNode.type & TNodeType.ElementContainer) { |
| 783 | commentNode = unwrapRNode(slotValue) as RComment; |
| 784 | } else { |
| 785 | commentNode = insertAnchorNode(hostLView, hostTNode); |
| 786 | } |
| 787 | lContainer[NATIVE] = commentNode; |
| 788 | } |
| 789 | |
| 790 | /** |
| 791 | * Hydration logic that looks up all dehydrated views in this container |
no test coverage detected