From c2c3177b2118ed4639c1e6bf5641289b91eb35fa Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 9 Oct 2020 14:17:20 +0200 Subject: [PATCH] avoid innerHTML in context view, https://github.com/microsoft/vscode/issues/106395 --- src/vs/base/browser/ui/contextview/contextview.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/vs/base/browser/ui/contextview/contextview.ts b/src/vs/base/browser/ui/contextview/contextview.ts index 82e9fddfa28..97e78cefeda 100644 --- a/src/vs/base/browser/ui/contextview/contextview.ts +++ b/src/vs/base/browser/ui/contextview/contextview.ts @@ -157,11 +157,9 @@ export class ContextView extends Disposable { this.shadowRootHostElement = DOM.$('.shadow-root-host'); this.container.appendChild(this.shadowRootHostElement); this.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' }); - this.shadowRoot.innerHTML = ` - - `; + const style = document.createElement('style'); + style.textContent = SHADOW_ROOT_CSS; + this.shadowRoot.appendChild(style); this.shadowRoot.appendChild(this.view); this.shadowRoot.appendChild(DOM.$('slot')); } else {