MCPcopy Index your code
hub / github.com/darkreader/darkreader / defineSheetScope

Function defineSheetScope

src/inject/dynamic-theme/style-scope.ts:3–5  ·  view source on GitHub ↗
(sheet: CSSStyleSheet, node: Document | ShadowRoot)

Source from the content-addressed store, hash-verified

1const sheetsScopes = new WeakMap<CSSStyleSheet, Document | ShadowRoot>();
2
3export function defineSheetScope(sheet: CSSStyleSheet, node: Document | ShadowRoot): void {
4 sheetsScopes.set(sheet, node);
5}
6
7export function getSheetScope(sheet: CSSStyleSheet): Document | ShadowRoot | null {
8 if (!sheet.ownerNode) {

Callers 2

iterateSourceSheetsFunction · 0.90
getSheetScopeFunction · 0.85

Calls 1

setMethod · 0.65

Tested by

no test coverage detected