()
| 398 | } |
| 399 | |
| 400 | function prepareOverridesSheet(): CSSStyleSheet { |
| 401 | if (!syncStyle) { |
| 402 | createSyncStyle(); |
| 403 | } |
| 404 | |
| 405 | syncStylePositionWatcher && syncStylePositionWatcher.stop(); |
| 406 | insertStyle(); |
| 407 | |
| 408 | // Firefox issue: Some websites get CSP warning, |
| 409 | // when `textContent` is not set (e.g. pypi.org). |
| 410 | // But for other websites (e.g. facebook.com) |
| 411 | // some images disappear when `textContent` |
| 412 | // is initially set to an empty string. |
| 413 | if (syncStyle!.sheet == null) { |
| 414 | syncStyle!.textContent = ''; |
| 415 | } |
| 416 | |
| 417 | const sheet = syncStyle!.sheet; |
| 418 | |
| 419 | removeCSSRulesFromSheet(sheet!); |
| 420 | |
| 421 | if (syncStylePositionWatcher) { |
| 422 | syncStylePositionWatcher.run(); |
| 423 | } else if (inMode === 'next') { |
| 424 | syncStylePositionWatcher = watchForNodePosition(syncStyle!, 'prev-sibling', () => { |
| 425 | forceRenderStyle = true; |
| 426 | buildOverrides(); |
| 427 | }); |
| 428 | } |
| 429 | |
| 430 | return syncStyle!.sheet!; |
| 431 | } |
| 432 | |
| 433 | function buildOverrides() { |
| 434 | const force = forceRenderStyle; |
nothing calls this directly
no test coverage detected