2010-10-25 Ryosuke Niwa <rniwa@webkit.org>
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Oct 2010 23:03:26 +0000 (23:03 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Oct 2010 23:03:26 +0000 (23:03 +0000)
        Reviewed by Tony Chang.

        execCommand removeFormat is blowing away text outside the selection
        https://bugs.webkit.org/show_bug.cgi?id=21843

        Added a test to ensure executing RemoveFormant command on an orphaned list item
        does not remove non-orphaned list items preceding the orphaned item.

        * editing/execCommand/remove-format-orphaned-list-item-expected.txt: Added.
        * editing/execCommand/remove-format-orphaned-list-item.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70500 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/editing/execCommand/remove-format-orphaned-list-item-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/remove-format-orphaned-list-item.html [new file with mode: 0644]

index 7779832..2cfe1d6 100644 (file)
@@ -1,3 +1,16 @@
+2010-10-25  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Reviewed by Tony Chang.
+
+        execCommand removeFormat is blowing away text outside the selection
+        https://bugs.webkit.org/show_bug.cgi?id=21843
+
+        Added a test to ensure executing RemoveFormant command on an orphaned list item
+        does not remove non-orphaned list items preceding the orphaned item.
+
+        * editing/execCommand/remove-format-orphaned-list-item-expected.txt: Added.
+        * editing/execCommand/remove-format-orphaned-list-item.html: Added.
+
 2010-10-25  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Unreviewed.
diff --git a/LayoutTests/editing/execCommand/remove-format-orphaned-list-item-expected.txt b/LayoutTests/editing/execCommand/remove-format-orphaned-list-item-expected.txt
new file mode 100644 (file)
index 0000000..5dc6639
--- /dev/null
@@ -0,0 +1,7 @@
+This tests RemoveFormant command on an orphaned list item following non-orphaned list items. WebKit used to remove non-orphaned list items ("hello world"). You should see "hello world WebKit" below.
+| <ul>
+|   <li>
+|     "hello"
+|   <li>
+|     "world"
+|   "<#selection-anchor>WebKit<#selection-focus>"
diff --git a/LayoutTests/editing/execCommand/remove-format-orphaned-list-item.html b/LayoutTests/editing/execCommand/remove-format-orphaned-list-item.html
new file mode 100644 (file)
index 0000000..b7b5aa7
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/dump-as-markup.js"></script>
+<div id="test" contenteditable><ul><li>hello</li><li>world</li>WebKit</ul></div>
+<script>
+
+Markup.description('This tests RemoveFormant command on an orphaned list item following non-orphaned list items. WebKit used to remove non-orphaned list items ("hello world"). You should see "hello world WebKit" below.');
+var text = document.getElementById('test').lastChild.lastChild;
+var range = document.createRange();
+range.setStart(text, 0);
+range.setEnd(text, 6);
+window.getSelection().removeAllRanges();
+window.getSelection().addRange(range);
+document.execCommand('RemoveFormat', false, null);
+Markup.dump('test');
+
+</script>
+</body>
+</html>