Tests: Avoid racing iframe bad XML load test

Create the iframe inside the test with its src already set. This avoids
observing a parser-created iframe's initial load event when the test is
only trying to check that malformed XML iframe navigation fires load.
This commit is contained in:
Andreas Kling 2026-05-22 14:42:18 +02:00 committed by Andreas Kling
parent f264db039a
commit e9abdc4ed0

View file

@ -1,12 +1,13 @@
<!DOCTYPE html>
<iframe id="i1"></iframe>
<script src="../include.js"></script>
<script>
asyncTest((done) => {
i1.onload = function() {
const iframe = document.createElement("iframe");
iframe.onload = function() {
println("OK");
done();
}
i1.src = "data:application/xml;charset=utf-8;base64,vwo=";
iframe.src = "data:application/xml;charset=utf-8;base64,vwo=";
document.body.appendChild(iframe);
});
</script>