Bug 1838484 - Don't create module loader for template contents owner document r=smaug
commit41354b583a4a5219ea6b1e7fcebd2a0c0b08d131
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 16 Jun 2023 16:47:39 +0000 (16 16:47 +0000)
committerJon Coppeard <jcoppeard@mozilla.com>
Fri, 16 Jun 2023 16:47:39 +0000 (16 16:47 +0000)
treeea273159d98c021370264b87874b368b23e5652d
parentf74991659a8224a4aec513f3a6a5f5b0b21e5b30
Bug 1838484 - Don't create module loader for template contents owner document r=smaug

When I added ScriptLoader::SetGlobalObject I didn't realise that more than one
document could share the same global object. It turns out that this happens for
these template contents owner documents and this causes the assert that checks
that right module loader is associated with the global to fail because it finds the
other document's module loader.

As far as I can tell we don't need a module load for these documents so we can
skip this call that creates it.

For some reason the test times out on Android and I wasn't able to work out why
so I didn't enable it there.

Differential Revision: https://phabricator.services.mozilla.com/D181267
dom/base/Document.cpp
dom/base/Document.h
dom/base/crashtests/1838484.html [new file with mode: 0644]
dom/base/crashtests/crashtests.list