Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script > | |
| 5 <script src=../../fast/js/resources/js-test-pre.js language="JavaScript" type="t ext/JavaScript" ></script> | |
| 6 <script> | |
| 7 function editingTest() { | |
| 8 var testDiv = document.getElementById("test"); | |
| 9 testDiv.focus(); | |
| 10 execSelectAllCommand(); | |
| 11 document.execCommand("BackColor", false, "green"); | |
|
yosin_UTC9
2013/09/09 04:57:48
Can we put <span style="background-color: green">.
| |
| 12 execCutCommand(); | |
|
yosin_UTC9
2013/09/09 04:57:48
"Cut" command works only in DRT. So, this test cas
yosin_UTC9
2013/09/09 04:57:48
Can we use "Delete" command instead of "Cut" comma
| |
| 13 | |
| 14 execTypeCharacterCommand('N'); | |
|
yosin_UTC9
2013/09/09 04:57:48
We don't need to use functions in editor.js.
| |
| 15 execTypeCharacterCommand('e'); | |
| 16 execTypeCharacterCommand('w'); | |
| 17 execTypeCharacterCommand(' '); | |
| 18 execTypeCharacterCommand('T'); | |
| 19 execTypeCharacterCommand('e'); | |
| 20 execTypeCharacterCommand('x'); | |
| 21 execTypeCharacterCommand('t'); | |
| 22 | |
| 23 span = document.getElementsByTagName("span")[0]; | |
| 24 green = "rgb(0, 128, 0)"; | |
| 25 | |
| 26 shouldBe('span.style.backgroundColor', 'green'); | |
| 27 } | |
| 28 </script> | |
| 29 | |
| 30 <title>Test background color style</title> | |
| 31 </head> | |
| 32 | |
| 33 <body> | |
| 34 <p> | |
| 35 This tests whether background style applied on a selection is retained when the selection is deleted/cut and is replaced with new text.<br> | |
| 36 The background color of the text below should be green. | |
| 37 </p> | |
| 38 <div id="test" contenteditable> | |
| 39 Select this text and cut/delete. Type new text, the background color should be g reen. | |
| 40 </div> | |
| 41 <script> | |
| 42 runDumpAsTextEditingTest(true); | |
|
yosin_UTC9
2013/09/09 04:57:48
This test has shouldBe(), so we don't need to dump
| |
| 43 </script> | |
| 44 </body> | |
| 45 | |
| 46 </html> | |
| OLD | NEW |