Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / style / query-typing-style.html
blobb74aa6572d436bcdd62d7597efb454ec619dcb36
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <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>
5 <div id="test" contenteditable></div>
6 <pre><script>
8 if (window.testRunner)
9 testRunner.dumpAsText();
11 var test = document.getElementById('test');
12 test.focus();
13 window.getSelection().collapse(test, test.childNodes.length);
14 document.execCommand('backColor', false, '#ff0000');
15 document.execCommand('fontSize', false, 5);
16 var backColor = document.queryCommandValue('backColor');
17 var fontSize = document.queryCommandValue('fontSize');
18 document.writeln(backColor == 'rgb(255, 0, 0)' ? 'PASS: background color' : "FAIL: background color; expected rgb(255, 0, 0) but got " + backColor);
19 document.writeln(fontSize == 5 ? 'PASS: font size' : "FAIL: font size; expected 5 but got " + fontSize);
21 </script></pre>
22 </body>
23 </html>