Merge pull request #548 from mnaza/fix/cssstyledeclaration-global-546
fix(js): expose CSSStyleDeclaration as a real global interface
This commit is contained in:
2 files changed
+20
No files matched your search
Vendored
+6
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user