Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /dom/crashtests/normalize-crash.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Node.normalize() with contenteditable selection should not crash</title>
<div id="sample" contenteditable="true"></div>
<script>
var text1 = document.createTextNode('abc');
var text2 = document.createTextNode(' defg');
var sample = document.getElementById('sample');
sample.appendChild(text1);
sample.appendChild(text2);
var selection = window.getSelection();
selection.collapse(sample, 0);
selection.extend(sample, 2);
sample.normalize();
</script>