<!DOCTYPE html><!-- webkit-test-runner [ LiveRangeSelectionEnabled=false ] -->
<script>
if (window.testRunner)
    testRunner.dumpAsText();
onload = () => {
  let div0 = document.createElement('div');
  document.body.appendChild(div0);
  let span0 = document.createElement('span');
  div0.appendChild(span0);
  let div1 = document.createElement('div');
  document.body.appendChild(div1);
  span0.attachShadow({mode: 'open'}).appendChild(document.createElement('img'));
  document.execCommand('SelectAll');
  document.body.appendChild(document.createElement('input'));
  document.designMode = 'on';
  document.execCommand('InsertHTML', false, 'This test passes if WebKit does not crash. PASS');
  document.designMode = 'off';
  getSelection().modify('extend', 'left', 'lineboundary');
  getSelection().modify('extend', 'right', 'lineboundary');
  getSelection().extend(div1);
  document.execCommand('Copy');
};
</script>
