<!DOCTYPE html>
<body>
PASS if Blink doesn't crash.
<div id="container">
<div id="sample" contenteditable="true"></div>
</div>
</body>
<script>
if (window.testRunner)
    testRunner.dumpAsText();
var container = document.getElementById('container');
var iframe0 = document.createElement('iframe');
container.appendChild(iframe0);
var sample = document.getElementById('sample');
var iframe1 = document.createElement('iframe');
document.documentElement.appendChild(iframe1);

var iframe2 = document.createElement('iframe');
var documentElement0 = iframe0.contentDocument.documentElement;
sample.appendChild(documentElement0);
documentElement0.appendChild(iframe2);
window.getSelection().selectAllChildren(iframe2);

var iframe3 = document.createElement('iframe');
sample.appendChild(iframe3);

document.execCommand('SelectAll');
document.execCommand('CreateLink', false, 'foobar');
iframe1.contentWindow.document.write('0123456789');
iframe1.contentWindow.document.close();
document.execCommand('Undo');

var iframe4 = document.createElement('iframe');
iframe3.appendChild(iframe4);
iframe1.contentDocument.documentElement.appendChild(iframe3);

var document4 = iframe4.ownerDocument;
document4.execCommand('Redo');
document4.execCommand('InsertOrderedList');

container.outerHTML = '';
</script>
</html>
