Skip to content

Commit 325cc07

Browse files
authored
Merge pull request #600 from Shopify/fix-document-fragment-owner-document
Fix DocumentFragment ownerDocument
2 parents 877d99e + d9b4dab commit 325cc07

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/pretty-bags-cheer.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@remote-dom/polyfill': patch
3+
'@remote-dom/core': patch
4+
---
5+
6+
Fix document fragment owner document

packages/polyfill/source/DocumentFragment.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ import {ParentNode} from './ParentNode.ts';
44
export class DocumentFragment extends ParentNode {
55
nodeType = NodeType.DOCUMENT_FRAGMENT_NODE;
66
[NAME] = '#document-fragment';
7-
[OWNER_DOCUMENT] = window.document as any;
7+
[OWNER_DOCUMENT] = (typeof window !== 'undefined'
8+
? window.document
9+
: null) as any;
810
}

0 commit comments

Comments
 (0)