Skip to content

Commit

Permalink
avoid innerHTML in context view, #106395
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Oct 9, 2020
1 parent 04b9275 commit c2c3177
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/vs/base/browser/ui/contextview/contextview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
<style>
${SHADOW_ROOT_CSS}
</style>
`;
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 {
Expand Down

0 comments on commit c2c3177

Please sign in to comment.