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>
<html>
<body>
<script src="../../resources/dump-as-markup.js"></script>
<div contenteditable="true" id="div">foo<span contenteditable="false"> bar</span></div>
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
if (window.internals)
internals.settings.setEditingBehavior('mac');
var div = document.getElementById("div");
var sel = window.getSelection();
sel.collapse(div, 0);
sel.modify("extend", "forward", "word");
document.execCommand("Delete");
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>");
Markup.dump(div);
// 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>
selection_test(
'<div contenteditable>^foo|<span contenteditable="false"> bar</span></div>',
'delete',
'<div contenteditable>|<span contenteditable="false"> bar</span></div>',
'Delete should consider editable boundaries');
</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