Skip to content

Commit 165663a

Browse files
committed
fix: add better comment
1 parent 3c63e5f commit 165663a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/@lwc/engine-dom/src/styles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ const isIE11 = !isUndefined((document as any).documentMode);
3232

3333
// Global cache of style elements used for fast cloning
3434
let styleElements: Map<string, HTMLStyleElement> = new Map();
35-
// Global cache of CSSStyleSheets because these need to be unique based on content
35+
// Global cache of CSSStyleSheets because these need to be unique based on content so the browser
36+
// can optimize repeated usages across multiple shadow roots
3637
let stylesheets: Map<string, CSSStyleSheet> = new Map();
3738
// Bookkeeping of targets to CSS that has already been injected into them, so we don't duplicate
3839
let shadowRootsToInsertedStylesheets: WeakMap<ShadowRoot, Set<string>> = new WeakMap();

0 commit comments

Comments
 (0)