Index: third_party/WebKit/LayoutTests/editing/deleting/delete_ws_fixup.html |
diff --git a/third_party/WebKit/LayoutTests/editing/deleting/delete_ws_fixup.html b/third_party/WebKit/LayoutTests/editing/deleting/delete_ws_fixup.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..52ddff6db4d8205ee5d755f02173286a389d201e |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/editing/deleting/delete_ws_fixup.html |
@@ -0,0 +1,29 @@ |
+<!doctype html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script src="../assert_selection.js"></script> |
+<script> |
+test(() => assert_selection( |
+ '<div contenteditable>abc<i>de ef</i> gh <b> i|j </b> kl</div>', |
+ 'delete', |
+ '<div contenteditable>abc<i>de ef</i> gh |<b>j </b> kl</div>'), |
+ 'Delete a character also removes redundant whitespaces'); |
+ |
+test(() => assert_selection( |
+ '<div contenteditable>abc<i>de ef</i> gh <b> ^ij| </b> kl</div>', |
+ 'delete', |
+ '<div contenteditable>abc<i>de ef</i> gh |<b>\u{00A0}</b>kl</div>'), |
+ 'Delete characters and fix up whitespaces'); |
+ |
+test(() => assert_selection( |
+ '<div contenteditable>bar ^baz|<span> </span>foo</div>', |
+ 'delete', |
+ '<div contenteditable>bar |<span>\u{00A0}</span>foo</div>'), |
+ 'Delete characters and convert SPACEs to NBSP'); |
+ |
+test(() => assert_selection( |
+ '<div contenteditable>bar ^baz|<span> \u{00A0} </span>foo</div>', |
+ 'delete', |
+ '<div contenteditable>bar |<span>\u{00A0} \u{00A0}</span>foo</div>'), |
+ 'Delete characters and convert NBSP+SPACEs to NBSPs+SPACE'); |
+</script> |