MCPcopy Create free account
hub / github.com/angular/angular / resolveElement

Function resolveElement

packages/core/src/sanitization/sanitization.ts:301–325  ·  view source on GitHub ↗
(tagName: string)

Source from the content-addressed store, hash-verified

299}
300
301function resolveElement(tagName: string): [namespace: string | null | undefined, tagName: string] {
302 tagName = tagName.toLowerCase();
303 const splitResult = splitNsName(tagName, false);
304 if (splitResult[0]) {
305 return splitResult;
306 }
307
308 const index = getSelectedIndex();
309 const tNode = index === -1 ? null : getSelectedTNode();
310 let namespace = tNode?.namespace;
311
312 if (tagName === TNodeName.DynamicHost && tNode?.type === TNodeType.Element) {
313 const element = getNativeByTNode(tNode, getLView()) as RElement;
314 if (element.tagName) {
315 tagName = element.tagName.toLowerCase();
316 }
317
318 if (namespace == null) {
319 const namespaceURI = (element as RElement & {namespaceURI?: string | null}).namespaceURI;
320 namespace = namespaceURI && NAMESPACE_URIS[namespaceURI];
321 }
322 }
323
324 return [namespace, tagName];
325}
326
327/**
328 * Set of attributes that are sensitive and should be sanitized.

Callers 2

getSecurityContextFunction · 0.85
ɵɵvalidateAttributeFunction · 0.85

Calls 5

splitNsNameFunction · 0.90
getSelectedIndexFunction · 0.90
getSelectedTNodeFunction · 0.90
getNativeByTNodeFunction · 0.90
getLViewFunction · 0.90

Tested by

no test coverage detected