blob: bbcea0a147a47e48fecaeb2e3516250f9d88fd14 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/dump-as-markup.js"></script>
<div id="test" contenteditable="true">
<b>foo</b><a href="http://www.google.com/">bar</a><i>baz</i><br>
<table border="1"><tr><td>foo</td><td>bar</td><td>baz</td></tr></table>
<u>foo</u>bar<span style="text-decoration:line-through">baz</span><br>
</div>
<pre id="console"></pre>
<script>
if (window.testRunner)
testRunner.dumpEditingCallbacks();
function log(message) {
var console = document.getElementById("console");
console.innerHTML += message + '\n';
}
var e = document.getElementById("test");
var s = window.getSelection();
if (document.queryCommandEnabled("RemoveFormat"))
log("Failure: RemoveFormat enabled with no selection.");
s.setPosition(e, 0);
if (document.queryCommandEnabled("RemoveFormat"))
log("Failure: RemoveFormat enabled with a caret selection.");
document.execCommand("SelectAll");
if (!document.queryCommandEnabled("RemoveFormat"))
log("Failure: RemoveFormat disabled with an editable selection.");
if (!document.execCommand("RemoveFormat"))
log("Failure: execCommand('RemoveFormat') returned false.");
Markup.description('This is a test for execCommand("RemoveFormat"). It demonstrates a bug: everything in the editable region below should be selected, as everything was selected before Remove Format was performed.');
Markup.dump(e, 'markup');
Markup.dump('console', 'console');
</script>
</body>
</html>