<!DOCTYPE html>
<html>
<script src="../../resources/dump-as-markup.js"></script>
<script>
function selectAndRemoveFormat()
{
    document.designMode = 'on';
    document.execCommand('SelectAll');
    document.execCommand('RemoveFormat');
}

function dumpAfterCommand()
{
    Markup.description('This testcase is to test crash scenario when designMode is set on document and RemoveFormat is called. Expected result is that crash should not happen and underline should be removed from all the selected text')
    Markup.dump('container');
}
</script>
<body>
    <div id="container" style="text-decoration: underline !important;">This Test should not crash.
        <iframe onload="selectAndRemoveFormat()"></iframe>
        <p>PASS</p>
    </div>
    <script>
        dumpAfterCommand();
    </script>
</body>
</html>

