3 This tests queryCommandState.
5 <a href="https://bugs.webkit.org/show_bug.cgi?id=32285">Bug 32285</a>
7 <a href="rdar://problem/7442387"> Radar 7442065</a>
9 <div id="e" contenteditable="true">
13 <ul id="console"></ul>
15 <script type="text/javascript">
17 if (window.testRunner) {
18 testRunner.dumpAsText();
20 var elem = document.getElementById("e");
21 var selection = window.getSelection();
22 selection.collapse(elem, 0);
24 document.execCommand("SelectAll");
25 document.execCommand("Bold");
26 assert(document.queryCommandState("Bold"));
27 assert(!document.queryCommandState("Italic"));
28 document.execCommand("Italic");
29 assert(document.queryCommandState("Bold"));
30 assert(document.queryCommandState("Italic"));
31 document.execCommand("Bold", false);
32 assert(!document.queryCommandState("Bold"));
33 assert(document.queryCommandState("Italic"));
36 var li = document.createElement("li");
37 li.appendChild(document.createTextNode(str));
38 var console = document.getElementById("console");
39 console.appendChild(li);
42 function assert(bool) {