blob: c6a047aec17a11f3fcd9de6b123b448c0f3cc647 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<p>This tests querying BackColor and FontSize of the typing style. WebKit should not modify the typing style and should return the correct values.</p>
<div id="test" contenteditable></div>
<pre><script>
if (window.testRunner)
testRunner.dumpAsText();
var test = document.getElementById('test');
test.focus();
window.getSelection().setPosition(test, 1);
document.execCommand('backColor', false, '#ff0000');
document.execCommand('fontSize', false, 5);
var backColor = document.queryCommandValue('backColor');
var fontSize = document.queryCommandValue('fontSize');
document.writeln(backColor == 'rgb(255, 0, 0)' ? 'PASS: background color' : "FAIL: background color; expected rgb(255, 0, 0) but got " + backColor);
document.writeln(fontSize == 5 ? 'PASS: font size' : "FAIL: font size; expected 5 but got " + fontSize);
</script></pre>
</body>
</html>