<!DOCTYPE html>
<html> 
<head>

<style>
.editing { 
    border: 2px solid red; 
    font-size: 24px; 
}
.explanation { 
    border: 2px solid blue; 
    padding: 12px; 
    font-size: 24px; 
    margin-bottom: 24px;
}
.scenario { margin-bottom: 16px;}
.scenario:first-line { font-weight: bold; margin-bottom: 16px;}
.expected-results:first-line { font-weight: bold }
</style>
<script src=../editing.js></script>
<script src="../../resources/dump-as-markup.js"></script>

<script>
if (window.testRunner)
     testRunner.dumpAsText();

function editingTest() {
    Markup.dump('test', 'Markup before');
    selectAllCommand();
    copyCommand();
    pasteCommand();
    Markup.dump('test', 'Markup after');
}
</script>

<title>Editing Test</title> 
</head> 
<body>
<div class="explanation">
<div class="scenario">
Tests: 
<br>
Fix for this bug: 
<a href="https://bugs.webkit.org/show_bug.cgi?id=56874">&lt;https://bugs.webkit.org/show_bug.cgi?id=56874&gt;</a> Repeated copy and paste-in-place operation results in increasingly verbose HTML.
</div>
<div class="expected-results">
Expected Results:
<br>
The markup before and after should be identical.
</div>
</div>
<div contenteditable id="test" class="editing">
<b><i>hello bold and italic</i></b><div><i>hello italic</I></div><div><font color="#ff0000">hello red</font></div>
</div>

<script>
runEditingTest();
</script>

</body>
</html>
