Skip to content

Commit

Permalink
update style.textContent instead of calling insertRule, microsoft#75061
Browse files Browse the repository at this point in the history
this change makes style changes visible to the mutation observer
  • Loading branch information
jrieken committed Jun 19, 2019
1 parent 8a0e33a commit 5565ddd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/vs/base/browser/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,7 @@ export function createCSSRule(selector: string, cssText: string, style: HTMLStyl
if (!style || !cssText) {
return;
}

(<CSSStyleSheet>style.sheet).insertRule(selector + '{' + cssText + '}', 0);
style.textContent = `${selector}{${cssText}}\n${style.textContent}`;
}

export function removeCSSRulesContainingSelector(ruleName: string, style: HTMLStyleElement = getSharedStyleSheet()): void {
Expand Down

0 comments on commit 5565ddd

Please sign in to comment.