4 <script src=
"../../resources/dump-as-markup.js"></script>
5 <div id=
"test" contenteditable=
"true">
6 <b>foo
</b><a href=
"http://www.google.com/">bar
</a><i>baz
</i><br>
7 <table border=
"1"><tr><td>foo
</td><td>bar
</td><td>baz
</td></tr></table>
8 <u>foo
</u>bar
<span style=
"text-decoration:line-through">baz
</span><br>
10 <pre id=
"console"></pre>
13 if (window
.testRunner
)
14 testRunner
.dumpEditingCallbacks();
16 function log(message
) {
17 var console
= document
.getElementById("console");
18 console
.innerHTML
+= message
+ '\n';
21 var e
= document
.getElementById("test");
22 var s
= window
.getSelection();
24 if (document
.queryCommandEnabled("RemoveFormat"))
25 log("Failure: RemoveFormat enabled with no selection.");
27 if (document
.queryCommandEnabled("RemoveFormat"))
28 log("Failure: RemoveFormat enabled with a caret selection.");
29 document
.execCommand("SelectAll");
30 if (!document
.queryCommandEnabled("RemoveFormat"))
31 log("Failure: RemoveFormat disabled with an editable selection.");
32 if (!document
.execCommand("RemoveFormat"))
33 log("Failure: execCommand('RemoveFormat') returned false.");
35 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.');
36 Markup
.dump(e
, 'markup');
37 Markup
.dump('console', 'console');