Commit febd8e17 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Rewrite editing/deleting/smart-delete-across-editable-boundaries-2.html to use selection_test()

This patch changes "smart-delete-across-editable-boundaries-2.html" to utilize
|selection_test()| for ease of maintenance.

This patch is a preparation for the patch[1].

[1] http://crrev.com/c/737981 Introduce TextOffsetMapping to simplify
word/paragraph selection

Bug: 679977
Change-Id: If0c815668d80ebfed826f4efd5e4bf9a428a627e
Reviewed-on: https://chromium-review.googlesource.com/892556Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533118}
parent ad086b78
This tests for a bug where expansion for smart delete would not consider editable boundaries. Only 'foo' should be deleted. You should see ' bar'. <radr://problem/5390681>
| <span>
| contenteditable="false"
| " bar"
<!DOCTYPE html> <!doctype html>
<html> <script src="../../resources/testharness.js"></script>
<body> <script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/dump-as-markup.js"></script> <script src="../assert_selection.js"></script>
<div contenteditable="true" id="div">foo<span contenteditable="false"> bar</span></div>
<script> <script>
if (window.internals) // This tests for a bug where expansion for smart delete would not consider
internals.settings.setEditingBehavior('mac'); // editable boundaries. Only 'foo' should be deleted. You should see ' bar'.
var div = document.getElementById("div"); // <radr://problem/5390681>
var sel = window.getSelection(); selection_test(
sel.collapse(div, 0); '<div contenteditable>^foo|<span contenteditable="false"> bar</span></div>',
sel.modify("extend", "forward", "word"); 'delete',
document.execCommand("Delete"); '<div contenteditable>|<span contenteditable="false"> bar</span></div>',
Markup.description("This tests for a bug where expansion for smart delete would not consider editable boundaries. Only 'foo' should be deleted. You should see ' bar'. <radr://problem/5390681>"); 'Delete should consider editable boundaries');
Markup.dump(div);
</script> </script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment