WebReflection / linkedom

A triple-linked lists based DOM implementation.
https://webreflection.medium.com/linkedom-a-jsdom-alternative-53dd8f699311
ISC License
1.62k stars 78 forks source link

Illegal constructor when extending DocumentFragment #255

Closed mary-ext closed 7 months ago

mary-ext commented 7 months ago

Extending DocumentFragment is used by @github/template-parts and document-persistent-fragment

Using these in linkedom causes Illegal constructor error being thrown, even though the browser and JSDOM handles this just fine.

WebReflection commented 7 months ago

JSDOM pollutes the global or assume there's only one document on the global, which is nonsense in here ... almost every class in here requires the ownerDocument as first argument so you can bind the class passing your document reference and be good with it.

P.S. document-persistent-fragment is not needed anymore, I've found a way better solution in latest uhtml library and I might soon just publish that as module a part where no global patch is ever needed.

mary-ext commented 7 months ago

Hmmm yeah I think I'll try doing it some other way, it wasn't necessary for it to extend DocumentFragment anyway...

I happened to remember about document-persistent-fragment while writing up this issue, but very nice to know ^^