update style.textContent instead of calling insertRule, #75061

this change makes style changes visible to the mutation observer
This commit is contained in:
Johannes Rieken
2019-06-19 15:58:46 +02:00
parent 8a0e33ad3d
commit 5565ddd88c

View File

@@ -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 {