Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: LayoutTests/editing/deleting/display-table.html

Issue 59963002: Unable to delete the first and the last characters of a contenteditable div with display: table. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing the nits Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/editing/deleting/display-table-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/deleting/display-table.html
diff --git a/LayoutTests/editing/deleting/display-table.html b/LayoutTests/editing/deleting/display-table.html
new file mode 100644
index 0000000000000000000000000000000000000000..f7b138621be011e091380fc01d91ca5293151a96
--- /dev/null
+++ b/LayoutTests/editing/deleting/display-table.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#tableDiv {
+ display: table;
+}
+</style>
+<script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<div id="tableDiv" contenteditable="true"></div>
+<div id="log"></div>
+<script>
+function runTest(caretPosition, deleteCommand, expectedString)
+{
+ var testDiv = document.getElementById('tableDiv');
+ testDiv.innerText = 'ABCD';
+
+ var selection = window.getSelection();
+ selection.collapse(testDiv, caretPosition);
+
+ document.execCommand(deleteCommand);
+ shouldBeEqualToString("document.getElementById('tableDiv').textContent", expectedString);
+}
+
+description("This test verifies that we are able to successfully delete the first and the last characters of a contenteditable div with display: table.");
+
+runTest(0, "forwardDelete", "BCD");
+runTest(1, "Delete", "ABC");
+
+if (window.testRunner)
+ document.getElementById('tableDiv').outerHTML = '';
+
+finishJSTest();
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/editing/deleting/display-table-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698