Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / execCommand / style-with-css.html
blob8fa14ff6c0eba8e75ae3830850e4a16a837483de
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <script>
10 description('Test styleWithCSS command');
12 function testStyleWithCSS(styleArg, expectedState)
14 document.execCommand('styleWithCSS', false, styleArg);
15 if (document.queryCommandState('styleWithCSS') === expectedState)
16 testPassed('styleWithCSS changed the state successfully');
17 else
18 testFailed('styleWithCSS failed with the argument ' + styleArg);
21 testStyleWithCSS(true, true);
22 testStyleWithCSS('false', false);
23 testStyleWithCSS('FALSE', false);
24 testStyleWithCSS('random string', true);
25 testStyleWithCSS(null, true);
27 document.execCommand('styleWithCSS', false, true);
28 if (document.queryCommandState('styleWithCSS') === true)
29 testPassed("queryCommandState('styleWithCSS') returns true");
30 else
31 testFailed("queryCommandState('styleWithCSS') should return boolean true");
33 if (document.queryCommandValue('styleWithCSS') === 'true')
34 testPassed("queryCommandValue('styleWithCSS') returns 'true'");
35 else
36 testFailed("queryCommandValue('styleWithCSS') should return 'true'");
38 document.execCommand('styleWithCSS', false, false);
39 if (document.queryCommandState('styleWithCSS') === false)
40 testPassed("queryCommandState('styleWithCSS') returns false");
41 else
42 testFailed("queryCommandState('styleWithCSS') should return boolean false");
44 if (document.queryCommandValue('styleWithCSS') === 'false')
45 testPassed("queryCommandValue('styleWithCSS') returns 'false'");
46 else
47 testFailed("queryCommandValue('styleWithCSS') should return 'false'");
49 </script>
50 </body>
51 </html>