mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 00:05:36 +00:00
82d2f60a4d
MozReview-Commit-ID: DxYWPNcb7jK --HG-- extra : rebase_source : f5c5ca6d6fb4c3bb276398b08c81eda1a72b84ae
34 lines
972 B
HTML
34 lines
972 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script type="application/javascript">
|
|
document.designMode = 'on';
|
|
|
|
let div = document.createElement('div');
|
|
let p = document.createElement('p');
|
|
document.documentElement.appendChild(div);
|
|
document.documentElement.appendChild(
|
|
document.createElement('body'));
|
|
document.documentElement.appendChild(p);
|
|
document.execCommand('insertimage', false, 'http://localhost/');
|
|
document.execCommand('insertparagraph', false, null);
|
|
|
|
document.elementFromPoint(0, 0);
|
|
|
|
let selection = window.getSelection();
|
|
selection.modify('extend', 'forward', 'character');
|
|
|
|
let range = document.createRange();
|
|
range.selectNode(p);
|
|
selection.addRange(range);
|
|
range.setStart(div, 0);
|
|
|
|
range = document.createRange();
|
|
range.selectNode(p);
|
|
selection.addRange(range);
|
|
|
|
document.execCommand('delete', false, null);
|
|
</script>
|
|
</head>
|
|
</html>
|