<!DOCTYPE html>
<html>
<body>
<script src="../../resources/dump-as-markup.js"></script>
<div contenteditable="true">
<div id="test">H <span style="color: blue;">W</span></div>
</div>
<script>
Markup.description('Testcase for bug https://webkit.org/b/120726: When deleting editable content, typing style should be reset when moving into another node.');

Markup.waitUntilDone();

var testElement = document.getElementById('test');
var selection = window.getSelection();

selection.collapse(testElement, 2);
document.execCommand("Delete");
document.execCommand("InsertText", false, "O");
Markup.dump(test, "Deleting 'W' in blue color and then inserting 'O'. The following markup should show 'O' in blue color");

document.execCommand("Delete");
document.execCommand("Delete");
document.execCommand("InsertText", false, "W");
Markup.dump(test, "Deleting the blue colored text and the preceding space and then inserting 'W'. 'W' should be not be in blue color in the following markup");

Markup.notifyDone();
</script>
</body>
</html>
