Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/syntax/serializing-html-fragments/range-on-pi-contextual-fragment-crash.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<head>
<title>createContextualFragment should not crash when the end node is a processing instruction</title>
<link rel="author" title="Simon Wülker" href="mailto:simon.wuelker@arcor.de">
</head>
<body>
<script>
let pi = document.createProcessingInstruction("xml-stylesheet", 'href="mycss.css" type="text/css"');
let range = document.createRange();
range.setEnd(pi, 0)
range.createContextualFragment("<div>A</div>");
</script>
</body>