* Regular creation mode: an anchor is created and * assigned to the `lContainer[NATIVE]` slot.
( lContainer: LContainer, hostLView: LView, hostTNode: TNode, slotValue: any, )
| 743 | * assigned to the `lContainer[NATIVE]` slot. |
| 744 | */ |
| 745 | function createAnchorNode( |
| 746 | lContainer: LContainer, |
| 747 | hostLView: LView, |
| 748 | hostTNode: TNode, |
| 749 | slotValue: any, |
| 750 | ) { |
| 751 | // We already have a native element (anchor) set, return. |
| 752 | if (lContainer[NATIVE]) return; |
| 753 | |
| 754 | let commentNode: RComment; |
| 755 | // If the host is an element container, the native host element is guaranteed to be a |
| 756 | // comment and we can reuse that comment as anchor element for the new LContainer. |
| 757 | // The comment node in question is already part of the DOM structure so we don't need to append |
| 758 | // it again. |
| 759 | if (hostTNode.type & TNodeType.ElementContainer) { |
| 760 | commentNode = unwrapRNode(slotValue) as RComment; |
| 761 | } else { |
| 762 | commentNode = insertAnchorNode(hostLView, hostTNode); |
| 763 | } |
| 764 | lContainer[NATIVE] = commentNode; |
| 765 | } |
| 766 | |
| 767 | /** |
| 768 | * Hydration logic that looks up all dehydrated views in this container |
no test coverage detected