mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:55:08 +00:00

Normally, assigning to e.g document.body.onload will forward to window.onload. However, in a detached DOM tree, there is no associated window, so we have nowhere to forward to, making this a no-op. The bulk of this change is making Document::window() return a nullable pointer, as documents created by DOMParser or DOMImplementation do not have an associated window object, and so must be able to return null from here.
10 lines
293 B
HTML
10 lines
293 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
var parser = new DOMParser();
|
|
var doc = parser.parseFromString("", "text/html");
|
|
var body = doc.createElement("body");
|
|
body.onblur = null;
|
|
println("PASS (didn't crash)");
|
|
});
|
|
</script>
|