* Locates an RNode given a set of navigation instructions (which also contains * a starting point node info).
(path: string, lView: LView)
| 240 | * a starting point node info). |
| 241 | */ |
| 242 | function locateRNodeByPath(path: string, lView: LView): RNode { |
| 243 | const [referenceNode, ...navigationInstructions] = decompressNodeLocation(path); |
| 244 | let ref: Element; |
| 245 | if (referenceNode === REFERENCE_NODE_HOST) { |
| 246 | ref = lView[DECLARATION_COMPONENT_VIEW][HOST] as unknown as Element; |
| 247 | } else if (referenceNode === REFERENCE_NODE_BODY) { |
| 248 | ref = ɵɵresolveBody( |
| 249 | lView[DECLARATION_COMPONENT_VIEW][HOST] as RElement & {ownerDocument: Document}, |
| 250 | ) as Element; |
| 251 | } else { |
| 252 | const parentElementId = Number(referenceNode); |
| 253 | ref = unwrapRNode((lView as any)[parentElementId + HEADER_OFFSET]) as Element; |
| 254 | } |
| 255 | return navigateToNode(ref, navigationInstructions); |
| 256 | } |
| 257 | |
| 258 | /** |
| 259 | * Generate a list of DOM navigation operations to get from node `start` to node `finish`. |
no test coverage detected
searching dependent graphs…