Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / style / fontsize-1.html
blobf0228125d825c6d782d82ba691a16007918f52bc
1 <script src="../../resources/dump-as-markup.js"></script>
2 <div id="div" contenteditable="true"></div>
3 <ul id="console"></ul>
5 <script>
7 Markup.description("This test execCommand('FontSize', ...). You should see 'small' 'medium' and 'large' below in every increasing font sizes.")
9 function log(str) {
10 var li = document.createElement("li");
11 li.appendChild(document.createTextNode(str));
12 var console = document.getElementById("console");
13 console.appendChild(li);
16 var div = document.getElementById("div");
17 var sel = window.getSelection();
19 sel.collapse(div, 0);
20 Markup.dump(div, 'initial');
22 if (document.execCommand("FontSize", false, "pasd"))
23 log("Failure: execCommand('FontSize', [Illegal value]) should fail.");
25 if (!document.execCommand("FontSize", false, "2"))
26 log("Failure: execCommand('FontSize', [Legal value]) failed.");
27 Markup.dump(div, 'fontsize 2');
29 document.execCommand("InsertText", false, "small");
30 Markup.dump(div, 'type small');
32 if (!document.execCommand("FontSize", false, "4"))
33 log("Failure: execCommand('FontSize', [Legal value]) failed.");
34 Markup.dump(div, 'fontsize 4');
36 document.execCommand("InsertText", false, "medium");
37 Markup.dump(div, 'type medium');
39 if (!document.execCommand("FontSize", false, "6"))
40 log("Failure: execCommand('FontSize', [Legal value]) failed.");
41 Markup.dump(div, 'fontsize 6');
43 document.execCommand("InsertText", false, "large");
44 Markup.dump(div, 'type large');
46 Markup.dump('console', 'console');
48 </script>