Skip to content

Commit

Permalink
CSSStylesheet DOM Shim
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Apr 12, 2024
1 parent c97da38 commit a4c553d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/dom-shim.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
function noop() { }

// https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/CSSStyleSheet
class CSSStyleSheet {
constructor() { }
replace() { }
replaceSync() { }
}

// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
class EventTarget {
constructor() {
Expand Down Expand Up @@ -146,4 +153,5 @@ class CustomElementsRegistry {
globalThis.addEventListener = globalThis.addEventListener ?? noop;
globalThis.document = globalThis.document ?? new Document();
globalThis.customElements = globalThis.customElements ?? new CustomElementsRegistry();
globalThis.HTMLElement = globalThis.HTMLElement ?? HTMLElement;
globalThis.HTMLElement = globalThis.HTMLElement ?? HTMLElement;
globalThis.CSSStyleSheet = globalThis.CSSStyleSheet ?? CSSStyleSheet;

0 comments on commit a4c553d

Please sign in to comment.