(node: Document | ShadowRoot)
| 274 | }; |
| 275 | |
| 276 | const onAdoptedSheetsChange = (node: Document | ShadowRoot) => { |
| 277 | const prev = adoptedSheetsSnapshots.get(node); |
| 278 | const curr = (node.adoptedStyleSheets || []).filter((s) => !isDRAdoptedSheetOverride(s)); |
| 279 | adoptedSheetsSnapshots.set(node, curr); |
| 280 | if (!prev || !areArraysEqual(prev, curr)) { |
| 281 | curr.forEach((sheet) => { |
| 282 | if (!adoptedSheetOwners.has(sheet)) { |
| 283 | adoptedSheetOwners.set(sheet, new Set()); |
| 284 | } |
| 285 | adoptedSheetOwners.get(sheet)!.add(node); |
| 286 | for (const rule of sheet.cssRules) { |
| 287 | const declaration = (rule as CSSStyleRule).style; |
| 288 | if (declaration) { |
| 289 | adoptedDeclarationSheets.set(declaration, sheet); |
| 290 | } |
| 291 | } |
| 292 | }); |
| 293 | node.dispatchEvent(adoptedSheetsChangeEvent); |
| 294 | } |
| 295 | }; |
| 296 | |
| 297 | const proxyAdoptedSheetsArray = (node: Document | ShadowRoot, source: CSSStyleSheet[]) => { |
| 298 | if (adoptedSheetsProxySources.has(source)) { |
no test coverage detected
searching dependent graphs…