Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/document-metadata/the-style-element/crashtests/style-with-title-mutations-while-parsing.xhtml - WPT Dashboard Interop Dashboard
<?xml version="1.0" encoding="UTF-8"?>
<head>
<meta name="assert" content="No crash when a titled stylesheet finishes loading while the parser appends more style elements from a mutation observer."/>
<script>
let done = false;
window.mo = new MutationObserver(function() {
if (done) return;
done = true;
for (var i = 0; i < 64; i++) {
var s = document.createElement("style");
s.textContent = ".c" + i + " { color: rgb(" + (i % 255) + ", 1, 2); }";
document.head.appendChild(s);
}
requestAnimationFrame(function() {
document.documentElement.classList.remove("test-wait");
});
});
window.mo.observe(document, {childList: true, subtree: true, characterData: true});
</script>
</head>
<body>
<p>first paragraph</p>
<style title="uniquetitle5">body { color: rgb(19,20,21); background-color: rgb(22,23,24); }</style>
<p>after</p>
</body>
</html>