The node that doesn't have a document (easy to repro with documentType node which is just created) crashes while trying to dispatchEvent.
FireFox in similar scenario simply treats dispatchEvent() as noop. We should do the same. Patch is coming.
Created attachment 41539 [details]
Comment on attachment 41539 [details]