Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / editability / empty-document-stylewithcss.html
blobdf61ce0f778ce7a50d0cdf109ba86255ed807d9c
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 if (window.testRunner)
6 testRunner.dumpAsText();
8 function runTest() {
9 document.designMode="on";
10 document.open();
11 window.getSelection().addRange(document.createRange());
13 var initialValue = document.queryCommandValue('StyleWithCSS');
14 document.execCommand("StyleWithCSS", false, !eval(initialValue));
15 document.writeln('hello');
17 document.open();
18 window.getSelection().addRange(document.createRange());
19 var valueAfterFirstNegation = document.queryCommandValue('StyleWithCSS');
21 document.execCommand("StyleWithCSS", false, !eval(valueAfterFirstNegation));
22 document.writeln('world');
23 var valueAfterSecondNegation = document.queryCommandValue('StyleWithCSS');
25 document.open();
26 document.writeln('This test ensures WebKit executes StyleWithCSS properly even in an empty document.<br>');
27 document.write('First negation:' + (initialValue !== valueAfterFirstNegation ? 'PASS' : 'FAIL') + '<br>');
28 document.write('Second negation:' + (valueAfterFirstNegation !== valueAfterSecondNegation ? 'PASS' : 'FAIL') + '<br>');
30 </script>
31 </head>
32 <body onload="runTest()"></body>
33 </html>