未验证 提交 bb73c423 编写于 作者: A Alex Dima

No more need to use monacoShadowRoot in createStyleSheet because all...

No more need to use monacoShadowRoot in createStyleSheet because all standalone editor calls are qualified
上级 4b88d528
......@@ -837,20 +837,11 @@ export function isInShadowDOM(domNode: Node): boolean {
return isShadowRoot(domNode);
}
export function createStyleSheet(container: HTMLElement | null = null): HTMLStyleElement {
if (!container) {
if ((window as any).monacoShadowRoot) {
container = (window as any).monacoShadowRoot.querySelector('head');
}
else {
container = document.getElementsByTagName('head')[0];
}
}
export function createStyleSheet(container: HTMLElement = document.getElementsByTagName('head')[0]): HTMLStyleElement {
let style = document.createElement('style');
style.type = 'text/css';
style.media = 'screen';
(container as HTMLElement).appendChild(style);
container.appendChild(style);
return style;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册