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

Function resolveElement

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

Source from the content-addressed store, hash-verified

286}
287
288function resolveElement(tagName: string): [namespace: string | null | undefined, tagName: string] {
289 tagName = tagName.toLowerCase();
290 const splitResult = splitNsName(tagName, false);
291 if (splitResult[0]) {
292 return splitResult;
293 }
294
295 const index = getSelectedIndex();
296 const tNode = index === -1 ? null : getSelectedTNode();
297 let namespace = tNode?.namespace;
298
299 if (tagName === TNodeName.DynamicHost && tNode?.type === TNodeType.Element) {
300 const element = getNativeByTNode(tNode, getLView()) as RElement;
301 if (element.tagName) {
302 tagName = element.tagName.toLowerCase();
303 }
304
305 if (namespace == null) {
306 const namespaceURI = (element as RElement & {namespaceURI?: string | null}).namespaceURI;
307 namespace = namespaceURI && NAMESPACE_URIS[namespaceURI];
308 }
309 }
310
311 return [namespace, tagName];
312}
313
314/**
315 * 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