Commit 03a11fee authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Utilize selection_test() in editing/execCommand/4916541.html

This patch changes "4916541.html" to utilize |selection_test()| and renames to
"indent_preserves_selection.html" for ease of maintenance and help to
implementing EditingNG.

Bug: 707656, 679977
Change-Id: Ia4924cefd6bfd93f9c83954a425cdafb15db3dad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2186788
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766327}
parent 291cbb42
<p>This tests selection preservation during an indent operation. The selection should start and end in the same parts of the words 'foo' and 'bar' before and after the indent operation.</p>
<div id="div" contenteditable="true"><span id="foo">foo</span><br><span id="bar">bar</span></div>
<script>
var foo = document.getElementById("foo").firstChild;
var bar = document.getElementById("bar").firstChild;
var sel = window.getSelection();
sel.setBaseAndExtent(foo, 1, bar, 2);
document.execCommand("Indent");
</script>
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
// This tests selection preservation during an indent operation. The selection
// should start and end in the same parts of the words 'foo' and 'bar' before
// and after the indent operation.
selection_test(
[
'<div contenteditable>',
'<span id="foo">f^oo</span><br><span id="bar">ba|r</span>',
'</div>',
],
'indent',
[
'<div contenteditable>',
'<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">',
'<span id="foo">f^oo<br></span><span id="bar">ba|r</span>',
'</blockquote>',
'</div>',
]);
</script>
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