Commit 86ae6639 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Utilize selection_test() for "editing/deleting/type-delete-after-quote{,-2}.html"

This patch changes "type-delete-after-quote{1,-2}.html" to utilize
|selection_test()| and integrate into "type-delete-after-quote.html", since both
tests use similar test input, for ease of maintenance.

Note: "type-delete-after-quote.html" is failed on layout_ng bot due by pixel
test.

Bug: 679977, 636993
Change-Id: I27db14fae0ab951df387e4d58c45f556470209c6
Reviewed-on: https://chromium-review.googlesource.com/991796Reviewed-by: default avatarYoichi Osato <yoichio@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547644}
parent b849563d
When your cursor is after an empty blockquote, hitting delete should bring the cursor (and the content following the cursor) back into the blockquote, instead of deleting the empty blockquote.
<blockquote type="cite">Quoted<br>This should be quoted too</blockquote>
<html>
<head>
<style>
blockquote {
color: blue;
border-left: 2px solid blue;
margin-left: 0px;
padding-left: 10px;
}
</style>
</head>
<body>
<div id="description">When your cursor is after an empty blockquote, hitting delete should bring the cursor (and the content following the cursor) back into the blockquote, instead of deleting the empty blockquote.</div>
<div id="edit" contenteditable="true"><blockquote type="cite">Quoted<br><br></blockquote>This should be quoted too</div>
<script>
edit = document.getElementById("edit");
var s = window.getSelection();
s.collapse(edit, 1);
document.execCommand("Delete");
if (window.testRunner) {
testRunner.dumpAsText();
document.body.innerText = document.getElementById("description").innerText + "\n" + document.getElementById("edit").innerHTML;
}
</script>
</body>
</html>
<html>
<head>
<style>
blockquote {
color: blue;
border-left: 2px solid blue;
margin-left: 0px;
padding-left: 10px;
}
</style>
</head>
<body>
<div id="description">When your cursor is after an empty blockquote, hitting delete should bring the cursor (and the content following the cursor) back into the blockquote, instead of deleting the empty blockquote.</div>
<div id="edit" contenteditable="true"><blockquote type="cite"><br></blockquote>This should be quoted</div>
<!doctype HTML>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
edit = document.getElementById("edit");
var s = window.getSelection();
s.collapse(edit, 1);
document.execCommand("Delete");
selection_test(
[
'<div contenteditable>',
'<blockquote type="cite"><br></blockquote>|',
'ab',
'</div>',
],
'Delete',
[
'<div contenteditable>',
'<blockquote type="cite">|ab</blockquote>',
'</div>',
],
'1 Delete to replace empty blockquote placeholder BR with following text');
selection_test(
[
'<div contenteditable>',
'<blockquote type="cite">ab<br><br></blockquote>|',
'CD',
'</div>',
],
'Delete',
[
'<div contenteditable>',
'<blockquote type="cite">ab<br>|CD</blockquote>',
'</div>',
],
'2 Delete to replace blockquote placeholder BR with following text');
</script>
</body>
</html>
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x576
LayoutBlockFlow {DIV} at (0,0) size 784x40
LayoutText {#text} at (0,0) size 775x39
text run at (0,0) width 775: "When your cursor is after an empty blockquote, hitting delete should bring the cursor (and the content following the cursor)"
text run at (0,20) width 422: "back into the blockquote, instead of deleting the empty blockquote."
LayoutBlockFlow {DIV} at (0,56) size 784x20
LayoutBlockFlow {BLOCKQUOTE} at (0,0) size 744x20 [color=#0000FF] [border: none (2px solid #0000FF)]
LayoutText {#text} at (12,0) size 140x19
text run at (12,0) width 140: "This should be quoted"
caret: position 0 of child 0 {#text} of child 0 {BLOCKQUOTE} of child 3 {DIV} of body
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x576
LayoutBlockFlow {DIV} at (0,0) size 784x36
LayoutText {#text} at (0,0) size 743x36
text run at (0,0) width 743: "When your cursor is after an empty blockquote, hitting delete should bring the cursor (and the content following the"
text run at (0,18) width 480: "cursor) back into the blockquote, instead of deleting the empty blockquote."
LayoutBlockFlow {DIV} at (0,52) size 784x18
LayoutBlockFlow {BLOCKQUOTE} at (0,0) size 744x18 [color=#0000FF] [border: none (2px solid #0000FF)]
LayoutText {#text} at (12,0) size 142x18
text run at (12,0) width 142: "This should be quoted"
caret: position 0 of child 0 {#text} of child 0 {BLOCKQUOTE} of child 3 {DIV} of body
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x576
LayoutBlockFlow {DIV} at (0,0) size 784x40
LayoutText {#text} at (0,0) size 770x39
text run at (0,0) width 770: "When your cursor is after an empty blockquote, hitting delete should bring the cursor (and the content following the cursor) back"
text run at (0,20) width 371: "into the blockquote, instead of deleting the empty blockquote."
LayoutBlockFlow {DIV} at (0,56) size 784x20
LayoutBlockFlow {BLOCKQUOTE} at (0,0) size 744x20 [color=#0000FF] [border: none (2px solid #0000FF)]
LayoutText {#text} at (12,0) size 133x19
text run at (12,0) width 133: "This should be quoted"
caret: position 0 of child 0 {#text} of child 0 {BLOCKQUOTE} of child 3 {DIV} of body
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