blob: 9da556be9edb798fea3c75e6bcfd837a8a424bd8 [file] [log] [blame]
<script src="../../resources/dump-as-markup.js"></script>
<div id="div" contenteditable="true"></div>
<ul id="console"></ul>
<script>
Markup.description("This test execCommand('FontSize', ...). You should see 'small' 'medium' and 'large' below in every increasing font sizes.")
function log(str) {
var li = document.createElement("li");
li.appendChild(document.createTextNode(str));
var console = document.getElementById("console");
console.appendChild(li);
}
var div = document.getElementById("div");
var sel = window.getSelection();
sel.setPosition(div, 0);
Markup.dump(div, 'initial');
if (document.execCommand("FontSize", false, "pasd"))
log("Failure: execCommand('FontSize', [Illegal value]) should fail.");
if (!document.execCommand("FontSize", false, "2"))
log("Failure: execCommand('FontSize', [Legal value]) failed.");
Markup.dump(div, 'fontsize 2');
document.execCommand("InsertText", false, "small");
Markup.dump(div, 'type small');
if (!document.execCommand("FontSize", false, "4"))
log("Failure: execCommand('FontSize', [Legal value]) failed.");
Markup.dump(div, 'fontsize 4');
document.execCommand("InsertText", false, "medium");
Markup.dump(div, 'type medium');
if (!document.execCommand("FontSize", false, "6"))
log("Failure: execCommand('FontSize', [Legal value]) failed.");
Markup.dump(div, 'fontsize 6');
document.execCommand("InsertText", false, "large");
Markup.dump(div, 'type large');
Markup.dump('console', 'console');
</script>