From f0dd2d26ed4778443263f4073fc1a658b0707788 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 9 Sep 2020 10:45:59 +0200 Subject: [PATCH] use textContent instead of innerHTML (for #106285) --- src/vs/base/browser/ui/codicons/codiconStyles.ts | 2 +- .../services/themes/browser/workbenchThemeService.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/base/browser/ui/codicons/codiconStyles.ts b/src/vs/base/browser/ui/codicons/codiconStyles.ts index b3dc12fb3f350..59dbdbe873acc 100644 --- a/src/vs/base/browser/ui/codicons/codiconStyles.ts +++ b/src/vs/base/browser/ui/codicons/codiconStyles.ts @@ -20,7 +20,7 @@ function initialize() { for (let c of iconRegistry.all) { rules.push(formatRule(c)); } - codiconStyleSheet.innerHTML = rules.join('\n'); + codiconStyleSheet.textContent = rules.join('\n'); } const delayer = new RunOnceScheduler(updateAll, 0); diff --git a/src/vs/workbench/services/themes/browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/browser/workbenchThemeService.ts index 39c18b0c7d365..cbce827b1dbd8 100644 --- a/src/vs/workbench/services/themes/browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/browser/workbenchThemeService.ts @@ -685,10 +685,10 @@ function _applyRules(styleSheetContent: string, rulesClassName: string) { const elStyle = document.createElement('style'); elStyle.type = 'text/css'; elStyle.className = rulesClassName; - elStyle.innerHTML = styleSheetContent; + elStyle.textContent = styleSheetContent; document.head.appendChild(elStyle); } else { - (themeStyles[0]).innerHTML = styleSheetContent; + (themeStyles[0]).textContent = styleSheetContent; } }