* Locates an RNode given a set of navigation instructions (which also contains * a starting point node info).
(path: string, lView: LView)
| 273 | * a starting point node info). |
| 274 | */ |
| 275 | function locateRNodeByPath(path: string, lView: LView): RNode { |
| 276 | const [referenceNode, ...navigationInstructions] = decompressNodeLocation(path); |
| 277 | let ref: Element; |
| 278 | if (referenceNode === REFERENCE_NODE_HOST) { |
| 279 | ref = lView[DECLARATION_COMPONENT_VIEW][HOST] as unknown as Element; |
| 280 | } else if (referenceNode === REFERENCE_NODE_BODY) { |
| 281 | ref = ɵɵresolveBody( |
| 282 | lView[DECLARATION_COMPONENT_VIEW][HOST] as RElement & {ownerDocument: Document}, |
| 283 | ) as Element; |
| 284 | } else { |
| 285 | const parentElementId = Number(referenceNode); |
| 286 | ref = unwrapRNode((lView as any)[parentElementId + HEADER_OFFSET]) as Element; |
| 287 | } |
| 288 | return navigateToNode(ref, navigationInstructions); |
| 289 | } |
| 290 | |
| 291 | /** |
| 292 | * Generate a list of DOM navigation operations to get from node `start` to node `finish`. |
no test coverage detected