Commit 6f777576 authored by Shimi Zhang's avatar Shimi Zhang Committed by Commit Bot

Convert editing/deleting/5115601.html to utilize |selection_test()|

In preparing for http://crrev/c/1102157, make it easier for us to handle
the behavior change.

Bug: 847192
Change-Id: I5b4053056e96b7c2ecec879b3fea722b3d68d511
Reviewed-on: https://chromium-review.googlesource.com/1105575Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568598}
parent 617fed53
This tests to make sure that after a deletion, merging can merge into an editable region that's embedded in non-editable content that is collapsed by the deletion.
| "
"
| <table>
| border="1"
| contenteditable="false"
| <tbody>
| <tr>
| <td>
| <span>
| contenteditable="true"
| id="start"
| "<#selection-caret>This sentence should be inside the editable cell."
<!DOCTYPE html> <!DOCTYPE html>
<html> <script src="../../resources/testharness.js"></script>
<body> <script src="../../resources/testharnessreport.js"></script>
<p id="description">This tests to make sure that after a deletion, merging can merge into an editable region that's embedded in non-editable content that is collapsed by the deletion.</p> <script src="../assert_selection.js"></script>
<div id="root" contenteditable="true">
<table border="1" contenteditable="false"><tr><td><span id="start" contenteditable="true">foo</span></td></tr></table><span id="end">x</span>This sentence should be inside the editable cell.
</div>
<script src="../../resources/dump-as-markup.js"></script>
<script> <script>
var start = document.getElementById("start"); selection_test(
var end = document.getElementById("end"); [ '<div contenteditable>',
var sel = window.getSelection(); '<table border="1" contenteditable="false">',
var range = document.createRange(); '<tr><td>',
range.setStart(start, 0); '<span contenteditable>^foo</span>',
range.setEnd(end, end.childNodes.length); '</td></tr>',
sel.addRange(range); '</table>',
document.execCommand("Delete"); '<span>x|</span>This sentence should be inside the editable cell.',
Markup.description(description.textContent); '</div>',
Markup.dump("root"); ],
'delete',
[ '<div contenteditable>',
'<table border="1" contenteditable="false">',
'<tbody><tr><td>',
'<span contenteditable>|This sentence should be inside the editable cell.</span>',
'</td></tr></tbody>',
'</table>',
'</div>',
],
'This tests to make sure that after a deletion, merging can merge into an editable'
+ ' region that\'s embedded in non-editable content that is collapsed by the deletion.'
);
</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