chromium/third_party/blink/web_tests/editing/deleting/delete-svg-001.html


<div id="container">
<p id="description"></p>
Manual steps (run in assertion enabled binary)
<ol>
    <li>Place caret before "X".</li>
    <li>Hit Delete key</li>
    <li>See no assertion at Range constructor.</li>
</ol>
<div contenteditable="true">hello<span style="width: 10px; height: 10px;" id="sample">
<svg viewBox="0 0 100 100" width="20" height="20" version="1.1" xmlns="http://www.w3.org/2000/svg"><text x="10" y="70" font-size="80">X</text><line x1="0" y1="2.5" x2="100" y2="2.5" stroke="red" stroke-width="5" color="yellow"></line><line x1="0" y1="97.5" x2="100" y2="97.5" stroke="red" stroke-width="5" color="yellow"></line></svg></span>world</div>
</div>
<script src="../../resources/js-test.js"></script>
<script>
description('Delete SVG element without assertion');
function $(id) { return document.getElementById(id); }

var sample = $('sample');
var range = document.createRange();
range.setStart(sample.firstChild, 1);
getSelection().addRange(range);
document.execCommand('forwardDelete');
shouldBe('sample.textContent.charCodeAt(0)', '160'); // U+00A0 &nbsp;

if (window.testRunner)
    $('container').outerHTML = '';
</script>