提交 5565ddd8 编写于 作者: J Johannes Rieken

update style.textContent instead of calling insertRule, #75061

this change makes style changes visible to the mutation observer
上级 8a0e33ad
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册