Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<html>
<body>
<script>
// Generate an SVG data URI whose URI string will consume 20 MB in expat
// (which uses two-byte chars).
let img = document.createElement('img');
let rect = "<rect />";
let src = "data:image/svg+xml;utf8,<svg>" + rect.repeat(20 * 1000 * 1000 / rect.length / 2) + "</svg>";
img.src = src;
document.body.appendChild(img);
</script>