Add a "pre" polyfill

This is always run, but only the full webcomponents polyfill, it's very
small and isn't intrusive. This introduces a layer of indirection so that,
if the full polyfill is loaded, its monkeypatched constructor will be called
This commit is contained in:
Karl Seguin
2025-07-12 19:49:19 +08:00
parent 818f4540fd
commit 1602932d72
5 changed files with 55 additions and 4 deletions

View File

@@ -126,6 +126,8 @@ fn run(
});
defer runner.deinit();
try polyfill.preload(arena, runner.page.main_context);
// loop over the scripts.
const doc = parser.documentHTMLToDocument(runner.page.window.document);
const scripts = try parser.documentGetElementsByTagName(doc, "script");