From 5565ddd88c6350f90e1031be4ce0d6089ac73a57 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 19 Jun 2019 15:58:46 +0200 Subject: [PATCH] update style.textContent instead of calling insertRule, #75061 this change makes style changes visible to the mutation observer --- src/vs/base/browser/dom.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index 64fd5661495bb..265d69f85a261 100644 --- a/src/vs/base/browser/dom.ts +++ b/src/vs/base/browser/dom.ts @@ -804,8 +804,7 @@ export function createCSSRule(selector: string, cssText: string, style: HTMLStyl if (!style || !cssText) { return; } - - (style.sheet).insertRule(selector + '{' + cssText + '}', 0); + style.textContent = `${selector}{${cssText}}\n${style.textContent}`; } export function removeCSSRulesContainingSelector(ruleName: string, style: HTMLStyleElement = getSharedStyleSheet()): void {