Merge pull request #548 from mnaza/fix/cssstyledeclaration-global-546

fix(js): expose CSSStyleDeclaration as a real global interface
This commit is contained in:
SGavrl authored and GitHub committed 2026-08-07 16:51:57 +00:00
commit d361e41185
2 files changed
+20

No files matched your search

+6
View File
@@ -6049,6 +6049,12 @@ globalThis.DocumentType = DocumentType;
globalThis.Node = Node;
globalThis.Element = Element;
globalThis.Document = Document;
// CSSStyleDeclaration is the type of element.style and getComputedStyle(); it is
// pre-declared non-enumerable in _preHideInternals, but unlike the other WebIDL
// interfaces it had no value assignment, leaving `window.CSSStyleDeclaration`
// undefined (so `el.style instanceof CSSStyleDeclaration` threw). Assigning here
// only fills the value; the property stays enumerable:false, matching Chrome.
globalThis.CSSStyleDeclaration = CSSStyleDeclaration;
globalThis.XPathResult = globalThis.XPathResult || class XPathResult {};
Object.assign(globalThis.XPathResult, {
ANY_TYPE: 0,