30 lines
1.1 KiB
HTML
30 lines
1.1 KiB
HTML
|
|
<!DOCTYPE html>
|
||
|
|
<script src="../include.js"></script>
|
||
|
|
<script>
|
||
|
|
asyncTest(async (done) => {
|
||
|
|
internals.setTestTimeout(5000);
|
||
|
|
|
||
|
|
const httpServer = httpTestServer();
|
||
|
|
const prefix = `<!DOCTYPE html><body><span id="target">¬`;
|
||
|
|
const body = `${prefix}in;</span><script>window.onload = () => parent.postMessage(document.getElementById("target").textContent, "*");<\/script>`;
|
||
|
|
const url = await httpServer.createEcho("GET", "/parser-streams-named-character-reference-split", {
|
||
|
|
status: 200,
|
||
|
|
headers: {
|
||
|
|
"Content-Type": "text/html",
|
||
|
|
},
|
||
|
|
body,
|
||
|
|
});
|
||
|
|
|
||
|
|
const frame = document.createElement("iframe");
|
||
|
|
window.addEventListener("message", event => {
|
||
|
|
const text = event.data;
|
||
|
|
println(`length: ${text.length}`);
|
||
|
|
println(`code point: ${text.codePointAt(0)}`);
|
||
|
|
done();
|
||
|
|
}, { once: true });
|
||
|
|
|
||
|
|
frame.src = `${url}?chunks=${new TextEncoder().encode(prefix).length}&chunk_delay_ms=100`;
|
||
|
|
document.body.appendChild(frame);
|
||
|
|
});
|
||
|
|
</script>
|