Index: LayoutTests/editing/style/background-color-retained.html |
diff --git a/LayoutTests/editing/style/background-color-retained.html b/LayoutTests/editing/style/background-color-retained.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..21fd002c687ee40da65dc16982b109784e29e690 |
--- /dev/null |
+++ b/LayoutTests/editing/style/background-color-retained.html |
@@ -0,0 +1,46 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script> |
+<script src=../../fast/js/resources/js-test-pre.js language="JavaScript" type="text/JavaScript" ></script> |
+<script> |
+function editingTest() { |
+ var testDiv = document.getElementById("test"); |
+ testDiv.focus(); |
+ execSelectAllCommand(); |
+ document.execCommand("BackColor", false, "green"); |
yosin_UTC9
2013/09/09 04:57:48
Can we put <span style="background-color: green">.
|
+ 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
|
+ |
+ execTypeCharacterCommand('N'); |
yosin_UTC9
2013/09/09 04:57:48
We don't need to use functions in editor.js.
|
+ execTypeCharacterCommand('e'); |
+ execTypeCharacterCommand('w'); |
+ execTypeCharacterCommand(' '); |
+ execTypeCharacterCommand('T'); |
+ execTypeCharacterCommand('e'); |
+ execTypeCharacterCommand('x'); |
+ execTypeCharacterCommand('t'); |
+ |
+ span = document.getElementsByTagName("span")[0]; |
+ green = "rgb(0, 128, 0)"; |
+ |
+ shouldBe('span.style.backgroundColor', 'green'); |
+} |
+</script> |
+ |
+<title>Test background color style</title> |
+</head> |
+ |
+<body> |
+<p> |
+ This tests whether background style applied on a selection is retained when the selection is deleted/cut and is replaced with new text.<br> |
+ The background color of the text below should be green. |
+</p> |
+<div id="test" contenteditable> |
+Select this text and cut/delete. Type new text, the background color should be green. |
+</div> |
+<script> |
+ runDumpAsTextEditingTest(true); |
yosin_UTC9
2013/09/09 04:57:48
This test has shouldBe(), so we don't need to dump
|
+</script> |
+</body> |
+ |
+</html> |