mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 22:12:26 +01:00
add and adopt trusted types apply util, https://github.com/microsoft/vscode/issues/106396
This commit is contained in:
@@ -22,6 +22,13 @@ export function clearNode(node: HTMLElement): void {
|
||||
}
|
||||
}
|
||||
|
||||
export function trustedInnerHTML(node: Element, value: TrustedHTML): void {
|
||||
// this is a workaround for innerHTML not allowing for "asymetric" accessors
|
||||
// see https://github.com/microsoft/vscode/issues/106396#issuecomment-692625393
|
||||
// and https://github.com/microsoft/TypeScript/issues/30024
|
||||
node.innerHTML = value as unknown as string;
|
||||
}
|
||||
|
||||
export function isInDOM(node: Node | null): boolean {
|
||||
while (node) {
|
||||
if (node === document.body) {
|
||||
|
||||
Reference in New Issue
Block a user